Mercurial > cpython-lru_cache-weakref
comparison Include/Python.h @ 46149:7fdff02e6f45 legacy-trunk
Revert r61969 which added casts to Py_CHARMASK to avoid compiler warnings.
Rather than sprinkle casts throughout the code, change Py_CHARMASK to
always cast it's result to an unsigned char. This should ensure we
do the right thing when accessing an array with the result.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Fri, 28 Mar 2008 04:58:51 +0000 |
| parents | 5341b30b1812 |
| children | 840064802952 |
comparison
equal
deleted
inserted
replaced
| 46148:59d082591f56 | 46149:7fdff02e6f45 |
|---|---|
| 146 /* Convert a possibly signed character to a nonnegative int */ | 146 /* Convert a possibly signed character to a nonnegative int */ |
| 147 /* XXX This assumes characters are 8 bits wide */ | 147 /* XXX This assumes characters are 8 bits wide */ |
| 148 #ifdef __CHAR_UNSIGNED__ | 148 #ifdef __CHAR_UNSIGNED__ |
| 149 #define Py_CHARMASK(c) (c) | 149 #define Py_CHARMASK(c) (c) |
| 150 #else | 150 #else |
| 151 #define Py_CHARMASK(c) ((c) & 0xff) | 151 #define Py_CHARMASK(c) ((unsigned char)((c) & 0xff)) |
| 152 #endif | 152 #endif |
| 153 | 153 |
| 154 #include "pyfpe.h" | 154 #include "pyfpe.h" |
| 155 | 155 |
| 156 /* These definitions must match corresponding definitions in graminit.h. | 156 /* These definitions must match corresponding definitions in graminit.h. |
