diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-12-27 03:35:57 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-12-27 03:35:57 +0000 |
commit | 1307b441cd2cdc94bdde1999d48aefb55d91e082 (patch) | |
tree | 4674edabfa271c4f0dd2b4f21f783640958e8cac /src/common/db.h | |
parent | dfe4ede046db94e2e6e580d2efa13bb9a773ce15 (diff) | |
download | hercules-1307b441cd2cdc94bdde1999d48aefb55d91e082.tar.gz hercules-1307b441cd2cdc94bdde1999d48aefb55d91e082.tar.bz2 hercules-1307b441cd2cdc94bdde1999d48aefb55d91e082.tar.xz hercules-1307b441cd2cdc94bdde1999d48aefb55d91e082.zip |
* Tweeked the declaration and initialization defines for vectors.
* Made do_sockets leave the for loop as soon as the readable number of sockets returned by select is found.
* Made all posix compliant systems that support it and FreeBSD >= 5.1 (implements it but doesn't have the posix defines) use the precise and consistent tick() implementation.
* Minor tweek to HEAP_SEARCH (same variable can be used in from and to).
* Fixed the map server not exiting when make_listen_bind fails and returns -1.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11983 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/db.h')
-rw-r--r-- | src/common/db.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/common/db.h b/src/common/db.h index 30948b0cb..cf9e4e82e 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -854,11 +854,23 @@ void linkdb_final ( struct linkdb_node** head ); +/// Declares an anonymous vector struct. +/// +/// @param __type Type of data +#define VECTOR_DECL(__type) \ + struct { \ + size_t _max_; \ + size_t _len_; \ + __type* _data_; \ + } + + + /// Declares a named vector struct. /// /// @param __name Structure name /// @param __type Type of data -#define VECTOR_STRUCT(__name,__type) \ +#define VECTOR_STRUCT_DECL(__name,__type) \ struct __name { \ size_t _max_; \ size_t _len_; \ @@ -867,7 +879,16 @@ void linkdb_final ( struct linkdb_node** head ); -/// Declares a named vector struct variable. +/// Declares and initializes an anonymous vector variable. +/// +/// @param __type Type of data +/// @param __var Variable name +#define VECTOR_VAR(__type,__var) \ + VECTOR_DECL(__type) __var = {0,0,NULL} + + + +/// Declares and initializes a named vector variable. /// /// @param __name Structure name /// @param __var Variable name @@ -876,16 +897,11 @@ void linkdb_final ( struct linkdb_node** head ); -/// Declares a vector variable with an anonymous struct. +/// Initializes a vector. /// -/// @param __type Type of data -/// @param __var Variable name -#define VECTOR_VAR(__type,__var) \ - struct { \ - size_t _max_; \ - size_t _len_; \ - __type* _data_; \ - } __var = {0,0,NULL} +/// @param __vec Vector +#define VECTOR_INIT(__vec) \ + memset(&(__vec), 0, sizeof(__vec)) |