removed register from inlined variables
Costa Tsaousis (ktsaou) committed
Jan 21, 2017 at 01:15 UTC
f0c2403f7481e6431285d7c5a0edaee76c7ae7be
1 file changed
+13
-13
src/inlined.h
+13
-13
@@ -7,8 +7,8 @@
7
// these functions that are called thousands of times per second
8
9
static inline uint32_t simple_hash(const char *name) {
10
- register unsigned char *s = (unsigned char *) name;
11
- register uint32_t hval = 0x811c9dc5;
10
+ unsigned char *s = (unsigned char *) name;
11
+ uint32_t hval = 0x811c9dc5;
12
while (*s) {
13
hval *= 16777619;
14
hval ^= (uint32_t) *s++;
@@ -17,8 +17,8 @@ static inline uint32_t simple_hash(const char *name) {
17
}
18
19
static inline uint32_t simple_uhash(const char *name) {
20
- register unsigned char *s = (unsigned char *) name;
21
- register uint32_t hval = 0x811c9dc5, c;
20
+ unsigned char *s = (unsigned char *) name;
21
+ uint32_t hval = 0x811c9dc5, c;
22
while ((c = *s++)) {
23
if (unlikely(c >= 'A' && c <= 'Z')) c += 'a' - 'A';
24
hval *= 16777619;
@@ -28,8 +28,8 @@ static inline uint32_t simple_uhash(const char *name) {
28
}
29
30
static inline int str2i(const char *s) {
31
- register int n = 0;
32
- register char c, negative = (*s == '-');
31
+ int n = 0;
32
+ char c, negative = (*s == '-');
33
34
for(c = (negative)?*(++s):*s; c >= '0' && c <= '9' ; c = *(++s)) {
35
n *= 10;
@@ -43,8 +43,8 @@ static inline int str2i(const char *s) {
43
}
44
45
static inline long str2l(const char *s) {
46
- register long n = 0;
47
- register char c, negative = (*s == '-');
46
+ long n = 0;
47
+ char c, negative = (*s == '-');
48
49
for(c = (negative)?*(++s):*s; c >= '0' && c <= '9' ; c = *(++s)) {
50
n *= 10;
@@ -58,8 +58,8 @@ static inline long str2l(const char *s) {
58
}
59
60
static inline unsigned long str2ul(const char *s) {
61
- register unsigned long n = 0;
62
- register char c;
61
+ unsigned long n = 0;
62
+ char c;
63
for(c = *s; c >= '0' && c <= '9' ; c = *(++s)) {
64
n *= 10;
65
n += c - '0';
@@ -68,8 +68,8 @@ static inline unsigned long str2ul(const char *s) {
68
}
69
70
static inline unsigned long long str2ull(const char *s) {
71
- register unsigned long long n = 0;
72
- register char c;
71
+ unsigned long long n = 0;
72
+ char c;
73
for(c = *s; c >= '0' && c <= '9' ; c = *(++s)) {
74
n *= 10;
75
n += c - '0';
@@ -78,7 +78,7 @@ static inline unsigned long long str2ull(const char *s) {
78
}
79
80
#ifdef NETDATA_STRSAME
81
-static inline int strsame(register const char *a, register const char *b) {
81
+static inline int strsame(const char *a, const char *b) {
82
if(unlikely(a == b)) return 0;
83
while(*a && *a == *b) { a++; b++; }
84
return *a - *b;