[Scummvm-cvs-logs] SF.net SVN: scummvm:[38432] scummvm/trunk/engines/sci/include/heapmgr.h

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Feb 17 19:16:41 CET 2009


Revision: 38432
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38432&view=rev
Author:   fingolfin
Date:     2009-02-17 18:16:41 +0000 (Tue, 17 Feb 2009)

Log Message:
-----------
SCI: Silence 'check always true' warnings with a trick (temporary, that code needs to be revised anyway)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/include/heapmgr.h

Modified: scummvm/trunk/engines/sci/include/heapmgr.h
===================================================================
--- scummvm/trunk/engines/sci/include/heapmgr.h	2009-02-17 18:16:31 UTC (rev 38431)
+++ scummvm/trunk/engines/sci/include/heapmgr.h	2009-02-17 18:16:41 UTC (rev 38432)
@@ -33,7 +33,9 @@
 
 #define HEAPENTRY_INVALID -1
 
-#define ENTRY_IS_VALID(t, i) ((i) >= 0 && (i) < (t)->max_entry && (t)->table[(i)].next_free == (i))
+// FIXME: We write (i == 0 || i > 0) instead of (i >= 0) to silence certain annoying warnings:
+// generated by GCC: "comparison is always true due to limited range of data type".
+#define ENTRY_IS_VALID(t, i) ((i == 0 || i > 0) && (i) < (t)->max_entry && (t)->table[(i)].next_free == (i))
 
 #define DECLARE_HEAPENTRY(ENTRY)						\
 typedef struct {								\


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list