summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/store.cc
Commit message (Collapse)AuthorAgeFilesLines
* store.{cc,h}: remove pointless special case for MSVCSteven Noonan2009-12-291-74/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The version currently in use by TARGET_COMPILER_VC only works on GCC, Clang, and MSVC. Why use the other one? Even an objdump output shows there's no difference between the two, except in terms of function naming: --- store.byref.D 2009-12-29 13:59:36.364840900 -0800 +++ store.byval.D 2009-12-29 14:04:29.313840690 -0800 @@ -712,32 +712,32 @@ 57b: 48 03 42 08 add 0x8(%rdx),%rax 57f: c3 retq -0000000000000580 <CrawlStoreValue::operator bool()>: - 580: e9 00 00 00 00 jmpq 585 <CrawlStoreValue::operator bool()+0x5> +0000000000000580 <CrawlStoreValue::operator bool&()>: + 580: e9 00 00 00 00 jmpq 585 <CrawlStoreValue::operator bool&()+0x5> 585: 90 nop 586: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 58d: 00 00 00 -0000000000000590 <CrawlStoreValue::operator char()>: - 590: e9 00 00 00 00 jmpq 595 <CrawlStoreValue::operator char()+0x5> +0000000000000590 <CrawlStoreValue::operator char&()>: + 590: e9 00 00 00 00 jmpq 595 <CrawlStoreValue::operator char&()+0x5> 595: 90 nop 596: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 59d: 00 00 00 -00000000000005a0 <CrawlStoreValue::operator short()>: - 5a0: e9 00 00 00 00 jmpq 5a5 <CrawlStoreValue::operator short()+0x5> +00000000000005a0 <CrawlStoreValue::operator short&()>: + 5a0: e9 00 00 00 00 jmpq 5a5 <CrawlStoreValue::operator short&()+0x5> 5a5: 90 nop 5a6: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 5ad: 00 00 00 -00000000000005b0 <CrawlStoreValue::operator float()>: - 5b0: e9 00 00 00 00 jmpq 5b5 <CrawlStoreValue::operator float()+0x5> +00000000000005b0 <CrawlStoreValue::operator float&()>: + 5b0: e9 00 00 00 00 jmpq 5b5 <CrawlStoreValue::operator float&()+0x5> 5b5: 90 nop 5b6: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 5bd: 00 00 00 -00000000000005c0 <CrawlStoreValue::operator long()>: - 5c0: e9 00 00 00 00 jmpq 5c5 <CrawlStoreValue::operator long()+0x5> +00000000000005c0 <CrawlStoreValue::operator long&()>: + 5c0: e9 00 00 00 00 jmpq 5c5 <CrawlStoreValue::operator long&()+0x5> 5c5: 90 nop 5c6: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 5cd: 00 00 00 @@ -1863,8 +1863,8 @@ 1324: 66 66 66 2e 0f 1f 84 nopw %cs:0x0(%rax,%rax,1) 132b: 00 00 00 00 00 -0000000000001330 <CrawlStoreValue::operator level_pos()>: - 1330: e9 00 00 00 00 jmpq 1335 <CrawlStoreValue::operator level_pos()+0x5> +0000000000001330 <CrawlStoreValue::operator level_pos&()>: + 1330: e9 00 00 00 00 jmpq 1335 <CrawlStoreValue::operator level_pos&()+0x5> 1335: 90 nop 1336: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 133d: 00 00 00 @@ -1982,8 +1982,8 @@ 14bb: 90 nop 14bc: 0f 1f 40 00 nopl 0x0(%rax) -00000000000014c0 <CrawlStoreValue::operator level_id()>: - 14c0: e9 00 00 00 00 jmpq 14c5 <CrawlStoreValue::operator level_id()+0x5> +00000000000014c0 <CrawlStoreValue::operator level_id&()>: + 14c0: e9 00 00 00 00 jmpq 14c5 <CrawlStoreValue::operator level_id&()+0x5> 14c5: 90 nop 14c6: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 14cd: 00 00 00 @@ -2090,8 +2090,8 @@ 1612: 66 66 66 66 66 2e 0f nopw %cs:0x0(%rax,%rax,1) 1619: 1f 84 00 00 00 00 00 -0000000000001620 <CrawlStoreValue::operator coord_def()>: - 1620: e9 00 00 00 00 jmpq 1625 <CrawlStoreValue::operator coord_def()+0x5> +0000000000001620 <CrawlStoreValue::operator coord_def&()>: + 1620: e9 00 00 00 00 jmpq 1625 <CrawlStoreValue::operator coord_def&()+0x5> 1625: 90 nop 1626: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 162d: 00 00 00 @@ -2329,8 +2329,8 @@ 1919: 90 nop 191a: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) -0000000000001920 <CrawlStoreValue::operator CrawlVector()>: - 1920: e9 00 00 00 00 jmpq 1925 <CrawlStoreValue::operator CrawlVector()+0x5> +0000000000001920 <CrawlStoreValue::operator CrawlVector&()>: + 1920: e9 00 00 00 00 jmpq 1925 <CrawlStoreValue::operator CrawlVector&()+0x5> 1925: 90 nop 1926: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 192d: 00 00 00 @@ -2423,8 +2423,8 @@ 1a56: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 1a5d: 00 00 00 -0000000000001a60 <CrawlStoreValue::operator CrawlHashTable()>: - 1a60: e9 00 00 00 00 jmpq 1a65 <CrawlStoreValue::operator CrawlHashTable()+0x5> +0000000000001a60 <CrawlStoreValue::operator CrawlHashTable&()>: + 1a60: e9 00 00 00 00 jmpq 1a65 <CrawlStoreValue::operator CrawlHashTable&()+0x5> 1a65: 90 nop 1a66: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 1a6d: 00 00 00 @@ -2566,8 +2566,8 @@ 1c36: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 1c3d: 00 00 00 -0000000000001c40 <CrawlStoreValue::operator std::string()>: - 1c40: e9 00 00 00 00 jmpq 1c45 <CrawlStoreValue::operator std::string()+0x5> +0000000000001c40 <CrawlStoreValue::operator std::string&()>: + 1c40: e9 00 00 00 00 jmpq 1c45 <CrawlStoreValue::operator std::string&()+0x5> 1c45: 90 nop 1c46: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 1c4d: 00 00 00 @@ -2825,8 +2825,8 @@ 1fed: 90 nop 1fee: 66 90 xchg %ax,%ax -0000000000001ff0 <CrawlStoreValue::operator dlua_chunk()>: - 1ff0: e9 00 00 00 00 jmpq 1ff5 <CrawlStoreValue::operator dlua_chunk()+0x5> +0000000000001ff0 <CrawlStoreValue::operator dlua_chunk&()>: + 1ff0: e9 00 00 00 00 jmpq 1ff5 <CrawlStoreValue::operator dlua_chunk&()+0x5> 1ff5: 90 nop 1ff6: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 1ffd: 00 00 00 @@ -2979,8 +2979,8 @@ 2206: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 220d: 00 00 00 -0000000000002210 <CrawlStoreValue::operator monsters()>: - 2210: e9 00 00 00 00 jmpq 2215 <CrawlStoreValue::operator monsters()+0x5> +0000000000002210 <CrawlStoreValue::operator monsters&()>: + 2210: e9 00 00 00 00 jmpq 2215 <CrawlStoreValue::operator monsters&()+0x5> 2215: 90 nop 2216: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 221d: 00 00 00 @@ -3120,8 +3120,8 @@ 2448: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1) 244f: 00 -0000000000002450 <CrawlStoreValue::operator item_def()>: - 2450: e9 00 00 00 00 jmpq 2455 <CrawlStoreValue::operator item_def()+0x5> +0000000000002450 <CrawlStoreValue::operator item_def&()>: + 2450: e9 00 00 00 00 jmpq 2455 <CrawlStoreValue::operator item_def&()+0x5> 2455: 90 nop 2456: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 245d: 00 00 00 The only difference is that the non-TARGET_COMPILER_VC version breaks non-GCC compilers. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Reset tag_minor_version to 0Matthew Cline2009-11-141-6/+0
|
* store: can now handle monsters and Lua chunksMatthew Cline2009-11-121-12/+125
| | | | | CrawlHashTables and CrawlVectors can now contain monsters and Lua chunks.
* store.cc: Allow unset/unused values to be savedMatthew Cline2009-11-111-7/+7
| | | | Allow unset/unused values to be saved and restored.
* CrawlHashTable: free memory on assignmentMatthew Cline2009-11-101-1/+4
| | | | | Free a CrawlHashTable's used memory when it's clobbered via being assigned to.
* CrawlHashTable: reduce RAM overheadMatthew Cline2009-11-101-123/+101
| | | | | | | The RAM overhead for an unused CrawlHash table has been reduced from 32 to 4 (on 32 bit systems), with an increased overhead of 4 bytes for ones which are used. This leads to a 35% RAM reduction for item_def instances with an unused props field.
* store.{cc,h}: Handle level_id and level_posMatthew Cline2009-10-291-14/+222
| | | | | level_id and level_pos instances can now be stored in CrawlHashTables and CrawlVectors.
* versioning: remove SVN-specific revision data, add Git versioningSteven Noonan2009-10-181-1/+0
| | | | Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* platform detection: clean up abuse of '_MSC_VER' macroSteven Noonan2009-10-131-1/+1
| | | | | | | Use TARGET_COMPILER_VC instead, unless you need to find the Visual C++ version information. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* fix 'DEBUG' macro usage consistencySteven Noonan2009-10-131-5/+5
| | | | | | | | | | | | | Sometimes we were doing #if DEBUG and others we were doing #ifdef DEBUG. If we mix both, we have problems: If the DEBUG macro isn't defined, the statement '#if DEBUG' doesn't really make sense logically, because 'DEBUG' has no value. And if we '#define DEBUG 0', then the '#ifdef DEBUG's become true statements. The easiest fix is to swap out the #ifs with #ifdefs. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Drop obsolete CVS last-committed headers ($Author$).Adam Borowski2009-10-061-2/+0
|
* Add spacing fixes.dolorous2009-04-301-6/+6
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9709 c06c8d41-db1a-0410-9941-cceddc491573
* Fix bug #2551376: CrawlStoreValue conversion constructors were crashing.zelgadis2009-01-311-11/+21
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8863 c06c8d41-db1a-0410-9941-cceddc491573
* Adding REVISION() macro to all source files.ennewalker2009-01-041-0/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8217 c06c8d41-db1a-0410-9941-cceddc491573
* Let portal vaults (and places like Vault:8 and Slime:6) change the short andzelgadis2008-12-271-1/+1
| | | | | | | | | long descriptions of features. For example, "An ice covered rock wall" instead of "A rock wall". See dat/icecave.des function ice_cave_feat_descs() for examples. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7992 c06c8d41-db1a-0410-9941-cceddc491573
* Remove pre-Stone Soup change history from source files, and push it allj-p-e-g2008-09-141-4/+0
| | | | | | | | | | into a file crawlhistory.txt in docs/obsolete. I used a perl script to do this under the assumption that all these change logs used the same system following the keyword "Change History". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6930 c06c8d41-db1a-0410-9941-cceddc491573
* Kill hard tabs, and add whitespace fixes.dolorous2008-06-261-10/+10
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6158 c06c8d41-db1a-0410-9941-cceddc491573
* Misc. minor cleanups. (Yes, a huge amount of them but still...)j-p-e-g2008-06-261-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6146 c06c8d41-db1a-0410-9941-cceddc491573
* Don't assert in CrawlVector::set_max_size() if called more than once onzelgadis2008-06-041-1/+1
| | | | | | | the same vector as long as the new max size is the same as the old one. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5471 c06c8d41-db1a-0410-9941-cceddc491573
* Go all the way and also store a randart's name and description inj-p-e-g2008-04-221-4/+4
| | | | | | | | | | | the props table. No more re-rolling every time we need the name, yay! :D Should be save file compatible, and I also modified my previous change to be save file compatible, after all. Not entirely sure this works, though, as I didn't have any old saved games to test this with. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4479 c06c8d41-db1a-0410-9941-cceddc491573
* Cleanup/refactoring of tags.cc. No functional changes. I've beenpauldubois2008-03-171-6/+6
| | | | | | | | | | | | | | | | | | | running with and without this patch applied for about a week, and none of my saves have broken, so I'm ready to commit it. - Tag system no longer uses one big (shared!) global buffer. This was the original impetus behind the change... - Change every use of tagHeader into reader or writer (touches a lot). - Split tagHeader into two classes: reader and writer. Turns out every place that used tagHeader only cared about reading or writing and not about tags at all. There was nothing left in tagHeader, so it disappeared along with a bunch of grotty special-case code. - Not done: merge the files.cc read/writeThing code with the tags.cc marshall/unmarshallThing code. This patch is big enough already. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3685 c06c8d41-db1a-0410-9941-cceddc491573
* Batch of tiny changes for MSVC compiles.pauldubois2008-03-101-0/+13
| | | | | | | | | | | | | | | Most of these fall into the category: - don't use struct to refer to a class, and vice versa - msvc doesn't like unistd.h or dirent.h Doesn't fix all the struct/class problems; I think I'll silence those for now and move on because it's not all that important. Tested on OS X. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3571 c06c8d41-db1a-0410-9941-cceddc491573
* [Bug 1907221] Add "Modified for Crawl Reference" statement and author to aj-p-e-g2008-03-081-2/+2
| | | | | | | | huge number of files. Also correct file name comments. No coding changes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3539 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed crashes when searching for randarts in stash-tracker.dshaligram2007-12-161-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3078 c06c8d41-db1a-0410-9941-cceddc491573
* The copy operator for CrawlStoreValue was copying the value of thezelgadis2007-12-071-3/+47
| | | | | | | | | | val.ptr pointer, rather than copying the object that the pointer referenced; this could potentially lead to freed memory being referenced or to memory being freed twice. This will hopefully fix some CrawlStore related assertions caused by randarts. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3015 c06c8d41-db1a-0410-9941-cceddc491573
* Squash unused-variable warnings by only declaring variables that exist solelynlanza2007-10-151-1/+6
| | | | | | | for ASSERT when we're defining DEBUG. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2462 c06c8d41-db1a-0410-9941-cceddc491573
* The clear() methods should clear the default_flags and type members,zelgadis2007-10-141-0/+4
| | | | | | | as well as clearing out the contained values. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2458 c06c8d41-db1a-0410-9941-cceddc491573
* Added an actual vector version of CrawlHashTable, and removed the codezelgadis2007-10-091-0/+1615
for making a hash table imitate a vector. Since there's now more than just one type of savable/restorable container, hash.cc and hash.h have been renamed to store.cc and store.h ("store" for storage). Destroying/unlinking/deleting an item now clears out the item's props field. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2389 c06c8d41-db1a-0410-9941-cceddc491573