From 12dce46d611d6ea7c772174ebbd555fa10fead99 Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 18 Nov 2013 08:53:22 +0100 Subject: Sanitized and improved several macros through the code - Sanitized all potentially unsafe macros (related eA:15259) - Improved some function-like macros to evaluate their argument only once and keep it in a temporary variable. This improves performance in the damage calculation related code. Signed-off-by: Haru --- src/common/sql.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/common/sql.h') diff --git a/src/common/sql.h b/src/common/sql.h index da00edf2d..1fb436853 100644 --- a/src/common/sql.h +++ b/src/common/sql.h @@ -11,7 +11,7 @@ // Return codes -#define SQL_ERROR -1 +#define SQL_ERROR (-1) #define SQL_SUCCESS 0 #define SQL_NO_DATA 100 @@ -277,7 +277,7 @@ void sql_defaults(void); #if defined(SQL_REMOVE_SHOWDEBUG) #define Sql_ShowDebug(self) (void)0 #else -#define Sql_ShowDebug(self) SQL->ShowDebug_(self, __FILE__, __LINE__) +#define Sql_ShowDebug(self) (SQL->ShowDebug_((self), __FILE__, __LINE__)) #endif void Sql_HerculesUpdateCheck(Sql* self); @@ -286,16 +286,10 @@ void Sql_HerculesUpdateSkip(Sql* self,const char *filename); #if defined(SQL_REMOVE_SHOWDEBUG) #define SqlStmt_ShowDebug(self) (void)0 #else -#define SqlStmt_ShowDebug(self) SQL->StmtShowDebug_(self, __FILE__, __LINE__) -#endif /// Shows debug information (with statement). - - - - - +#define SqlStmt_ShowDebug(self) (SQL->StmtShowDebug_((self), __FILE__, __LINE__)) +#endif void Sql_Init(void); - #endif /* _COMMON_SQL_H_ */ -- cgit v1.2.3-60-g2f50