Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
46b7bda9
Kaydet (Commit)
46b7bda9
authored
Ock 08, 2006
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix icc warnings: conversion from "long" to "int" may lose significant bits
üst
d39d861a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
ast.c
Python/ast.c
+4
-5
symtable.c
Python/symtable.c
+11
-10
No files found.
Python/ast.c
Dosyayı görüntüle @
46b7bda9
...
@@ -78,7 +78,7 @@ static void
...
@@ -78,7 +78,7 @@ static void
ast_error_finish
(
const
char
*
filename
)
ast_error_finish
(
const
char
*
filename
)
{
{
PyObject
*
type
,
*
value
,
*
tback
,
*
errstr
,
*
loc
,
*
tmp
;
PyObject
*
type
,
*
value
,
*
tback
,
*
errstr
,
*
loc
,
*
tmp
;
int
lineno
;
long
lineno
;
assert
(
PyErr_Occurred
());
assert
(
PyErr_Occurred
());
if
(
!
PyErr_ExceptionMatches
(
PyExc_SyntaxError
))
if
(
!
PyErr_ExceptionMatches
(
PyExc_SyntaxError
))
...
@@ -101,7 +101,7 @@ ast_error_finish(const char *filename)
...
@@ -101,7 +101,7 @@ ast_error_finish(const char *filename)
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
loc
=
Py_None
;
loc
=
Py_None
;
}
}
tmp
=
Py_BuildValue
(
"(z
i
OO)"
,
filename
,
lineno
,
Py_None
,
loc
);
tmp
=
Py_BuildValue
(
"(z
l
OO)"
,
filename
,
lineno
,
Py_None
,
loc
);
Py_DECREF
(
loc
);
Py_DECREF
(
loc
);
if
(
!
tmp
)
{
if
(
!
tmp
)
{
Py_DECREF
(
errstr
);
Py_DECREF
(
errstr
);
...
@@ -261,7 +261,6 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
...
@@ -261,7 +261,6 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
/* Only a simple_stmt can contain multiple statements. */
/* Only a simple_stmt can contain multiple statements. */
REQ
(
n
,
simple_stmt
);
REQ
(
n
,
simple_stmt
);
for
(
i
=
0
;
i
<
NCH
(
n
);
i
+=
2
)
{
for
(
i
=
0
;
i
<
NCH
(
n
);
i
+=
2
)
{
stmt_ty
s
;
if
(
TYPE
(
CHILD
(
n
,
i
))
==
NEWLINE
)
if
(
TYPE
(
CHILD
(
n
,
i
))
==
NEWLINE
)
break
;
break
;
s
=
ast_for_stmt
(
&
c
,
CHILD
(
n
,
i
));
s
=
ast_for_stmt
(
&
c
,
CHILD
(
n
,
i
));
...
@@ -1510,7 +1509,7 @@ ast_for_expr(struct compiling *c, const node *n)
...
@@ -1510,7 +1509,7 @@ ast_for_expr(struct compiling *c, const node *n)
return
NULL
;
return
NULL
;
}
}
asdl_seq_SET
(
ops
,
i
/
2
,
(
void
*
)
operator
);
asdl_seq_SET
(
ops
,
i
/
2
,
(
void
*
)
(
Py_uintptr_t
)
operator
);
asdl_seq_SET
(
cmps
,
i
/
2
,
expression
);
asdl_seq_SET
(
cmps
,
i
/
2
,
expression
);
}
}
expression
=
ast_for_expr
(
c
,
CHILD
(
n
,
0
));
expression
=
ast_for_expr
(
c
,
CHILD
(
n
,
0
));
...
@@ -2031,7 +2030,7 @@ alias_for_import_name(struct compiling *c, const node *n)
...
@@ -2031,7 +2030,7 @@ alias_for_import_name(struct compiling *c, const node *n)
return
alias
(
NEW_IDENTIFIER
(
CHILD
(
n
,
0
)),
NULL
,
c
->
c_arena
);
return
alias
(
NEW_IDENTIFIER
(
CHILD
(
n
,
0
)),
NULL
,
c
->
c_arena
);
else
{
else
{
/* Create a string of the form "a.b.c" */
/* Create a string of the form "a.b.c" */
in
t
i
,
len
;
size_
t
i
,
len
;
char
*
s
;
char
*
s
;
len
=
0
;
len
=
0
;
...
...
Python/symtable.c
Dosyayı görüntüle @
46b7bda9
...
@@ -354,7 +354,7 @@ PyST_GetScope(PySTEntryObject *ste, PyObject *name)
...
@@ -354,7 +354,7 @@ PyST_GetScope(PySTEntryObject *ste, PyObject *name)
*/
*/
static
int
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
*
bound
,
PyObject
*
local
,
PyObject
*
free
,
PyObject
*
global
)
PyObject
*
global
)
{
{
...
@@ -426,14 +426,14 @@ static int
...
@@ -426,14 +426,14 @@ static int
analyze_cells
(
PyObject
*
scope
,
PyObject
*
free
)
analyze_cells
(
PyObject
*
scope
,
PyObject
*
free
)
{
{
PyObject
*
name
,
*
v
,
*
w
;
PyObject
*
name
,
*
v
,
*
w
;
int
flags
,
pos
=
0
,
success
=
0
;
int
pos
=
0
,
success
=
0
;
w
=
PyInt_FromLong
(
CELL
);
w
=
PyInt_FromLong
(
CELL
);
if
(
!
w
)
if
(
!
w
)
return
0
;
return
0
;
while
(
PyDict_Next
(
scope
,
&
pos
,
&
name
,
&
v
))
{
while
(
PyDict_Next
(
scope
,
&
pos
,
&
name
,
&
v
))
{
assert
(
PyInt_Check
(
v
));
assert
(
PyInt_Check
(
v
));
flags
=
PyInt_AS_LONG
(
v
);
long
flags
=
PyInt_AS_LONG
(
v
);
if
(
flags
!=
LOCAL
)
if
(
flags
!=
LOCAL
)
continue
;
continue
;
if
(
!
PyDict_GetItem
(
free
,
name
))
if
(
!
PyDict_GetItem
(
free
,
name
))
...
@@ -506,9 +506,10 @@ update_symbols(PyObject *symbols, PyObject *scope,
...
@@ -506,9 +506,10 @@ update_symbols(PyObject *symbols, PyObject *scope,
PyObject
*
bound
,
PyObject
*
free
,
int
class
)
PyObject
*
bound
,
PyObject
*
free
,
int
class
)
{
{
PyObject
*
name
,
*
v
,
*
u
,
*
w
,
*
free_value
=
NULL
;
PyObject
*
name
,
*
v
,
*
u
,
*
w
,
*
free_value
=
NULL
;
int
i
,
flags
,
pos
=
0
;
int
pos
=
0
;
while
(
PyDict_Next
(
symbols
,
&
pos
,
&
name
,
&
v
))
{
while
(
PyDict_Next
(
symbols
,
&
pos
,
&
name
,
&
v
))
{
long
i
,
flags
;
assert
(
PyInt_Check
(
v
));
assert
(
PyInt_Check
(
v
));
flags
=
PyInt_AS_LONG
(
v
);
flags
=
PyInt_AS_LONG
(
v
);
w
=
PyDict_GetItem
(
scope
,
name
);
w
=
PyDict_GetItem
(
scope
,
name
);
...
@@ -539,7 +540,7 @@ update_symbols(PyObject *symbols, PyObject *scope,
...
@@ -539,7 +540,7 @@ update_symbols(PyObject *symbols, PyObject *scope,
*/
*/
if
(
class
&&
if
(
class
&&
PyInt_AS_LONG
(
o
)
&
(
DEF_BOUND
|
DEF_GLOBAL
))
{
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
);
o
=
PyInt_FromLong
(
i
);
if
(
!
o
)
{
if
(
!
o
)
{
Py_DECREF
(
free_value
);
Py_DECREF
(
free_value
);
...
@@ -581,7 +582,7 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
...
@@ -581,7 +582,7 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
{
{
PyObject
*
name
,
*
v
,
*
local
=
NULL
,
*
scope
=
NULL
,
*
newbound
=
NULL
;
PyObject
*
name
,
*
v
,
*
local
=
NULL
,
*
scope
=
NULL
,
*
newbound
=
NULL
;
PyObject
*
newglobal
=
NULL
,
*
newfree
=
NULL
;
PyObject
*
newglobal
=
NULL
,
*
newfree
=
NULL
;
int
i
,
flags
,
pos
=
0
,
success
=
0
;
int
i
,
pos
=
0
,
success
=
0
;
local
=
PyDict_New
();
local
=
PyDict_New
();
if
(
!
local
)
if
(
!
local
)
...
@@ -614,7 +615,7 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
...
@@ -614,7 +615,7 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
assert
(
PySTEntry_Check
(
ste
));
assert
(
PySTEntry_Check
(
ste
));
assert
(
PyDict_Check
(
ste
->
ste_symbols
));
assert
(
PyDict_Check
(
ste
->
ste_symbols
));
while
(
PyDict_Next
(
ste
->
ste_symbols
,
&
pos
,
&
name
,
&
v
))
{
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
,
if
(
!
analyze_name
(
ste
,
scope
,
name
,
flags
,
bound
,
local
,
free
,
global
))
global
))
goto
error
;
goto
error
;
...
@@ -750,7 +751,7 @@ symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block,
...
@@ -750,7 +751,7 @@ symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block,
return
1
;
return
1
;
}
}
static
int
static
long
symtable_lookup
(
struct
symtable
*
st
,
PyObject
*
name
)
symtable_lookup
(
struct
symtable
*
st
,
PyObject
*
name
)
{
{
PyObject
*
o
;
PyObject
*
o
;
...
@@ -769,7 +770,7 @@ symtable_add_def(struct symtable *st, PyObject *name, int flag)
...
@@ -769,7 +770,7 @@ symtable_add_def(struct symtable *st, PyObject *name, int flag)
{
{
PyObject
*
o
;
PyObject
*
o
;
PyObject
*
dict
;
PyObject
*
dict
;
int
val
;
long
val
;
PyObject
*
mangled
=
_Py_Mangle
(
st
->
st_private
,
name
);
PyObject
*
mangled
=
_Py_Mangle
(
st
->
st_private
,
name
);
if
(
!
mangled
)
if
(
!
mangled
)
...
@@ -1018,7 +1019,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
...
@@ -1018,7 +1019,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
for
(
i
=
0
;
i
<
asdl_seq_LEN
(
seq
);
i
++
)
{
for
(
i
=
0
;
i
<
asdl_seq_LEN
(
seq
);
i
++
)
{
identifier
name
=
asdl_seq_GET
(
seq
,
i
);
identifier
name
=
asdl_seq_GET
(
seq
,
i
);
char
*
c_name
=
PyString_AS_STRING
(
name
);
char
*
c_name
=
PyString_AS_STRING
(
name
);
int
cur
=
symtable_lookup
(
st
,
name
);
long
cur
=
symtable_lookup
(
st
,
name
);
if
(
cur
<
0
)
if
(
cur
<
0
)
return
0
;
return
0
;
if
(
cur
&
(
DEF_LOCAL
|
USE
))
{
if
(
cur
&
(
DEF_LOCAL
|
USE
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment