summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/store.h
Commit message (Collapse)AuthorAgeFilesLines
* store.{cc,h}: remove pointless special case for MSVCSteven Noonan2009-12-291-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* store: can now handle monsters and Lua chunksMatthew Cline2009-11-121-2/+17
| | | | | CrawlHashTables and CrawlVectors can now contain monsters and Lua chunks.
* CrawlHashTable: reduce RAM overheadMatthew Cline2009-11-101-13/+11
| | | | | | | 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/+32
| | | | | level_id and level_pos instances can now be stored in CrawlHashTables and CrawlVectors.
* 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>
* Drop obsolete CVS last-committed headers ($Author$).Adam Borowski2009-10-061-2/+0
|
* 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
* Implement pathfinding for monsters, using the A* algorithm.j-p-e-g2008-06-041-1/+1
| | | | | | | | | | | | | | | | It's not actually used anywhere yet, but I've implemented a wizmode testing function (x on monster, then 'w') that calculates the shortest path to any playerchosen destination on the level, and it seems to work quite well. The monsters tend to take zigzag paths but that should be easy enough to smooth out and in any case doesn't matter all that much since the player usually won't witness this. Oh, and though I tested the whole thing in a labyrinth, it went ridiculously fast! I'd rather doubted that but Darshan was completely right, as usually. :p Please don't remove the debugging output yet, I still need them. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5476 c06c8d41-db1a-0410-9941-cceddc491573
* #if 0 out some methods that don't actually exist.pauldubois2008-03-201-0/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3743 c06c8d41-db1a-0410-9941-cceddc491573
* Cleanup/refactoring of tags.cc. No functional changes. I've beenpauldubois2008-03-171-7/+8
| | | | | | | | | | | | | | | | | | | 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-2/+15
| | | | | | | | | | | | | | | 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-4/+4
| | | | | | | | 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
* Some code cleanup.haranp2007-10-231-21/+21
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2524 c06c8d41-db1a-0410-9941-cceddc491573
* Added an actual vector version of CrawlHashTable, and removed the codezelgadis2007-10-091-0/+402
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