- config.c, config.h:libopm_config_set(), libopm_config(): use explicit unsigned...
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Wed, 6 May 2015 16:42:39 +0000 (16:42 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Wed, 6 May 2015 16:42:39 +0000 (16:42 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@5923 82007160-df01-0410-b94d-b575c5fd34c7

src/libopm/src/config.c
src/libopm/src/config.h

index 5b6c07d95ab8784ad738a0acc2fb1f064f2329a5..ac793981e966bea94505c9a5c556125d3ac7f50f 100644 (file)
@@ -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];
 }
index f351ce17e36b615336be15e8de951467cb9a8d4f..295b7311306498589a4493401c34ed6e3aa7a8ab 100644 (file)
@@ -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 */