static PyObject *
dictbytype(PyObject *src, int scope_type, int flag, Py_ssize_t offset)
{
- Py_ssize_t i = offset, scope, num_keys, key_i;
+ Py_ssize_t i = offset, num_keys, key_i;
PyObject *k, *v, *dest = PyDict_New();
PyObject *sorted_keys;
Py_DECREF(dest);
return NULL;
}
- /* XXX this should probably be a macro in symtable.h */
- scope = (vi >> SCOPE_OFFSET) & SCOPE_MASK;
-
- if (scope == scope_type || vi & flag) {
+ if (SYMBOL_TO_SCOPE(vi) == scope_type || vi & flag) {
PyObject *item = PyLong_FromSsize_t(i);
if (item == NULL) {
Py_DECREF(sorted_keys);
if (symbol == -1 && PyErr_Occurred()) {
return ERROR;
}
- long scope = (symbol >> SCOPE_OFFSET) & SCOPE_MASK;
+ long scope = SYMBOL_TO_SCOPE(symbol);
PyObject *outv = PyDict_GetItemWithError(SYMTABLE_ENTRY(c)->ste_symbols, k);
if (outv == NULL) {
if (PyErr_Occurred()) {
if (outsymbol == -1 && PyErr_Occurred()) {
return ERROR;
}
- long outsc = (outsymbol >> SCOPE_OFFSET) & SCOPE_MASK;
+ long outsc = SYMBOL_TO_SCOPE(outsymbol);
// If a name has different scope inside than outside the comprehension,
// we need to temporarily handle it with the right scope while
// compiling the comprehension. If it's free in the comprehension
if (symbol < 0) {
return -1;
}
- return (symbol >> SCOPE_OFFSET) & SCOPE_MASK;
+ return SYMBOL_TO_SCOPE(symbol);
}
int
assert(_PyUnicode_EqualToASCIIString(k, ".0"));
continue;
}
- int scope = (comp_flags >> SCOPE_OFFSET) & SCOPE_MASK;
+ int scope = SYMBOL_TO_SCOPE(comp_flags);
int only_flags = comp_flags & ((1 << SCOPE_OFFSET) - 1);
if (scope == CELL || only_flags & DEF_COMP_CELL) {
if (PySet_Add(inlined_cells, k) < 0) {