summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-07-01 21:29:03 +0000
committersmatz <smatz@openttd.org>2009-07-01 21:29:03 +0000
commit93c5300fc5cf8041b4e57eac0c714d5f55a6ed8b (patch)
treeff2e05e25ffed493c169e23c966e3c3e35509636 /src/saveload
parent76a50ce94dc7c78d76c309d8a639591fed2a2da8 (diff)
downloadopenttd-93c5300fc5cf8041b4e57eac0c714d5f55a6ed8b.tar.xz
(svn r16715) -Codechange: add attribute to assert_compile(), so it doesn't warn when used inside function
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/oldloader.cpp2
-rw-r--r--src/saveload/saveload.cpp5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/saveload/oldloader.cpp b/src/saveload/oldloader.cpp
index ba26d66a2..812b8ad99 100644
--- a/src/saveload/oldloader.cpp
+++ b/src/saveload/oldloader.cpp
@@ -237,9 +237,9 @@ static inline bool CheckOldSavegameType(FILE *f, char *temp, const char *last, u
return ret;
}
-assert_compile(TTD_HEADER_SIZE >= TTO_HEADER_SIZE);
static SavegameType DetermineOldSavegameType(FILE *f, char *title, const char *last)
{
+ assert_compile(TTD_HEADER_SIZE >= TTO_HEADER_SIZE);
char temp[TTD_HEADER_SIZE];
SavegameType type = SGT_TTO;
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 1ac00f7ab..46c6104e6 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -1498,11 +1498,10 @@ static size_t ReferenceToInt(const void *obj, SLRefType rt)
* @param rt SLRefType type of the object the pointer is sought of
* @return Return the index converted to a pointer of any type
*/
-
-assert_compile(sizeof(size_t) <= sizeof(void *));
-
static void *IntToReference(size_t index, SLRefType rt)
{
+ assert_compile(sizeof(size_t) <= sizeof(void *));
+
assert(_sl.action == SLA_PTRS);
/* After version 4.3 REF_VEHICLE_OLD is saved as REF_VEHICLE,