Skip to content

Commit 324ce7c

Browse files
author
Anselm Kruis
committed
Stackless issue python#140: Fix compiler warnings
Fix warnings emitted by gcc 7.2. - ceval.c: '*' in boolean context, suggest '&&' instead. - stacklessmodule.c: a misleading indentation (cherry picked from commit c51072e)
1 parent 4fc14c7 commit 324ce7c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3957,7 +3957,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
39573957
/* Set f->f_lasti to the instruction before the current one or to the
39583958
* first instruction (-1). See "f->f_lasti refers to ..." above.
39593959
*/
3960-
f->f_lasti = INSTR_OFFSET() ?
3960+
f->f_lasti = INSTR_OFFSET() != 0 ?
39613961
assert(INSTR_OFFSET() >= sizeof(_Py_CODEUNIT)),
39623962
(int)(INSTR_OFFSET() - sizeof(_Py_CODEUNIT)) : -1;
39633963
if (SLP_PEEK_NEXT_FRAME(tstate)->f_back != f)
@@ -4008,7 +4008,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
40084008
/* Set f->f_lasti to the instruction before the current one or to the
40094009
* first instruction (-1). See "f->f_lasti refers to ..." above.
40104010
*/
4011-
f->f_lasti = INSTR_OFFSET() ?
4011+
f->f_lasti = INSTR_OFFSET() != 0 ?
40124012
assert(INSTR_OFFSET() >= sizeof(_Py_CODEUNIT)),
40134013
(int)(INSTR_OFFSET() - sizeof(_Py_CODEUNIT)) : -1;
40144014
return (PyObject *) Py_UnwindToken;

Stackless/module/stacklessmodule.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -871,10 +871,9 @@ test_cframe(PyObject *self, PyObject *args, PyObject *kwds)
871871
if (!PyArg_ParseTupleAndKeywords(args, kwds, "l|l:test_cframe",
872872
argnames, &switches, &extra))
873873
return NULL;
874-
if (extra < 0 || extra > STACK_MAX_USEFUL)
875-
VALUE_ERROR(
876-
"test_cframe: words are limited by 0 and " \
877-
STACK_MAX_USESTR, NULL);
874+
if (extra < 0 || extra > STACK_MAX_USEFUL)
875+
VALUE_ERROR("test_cframe: words are limited by 0 and " \
876+
STACK_MAX_USESTR, NULL);
878877
if (extra > 0)
879878
alloca(extra*sizeof(PyObject*));
880879
Py_INCREF(ret);

0 commit comments

Comments
 (0)