summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-01-08 01:06:06 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-01-08 01:06:06 (GMT)
commit46b7bda9bcd0fb11878a154234c3064e19e35f3c (patch)
tree4d7e30ff3e17be4baeb7414d24825cf4923d168f /Python/symtable.c
parentd39d861a36bf2ff7ccbb8248fa7fb81517923877 (diff)
downloadcpython-46b7bda9bcd0fb11878a154234c3064e19e35f3c.zip
cpython-46b7bda9bcd0fb11878a154234c3064e19e35f3c.tar.gz
cpython-46b7bda9bcd0fb11878a154234c3064e19e35f3c.tar.bz2
Fix icc warnings: conversion from "long" to "int" may lose significant bits
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 09674d2..915324d 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -354,7 +354,7 @@ PyST_GetScope(PySTEntryObject *ste, PyObject *name)
*/
static int
-analyze_name(PySTEntryObject *ste, PyObject *dict, PyObject *name, int flags,
+analyze_name(PySTEntryObject *ste, PyObject *dict, PyObject *name, long flags,
PyObject *bound, PyObject *local, PyObject *free,
PyObject *global)
{
@@ -426,14 +426,14 @@ static int
analyze_cells(PyObject *scope, PyObject *free)
{
PyObject *name, *v, *w;
- int flags, pos = 0, success = 0;
+ int pos = 0, success = 0;
w = PyInt_FromLong(CELL);
if (!w)
return 0;
while (PyDict_Next(scope, &pos, &name, &v)) {
assert(PyInt_Check(v));
- flags = PyInt_AS_LONG(v);
+ long flags = PyInt_AS_LONG(v);
if (flags != LOCAL)
continue;
if (!PyDict_GetItem(free, name))
@@ -506,9 +506,10 @@ update_symbols(PyObject *symbols, PyObject *scope,
PyObject *bound, PyObject *free, int class)
{
PyObject *name, *v, *u, *w, *free_value = NULL;
- int i, flags, pos = 0;
+ int pos = 0;
while (PyDict_Next(symbols, &pos, &name, &v)) {
+ long i, flags;
assert(PyInt_Check(v));
flags = PyInt_AS_LONG(v);
w = PyDict_GetItem(scope, name);
@@ -539,7 +540,7 @@ update_symbols(PyObject *symbols, PyObject *scope,
*/
if (class &&
PyInt_AS_LONG(o) & (DEF_BOUND | DEF_GLOBAL)) {
- i = PyInt_AS_LONG(o) | DEF_FREE_CLASS;
+ long i = PyInt_AS_LONG(o) | DEF_FREE_CLASS;
o = PyInt_FromLong(i);
if (!o) {
Py_DECREF(free_value);
@@ -581,7 +582,7 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
{
PyObject *name, *v, *local = NULL, *scope = NULL, *newbound = NULL;
PyObject *newglobal = NULL, *newfree = NULL;
- int i, flags, pos = 0, success = 0;
+ int i, pos = 0, success = 0;
local = PyDict_New();
if (!local)
@@ -614,7 +615,7 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
assert(PySTEntry_Check(ste));
assert(PyDict_Check(ste->ste_symbols));
while (PyDict_Next(ste->ste_symbols, &pos, &name, &v)) {
- flags = PyInt_AS_LONG(v);
+ long flags = PyInt_AS_LONG(v);
if (!analyze_name(ste, scope, name, flags, bound, local, free,
global))
goto error;
@@ -750,7 +751,7 @@ symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block,
return 1;
}
-static int
+static long
symtable_lookup(struct symtable *st, PyObject *name)
{
PyObject *o;
@@ -769,7 +770,7 @@ symtable_add_def(struct symtable *st, PyObject *name, int flag)
{
PyObject *o;
PyObject *dict;
- int val;
+ long val;
PyObject *mangled = _Py_Mangle(st->st_private, name);
if (!mangled)
@@ -1018,7 +1019,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
for (i = 0; i < asdl_seq_LEN(seq); i++) {
identifier name = asdl_seq_GET(seq, i);
char *c_name = PyString_AS_STRING(name);
- int cur = symtable_lookup(st, name);
+ long cur = symtable_lookup(st, name);
if (cur < 0)
return 0;
if (cur & (DEF_LOCAL | USE)) {