X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bdfe4f8674f98efbf2d67ad854ef83a1d5f855ed..c0ae635db715a7d6f260872689f27a75e0ce4b98:/include/xbt/str.h diff --git a/include/xbt/str.h b/include/xbt/str.h index dc164b72fb..72acbe5886 100644 --- a/include/xbt/str.h +++ b/include/xbt/str.h @@ -1,6 +1,6 @@ /* str.h - XBT string related functions. */ -/* Copyright (c) 2007-2013. 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 @@ -9,6 +9,7 @@ #ifndef XBT_STR_H #define XBT_STR_H +#include /* ssize_t */ #include /* 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; - 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) - 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 */ @@ -90,7 +91,7 @@ static XBT_INLINE unsigned int xbt_str_hash_ext(const char *str, int str_len) } # else - register unsigned int hash = 0; + unsigned int hash = 0; 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; - 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) - register unsigned int hash = 0x811c9dc5; + unsigned int hash = 0x811c9dc5; 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 - register unsigned int hash = 0; + unsigned int hash = 0; while (*str) { hash += (*str) * (*str); @@ -138,7 +139,7 @@ static XBT_INLINE unsigned int xbt_str_hash(const char *str) #endif return hash; } - + /**@}*/ SG_END_DECL()