diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-16 07:40:12 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-16 07:40:12 (GMT) |
commit | 53fa8b2a4bbb589d3d761284c70f93e0f852df23 (patch) | |
tree | 950b373e6fde26fd3e5bb6282619ed6a38b8f31a /Modules | |
parent | a9e00d13cd5d547145ab065c166ca2075e06d6bf (diff) | |
download | cpython-53fa8b2a4bbb589d3d761284c70f93e0f852df23.zip cpython-53fa8b2a4bbb589d3d761284c70f93e0f852df23.tar.gz cpython-53fa8b2a4bbb589d3d761284c70f93e0f852df23.tar.bz2 |
Fixed few compiler warnings.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/cjkcodecs/_codecs_iso2022.c | 7 | ||||
-rw-r--r-- | Modules/faulthandler.c | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/Modules/cjkcodecs/_codecs_iso2022.c b/Modules/cjkcodecs/_codecs_iso2022.c index 5c401aa..1ce4218 100644 --- a/Modules/cjkcodecs/_codecs_iso2022.c +++ b/Modules/cjkcodecs/_codecs_iso2022.c @@ -292,7 +292,7 @@ iso2022processesc(const void *config, MultibyteCodec_State *state, const unsigned char **inbuf, Py_ssize_t *inleft) { unsigned char charset, designation; - Py_ssize_t i, esclen; + Py_ssize_t i, esclen = 0; for (i = 1;i < MAX_ESCSEQLEN;i++) { if (i >= *inleft) @@ -307,10 +307,9 @@ iso2022processesc(const void *config, MultibyteCodec_State *state, } } - if (i >= MAX_ESCSEQLEN) - return 1; /* unterminated escape sequence */ - switch (esclen) { + case 0: + return 1; /* unterminated escape sequence */ case 3: if (INBYTE2 == '$') { charset = INBYTE3 | CHARSET_DBCS; diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index 6f7c71d..4643c0e 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -458,7 +458,7 @@ faulthandler_thread(void *unused) assert(st == PY_LOCK_FAILURE); /* get the thread holding the GIL, NULL if no thread hold the GIL */ - current = _Py_atomic_load_relaxed(&_PyThreadState_Current); + current = (PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current); write(thread.fd, thread.header, (int)thread.header_len); |