diff --git a/src/compiler.h b/src/compiler.h index b528ec5b..1820c2d0 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -925,8 +925,8 @@ __SUBSCR_END: StrName name = prev().str(); // check duplicate argument name - for(int i: decl->args){ - if(decl->code->varnames[i] == name) { + for(int j: decl->args){ + if(decl->code->varnames[j] == name) { SyntaxError("duplicate argument name"); } } diff --git a/src/iter.h b/src/iter.h index 469e4316..97c02dc6 100644 --- a/src/iter.h +++ b/src/iter.h @@ -101,7 +101,7 @@ struct Generator{ if(ret == PY_OP_YIELD){ // backup the context frame = std::move(vm->callstack.top()); - PyObject* ret = frame._s->popx(); + ret = frame._s->popx(); for(PyObject* obj: frame.stack_view()) s_backup.push_back(obj); vm->_pop_frame(); state = 1; diff --git a/src/linalg.h b/src/linalg.h index 1fe414c5..fb2faf6c 100644 --- a/src/linalg.h +++ b/src/linalg.h @@ -260,12 +260,12 @@ struct Mat3x3{ ); } - Vec2 transform_point(Vec2 v) const { - return Vec2(_11 * v.x + _12 * v.y + _13, _21 * v.x + _22 * v.y + _23); + Vec2 transform_point(Vec2 vec) const { + return Vec2(_11 * vec.x + _12 * vec.y + _13, _21 * vec.x + _22 * vec.y + _23); } - Vec2 transform_vector(Vec2 v) const { - return Vec2(_11 * v.x + _12 * v.y, _21 * v.x + _22 * v.y); + Vec2 transform_vector(Vec2 vec) const { + return Vec2(_11 * vec.x + _12 * vec.y, _21 * vec.x + _22 * vec.y); } }; @@ -617,14 +617,17 @@ struct PyMat3x3: Mat3x3{ }); vm->bind_func<0>(type, "zeros", [](VM* vm, ArgsView args){ + PK_UNUSED(args); return VAR_T(PyMat3x3, Mat3x3::zeros()); }); vm->bind_func<0>(type, "ones", [](VM* vm, ArgsView args){ + PK_UNUSED(args); return VAR_T(PyMat3x3, Mat3x3::ones()); }); vm->bind_func<0>(type, "identity", [](VM* vm, ArgsView args){ + PK_UNUSED(args); return VAR_T(PyMat3x3, Mat3x3::identity()); }); diff --git a/src/vm.h b/src/vm.h index e3070bf8..3c804f09 100644 --- a/src/vm.h +++ b/src/vm.h @@ -487,6 +487,7 @@ public: template PyObject* bind_notimplemented_constructor(__T&& type) { return bind_constructor<-1>(std::forward<__T>(type), [](VM* vm, ArgsView args){ + PK_UNUSED(args); vm->NotImplementedError(); return vm->None; }); @@ -739,6 +740,7 @@ template<> inline float py_cast(VM* vm, PyObject* obj){ return BitsCvt(bits)._float; } template<> inline float _py_cast(VM* vm, PyObject* obj){ + PK_UNUSED(vm); i64 bits = PK_BITS(obj) & Number::c1; return BitsCvt(bits)._float; } @@ -748,6 +750,7 @@ template<> inline double py_cast(VM* vm, PyObject* obj){ return BitsCvt(bits)._float; } template<> inline double _py_cast(VM* vm, PyObject* obj){ + PK_UNUSED(vm); i64 bits = PK_BITS(obj) & Number::c1; return BitsCvt(bits)._float; } @@ -777,6 +780,7 @@ PY_VAR_INT(unsigned long long) #define PY_VAR_FLOAT(T) \ inline PyObject* py_var(VM* vm, T _val){ \ + PK_UNUSED(vm); \ BitsCvt val(static_cast(_val)); \ i64 bits = val._int & Number::c1; \ i64 tail = val._int & Number::c2; \