Author: Alex Mestiashvili 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 --- 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 char* GHash::NextKey() { register int pos=fCurrentEntry; - while (pos OBJ* GHash::NextData() { register int pos=fCurrentEntry; - while (pos OBJ* GHash::NextData(char* &nextkey) { register int pos=fCurrentEntry; - while (pos int GHash::First() const { register int pos=0; - while(pos int GHash::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 int GHash::Next(int pos) const { GASSERT(0<=pos && pos int GHash::Prev(int pos) const { GASSERT(0<=pos && 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; }