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
Xavier Thompson
cython
Commits
6af313c9
Commit
6af313c9
authored
Jul 25, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete trailing whitespaces
parent
02864e44
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
23 deletions
+23
-23
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+1
-1
Cython/Compiler/CythonScope.py
Cython/Compiler/CythonScope.py
+3
-3
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+1
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+11
-11
Cython/Compiler/Pipeline.py
Cython/Compiler/Pipeline.py
+1
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+2
-2
Cython/Compiler/UtilityCode.py
Cython/Compiler/UtilityCode.py
+1
-1
No files found.
Cython/Compiler/Code.py
View file @
6af313c9
...
...
@@ -61,7 +61,7 @@ class UtilityCode(object):
def
get_tree
(
self
):
pass
def
specialize
(
self
,
pyrex_type
=
None
,
**
data
):
# Dicts aren't hashable...
if
pyrex_type
is
not
None
:
...
...
Cython/Compiler/CythonScope.py
View file @
6af313c9
...
...
@@ -48,13 +48,13 @@ class CythonScope(ModuleScope):
def
populate_cython_scope
(
self
):
# These are used to optimize isinstance in FinalOptimizePhase
type_object
=
self
.
declare_typedef
(
'PyTypeObject'
,
base_type
=
c_void_type
,
'PyTypeObject'
,
base_type
=
c_void_type
,
pos
=
None
,
cname
=
'PyTypeObject'
)
type_object
.
is_void
=
True
type_object_type
=
type_object
.
type
self
.
declare_cfunction
(
'PyObject_TypeCheck'
,
CFuncType
(
c_bint_type
,
[
CFuncTypeArg
(
"o"
,
py_object_type
,
None
),
...
...
Cython/Compiler/Main.py
View file @
6af313c9
...
...
@@ -68,7 +68,7 @@ class Context(object):
# cython_scope is a hack, set to False by subclasses, in order to break
# an infinite loop.
# Better code organization would fix it.
import
Builtin
,
CythonScope
self
.
modules
=
{
"__builtin__"
:
Builtin
.
builtin_scope
}
cyscope
=
CythonScope
.
create_cython_scope
(
...
...
Cython/Compiler/ModuleNode.py
View file @
6af313c9
...
...
@@ -990,7 +990,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if
not
type
.
scope
:
return
code
.
putln
(
self
.
sue_predeclaration
(
type
,
"struct"
,
type
.
objstruct_cname
))
def
generate_objstruct_definition
(
self
,
type
,
code
):
code
.
mark_pos
(
type
.
pos
)
# Generate object struct definition for an
...
...
@@ -1088,7 +1088,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def
generate_variable_definitions
(
self
,
env
,
code
):
for
entry
in
env
.
var_entries
:
if
(
not
entry
.
in_cinclude
and
if
(
not
entry
.
in_cinclude
and
entry
.
visibility
==
"public"
):
code
.
put
(
entry
.
type
.
declaration_code
(
entry
.
cname
))
if
entry
.
init
is
not
None
:
...
...
Cython/Compiler/Nodes.py
View file @
6af313c9
...
...
@@ -983,7 +983,7 @@ class CStructOrUnionDefNode(StatNode):
# packed boolean
child_attrs
=
[
"attributes"
]
def
declare
(
self
,
env
,
scope
=
None
):
if
self
.
visibility
==
'extern'
and
self
.
packed
and
not
scope
:
error
(
self
.
pos
,
"Cannot declare extern struct as 'packed'"
)
...
...
Cython/Compiler/Optimize.py
View file @
6af313c9
...
...
@@ -2427,15 +2427,15 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
def
_handle_simple_method_unicode_endswith
(
self
,
node
,
args
,
is_unbound_method
):
return
self
.
_inject_tailmatch
(
node
,
args
,
is_unbound_method
,
'unicode'
,
'endswith'
,
node
,
args
,
is_unbound_method
,
'unicode'
,
'endswith'
,
unicode_tailmatch_utility_code
,
+
1
)
def
_handle_simple_method_unicode_startswith
(
self
,
node
,
args
,
is_unbound_method
):
return
self
.
_inject_tailmatch
(
node
,
args
,
is_unbound_method
,
'unicode'
,
'startswith'
,
node
,
args
,
is_unbound_method
,
'unicode'
,
'startswith'
,
unicode_tailmatch_utility_code
,
-
1
)
def
_inject_tailmatch
(
self
,
node
,
args
,
is_unbound_method
,
type_name
,
def
_inject_tailmatch
(
self
,
node
,
args
,
is_unbound_method
,
type_name
,
method_name
,
utility_code
,
direction
):
"""Replace unicode.startswith(...) and unicode.endswith(...)
by a direct call to the corresponding C-API function.
...
...
@@ -2784,7 +2784,7 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
def
_handle_simple_method_str_endswith
(
self
,
node
,
args
,
is_unbound_method
):
return
self
.
_inject_tailmatch
(
node
,
args
,
is_unbound_method
,
'str'
,
'endswith'
,
node
,
args
,
is_unbound_method
,
'str'
,
'endswith'
,
str_tailmatch_utility_code
,
+
1
)
def
_handle_simple_method_str_startswith
(
self
,
node
,
args
,
is_unbound_method
):
...
...
@@ -2794,7 +2794,7 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
def
_handle_simple_method_bytes_endswith
(
self
,
node
,
args
,
is_unbound_method
):
return
self
.
_inject_tailmatch
(
node
,
args
,
is_unbound_method
,
'bytes'
,
'endswith'
,
node
,
args
,
is_unbound_method
,
'bytes'
,
'endswith'
,
bytes_tailmatch_utility_code
,
+
1
)
def
_handle_simple_method_bytes_startswith
(
self
,
node
,
args
,
is_unbound_method
):
...
...
@@ -2909,12 +2909,12 @@ static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, Py_ssize
const char* sub_ptr;
Py_ssize_t sub_len;
int retval;
#if PY_VERSION_HEX >= 0x02060000
Py_buffer view;
view.obj = NULL;
#endif
if ( PyBytes_Check(arg) ) {
sub_ptr = PyBytes_AS_STRING(arg);
sub_len = PyBytes_GET_SIZE(arg);
...
...
@@ -2936,7 +2936,7 @@ static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, Py_ssize
sub_len = view.len;
#endif
}
if (end > self_len)
end = self_len;
else if (end < 0)
...
...
@@ -2953,7 +2953,7 @@ static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, Py_ssize
if (end-sub_len > start)
start = end - sub_len;
}
if (start + sub_len <= end)
retval = !memcmp(self_ptr+start, sub_ptr, sub_len);
else
...
...
@@ -2966,7 +2966,7 @@ static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, Py_ssize
return retval;
}
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr, Py_ssize_t start,
Py_ssize_t end, int direction)
{
...
...
@@ -2982,7 +2982,7 @@ static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr, Py_ssize_t
}
return 0;
}
return __Pyx_PyBytes_SingleTailmatch(self, substr, start, end, direction);
}
...
...
Cython/Compiler/Pipeline.py
View file @
6af313c9
...
...
@@ -74,7 +74,7 @@ def inject_utility_code_stage_factory(context):
# First, make sure any utility code pulled in by using symbols in the cython
# scope is included
use_utility_code_definitions
(
context
.
cython_scope
,
module_node
.
scope
)
added
=
[]
# Note: the list might be extended inside the loop (if some utility code
# pulls in other utility code)
...
...
Cython/Compiler/PyrexTypes.py
View file @
6af313c9
...
...
@@ -1970,7 +1970,7 @@ class StructUtilityCode(object):
def
get_tree
(
self
):
pass
def
put_code
(
self
,
output
):
code
=
output
[
'utility_code_def'
]
proto
=
output
[
'utility_code_proto'
]
...
...
@@ -2000,7 +2000,7 @@ class StructUtilityCode(object):
def
inject_tree_and_scope_into
(
self
,
module_node
):
pass
class
CStructOrUnionType
(
CType
):
# name string
...
...
Cython/Compiler/UtilityCode.py
View file @
6af313c9
...
...
@@ -75,7 +75,7 @@ class CythonUtilityCode(object):
# which when copied into the main ModuleNode overwrites
# any __test__ in user code; not desired
excludes
=
[
AutoTestDictTransform
]
import
Pipeline
,
ParseTreeTransforms
context
=
CythonUtilityCodeContext
(
self
.
name
)
context
.
prefix
=
self
.
prefix
...
...
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