summaryrefslogtreecommitdiff
blob: 48fe6e10ac967bf9c142c88a1cb7cb4b4bd0901b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Author: Alex Mestiashvili <mailatgoogl@gmail.com>
Origin: https://lists.debian.org/debian-med/2017/09/msg00021.html
Bug-Debian: https://bugs.debian.org/871234
Description: Fix gcc-7 build issue, thanks to Jeff Epler <jepler@unpythonic.net>
--- a/src/GHash.hh
+++ b/src/GHash.hh
@@ -88,7 +88,7 @@
                                 //nextkey is SET to the corresponding key
   GHashEntry* NextEntry() { //returns a pointer to a GHashEntry
   	 register int pos=fCurrentEntry;
-  	 while (pos<fCapacity && hash[pos].hash<0) pos++;
+  	 while (pos<fCapacity && (hash[pos].hash)<0) pos++;
   	 if (pos==fCapacity) {
   	                 fCurrentEntry=fCapacity;
   	                 return NULL;
@@ -186,7 +186,7 @@
         x=HASH2(h,n);
         GASSERT(1<=x && x<n);
         while(k[p].hash!=-1) p=(p+x)%n;
-        GASSERT(k[p].hash<0);
+        GASSERT((k[p].hash)<0);
         k[p]=hash[i];
         }
       }
@@ -225,7 +225,7 @@
   GTRACE(("GHash::insert: key=\"%s\"\n",ky));
   //GMessage("GHash::insert: key=\"%s\"\n",ky);
   GASSERT(0<=i && i<fCapacity);
-  GASSERT(hash[i].hash<0);
+  GASSERT((hash[i].hash)<0);
   hash[i].hash=h;
   hash[i].mark=mrk;
   hash[i].key=Gstrdup(ky);
@@ -266,7 +266,7 @@
   GTRACE(("GHash::insert: key=\"%s\"\n",ky));
   //GMessage("GHash::insert: key=\"%s\"\n",ky);
   GASSERT(0<=i && i<fCapacity);
-  GASSERT(hash[i].hash<0);
+  GASSERT((hash[i].hash)<0);
   hash[i].hash=h;
   hash[i].mark=mrk;
   hash[i].key=(char *)ky;
@@ -310,7 +310,7 @@
   if(i==-1) i=p;
   GTRACE(("GHash::replace: %08x: inserting: \"%s\"\n",this,ky));
   GASSERT(0<=i && i<fCapacity);
-  GASSERT(hash[i].hash<0);
+  GASSERT((hash[i].hash)<0);
   hash[i].hash=h;
   hash[i].mark=mrk;
   hash[i].key=Gstrdup(ky);
@@ -412,7 +412,7 @@
 
 template <class OBJ> char* GHash<OBJ>::NextKey() {
  register int pos=fCurrentEntry;
- while (pos<fCapacity && hash[pos].hash<0) pos++;
+ while (pos<fCapacity && (hash[pos].hash)<0) pos++;
  if (pos==fCapacity) {
                  fCurrentEntry=fCapacity;
                  return NULL;
@@ -425,7 +425,7 @@
 
 template <class OBJ> OBJ* GHash<OBJ>::NextData() {
  register int pos=fCurrentEntry;
- while (pos<fCapacity && hash[pos].hash<0) pos++;
+ while (pos<fCapacity && (hash[pos].hash)<0) pos++;
  if (pos==fCapacity) {
                  fCurrentEntry=fCapacity;
                  return NULL;
@@ -439,7 +439,7 @@
 
 template <class OBJ> OBJ* GHash<OBJ>::NextData(char* &nextkey) {
  register int pos=fCurrentEntry;
- while (pos<fCapacity && hash[pos].hash<0) pos++;
+ while (pos<fCapacity && (hash[pos].hash)<0) pos++;
  if (pos==fCapacity) {
                  fCurrentEntry=fCapacity;
                  nextkey=NULL;
@@ -457,16 +457,16 @@
 // Get first non-empty entry
 template <class OBJ> int GHash<OBJ>::First() const {
   register int pos=0;
-  while(pos<fCapacity){ if(0<=hash[pos].hash) break; pos++; }
-  GASSERT(fCapacity<=pos || 0<=hash[pos].hash);
+  while(pos<fCapacity){ if(0<=(hash[pos].hash)) break; pos++; }
+  GASSERT(fCapacity<=pos || 0<=(hash[pos].hash));
   return pos;
   }
 
 // Get last non-empty entry
 template <class OBJ> int GHash<OBJ>::Last() const {
   register int pos=fCapacity-1;
-  while(0<=pos){ if(0<=hash[pos].hash) break; pos--; }
-  GASSERT(pos<0 || 0<=hash[pos].hash);
+  while(0<=pos){ if(0<=(hash[pos].hash)) break; pos--; }
+  GASSERT(pos<0 || 0<=(hash[pos].hash));
   return pos;
   }
 
@@ -474,8 +474,8 @@
 // Find next valid entry
 template <class OBJ> int GHash<OBJ>::Next(int pos) const {
   GASSERT(0<=pos && pos<fCapacity);
-  while(++pos <= fCapacity-1){ if(0<=hash[pos].hash) break; }
-  GASSERT(fCapacity<=pos || 0<=hash[pos].hash);
+  while(++pos <= fCapacity-1){ if(0<=(hash[pos].hash)) break; }
+  GASSERT(fCapacity<=pos || 0<=(hash[pos].hash));
   return pos;
   }
 
@@ -483,8 +483,8 @@
 // Find previous valid entry
 template <class OBJ> int GHash<OBJ>::Prev(int pos) const {
   GASSERT(0<=pos && pos<fCapacity);
-  while(--pos >= 0){ if(0<=hash[pos].hash) break; }
-  GASSERT(pos<0 || 0<=hash[pos].hash);
+  while(--pos >= 0){ if(0<=(hash[pos].hash)) break; }
+  GASSERT(pos<0 || 0<=(hash[pos].hash));
   return pos;
   }