# HG changeset patch # User Eli Zaretskii # Date 1114360843 0 # Node ID 139319ba429a5fe2773cce954dcc767b0d7ed135 # Parent 3dfc34e3266ab09434034496ecb04b2ba053f322 (re_search_2, re_match_2_internal): Convert second arg of RE_TRANSLATE to int, to shut up GCC warnings. diff -r 3dfc34e3266a -r 139319ba429a src/regex.c --- a/src/regex.c Sun Apr 24 15:11:38 2005 +0000 +++ b/src/regex.c Sun Apr 24 16:40:43 2005 +0000 @@ -4290,12 +4290,19 @@ d += buf_charlen; } else - while (range > lim - && !fastmap[RE_TRANSLATE (translate, *d)]) - { - d++; - range--; - } + { + /* Convert *d to integer to shut up GCC's + whining about comparison that is always + true. */ + int di = *d; + + while (range > lim + && !fastmap[RE_TRANSLATE (translate, di)]) + { + di = *(++d); + range--; + } + } } else while (range > lim && !fastmap[*d]) @@ -5244,8 +5251,13 @@ else do { + /* Avoid compiler whining about comparison being + always true. */ + int di; + PREFETCH (); - if (RE_TRANSLATE (translate, *d) != *p++) + di = *d; + if (RE_TRANSLATE (translate, di) != *p++) { d = dfail; goto fail;