diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-06-25 15:32:43 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-06-25 15:32:43 (GMT) |
commit | 0ab5cf9b46f28d3151e882b39b61ab8937578953 (patch) | |
tree | cbf5f7439a138e7b77195ba148c34a2a8d0b7dd8 /Modules/_freeze_importlib.c | |
parent | 7334be889dafb30db76ad68b2f02c27fe2faf38d (diff) | |
download | cpython-0ab5cf9b46f28d3151e882b39b61ab8937578953.zip cpython-0ab5cf9b46f28d3151e882b39b61ab8937578953.tar.gz cpython-0ab5cf9b46f28d3151e882b39b61ab8937578953.tar.bz2 |
Issue #15181: importlib bytecode is unsigned and shouldn't have negative numbers.
This fixes a compiler warning with suncc.
Diffstat (limited to 'Modules/_freeze_importlib.c')
-rw-r--r-- | Modules/_freeze_importlib.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/_freeze_importlib.c b/Modules/_freeze_importlib.c index f6e329b..0900d37 100644 --- a/Modules/_freeze_importlib.c +++ b/Modules/_freeze_importlib.c @@ -31,7 +31,8 @@ main(int argc, char *argv[]) FILE *infile, *outfile = NULL; struct stat st; size_t text_size, data_size, n; - char *text, *data; + char *text; + unsigned char *data; PyObject *code, *marshalled; if (argc != 3) { @@ -85,7 +86,7 @@ main(int argc, char *argv[]) goto error; assert(PyBytes_CheckExact(marshalled)); - data = PyBytes_AS_STRING(marshalled); + data = (unsigned char *) PyBytes_AS_STRING(marshalled); data_size = PyBytes_GET_SIZE(marshalled); outfile = fopen(outpath, "wb"); @@ -99,7 +100,7 @@ main(int argc, char *argv[]) size_t i, end = Py_MIN(n + 16, data_size); fprintf(outfile, " "); for (i = n; i < end; i++) { - fprintf(outfile, "%d,", (int) data[i]); + fprintf(outfile, "%d,", (unsigned int) data[i]); } fprintf(outfile, "\n"); } |