[pypy-svn] r13725 - pypy/dist/pypy/translator/c

arigo at codespeak.net arigo at codespeak.net
Thu Jun 23 17:23:06 CEST 2005


Author: arigo
Date: Thu Jun 23 17:23:04 2005
New Revision: 13725

Modified:
   pypy/dist/pypy/translator/c/char_include.h
Log:
Compare characters unsignedly in C (credits: tismer)


Modified: pypy/dist/pypy/translator/c/char_include.h
==============================================================================
--- pypy/dist/pypy/translator/c/char_include.h	(original)
+++ pypy/dist/pypy/translator/c/char_include.h	Thu Jun 23 17:23:04 2005
@@ -6,10 +6,10 @@
 /***  binary operations ***/
 
 
-#define OP_CHAR_EQ(x,y,r,err)	  r = ((x) == (y));
-#define OP_CHAR_NE(x,y,r,err)	  r = ((x) != (y));
-#define OP_CHAR_LE(x,y,r,err)	  r = ((x) <= (y));
-#define OP_CHAR_GT(x,y,r,err)	  r = ((x) >  (y));
-#define OP_CHAR_LT(x,y,r,err)	  r = ((x) <  (y));
-#define OP_CHAR_GE(x,y,r,err)	  r = ((x) >= (y));
+#define OP_CHAR_EQ(x,y,r,err)	 r = ((x) == (y));
+#define OP_CHAR_NE(x,y,r,err)	 r = ((x) != (y));
+#define OP_CHAR_LE(x,y,r,err)	 r = ((unsigned char)(x) <= (unsigned char)(y));
+#define OP_CHAR_GT(x,y,r,err)	 r = ((unsigned char)(x) >  (unsigned char)(y));
+#define OP_CHAR_LT(x,y,r,err)	 r = ((unsigned char)(x) <  (unsigned char)(y));
+#define OP_CHAR_GE(x,y,r,err)	 r = ((unsigned char)(x) >= (unsigned char)(y));
 



More information about the Pypy-commit mailing list