summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-04-11 17:03:13 +0000
committerDarkvater <darkvater@openttd.org>2006-04-11 17:03:13 +0000
commitaa4f6605ad0549aaaffc96c88b2755b122dd3f7d (patch)
tree9f07bd191f1138d5b0f9306d4b7281e0f0f9887c
parent38417f17940fcf99ebbdba9ee308012afae06093 (diff)
downloadopenttd-aa4f6605ad0549aaaffc96c88b2755b122dd3f7d.tar.xz
(svn r4360) - CodeChange: add shortcut to SlGetArrayLength of the gamma-function along the lines of the Write/Read functions
-rw-r--r--saveload.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/saveload.c b/saveload.c
index 2d936b8d6..f3a4c77fe 100644
--- a/saveload.c
+++ b/saveload.c
@@ -282,6 +282,7 @@ static inline void SlWriteSparseIndex(uint index) {SlWriteSimpleGamma(index);}
static inline uint SlReadArrayLength(void) {return SlReadSimpleGamma();}
static inline void SlWriteArrayLength(uint length) {SlWriteSimpleGamma(length);}
+static inline uint SlGetArrayLength(uint length) {return SlGetGammaLength(length);}
void SlSetArrayIndex(uint index)
{
@@ -351,7 +352,7 @@ void SlSetLength(size_t length)
SlWriteArrayLength(length + 1);
break;
case CH_SPARSE_ARRAY:
- SlWriteArrayLength(length + 1 + SlGetGammaLength(_sl.array_index)); // Also include length of sparse index.
+ SlWriteArrayLength(length + 1 + SlGetArrayLength(_sl.array_index)); // Also include length of sparse index.
SlWriteSparseIndex(_sl.array_index);
break;
default: NOT_REACHED();