Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Warning fix: remove old and weird __foo__ function that generated a warning on clang...
[simgrid.git] / src / xbt / snprintf.c
index c1a4983..1267213 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005-2010, 2012-2014. The SimGrid Team.
+/* Copyright (c) 2005-2010, 2012-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #define LINUX_COMPATIBLE
 #endif
 
-#include "portable.h"           /* to get a working stdarg.h */
+#include "src/portable.h"           /* to get a working stdarg.h */
 
 #include <sys/types.h>
 #include <string.h>
 #endif
 
 #define fast_memcpy(d,s,n) \
-  { register size_t nn = (size_t)(n); \
+  { size_t nn = (size_t)(n); \
   if (nn >= breakeven_point) memcpy((d), (s), nn); \
   else if (nn > 0) { /* proc call overhead is worth only for large strings*/\
-  register char *dd; register const char *ss; \
+  char *dd; const char *ss; \
   for (ss=(s), dd=(d); nn>0; nn--) *dd++ = *ss++; } }
 
 #define fast_memset(d,c,n) \
-  { register size_t nn = (size_t)(n); \
+  { size_t nn = (size_t)(n); \
   if (nn >= breakeven_point) memset((d), (int)(c), nn); \
   else if (nn > 0) { /* proc call overhead is worth only for large strings*/\
-  register char *dd; register const int cc=(int)(c); \
+  char *dd; const int cc=(int)(c); \
   for (dd=(d); nn>0; nn--) *dd++ = cc; } }
 
 /* prototypes */
@@ -432,16 +432,15 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt,
 
 /* declarations */
 
-static char credits[] = "\n\
-  @(#)snprintf.c, v2.2: Mark Martinec, <mark.martinec@ijs.si>\n\
-  @(#)snprintf.c, v2.2: Copyright 1999, Mark Martinec. Frontier Artistic License applies.\n\
-  @(#)snprintf.c, v2.2: http://www.ijs.si/software/snprintf/\n";
+/* MPOQUET FIXME: the __foo__ function generates a warning on clang 3.7.0
+   MPOQUET FIXME: the credits is unused if __foo__ is commented*/
 
-static void __foo__(void)
-{
-  printf("%s", credits);
-  __foo__();
-}
+/*
+    Old copyright
+    snprintf.c, v2.2: Mark Martinec, <mark.martinec@ijs.si>
+    snprintf.c, v2.2: Copyright 1999, Mark Martinec. Frontier Artistic License applies.
+    snprintf.c, v2.2: http://www.ijs.si/software/snprintf
+*/
 
 #if defined(NEED_ASPRINTF)
 int asprintf(char **ptr, const char *fmt, /*args */ ...)