diff Include/allobjects.h @ 2304:170b99862d09 legacy-trunk

add Py_CHARMASK
author Guido van Rossum <guido@python.org>
date Fri, 10 Feb 1995 16:51:02 +0000
parents 9afdbf944c2a
children 582b00fbab16
line wrap: on
line diff
--- a/Include/allobjects.h	Thu Feb 09 17:18:10 1995 +0000
+++ b/Include/allobjects.h	Fri Feb 10 16:51:02 1995 +0000
@@ -82,6 +82,14 @@
 #define PyArg_GetInt(v, a)	PyArg_Parse((v), "i", (a))
 #define PyArg_NoArgs(v)		PyArg_Parse(v, "")
 
+/* Convert a possibly signed character to a nonnegative int */
+/* XXX This assumes characters are 8 bits wide */
+#ifdef __CHAR_UNSIGNED__
+#define Py_CHARMASK(c)		(c)
+#else
+#define Py_CHARMASK(c)		((c) & 0xff)
+#endif
+
 #ifdef __cplusplus
 }
 #endif