Commit 8e09e7fc authored by Kevin Modzelewski's avatar Kevin Modzelewski

make format

parent 344f58b7
......@@ -475,7 +475,7 @@ void setupBuiltins() {
addRTFunction(getattr_func, (void*)getattr3, NULL, 3, false);
builtins_module->giveAttr("getattr", new BoxedFunction(getattr_func));
Box* hasattr_obj = new BoxedFunction(boxRTFunction((void*)hasattr, NULL, 2, false));
Box* hasattr_obj = new BoxedFunction(boxRTFunction((void*)hasattr, NULL, 2, false));
builtins_module->giveAttr("hasattr", hasattr_obj);
......
......@@ -187,10 +187,12 @@ void setupDict() {
"__iter__", new BoxedFunction(boxRTFunction((void*)dictIterKeys, typeFromClass(dict_iterator_cls), 1, false)));
dict_cls->giveAttr("items", new BoxedFunction(boxRTFunction((void*)dictItems, NULL, 1, false)));
dict_cls->giveAttr("iteritems", new BoxedFunction(boxRTFunction((void*)dictIterItems, typeFromClass(dict_iterator_cls), 1, false)));
dict_cls->giveAttr("iteritems", new BoxedFunction(boxRTFunction((void*)dictIterItems,
typeFromClass(dict_iterator_cls), 1, false)));
dict_cls->giveAttr("values", new BoxedFunction(boxRTFunction((void*)dictValues, NULL, 1, false)));
dict_cls->giveAttr("itervalues", new BoxedFunction(boxRTFunction((void*)dictIterValues, typeFromClass(dict_iterator_cls), 1, false)));
dict_cls->giveAttr("itervalues", new BoxedFunction(boxRTFunction((void*)dictIterValues,
typeFromClass(dict_iterator_cls), 1, false)));
dict_cls->giveAttr("keys", new BoxedFunction(boxRTFunction((void*)dictKeys, NULL, 1, false)));
dict_cls->giveAttr("iterkeys", dict_cls->getattr("__iter__"));
......
......@@ -121,7 +121,8 @@ extern "C" Box* intAddFloat(BoxedInt* lhs, BoxedFloat* rhs) {
extern "C" Box* intAdd(BoxedInt* lhs, Box* rhs) {
if (!isSubclass(lhs->cls, int_cls))
raiseExcHelper(TypeError, "descriptor '__add__' requires a 'int' object but received a '%s'", getTypeName(rhs)->c_str());
raiseExcHelper(TypeError, "descriptor '__add__' requires a 'int' object but received a '%s'",
getTypeName(rhs)->c_str());
if (isSubclass(rhs->cls, int_cls)) {
BoxedInt* rhs_int = static_cast<BoxedInt*>(rhs);
......@@ -413,7 +414,8 @@ extern "C" Box* intInvert(BoxedInt* v) {
extern "C" Box* intPos(BoxedInt* v) {
if (!isSubclass(v->cls, int_cls))
raiseExcHelper(TypeError, "descriptor '__pos__' requires a 'int' object but received a '%s'", getTypeName(v)->c_str());
raiseExcHelper(TypeError, "descriptor '__pos__' requires a 'int' object but received a '%s'",
getTypeName(v)->c_str());
if (v->cls == int_cls)
return v;
......@@ -432,7 +434,8 @@ extern "C" Box* intNonzero(BoxedInt* v) {
extern "C" BoxedString* intRepr(BoxedInt* v) {
if (!isSubclass(v->cls, int_cls))
raiseExcHelper(TypeError, "descriptor '__repr__' requires a 'int' object but received a '%s'", getTypeName(v)->c_str());
raiseExcHelper(TypeError, "descriptor '__repr__' requires a 'int' object but received a '%s'",
getTypeName(v)->c_str());
char buf[80];
int len = snprintf(buf, 80, "%ld", v->n);
......@@ -457,7 +460,8 @@ extern "C" Box* intNew2(Box* _cls, Box* val) {
BoxedClass* cls = static_cast<BoxedClass*>(_cls);
if (!isSubclass(cls, int_cls))
raiseExcHelper(TypeError, "int.__new__(%s): %s is not a subtype of int", getNameOfClass(cls)->c_str(), getNameOfClass(cls)->c_str());
raiseExcHelper(TypeError, "int.__new__(%s): %s is not a subtype of int", getNameOfClass(cls)->c_str(),
getNameOfClass(cls)->c_str());
assert(cls->instance_size >= sizeof(BoxedInt));
void* mem = rt_alloc(cls->instance_size);
......
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