summaryrefslogtreecommitdiff
path: root/src/common/db.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-07-10 17:17:09 +0200
committerHaru <haru@dotalux.com>2014-07-11 08:47:35 +0200
commitbe75198abbd8420d25e67ee5d714422cf6c488db (patch)
treea19a8fe69e78f8bfc01cc0685b08a4fc88ca5654 /src/common/db.h
parent68e7f53f05dd80e8b4ab9d84c9931df22a6b060c (diff)
downloadhercules-be75198abbd8420d25e67ee5d714422cf6c488db.tar.gz
hercules-be75198abbd8420d25e67ee5d714422cf6c488db.tar.bz2
hercules-be75198abbd8420d25e67ee5d714422cf6c488db.tar.xz
hercules-be75198abbd8420d25e67ee5d714422cf6c488db.zip
Removed some c++ compatibility definitions
- Neither our code nor 3rdparty code is, (or will compile as) C++, regardless of those checks. - Special thanks to panikon. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/db.h')
-rw-r--r--src/common/db.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/db.h b/src/common/db.h
index ed87e474b..bf59e37d6 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -1138,8 +1138,8 @@ void linkdb_foreach (struct linkdb_node** head, LinkDBFunc func, ...);
do{ \
if( (__n) > VECTOR_CAPACITY(__vec) ) \
{ /* increase size */ \
- if( VECTOR_CAPACITY(__vec) == 0 ) SET_POINTER(VECTOR_DATA(__vec), aMalloc((__n)*sizeof(VECTOR_FIRST(__vec)))); /* allocate new */ \
- else SET_POINTER(VECTOR_DATA(__vec), aRealloc(VECTOR_DATA(__vec),(__n)*sizeof(VECTOR_FIRST(__vec)))); /* reallocate */ \
+ if( VECTOR_CAPACITY(__vec) == 0 ) VECTOR_DATA(__vec) = aMalloc((__n)*sizeof(VECTOR_FIRST(__vec))); /* allocate new */ \
+ else VECTOR_DATA(__vec) = aRealloc(VECTOR_DATA(__vec),(__n)*sizeof(VECTOR_FIRST(__vec))); /* reallocate */ \
memset(VECTOR_DATA(__vec)+VECTOR_LENGTH(__vec), 0, (VECTOR_CAPACITY(__vec)-VECTOR_LENGTH(__vec))*sizeof(VECTOR_FIRST(__vec))); /* clear new data */ \
VECTOR_CAPACITY(__vec) = (__n); /* update capacity */ \
} \
@@ -1151,7 +1151,7 @@ void linkdb_foreach (struct linkdb_node** head, LinkDBFunc func, ...);
} \
else if( (__n) < VECTOR_CAPACITY(__vec) ) \
{ /* reduce size */ \
- SET_POINTER(VECTOR_DATA(__vec), aRealloc(VECTOR_DATA(__vec),(__n)*sizeof(VECTOR_FIRST(__vec)))); /* reallocate */ \
+ VECTOR_DATA(__vec) = aRealloc(VECTOR_DATA(__vec),(__n)*sizeof(VECTOR_FIRST(__vec))); /* reallocate */ \
VECTOR_CAPACITY(__vec) = (__n); /* update capacity */ \
if( VECTOR_LENGTH(__vec) > (__n) ) VECTOR_LENGTH(__vec) = (__n); /* update length */ \
} \