Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
b4c17f7e
Commit
b4c17f7e
authored
Jun 02, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #69 from kkszysiu/compiling_fixes
Compiling fixes
parents
b2f7eddc
f653e32a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/runtime/int.cpp
src/runtime/int.cpp
+5
-5
src/runtime/int.h
src/runtime/int.h
+1
-1
No files found.
src/runtime/int.cpp
View file @
b4c17f7e
...
@@ -413,7 +413,7 @@ extern "C" Box* intInvert(BoxedInt* v) {
...
@@ -413,7 +413,7 @@ extern "C" Box* intInvert(BoxedInt* v) {
extern
"C"
Box
*
intPos
(
BoxedInt
*
v
)
{
extern
"C"
Box
*
intPos
(
BoxedInt
*
v
)
{
if
(
!
isSubclass
(
v
->
cls
,
int_cls
))
if
(
!
isSubclass
(
v
->
cls
,
int_cls
))
raiseExcHelper
(
TypeError
,
"descriptor '__pos__' requires a 'int' object but received a '%s'"
,
getTypeName
(
rhs
)
->
c_str
());
raiseExcHelper
(
TypeError
,
"descriptor '__pos__' requires a 'int' object but received a '%s'"
,
getTypeName
(
v
)
->
c_str
());
if
(
v
->
cls
==
int_cls
)
if
(
v
->
cls
==
int_cls
)
return
v
;
return
v
;
...
@@ -432,7 +432,7 @@ extern "C" Box* intNonzero(BoxedInt* v) {
...
@@ -432,7 +432,7 @@ extern "C" Box* intNonzero(BoxedInt* v) {
extern
"C"
BoxedString
*
intRepr
(
BoxedInt
*
v
)
{
extern
"C"
BoxedString
*
intRepr
(
BoxedInt
*
v
)
{
if
(
!
isSubclass
(
v
->
cls
,
int_cls
))
if
(
!
isSubclass
(
v
->
cls
,
int_cls
))
raiseExcHelper
(
TypeError
,
"descriptor '__repr__' requires a 'int' object but received a '%s'"
,
getTypeName
(
rhs
)
->
c_str
());
raiseExcHelper
(
TypeError
,
"descriptor '__repr__' requires a 'int' object but received a '%s'"
,
getTypeName
(
v
)
->
c_str
());
char
buf
[
80
];
char
buf
[
80
];
int
len
=
snprintf
(
buf
,
80
,
"%ld"
,
v
->
n
);
int
len
=
snprintf
(
buf
,
80
,
"%ld"
,
v
->
n
);
...
@@ -444,15 +444,15 @@ extern "C" Box* intHash(BoxedInt* self) {
...
@@ -444,15 +444,15 @@ extern "C" Box* intHash(BoxedInt* self) {
return
self
;
return
self
;
}
}
extern
"C"
Box
*
intNew1
(
Box
*
cls
)
{
extern
"C"
Box
*
intNew1
(
Box
*
_
cls
)
{
if
(
!
is
_s
ubclass
(
_cls
->
cls
,
type_cls
))
if
(
!
is
S
ubclass
(
_cls
->
cls
,
type_cls
))
raiseExcHelper
(
TypeError
,
"int.__new__(X): X is not a type object (%s)"
,
getTypeName
(
_cls
)
->
c_str
());
raiseExcHelper
(
TypeError
,
"int.__new__(X): X is not a type object (%s)"
,
getTypeName
(
_cls
)
->
c_str
());
return
boxInt
(
0
);
return
boxInt
(
0
);
}
}
extern
"C"
Box
*
intNew2
(
Box
*
_cls
,
Box
*
val
)
{
extern
"C"
Box
*
intNew2
(
Box
*
_cls
,
Box
*
val
)
{
if
(
!
is
_s
ubclass
(
_cls
->
cls
,
type_cls
))
if
(
!
is
S
ubclass
(
_cls
->
cls
,
type_cls
))
raiseExcHelper
(
TypeError
,
"int.__new__(X): X is not a type object (%s)"
,
getTypeName
(
_cls
)
->
c_str
());
raiseExcHelper
(
TypeError
,
"int.__new__(X): X is not a type object (%s)"
,
getTypeName
(
_cls
)
->
c_str
());
BoxedClass
*
cls
=
static_cast
<
BoxedClass
*>
(
_cls
);
BoxedClass
*
cls
=
static_cast
<
BoxedClass
*>
(
_cls
);
...
...
src/runtime/int.h
View file @
b4c17f7e
...
@@ -58,7 +58,7 @@ extern "C" BoxedString* intRepr(BoxedInt* v);
...
@@ -58,7 +58,7 @@ extern "C" BoxedString* intRepr(BoxedInt* v);
extern
"C"
Box
*
intHash
(
BoxedInt
*
self
);
extern
"C"
Box
*
intHash
(
BoxedInt
*
self
);
extern
"C"
Box
*
intNew1
(
Box
*
cls
);
extern
"C"
Box
*
intNew1
(
Box
*
cls
);
extern
"C"
Box
*
intNew2
(
Box
*
cls
,
Box
*
val
);
extern
"C"
Box
*
intNew2
(
Box
*
cls
,
Box
*
val
);
extern
"C"
Box
*
intInit1
(
Box
edInt
*
self
);
extern
"C"
Box
*
intInit1
(
Box
*
self
);
extern
"C"
Box
*
intInit2
(
BoxedInt
*
self
,
Box
*
val
);
extern
"C"
Box
*
intInit2
(
BoxedInt
*
self
,
Box
*
val
);
#define NUM_INTERNED_INTS 100
#define NUM_INTERNED_INTS 100
...
...
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