Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill several unused functions in xbt
[simgrid.git] / src / xbt / xbt_str.c
index a2fb805..fb1a0af 100644 (file)
@@ -124,50 +124,6 @@ void xbt_str_trim(char *s, const char *char_list)
   xbt_str_ltrim(s, char_list);
 }
 
-/**  @brief Replace double whitespaces (but no other characters) from the string.
- *
- * The function modifies the string so that each time that several spaces appear,
- * they are replaced by a single space. It will only do so for spaces (ASCII 32, 0x20).
- *
- * @param s The string to strip. Modified in place.
- *
- */
-void xbt_str_strip_spaces(char *s)
-{
-  char *p = s;
-  int e = 0;
-
-  if (!s)
-    return;
-
-  while (1) {
-    if (!*p)
-      goto end;
-
-    if (*p != ' ')
-      break;
-
-    p++;
-  }
-
-  e = 1;
-
-  do {
-    if (e)
-      *s++ = *p;
-
-    if (!*++p)
-      goto end;
-
-    if (e ^ (*p != ' '))
-      if ((e = !e))
-        *s++ = ' ';
-  } while (1);
-
-end:
-  *s = '\0';
-}
-
 /** @brief Substitutes a char for another in a string
  *
  * @param str the string to modify
@@ -852,28 +808,6 @@ char *xbt_str_from_file(FILE * file)
   return res;
 }
 
-/* @brief Retrun 1 if string 'str' starts with string 'start'
- *
- * \param str a string
- * \param start the string to search in str
- *
- * \return 1 if 'str' starts with 'start'
- */
-int xbt_str_start_with(const char* str, const char* start)
-{
-  unsigned int i;
-  size_t l_str = strlen(str);
-  size_t l_start = strlen(start);
-
-  if(l_start > l_str) return 0;
-
-  for(i = 0; i< l_start; i++){
-    if(str[i] != start[i]) return 0;
-  }
-
-  return 1;
-}
-
 /** @brief Parse an integer out of a string, or raise an error
  *
  * The #str is passed as argument to your #error_msg, as follows:
@@ -1125,7 +1059,7 @@ XBT_TEST_UNIT("xbt_str_diff", test_diff, "test the function xbt_str_diff")
 XBT_TEST_UNIT("xbt_str_parse", test_parse, "Test the parsing functions")
 {
   xbt_ex_t e;
-  int rint;
+  int rint = -9999;
   test_parse_ok(xbt_str_parse_int, "Parse int", rint, "42", 42);
   test_parse_ok(xbt_str_parse_int, "Parse 0 as an int", rint, "0", 0);
   test_parse_ok(xbt_str_parse_int, "Parse -1 as an int", rint, "-1", -1);
@@ -1135,7 +1069,7 @@ XBT_TEST_UNIT("xbt_str_parse", test_parse, "Test the parsing functions")
   test_parse_error(xbt_str_parse_int, "Parse '' as an int", rint, "");
   test_parse_error(xbt_str_parse_int, "Parse cruft as an int", rint, "cruft");
 
-  double rdouble;
+  double rdouble = -9999;
   test_parse_ok(xbt_str_parse_double, "Parse 42 as a double", rdouble, "42", 42);
   test_parse_ok(xbt_str_parse_double, "Parse 42.5 as a double", rdouble, "42.5", 42.5);
   test_parse_ok(xbt_str_parse_double, "Parse 0 as a double", rdouble, "0", 0);