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
[Windows] Fix access to root log categories from other libs
[simgrid.git]
/
include
/
xbt
/
str.h
diff --git
a/include/xbt/str.h
b/include/xbt/str.h
index
cddd67d
..
72acbe5
100644
(file)
--- a/
include/xbt/str.h
+++ b/
include/xbt/str.h
@@
-1,6
+1,6
@@
/* str.h - XBT string related functions. */
/* str.h - XBT string related functions. */
-/* Copyright (c) 2007
, 2008, 2009, 2010
. The SimGrid Team.
+/* Copyright (c) 2007
-2014
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-9,6
+9,7
@@
#ifndef XBT_STR_H
#define XBT_STR_H
#ifndef XBT_STR_H
#define XBT_STR_H
+#include <stdint.h> /* ssize_t */
#include <stdarg.h> /* va_* */
#include "xbt/misc.h"
#include "xbt/dynar.h"
#include <stdarg.h> /* va_* */
#include "xbt/misc.h"
#include "xbt/dynar.h"
@@
-68,14
+69,14
@@
static XBT_INLINE unsigned int xbt_str_hash_ext(const char *str, int str_len)
#ifdef DJB2_HASH_FUNCTION
/* fast implementation of djb2 algorithm */
int c;
#ifdef DJB2_HASH_FUNCTION
/* fast implementation of djb2 algorithm */
int c;
-
register
unsigned int hash = 5381;
+ unsigned int hash = 5381;
while (str_len--) {
c = *str++;
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
}
# elif defined(FNV_HASH_FUNCTION)
while (str_len--) {
c = *str++;
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
}
# elif defined(FNV_HASH_FUNCTION)
-
register
unsigned int hash = 0x811c9dc5;
+ unsigned int hash = 0x811c9dc5;
unsigned char *bp = (unsigned char *) str; /* start of buffer */
unsigned char *be = bp + str_len; /* beyond end of buffer */
unsigned char *bp = (unsigned char *) str; /* start of buffer */
unsigned char *be = bp + str_len; /* beyond end of buffer */
@@
-90,7
+91,7
@@
static XBT_INLINE unsigned int xbt_str_hash_ext(const char *str, int str_len)
}
# else
}
# else
-
register
unsigned int hash = 0;
+ unsigned int hash = 0;
while (str_len--) {
hash += (*str) * (*str);
while (str_len--) {
hash += (*str) * (*str);
@@
-109,14
+110,14
@@
static XBT_INLINE unsigned int xbt_str_hash(const char *str)
#ifdef DJB2_HASH_FUNCTION
/* fast implementation of djb2 algorithm */
int c;
#ifdef DJB2_HASH_FUNCTION
/* fast implementation of djb2 algorithm */
int c;
-
register
unsigned int hash = 5381;
+ unsigned int hash = 5381;
while ((c = *str++)) {
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
}
# elif defined(FNV_HASH_FUNCTION)
while ((c = *str++)) {
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
}
# elif defined(FNV_HASH_FUNCTION)
-
register
unsigned int hash = 0x811c9dc5;
+ unsigned int hash = 0x811c9dc5;
while (*str) {
/* multiply by the 32 bit FNV magic prime mod 2^32 */
while (*str) {
/* multiply by the 32 bit FNV magic prime mod 2^32 */
@@
-129,7
+130,7
@@
static XBT_INLINE unsigned int xbt_str_hash(const char *str)
}
# else
}
# else
-
register
unsigned int hash = 0;
+ unsigned int hash = 0;
while (*str) {
hash += (*str) * (*str);
while (*str) {
hash += (*str) * (*str);
@@
-138,7
+139,7
@@
static XBT_INLINE unsigned int xbt_str_hash(const char *str)
#endif
return hash;
}
#endif
return hash;
}
-
+
/**@}*/
SG_END_DECL()
/**@}*/
SG_END_DECL()