A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mc] Cleanup MC init code (split MCer and MCed init)
[simgrid.git]
/
src
/
xbt
/
snprintf.c
diff --git
a/src/xbt/snprintf.c
b/src/xbt/snprintf.c
index
9098beb
..
e4d51ca
100644
(file)
--- a/
src/xbt/snprintf.c
+++ b/
src/xbt/snprintf.c
@@
-1,3
+1,8
@@
+/* Copyright (c) 2005-2010, 2012-2014. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
/*
* snprintf.c - a portable implementation of snprintf
/*
* snprintf.c - a portable implementation of snprintf
@@
-365,17
+370,17
@@
#endif
#define fast_memcpy(d,s,n) \
#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*/\
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) \
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*/\
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 */
for (dd=(d); nn>0; nn--) *dd++ = cc; } }
/* prototypes */
@@
-422,6
+427,9
@@
int portable_vsnprintf(char *str, size_t str_m, const char *fmt,
#endif
#endif
#endif
#endif
+ /* FIXME: better place */
+#include "xbt/sysdep.h"
+
/* declarations */
static char credits[] = "\n\
/* declarations */
static char credits[] = "\n\
@@
-1165,9
+1173,6
@@
int portable_vsnprintf(char *str, size_t str_m, const char *fmt,
#endif
#endif
- /* FIXME: better place */
-#include "xbt/sysdep.h"
-
char *bvprintf(const char *fmt, va_list ap)
{
char *res;
char *bvprintf(const char *fmt, va_list ap)
{
char *res;