Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
072f3834
Commit
072f3834
authored
May 01, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor code cleanups
parent
5bc9ddec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+7
-7
No files found.
Cython/Compiler/Code.py
View file @
072f3834
...
@@ -1486,7 +1486,7 @@ class CCodeWriter(object):
...
@@ -1486,7 +1486,7 @@ class CCodeWriter(object):
# code generation
# code generation
def
putln
(
self
,
code
=
""
,
safe
=
False
):
def
putln
(
self
,
code
=
""
,
safe
=
False
):
if
self
.
marker
and
self
.
bol
:
if
self
.
marker
and
self
.
bol
:
self
.
emit_marker
()
self
.
emit_marker
()
if
self
.
emit_linenums
and
self
.
last_marker_line
!=
0
:
if
self
.
emit_linenums
and
self
.
last_marker_line
!=
0
:
...
@@ -1548,10 +1548,10 @@ class CCodeWriter(object):
...
@@ -1548,10 +1548,10 @@ class CCodeWriter(object):
self
.
put
(
sub
(
code
,
**
context
))
self
.
put
(
sub
(
code
,
**
context
))
def
increase_indent
(
self
):
def
increase_indent
(
self
):
self
.
level
=
self
.
level
+
1
self
.
level
+=
1
def
decrease_indent
(
self
):
def
decrease_indent
(
self
):
self
.
level
=
self
.
level
-
1
self
.
level
-=
1
def
begin_block
(
self
):
def
begin_block
(
self
):
self
.
putln
(
"{"
)
self
.
putln
(
"{"
)
...
@@ -1575,7 +1575,7 @@ class CCodeWriter(object):
...
@@ -1575,7 +1575,7 @@ class CCodeWriter(object):
return
return
assert
isinstance
(
source_desc
,
SourceDescriptor
)
assert
isinstance
(
source_desc
,
SourceDescriptor
)
contents
=
self
.
globalstate
.
commented_file_contents
(
source_desc
)
contents
=
self
.
globalstate
.
commented_file_contents
(
source_desc
)
lines
=
contents
[
max
(
0
,
line
-
3
):
line
]
# line numbers start at 1
lines
=
contents
[
max
(
0
,
line
-
3
):
line
]
# line numbers start at 1
lines
[
-
1
]
+=
u' # <<<<<<<<<<<<<<'
lines
[
-
1
]
+=
u' # <<<<<<<<<<<<<<'
lines
+=
contents
[
line
:
line
+
2
]
lines
+=
contents
[
line
:
line
+
2
]
...
@@ -1594,7 +1594,7 @@ class CCodeWriter(object):
...
@@ -1594,7 +1594,7 @@ class CCodeWriter(object):
self
.
putln
(
"goto %s;"
%
lbl
)
self
.
putln
(
"goto %s;"
%
lbl
)
def
put_var_declaration
(
self
,
entry
,
storage_class
=
""
,
def
put_var_declaration
(
self
,
entry
,
storage_class
=
""
,
dll_linkage
=
None
,
definition
=
True
):
dll_linkage
=
None
,
definition
=
True
):
#print "Code.put_var_declaration:", entry.name, "definition =", definition ###
#print "Code.put_var_declaration:", entry.name, "definition =", definition ###
if
entry
.
visibility
==
'private'
and
not
(
definition
or
entry
.
defined_in_pxd
):
if
entry
.
visibility
==
'private'
and
not
(
definition
or
entry
.
defined_in_pxd
):
#print "...private and not definition, skipping", entry.cname ###
#print "...private and not definition, skipping", entry.cname ###
...
@@ -1607,11 +1607,11 @@ class CCodeWriter(object):
...
@@ -1607,11 +1607,11 @@ class CCodeWriter(object):
if
not
entry
.
cf_used
:
if
not
entry
.
cf_used
:
self
.
put
(
'CYTHON_UNUSED '
)
self
.
put
(
'CYTHON_UNUSED '
)
self
.
put
(
entry
.
type
.
declaration_code
(
self
.
put
(
entry
.
type
.
declaration_code
(
entry
.
cname
,
dll_linkage
=
dll_linkage
))
entry
.
cname
,
dll_linkage
=
dll_linkage
))
if
entry
.
init
is
not
None
:
if
entry
.
init
is
not
None
:
self
.
put_safe
(
" = %s"
%
entry
.
type
.
literal_code
(
entry
.
init
))
self
.
put_safe
(
" = %s"
%
entry
.
type
.
literal_code
(
entry
.
init
))
elif
entry
.
type
.
is_pyobject
:
elif
entry
.
type
.
is_pyobject
:
self
.
put
(
" = NULL"
)
;
self
.
put
(
" = NULL"
)
self
.
putln
(
";"
)
self
.
putln
(
";"
)
def
put_temp_declarations
(
self
,
func_context
):
def
put_temp_declarations
(
self
,
func_context
):
...
...
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