Commit b4c17f7e authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #69 from kkszysiu/compiling_fixes

Compiling fixes
parents b2f7eddc f653e32a
...@@ -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_subclass(_cls->cls, type_cls)) if (!isSubclass(_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_subclass(_cls->cls, type_cls)) if (!isSubclass(_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);
......
...@@ -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(BoxedInt* 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment