diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/char/Makefile.in | 6 | ||||
-rw-r--r-- | src/char/char.c | 2 | ||||
-rw-r--r-- | src/common/conf.c | 86 | ||||
-rw-r--r-- | src/common/conf.h | 14 | ||||
-rw-r--r-- | src/login/Makefile.in | 6 | ||||
-rw-r--r-- | src/map/Makefile.in | 6 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 24 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.Hooks.inc | 40 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.Hooks.inc | 40 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 40 | ||||
-rw-r--r-- | src/test/Makefile.in | 4 | ||||
-rw-r--r-- | src/test/test_libconfig.c | 37 | ||||
-rw-r--r-- | src/test/test_spinlock.c | 12 | ||||
-rw-r--r-- | src/tool/Makefile.in | 4 |
14 files changed, 214 insertions, 107 deletions
diff --git a/src/char/Makefile.in b/src/char/Makefile.in index fe40621fb..7806ce2bb 100644 --- a/src/char/Makefile.in +++ b/src/char/Makefile.in @@ -51,7 +51,7 @@ CHAR_PH = HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) - CHAR_SERVER_SQL_DEPENDS=$(CHAR_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) $(SYSINFO_INC) + CHAR_SERVER_SQL_DEPENDS=$(CHAR_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) $(SYSINFO_INC) else CHAR_SERVER_SQL_DEPENDS=needs_mysql endif @@ -110,8 +110,8 @@ char-server: ../../char-server@EXEEXT@ ../../char-server@EXEEXT@: $(CHAR_SERVER_SQL_DEPENDS) Makefile @echo " LD $(notdir $@)" - @$(CC) @STATIC@ @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_D)/obj_sql/common_sql.a \ - $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ + @$(CC) @STATIC@ @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a \ + $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ # missing object files $(COMMON_D)/obj_all/common.a: diff --git a/src/char/char.c b/src/char/char.c index a43f783b5..d69ea0d53 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -5940,7 +5940,7 @@ bool char_config_read_player_new(const char *filename, const struct config_t *co #else const char *start_point_setting = "start_point_pre"; #endif - long long int i64 = 0; // TODO: Temporary until the signature of libconfig->setting_lookup_int64 is changed to take a defined-size int (int64) + int64 i64 = 0; nullpo_retr(false, filename); nullpo_retr(false, config); diff --git a/src/common/conf.c b/src/common/conf.c index 8ec2f3fb4..96b9bff9f 100644 --- a/src/common/conf.c +++ b/src/common/conf.c @@ -373,6 +373,80 @@ int config_lookup_mutable_string(const struct config_t *config, const char *name return CONFIG_FALSE; } +/** + * Wrapper for config_setting_get_int64() using defined-size variables + * + * @see config_setting_get_int64_real() + */ +int64 config_setting_get_int64_real(const struct config_setting_t *setting) +{ + return (int64)config_setting_get_int64(setting); +} + +/** + * Wrapper for config_setting_lookup_int64() using defined-size variables + * + * @see config_setting_lookup_int64() + */ +int config_setting_lookup_int64_real(const struct config_setting_t *setting, const char *name, int64 *value) +{ + long long int lli = 0; + + if (config_setting_lookup_int64(setting, name, &lli) != CONFIG_TRUE) + return CONFIG_FALSE; + + *value = (int64)lli; + + return CONFIG_TRUE; +} + +/** + * Wrapper for config_setting_set_int64() using defined-size variables + * + * @see config_setting_set_int64() + */ +int config_setting_set_int64_real(struct config_setting_t *setting, int64 value) +{ + return config_setting_set_int64(setting, (long long int)value); +} + +/** + * Wrapper for config_setting_get_int64_elem() using defined-size variables + * + * @see config_setting_get_int64_elem() + */ +int64 config_setting_get_int64_elem_real(const struct config_setting_t *setting, int idx) +{ + return (int64)config_setting_get_int64_elem(setting, idx); +} + +/** + * Wrapper for config_setting_set_int64_elem() using defined-size variables + * + * @see config_setting_set_int64_elem() + */ +struct config_setting_t *config_setting_set_int64_elem_real(struct config_setting_t *setting, int idx, int64 value) +{ + return config_setting_set_int64_elem(setting, idx, (long long int)value); +} + +/** + * Wrapper for config_lookup_int64() using defined-size variables + * + * @see config_lookup_int64() + */ +int config_lookup_int64_real(const struct config_t *config, const char *filepath, int64 *value) +{ + long long int lli = 0; + + if (config_lookup_int64(config, filepath, &lli) != CONFIG_TRUE) + return CONFIG_FALSE; + + *value = (int64)lli; + + return CONFIG_TRUE; +} + void libconfig_defaults(void) { libconfig = &libconfig_s; @@ -393,20 +467,20 @@ void libconfig_defaults(void) { libconfig->destroy = config_destroy; /* */ libconfig->setting_get_int = config_setting_get_int; - libconfig->setting_get_int64 = config_setting_get_int64; + libconfig->setting_get_int64 = config_setting_get_int64_real; libconfig->setting_get_float = config_setting_get_float; libconfig->setting_get_bool = config_setting_get_bool; libconfig->setting_get_string = config_setting_get_string; /* */ libconfig->setting_lookup = config_setting_lookup; libconfig->setting_lookup_int = config_setting_lookup_int; - libconfig->setting_lookup_int64 = config_setting_lookup_int64; + libconfig->setting_lookup_int64 = config_setting_lookup_int64_real; libconfig->setting_lookup_float = config_setting_lookup_float; libconfig->setting_lookup_bool = config_setting_lookup_bool; libconfig->setting_lookup_string = config_setting_lookup_string; /* */ libconfig->setting_set_int = config_setting_set_int; - libconfig->setting_set_int64 = config_setting_set_int64; + libconfig->setting_set_int64 = config_setting_set_int64_real; libconfig->setting_set_float = config_setting_set_float; libconfig->setting_set_bool = config_setting_set_bool; libconfig->setting_set_string = config_setting_set_string; @@ -415,13 +489,13 @@ void libconfig_defaults(void) { libconfig->setting_get_format = config_setting_get_format; /* */ libconfig->setting_get_int_elem = config_setting_get_int_elem; - libconfig->setting_get_int64_elem = config_setting_get_int64_elem; + libconfig->setting_get_int64_elem = config_setting_get_int64_elem_real; libconfig->setting_get_float_elem = config_setting_get_float_elem; libconfig->setting_get_bool_elem = config_setting_get_bool_elem; libconfig->setting_get_string_elem = config_setting_get_string_elem; /* */ libconfig->setting_set_int_elem = config_setting_set_int_elem; - libconfig->setting_set_int64_elem = config_setting_set_int64_elem; + libconfig->setting_set_int64_elem = config_setting_set_int64_elem_real; libconfig->setting_set_float_elem = config_setting_set_float_elem; libconfig->setting_set_bool_elem = config_setting_set_bool_elem; libconfig->setting_set_string_elem = config_setting_set_string_elem; @@ -441,7 +515,7 @@ void libconfig_defaults(void) { libconfig->lookup = config_lookup; /* */ libconfig->lookup_int = config_lookup_int; - libconfig->lookup_int64 = config_lookup_int64; + libconfig->lookup_int64 = config_lookup_int64_real; libconfig->lookup_float = config_lookup_float; libconfig->lookup_bool = config_lookup_bool; libconfig->lookup_string = config_lookup_string; diff --git a/src/common/conf.h b/src/common/conf.h index cb1ca6bee..bd6acc4be 100644 --- a/src/common/conf.h +++ b/src/common/conf.h @@ -46,7 +46,7 @@ struct libconfig_interface { void (*destroy) (struct config_t *config); int (*setting_get_int) (const struct config_setting_t *setting); - long long (*setting_get_int64) (const struct config_setting_t *setting); + int64 (*setting_get_int64) (const struct config_setting_t *setting); double (*setting_get_float) (const struct config_setting_t *setting); int (*setting_get_bool) (const struct config_setting_t *setting); @@ -55,12 +55,12 @@ struct libconfig_interface { struct config_setting_t * (*setting_lookup) (struct config_setting_t *setting, const char *name); int (*setting_lookup_int) (const struct config_setting_t *setting, const char *name, int *value); - int (*setting_lookup_int64) (const struct config_setting_t *setting, const char *name, long long *value); + int (*setting_lookup_int64) (const struct config_setting_t *setting, const char *name, int64 *value); int (*setting_lookup_float) (const struct config_setting_t *setting, const char *name, double *value); int (*setting_lookup_bool) (const struct config_setting_t *setting, const char *name, int *value); int (*setting_lookup_string) (const struct config_setting_t *setting, const char *name, const char **value); - int (*setting_set_int) (struct config_setting_t *setting ,int value); - int (*setting_set_int64) (struct config_setting_t *setting, long long value); + int (*setting_set_int) (struct config_setting_t *setting, int value); + int (*setting_set_int64) (struct config_setting_t *setting, int64 value); int (*setting_set_float) (struct config_setting_t *setting, double value); int (*setting_set_bool) (struct config_setting_t *setting, int value); int (*setting_set_string) (struct config_setting_t *setting, const char *value); @@ -69,12 +69,12 @@ struct libconfig_interface { short (*setting_get_format) (const struct config_setting_t *setting); int (*setting_get_int_elem) (const struct config_setting_t *setting, int idx); - long long (*setting_get_int64_elem) (const struct config_setting_t *setting, int idx); + int64 (*setting_get_int64_elem) (const struct config_setting_t *setting, int idx); double (*setting_get_float_elem) (const struct config_setting_t *setting, int idx); int (*setting_get_bool_elem) (const struct config_setting_t *setting, int idx); const char * (*setting_get_string_elem) (const struct config_setting_t *setting, int idx); struct config_setting_t * (*setting_set_int_elem) (struct config_setting_t *setting, int idx, int value); - struct config_setting_t * (*setting_set_int64_elem) (struct config_setting_t *setting, int idx, long long value); + struct config_setting_t * (*setting_set_int64_elem) (struct config_setting_t *setting, int idx, int64 value); struct config_setting_t * (*setting_set_float_elem) (struct config_setting_t *setting, int idx, double value); struct config_setting_t * (*setting_set_bool_elem) (struct config_setting_t *setting, int idx, int value); struct config_setting_t * (*setting_set_string_elem) (struct config_setting_t *setting, int idx, const char *value); @@ -93,7 +93,7 @@ struct libconfig_interface { struct config_setting_t * (*lookup) (const struct config_t *config, const char *filepath); int (*lookup_int) (const struct config_t *config, const char *filepath, int *value); - int (*lookup_int64) (const struct config_t *config, const char *filepath, long long *value); + int (*lookup_int64) (const struct config_t *config, const char *filepath, int64 *value); int (*lookup_float) (const struct config_t *config, const char *filepath, double *value); int (*lookup_bool) (const struct config_t *config, const char *filepath, int *value); int (*lookup_string) (const struct config_t *config, const char *filepath, const char **value); diff --git a/src/login/Makefile.in b/src/login/Makefile.in index c74ed1e10..69cc6a897 100644 --- a/src/login/Makefile.in +++ b/src/login/Makefile.in @@ -47,7 +47,7 @@ LOGIN_PH = lclif.p.h HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) - LOGIN_SERVER_SQL_DEPENDS=$(LOGIN_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ $(SYSINFO_INC)) + LOGIN_SERVER_SQL_DEPENDS=$(LOGIN_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) $(SYSINFO_INC) else LOGIN_SERVER_SQL_DEPENDS=needs_mysql endif @@ -106,8 +106,8 @@ login-server: ../../login-server@EXEEXT@ ../../login-server@EXEEXT@: $(LOGIN_SERVER_SQL_DEPENDS) Makefile @echo " LD $(notdir $@)" - @$(CC) @STATIC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_D)/obj_sql/common_sql.a \ - $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ + @$(CC) @STATIC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a \ + $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ # missing object files $(COMMON_D)/obj_all/common.a: diff --git a/src/map/Makefile.in b/src/map/Makefile.in index 3c6a3f806..c01826bfb 100644 --- a/src/map/Makefile.in +++ b/src/map/Makefile.in @@ -57,7 +57,7 @@ MAP_PH = HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) - MAP_SERVER_SQL_DEPENDS=$(MAP_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ $(SYSINFO_INC)) + MAP_SERVER_SQL_DEPENDS=$(MAP_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) $(SYSINFO_INC) else MAP_SERVER_SQL_DEPENDS=needs_mysql endif @@ -116,8 +116,8 @@ map-server: ../../map-server@EXEEXT@ ../../map-server@EXEEXT@: $(MAP_SERVER_SQL_DEPENDS) Makefile @echo " LD $(notdir $@)" - @$(CC) @STATIC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) $(COMMON_D)/obj_sql/common_sql.a \ - $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ + @$(CC) @STATIC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a \ + $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ # missing object files $(COMMON_D)/obj_all/common.a: diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index af90b1fcc..eb494a6c2 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -3480,8 +3480,8 @@ typedef void (*HPMHOOK_pre_libconfig_destroy) (struct config_t **config); typedef void (*HPMHOOK_post_libconfig_destroy) (struct config_t *config); typedef int (*HPMHOOK_pre_libconfig_setting_get_int) (const struct config_setting_t **setting); typedef int (*HPMHOOK_post_libconfig_setting_get_int) (int retVal___, const struct config_setting_t *setting); -typedef long long (*HPMHOOK_pre_libconfig_setting_get_int64) (const struct config_setting_t **setting); -typedef long long (*HPMHOOK_post_libconfig_setting_get_int64) (long long retVal___, const struct config_setting_t *setting); +typedef int64 (*HPMHOOK_pre_libconfig_setting_get_int64) (const struct config_setting_t **setting); +typedef int64 (*HPMHOOK_post_libconfig_setting_get_int64) (int64 retVal___, const struct config_setting_t *setting); typedef double (*HPMHOOK_pre_libconfig_setting_get_float) (const struct config_setting_t **setting); typedef double (*HPMHOOK_post_libconfig_setting_get_float) (double retVal___, const struct config_setting_t *setting); typedef int (*HPMHOOK_pre_libconfig_setting_get_bool) (const struct config_setting_t **setting); @@ -3492,8 +3492,8 @@ typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_lookup) (struct typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_lookup) (struct config_setting_t* retVal___, struct config_setting_t *setting, const char *name); typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int) (const struct config_setting_t **setting, const char **name, int **value); typedef int (*HPMHOOK_post_libconfig_setting_lookup_int) (int retVal___, const struct config_setting_t *setting, const char *name, int *value); -typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int64) (const struct config_setting_t **setting, const char **name, long long **value); -typedef int (*HPMHOOK_post_libconfig_setting_lookup_int64) (int retVal___, const struct config_setting_t *setting, const char *name, long long *value); +typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int64) (const struct config_setting_t **setting, const char **name, int64 **value); +typedef int (*HPMHOOK_post_libconfig_setting_lookup_int64) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value); typedef int (*HPMHOOK_pre_libconfig_setting_lookup_float) (const struct config_setting_t **setting, const char **name, double **value); typedef int (*HPMHOOK_post_libconfig_setting_lookup_float) (int retVal___, const struct config_setting_t *setting, const char *name, double *value); typedef int (*HPMHOOK_pre_libconfig_setting_lookup_bool) (const struct config_setting_t **setting, const char **name, int **value); @@ -3502,8 +3502,8 @@ typedef int (*HPMHOOK_pre_libconfig_setting_lookup_string) (const struct config_ typedef int (*HPMHOOK_post_libconfig_setting_lookup_string) (int retVal___, const struct config_setting_t *setting, const char *name, const char **value); typedef int (*HPMHOOK_pre_libconfig_setting_set_int) (struct config_setting_t **setting, int *value); typedef int (*HPMHOOK_post_libconfig_setting_set_int) (int retVal___, struct config_setting_t *setting, int value); -typedef int (*HPMHOOK_pre_libconfig_setting_set_int64) (struct config_setting_t **setting, long long *value); -typedef int (*HPMHOOK_post_libconfig_setting_set_int64) (int retVal___, struct config_setting_t *setting, long long value); +typedef int (*HPMHOOK_pre_libconfig_setting_set_int64) (struct config_setting_t **setting, int64 *value); +typedef int (*HPMHOOK_post_libconfig_setting_set_int64) (int retVal___, struct config_setting_t *setting, int64 value); typedef int (*HPMHOOK_pre_libconfig_setting_set_float) (struct config_setting_t **setting, double *value); typedef int (*HPMHOOK_post_libconfig_setting_set_float) (int retVal___, struct config_setting_t *setting, double value); typedef int (*HPMHOOK_pre_libconfig_setting_set_bool) (struct config_setting_t **setting, int *value); @@ -3516,8 +3516,8 @@ typedef short (*HPMHOOK_pre_libconfig_setting_get_format) (const struct config_s typedef short (*HPMHOOK_post_libconfig_setting_get_format) (short retVal___, const struct config_setting_t *setting); typedef int (*HPMHOOK_pre_libconfig_setting_get_int_elem) (const struct config_setting_t **setting, int *idx); typedef int (*HPMHOOK_post_libconfig_setting_get_int_elem) (int retVal___, const struct config_setting_t *setting, int idx); -typedef long long (*HPMHOOK_pre_libconfig_setting_get_int64_elem) (const struct config_setting_t **setting, int *idx); -typedef long long (*HPMHOOK_post_libconfig_setting_get_int64_elem) (long long retVal___, const struct config_setting_t *setting, int idx); +typedef int64 (*HPMHOOK_pre_libconfig_setting_get_int64_elem) (const struct config_setting_t **setting, int *idx); +typedef int64 (*HPMHOOK_post_libconfig_setting_get_int64_elem) (int64 retVal___, const struct config_setting_t *setting, int idx); typedef double (*HPMHOOK_pre_libconfig_setting_get_float_elem) (const struct config_setting_t **setting, int *idx); typedef double (*HPMHOOK_post_libconfig_setting_get_float_elem) (double retVal___, const struct config_setting_t *setting, int idx); typedef int (*HPMHOOK_pre_libconfig_setting_get_bool_elem) (const struct config_setting_t **setting, int *idx); @@ -3526,8 +3526,8 @@ typedef const char* (*HPMHOOK_pre_libconfig_setting_get_string_elem) (const stru typedef const char* (*HPMHOOK_post_libconfig_setting_get_string_elem) (const char* retVal___, const struct config_setting_t *setting, int idx); typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_int_elem) (struct config_setting_t **setting, int *idx, int *value); typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_int_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_int64_elem) (struct config_setting_t **setting, int *idx, long long *value); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_int64_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, long long value); +typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_int64_elem) (struct config_setting_t **setting, int *idx, int64 *value); +typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_int64_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_float_elem) (struct config_setting_t **setting, int *idx, double *value); typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_float_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, double value); typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_bool_elem) (struct config_setting_t **setting, int *idx, int *value); @@ -3554,8 +3554,8 @@ typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_lookup) (const struct c typedef struct config_setting_t* (*HPMHOOK_post_libconfig_lookup) (struct config_setting_t* retVal___, const struct config_t *config, const char *filepath); typedef int (*HPMHOOK_pre_libconfig_lookup_int) (const struct config_t **config, const char **filepath, int **value); typedef int (*HPMHOOK_post_libconfig_lookup_int) (int retVal___, const struct config_t *config, const char *filepath, int *value); -typedef int (*HPMHOOK_pre_libconfig_lookup_int64) (const struct config_t **config, const char **filepath, long long **value); -typedef int (*HPMHOOK_post_libconfig_lookup_int64) (int retVal___, const struct config_t *config, const char *filepath, long long *value); +typedef int (*HPMHOOK_pre_libconfig_lookup_int64) (const struct config_t **config, const char **filepath, int64 **value); +typedef int (*HPMHOOK_post_libconfig_lookup_int64) (int retVal___, const struct config_t *config, const char *filepath, int64 *value); typedef int (*HPMHOOK_pre_libconfig_lookup_float) (const struct config_t **config, const char **filepath, double **value); typedef int (*HPMHOOK_post_libconfig_lookup_float) (int retVal___, const struct config_t *config, const char *filepath, double *value); typedef int (*HPMHOOK_pre_libconfig_lookup_bool) (const struct config_t **config, const char **filepath, int **value); diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index 19e127a23..bab2c2721 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -8593,11 +8593,11 @@ int HP_libconfig_setting_get_int(const struct config_setting_t *setting) { } return retVal___; } -long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { +int64 HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting); + int64 (*preHookFunc) (const struct config_setting_t **setting); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_pre[hIndex].func; @@ -8612,7 +8612,7 @@ long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) retVal___ = HPMHooks.source.libconfig.setting_get_int64(setting); } if( HPMHooks.count.HP_libconfig_setting_get_int64_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting); @@ -8755,11 +8755,11 @@ int HP_libconfig_setting_lookup_int(const struct config_setting_t *setting, cons } return retVal___; } -int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, long long *value) { +int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_setting_t **setting, const char **name, long long **value); + int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_pre[hIndex].func; @@ -8774,7 +8774,7 @@ int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, co retVal___ = HPMHooks.source.libconfig.setting_lookup_int64(setting, name, value); } if( HPMHooks.count.HP_libconfig_setting_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, long long *value); + int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name, value); @@ -8890,11 +8890,11 @@ int HP_libconfig_setting_set_int(struct config_setting_t *setting, int value) { } return retVal___; } -int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long value) { +int HP_libconfig_setting_set_int64(struct config_setting_t *setting, int64 value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_set_int64_pre ) { - int (*preHookFunc) (struct config_setting_t **setting, long long *value); + int (*preHookFunc) (struct config_setting_t **setting, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_pre[hIndex].func; @@ -8909,7 +8909,7 @@ int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long v retVal___ = HPMHooks.source.libconfig.setting_set_int64(setting, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_post ) { - int (*postHookFunc) (int retVal___, struct config_setting_t *setting, long long value); + int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, value); @@ -9079,11 +9079,11 @@ int HP_libconfig_setting_get_int_elem(const struct config_setting_t *setting, in } return retVal___; } -long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { +int64 HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting, int *idx); + int64 (*preHookFunc) (const struct config_setting_t **setting, int *idx); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_pre[hIndex].func; @@ -9098,7 +9098,7 @@ long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *set retVal___ = HPMHooks.source.libconfig.setting_get_int64_elem(setting, idx); } if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting, int idx); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting, int idx); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -9214,11 +9214,11 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, long long value) { +struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { int hIndex = 0; struct config_setting_t* retVal___ = NULL; if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre ) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, long long *value); + struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func; @@ -9233,7 +9233,7 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_post ) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, long long value); + struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -9591,11 +9591,11 @@ int HP_libconfig_lookup_int(const struct config_t *config, const char *filepath, } return retVal___; } -int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, long long *value) { +int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_t **config, const char **filepath, long long **value); + int (*preHookFunc) (const struct config_t **config, const char **filepath, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_pre[hIndex].func; @@ -9610,7 +9610,7 @@ int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepat retVal___ = HPMHooks.source.libconfig.lookup_int64(config, filepath, value); } if( HPMHooks.count.HP_libconfig_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, long long *value); + int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, config, filepath, value); diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 097b4b283..b5fc0e70b 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -1899,11 +1899,11 @@ int HP_libconfig_setting_get_int(const struct config_setting_t *setting) { } return retVal___; } -long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { +int64 HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting); + int64 (*preHookFunc) (const struct config_setting_t **setting); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_pre[hIndex].func; @@ -1918,7 +1918,7 @@ long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) retVal___ = HPMHooks.source.libconfig.setting_get_int64(setting); } if( HPMHooks.count.HP_libconfig_setting_get_int64_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting); @@ -2061,11 +2061,11 @@ int HP_libconfig_setting_lookup_int(const struct config_setting_t *setting, cons } return retVal___; } -int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, long long *value) { +int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_setting_t **setting, const char **name, long long **value); + int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_pre[hIndex].func; @@ -2080,7 +2080,7 @@ int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, co retVal___ = HPMHooks.source.libconfig.setting_lookup_int64(setting, name, value); } if( HPMHooks.count.HP_libconfig_setting_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, long long *value); + int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name, value); @@ -2196,11 +2196,11 @@ int HP_libconfig_setting_set_int(struct config_setting_t *setting, int value) { } return retVal___; } -int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long value) { +int HP_libconfig_setting_set_int64(struct config_setting_t *setting, int64 value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_set_int64_pre ) { - int (*preHookFunc) (struct config_setting_t **setting, long long *value); + int (*preHookFunc) (struct config_setting_t **setting, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_pre[hIndex].func; @@ -2215,7 +2215,7 @@ int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long v retVal___ = HPMHooks.source.libconfig.setting_set_int64(setting, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_post ) { - int (*postHookFunc) (int retVal___, struct config_setting_t *setting, long long value); + int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, value); @@ -2385,11 +2385,11 @@ int HP_libconfig_setting_get_int_elem(const struct config_setting_t *setting, in } return retVal___; } -long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { +int64 HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting, int *idx); + int64 (*preHookFunc) (const struct config_setting_t **setting, int *idx); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_pre[hIndex].func; @@ -2404,7 +2404,7 @@ long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *set retVal___ = HPMHooks.source.libconfig.setting_get_int64_elem(setting, idx); } if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting, int idx); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting, int idx); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -2520,11 +2520,11 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, long long value) { +struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { int hIndex = 0; struct config_setting_t* retVal___ = NULL; if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre ) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, long long *value); + struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func; @@ -2539,7 +2539,7 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_post ) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, long long value); + struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -2897,11 +2897,11 @@ int HP_libconfig_lookup_int(const struct config_t *config, const char *filepath, } return retVal___; } -int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, long long *value) { +int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_t **config, const char **filepath, long long **value); + int (*preHookFunc) (const struct config_t **config, const char **filepath, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_pre[hIndex].func; @@ -2916,7 +2916,7 @@ int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepat retVal___ = HPMHooks.source.libconfig.lookup_int64(config, filepath, value); } if( HPMHooks.count.HP_libconfig_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, long long *value); + int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, config, filepath, value); diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index acf554d12..7b8fac984 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -36972,11 +36972,11 @@ int HP_libconfig_setting_get_int(const struct config_setting_t *setting) { } return retVal___; } -long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { +int64 HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting); + int64 (*preHookFunc) (const struct config_setting_t **setting); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_pre[hIndex].func; @@ -36991,7 +36991,7 @@ long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) retVal___ = HPMHooks.source.libconfig.setting_get_int64(setting); } if( HPMHooks.count.HP_libconfig_setting_get_int64_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting); @@ -37134,11 +37134,11 @@ int HP_libconfig_setting_lookup_int(const struct config_setting_t *setting, cons } return retVal___; } -int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, long long *value) { +int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_setting_t **setting, const char **name, long long **value); + int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_pre[hIndex].func; @@ -37153,7 +37153,7 @@ int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, co retVal___ = HPMHooks.source.libconfig.setting_lookup_int64(setting, name, value); } if( HPMHooks.count.HP_libconfig_setting_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, long long *value); + int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name, value); @@ -37269,11 +37269,11 @@ int HP_libconfig_setting_set_int(struct config_setting_t *setting, int value) { } return retVal___; } -int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long value) { +int HP_libconfig_setting_set_int64(struct config_setting_t *setting, int64 value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_set_int64_pre ) { - int (*preHookFunc) (struct config_setting_t **setting, long long *value); + int (*preHookFunc) (struct config_setting_t **setting, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_pre[hIndex].func; @@ -37288,7 +37288,7 @@ int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long v retVal___ = HPMHooks.source.libconfig.setting_set_int64(setting, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_post ) { - int (*postHookFunc) (int retVal___, struct config_setting_t *setting, long long value); + int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, value); @@ -37458,11 +37458,11 @@ int HP_libconfig_setting_get_int_elem(const struct config_setting_t *setting, in } return retVal___; } -long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { +int64 HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting, int *idx); + int64 (*preHookFunc) (const struct config_setting_t **setting, int *idx); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_pre[hIndex].func; @@ -37477,7 +37477,7 @@ long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *set retVal___ = HPMHooks.source.libconfig.setting_get_int64_elem(setting, idx); } if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting, int idx); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting, int idx); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -37593,11 +37593,11 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, long long value) { +struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { int hIndex = 0; struct config_setting_t* retVal___ = NULL; if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre ) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, long long *value); + struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func; @@ -37612,7 +37612,7 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_post ) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, long long value); + struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -37970,11 +37970,11 @@ int HP_libconfig_lookup_int(const struct config_t *config, const char *filepath, } return retVal___; } -int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, long long *value) { +int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_t **config, const char **filepath, long long **value); + int (*preHookFunc) (const struct config_t **config, const char **filepath, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_pre[hIndex].func; @@ -37989,7 +37989,7 @@ int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepat retVal___ = HPMHooks.source.libconfig.lookup_int64(config, filepath, value); } if( HPMHooks.count.HP_libconfig_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, long long *value); + int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, config, filepath, value); diff --git a/src/test/Makefile.in b/src/test/Makefile.in index c8006e5cf..3e7549943 100644 --- a/src/test/Makefile.in +++ b/src/test/Makefile.in @@ -87,8 +87,8 @@ $(TESTS_ALL): test_%: ../../test_%@EXEEXT@ ../../test_%@EXEEXT@: obj/test_%.o $(TEST_DEPENDS) Makefile @echo " LD $(notdir $@)" - @$(CC) @STATIC@ @LDFLAGS@ -o $@ $< $(COMMON_D)/obj_sql/common_sql.a \ - $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ + @$(CC) @STATIC@ @LDFLAGS@ -o $@ $< $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a \ + $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ # object files diff --git a/src/test/test_libconfig.c b/src/test/test_libconfig.c index e0a470e21..639cf64e8 100644 --- a/src/test/test_libconfig.c +++ b/src/test/test_libconfig.c @@ -86,6 +86,8 @@ static const char *test_libconfig_init_destroy(void) static const char *test_libconfig_read_file_src(void) { struct config_t config; + libconfig->init(&config); + #define FILENAME "src/test/libconfig/test.conf" if (libconfig->read_file_src(&config, FILENAME) == CONFIG_FALSE) { libconfig->destroy(&config); @@ -108,6 +110,9 @@ static const char *test_libconfig_read(void) if (!fp) { return "File not found: '" FILENAME "'."; } + + libconfig->init(&config); + if (libconfig->read(&config, fp) == CONFIG_FALSE) { fclose(fp); libconfig->destroy(&config); @@ -154,6 +159,8 @@ static const char *test_libconfig_write_file(void) static const char *test_libconfig_read_string(void) { struct config_t config; + libconfig->init(&config); + if (libconfig->read_string(&config, "") == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to read from string."; @@ -180,6 +187,8 @@ static const char *test_libconfig_syntax(void) "Setting_List: ( );\n" "/* End test file */\n"; + libconfig->init(&config); + if (libconfig->read_string(&config, input) == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to read from string."; @@ -216,6 +225,8 @@ static const char *test_libconfig_lookup(void) "Setting_List: ( );\n" "/* End test file */\n"; + libconfig->init(&config); + if (libconfig->read_string(&config, input) == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to parse configuration."; @@ -278,6 +289,8 @@ static const char *test_libconfig_setting_get(void) "Setting_List: ( );\n" "/* End test file */\n"; + libconfig->init(&config); + if (libconfig->read_string(&config, input) == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to parse configuration."; @@ -366,8 +379,8 @@ static const char *test_libconfig_setting_get(void) static const char *test_libconfig_set(void) { - //int (*setting_set_int) (struct config_setting_t *setting ,int value); - //int (*setting_set_int64) (struct config_setting_t *setting, long long value); + //int (*setting_set_int) (struct config_setting_t *setting, int value); + //int (*setting_set_int64) (struct config_setting_t *setting, int64 value); //int (*setting_set_float) (struct config_setting_t *setting, double value); //int (*setting_set_bool) (struct config_setting_t *setting, int value); //int (*setting_set_string) (struct config_setting_t *setting, const char *value); @@ -392,6 +405,8 @@ static const char *test_libconfig_setting_lookup(void) "Setting_List: ( );\n" "/* End test file */\n"; + libconfig->init(&config); + if (libconfig->read_string(&config, input) == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to parse configuration."; @@ -442,6 +457,8 @@ static const char *test_libconfig_setting_types(void) "Setting_List: ( );\n" "/* End test file */\n"; + libconfig->init(&config); + if (libconfig->read_string(&config, input) == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to parse configuration."; @@ -536,6 +553,8 @@ static const char *test_libconfig_values(void) "Setting_IntSignedMax: 0x7fffffff;\n" "/* End test file */\n"; + libconfig->init(&config); + if (libconfig->read_string(&config, input) == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to parse configuration."; @@ -599,6 +618,9 @@ static const char *test_libconfig_path_lookup(void) " 10,\n" ");\n" "/* End test file */\n"; + + libconfig->init(&config); + if (libconfig->read_string(&config, input) == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to parse configuration."; @@ -683,6 +705,9 @@ static const char *test_libconfig_setting_names(void) "};\n" "1st_setting_with_numbers: 5;\n" "/* End test file */\n"; + + libconfig->init(&config); + if (libconfig->read_string(&config, input) == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to parse configuration."; @@ -736,6 +761,9 @@ static const char *test_libconfig_duplicate_keys(void) " Duplicate: 4;\n" "};\n" "/* End test file */\n"; + + libconfig->init(&config); + if (libconfig->read_string(&config, input) == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to parse configuration."; @@ -780,6 +808,9 @@ static const char *test_libconfig_special_string_syntax(void) const char *input = "/* Test File */\n" "SpecialString: <\"This is an \"Item_Script\" Special String\n\tWith a line-break inside.\">;\n" "/* End test file */\n"; + + libconfig->init(&config); + if (libconfig->read_string(&config, input) == CONFIG_FALSE) { libconfig->destroy(&config); return "Unable to parse configuration."; @@ -818,7 +849,7 @@ int do_init(int argc, char **argv) //int (*setting_set_format) (struct config_setting_t *setting, short format); //short (*setting_get_format) (const struct config_setting_t *setting); //struct config_setting_t * (*setting_set_int_elem) (struct config_setting_t *setting, int idx, int value); - //struct config_setting_t * (*setting_set_int64_elem) (struct config_setting_t *setting, int idx, long long value); + //struct config_setting_t * (*setting_set_int64_elem) (struct config_setting_t *setting, int idx, int64 value); //struct config_setting_t * (*setting_set_float_elem) (struct config_setting_t *setting, int idx, double value); //struct config_setting_t * (*setting_set_bool_elem) (struct config_setting_t *setting, int idx, int value); //struct config_setting_t * (*setting_set_string_elem) (struct config_setting_t *setting, int idx, const char *value); diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c index 27d742cd1..1c0390d66 100644 --- a/src/test/test_spinlock.c +++ b/src/test/test_spinlock.c @@ -81,6 +81,7 @@ int do_init(int argc, char **argv) for(i =0; i < THRC; i++){ t[i] = thread->create_opt(worker, NULL, 1024*512, THREADPRIO_NORMAL); } + (void)t; while(1){ if(InterlockedCompareExchange(&done_threads, THRC, THRC) == THRC) @@ -100,14 +101,13 @@ int do_init(int argc, char **argv) } - if(ok != LOOPS){ + if (ok != LOOPS) { ShowFatalError("Test failed.\n"); exit(1); - }else{ - ShowStatus("Test passed.\n"); - exit(0); } - return 0; + + core->runflag = CORE_ST_STOP; + return EXIT_SUCCESS; }//end: do_init() void do_abort(void) { @@ -118,6 +118,8 @@ void set_server_type(void) { }//end: set_server_type() int do_final(void) { + ShowStatus("Test passed.\n"); + return EXIT_SUCCESS; }//end: do_final() diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in index eb1362780..6e8643c56 100644 --- a/src/tool/Makefile.in +++ b/src/tool/Makefile.in @@ -39,7 +39,7 @@ LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ MAPCACHE_OBJ = obj_all/mapcache.o MAPCACHE_C = mapcache.c MAPCACHE_H = -MAPCACHE_DEPENDS = $(MAPCACHE_OBJ) $(COMMON_D)/obj_all/common_mini.a $(LIBCONFIG_OBJ $(SYSINFO_INC)) +MAPCACHE_DEPENDS = $(MAPCACHE_OBJ) $(COMMON_D)/obj_all/common_mini.a $(LIBCONFIG_OBJ) $(SYSINFO_INC) @SET_MAKE@ @@ -55,7 +55,7 @@ mapcache: ../../mapcache@EXEEXT@ ../../mapcache@EXEEXT@: $(MAPCACHE_DEPENDS) Makefile @echo " LD $(notdir $@)" - @$(CC) @STATIC@ @LDFLAGS@ -o ../../mapcache@EXEEXT@ $(MAPCACHE_DEPENDS) @LIBS@ + @$(CC) @STATIC@ @LDFLAGS@ -o ../../mapcache@EXEEXT@ $(MAPCACHE_OBJ) $(COMMON_D)/obj_all/common_mini.a $(LIBCONFIG_OBJ) @LIBS@ buildclean: @echo " CLEAN tool (build temp files)" |