xmllite: Avoid warning in test_read_state related to -1 not being in XmlReadState.

Gerald Pfeifer gerald at pfeifer.com
Thu Nov 2 17:26:45 CDT 2017


Hi Nikolay and others,

the patch below avoids a warning of the kind

  reader.c:276:20: warning: comparison of constant -1 with expression of type
      'XmlReadState' (aka 'enum XmlReadState') is always false
      [-Wtautological-constant-out-of-range-compare]
    if (exp_broken == -1)
        ~~~~~~~~~~ ^  ~~

which clang issues, so I hope it can be included?

Gerald


Signed-off-by: Gerald Pfeifer <gerald at pfeifer.com>
---
 dlls/xmllite/tests/reader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c
index 0f03c3b42e..2a93a76ddb 100644
--- a/dlls/xmllite/tests/reader.c
+++ b/dlls/xmllite/tests/reader.c
@@ -273,7 +273,7 @@ static void test_read_state(IXmlReader *reader, XmlReadState expected,
     state = -1; /* invalid state value */
     IXmlReader_GetProperty(reader, XmlReaderProperty_ReadState, &state);
 
-    if (exp_broken == -1)
+    if (exp_broken == (XmlReadState)-1)
         broken_state = FALSE;
     else
         broken_state = broken(exp_broken == state);
-- 
2.14.1



More information about the wine-patches mailing list