From: michael Date: Wed, 6 May 2015 16:42:39 +0000 (+0000) Subject: - config.c, config.h:libopm_config_set(), libopm_config(): use explicit unsigned... X-Git-Tag: 1.1.0beta1~100 X-Git-Url: http://git.serene-ircd.net/?a=commitdiff_plain;h=d278ea3f790ac94cd92a661a3939c79254f4d8cd;p=hopm.git - config.c, config.h:libopm_config_set(), libopm_config(): use explicit unsigned type for array indices git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@5923 82007160-df01-0410-b94d-b575c5fd34c7 --- diff --git a/src/libopm/src/config.c b/src/libopm/src/config.c index 5b6c07d..ac79398 100644 --- a/src/libopm/src/config.c +++ b/src/libopm/src/config.c @@ -167,14 +167,14 @@ libopm_config_free(OPM_CONFIG_T *config) */ OPM_ERR_T -libopm_config_set(OPM_CONFIG_T *config, int key, const void *value) +libopm_config_set(OPM_CONFIG_T *config, unsigned int key, const void *value) { - int num; + unsigned int num; OPM_NODE_T *node; num = sizeof(HASH) / sizeof(OPM_CONFIG_HASH_T); - if (key < 0 || key >= num) + if (key >= num) return OPM_ERR_BADKEY; /* Return appropriate error code eventually */ switch (libopm_config_gettype(key)) @@ -246,7 +246,7 @@ libopm_config_gettype(int key) * will have to be cast on the return end to be any use. */ void * -libopm_config(OPM_CONFIG_T *config, int key) +libopm_config(OPM_CONFIG_T *config, unsigned int key) { return config->vars[key]; } diff --git a/src/libopm/src/config.h b/src/libopm/src/config.h index f351ce1..295b731 100644 --- a/src/libopm/src/config.h +++ b/src/libopm/src/config.h @@ -12,8 +12,8 @@ struct _opm_config_hash }; void libopm_config_free(OPM_CONFIG_T *); -void *libopm_config(OPM_CONFIG_T *, int); +void *libopm_config(OPM_CONFIG_T *, unsigned int); int libopm_config_gettype(int); OPM_CONFIG_T *libopm_config_create(void); -OPM_ERR_T libopm_config_set(OPM_CONFIG_T *, int , const void *); +OPM_ERR_T libopm_config_set(OPM_CONFIG_T *, unsigned int , const void *); #endif /* CONFIG_H */