Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[xbt] Fix 'control reaches end of non-void function' in Result::get()
[simgrid.git] / include / xbt / str.h
index 05da4c6..634291f 100644 (file)
 #include <stdarg.h>             /* va_* */
 #include <stdio.h>  /* FILE */
 
-#ifdef _MSC_VER
-#define strcasecmp _stricmp
-#endif
-
 SG_BEGIN_DECL()
 
 /** @addtogroup XBT_str
@@ -44,11 +40,9 @@ XBT_PUBLIC(xbt_dynar_t) xbt_str_split_str(const char *s, const char *sep);
 XBT_PUBLIC(char *) xbt_str_join(xbt_dynar_t dynar, const char *sep);
 XBT_PUBLIC(char *) xbt_str_join_array(const char *const *strs, const char *sep);
 
-/* */
 XBT_PUBLIC(void) xbt_str_subst(char *str, char from, char to, int amount);
 XBT_PUBLIC(char *) xbt_str_varsubst(const char *str, xbt_dict_t patterns);
 
-/* */
 XBT_PUBLIC(char *) xbt_str_from_file(FILE * file);
 
 XBT_PUBLIC(long int) xbt_str_parse_int(const char* str, const char* error_msg);
@@ -62,7 +56,6 @@ XBT_PUBLIC(double) xbt_str_parse_double(const char* str, const char* error_msg);
  */
 static inline unsigned int xbt_str_hash_ext(const char *str, int str_len)
 {
-
 #ifdef DJB2_HASH_FUNCTION
   /* fast implementation of djb2 algorithm */
   int c;
@@ -118,9 +111,7 @@ static inline unsigned int xbt_str_hash(const char *str)
 
   while (*str) {
     /* multiply by the 32 bit FNV magic prime mod 2^32 */
-    hash +=
-        (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) +
-        (hash << 24);
+    hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);
 
     /* xor the bottom with the current byte */
     hash ^= (unsigned int) *str++;
@@ -138,6 +129,5 @@ static inline unsigned int xbt_str_hash(const char *str)
 }
 
 /**@}*/
-
 SG_END_DECL()
 #endif                          /* XBT_STR_H */