diff --git a/ASTNode.h b/ASTNode.h index 22b90e1d3..90ad8c7e4 100644 --- a/ASTNode.h +++ b/ASTNode.h @@ -24,7 +24,7 @@ class ASTNode { NODE_LOCALS, }; - ASTNode(int type = NODE_INVALID) : m_refs(), m_type(type), m_processed() { } + ASTNode(int _type = NODE_INVALID) : m_refs(), m_type(_type), m_processed() { } virtual ~ASTNode() { } int type() const { return internalGetType(this); } @@ -65,8 +65,8 @@ class ASTNodeList : public ASTNode { public: typedef std::list> list_t; - ASTNodeList(list_t nodes) - : ASTNode(NODE_NODELIST), m_nodes(std::move(nodes)) { } + ASTNodeList(list_t _nodes) + : ASTNode(NODE_NODELIST), m_nodes(std::move(_nodes)) { } const list_t& nodes() const { return m_nodes; } void removeFirst(); @@ -74,8 +74,8 @@ class ASTNodeList : public ASTNode { void append(PycRef node) { m_nodes.emplace_back(std::move(node)); } protected: - ASTNodeList(list_t nodes, ASTNode::Type type) - : ASTNode(type), m_nodes(std::move(nodes)) { } + ASTNodeList(list_t _nodes, ASTNode::Type _type) + : ASTNode(_type), m_nodes(std::move(_nodes)) { } private: list_t m_nodes; @@ -84,8 +84,8 @@ class ASTNodeList : public ASTNode { class ASTChainStore : public ASTNodeList { public: - ASTChainStore(list_t nodes, PycRef src) - : ASTNodeList(nodes, NODE_CHAINSTORE), m_src(std::move(src)) { } + ASTChainStore(list_t _nodes, PycRef _src) + : ASTNodeList(_nodes, NODE_CHAINSTORE), m_src(std::move(_src)) { } PycRef src() const { return m_src; } @@ -112,8 +112,8 @@ class ASTUnary : public ASTNode { UN_POSITIVE, UN_NEGATIVE, UN_INVERT, UN_NOT }; - ASTUnary(PycRef operand, int op) - : ASTNode(NODE_UNARY), m_op(op), m_operand(std::move(operand)) { } + ASTUnary(PycRef _operand, int _op) + : ASTNode(NODE_UNARY), m_op(_op), m_operand(std::move(_operand)) { } PycRef operand() const { return m_operand; } int op() const { return m_op; } @@ -141,9 +141,9 @@ class ASTBinary : public ASTNode { BIN_INVALID }; - ASTBinary(PycRef left, PycRef right, int op, - int type = NODE_BINARY) - : ASTNode(type), m_op(op), m_left(std::move(left)), m_right(std::move(right)) { } + ASTBinary(PycRef _left, PycRef _right, int _op, + int _type = NODE_BINARY) + : ASTNode(_type), m_op(_op), m_left(std::move(_left)), m_right(std::move(_right)) { } PycRef left() const { return m_left; } PycRef right() const { return m_right; } @@ -171,8 +171,8 @@ class ASTCompare : public ASTBinary { CMP_EXCEPTION, CMP_BAD }; - ASTCompare(PycRef left, PycRef right, int op) - : ASTBinary(std::move(left), std::move(right), op, NODE_COMPARE) { } + ASTCompare(PycRef _left, PycRef _right, int _op) + : ASTBinary(std::move(_left), std::move(_right), _op, NODE_COMPARE) { } const char* op_str() const override; }; @@ -184,15 +184,15 @@ class ASTSlice : public ASTBinary { SLICE0, SLICE1, SLICE2, SLICE3 }; - ASTSlice(int op, PycRef left = {}, PycRef right = {}) - : ASTBinary(std::move(left), std::move(right), op, NODE_SLICE) { } + ASTSlice(int _op, PycRef _left = {}, PycRef _right = {}) + : ASTBinary(std::move(_left), std::move(_right), _op, NODE_SLICE) { } }; class ASTStore : public ASTNode { public: - ASTStore(PycRef src, PycRef dest) - : ASTNode(NODE_STORE), m_src(std::move(src)), m_dest(std::move(dest)) { } + ASTStore(PycRef _src, PycRef _dest) + : ASTNode(NODE_STORE), m_src(std::move(_src)), m_dest(std::move(_dest)) { } PycRef src() const { return m_src; } PycRef dest() const { return m_dest; } @@ -209,8 +209,8 @@ class ASTReturn : public ASTNode { RETURN, YIELD, YIELD_FROM }; - ASTReturn(PycRef value, RetType rettype = RETURN) - : ASTNode(NODE_RETURN), m_value(std::move(value)), m_rettype(rettype) { } + ASTReturn(PycRef _value, RetType _rettype = RETURN) + : ASTNode(NODE_RETURN), m_value(std::move(_value)), m_rettype(_rettype) { } PycRef value() const { return m_value; } RetType rettype() const { return m_rettype; } @@ -223,8 +223,8 @@ class ASTReturn : public ASTNode { class ASTName : public ASTNode { public: - ASTName(PycRef name) - : ASTNode(NODE_NAME), m_name(std::move(name)) { } + ASTName(PycRef _name) + : ASTNode(NODE_NAME), m_name(std::move(_name)) { } PycRef name() const { return m_name; } @@ -235,8 +235,8 @@ class ASTName : public ASTNode { class ASTDelete : public ASTNode { public: - ASTDelete(PycRef value) - : ASTNode(NODE_DELETE), m_value(std::move(value)) { } + ASTDelete(PycRef _value) + : ASTNode(NODE_DELETE), m_value(std::move(_value)) { } PycRef value() const { return m_value; } @@ -249,8 +249,8 @@ class ASTFunction : public ASTNode { public: typedef std::list> defarg_t; - ASTFunction(PycRef code, defarg_t defArgs, defarg_t kwDefArgs) - : ASTNode(NODE_FUNCTION), m_code(std::move(code)), + ASTFunction(PycRef _code, defarg_t defArgs, defarg_t kwDefArgs) + : ASTNode(NODE_FUNCTION), m_code(std::move(_code)), m_defargs(std::move(defArgs)), m_kwdefargs(std::move(kwDefArgs)) { } PycRef code() const { return m_code; } @@ -266,9 +266,9 @@ class ASTFunction : public ASTNode { class ASTClass : public ASTNode { public: - ASTClass(PycRef code, PycRef bases, PycRef name) - : ASTNode(NODE_CLASS), m_code(std::move(code)), m_bases(std::move(bases)), - m_name(std::move(name)) { } + ASTClass(PycRef _code, PycRef _bases, PycRef _name) + : ASTNode(NODE_CLASS), m_code(std::move(_code)), m_bases(std::move(_bases)), + m_name(std::move(_name)) { } PycRef code() const { return m_code; } PycRef bases() const { return m_bases; } @@ -286,9 +286,9 @@ class ASTCall : public ASTNode { typedef std::list> pparam_t; typedef std::list, PycRef>> kwparam_t; - ASTCall(PycRef func, pparam_t pparams, kwparam_t kwparams) - : ASTNode(NODE_CALL), m_func(std::move(func)), m_pparams(std::move(pparams)), - m_kwparams(std::move(kwparams)) { } + ASTCall(PycRef _func, pparam_t _pparams, kwparam_t _kwparams) + : ASTNode(NODE_CALL), m_func(std::move(_func)), m_pparams(std::move(_pparams)), + m_kwparams(std::move(_kwparams)) { } PycRef func() const { return m_func; } const pparam_t& pparams() const { return m_pparams; } @@ -299,8 +299,8 @@ class ASTCall : public ASTNode { bool hasVar() const { return m_var != nullptr; } bool hasKW() const { return m_kw != nullptr; } - void setVar(PycRef var) { m_var = std::move(var); } - void setKW(PycRef kw) { m_kw = std::move(kw); } + void setVar(PycRef _var) { m_var = std::move(_var); } + void setKW(PycRef _kw) { m_kw = std::move(_kw); } private: PycRef m_func; @@ -315,8 +315,8 @@ class ASTImport : public ASTNode { public: typedef std::list> list_t; - ASTImport(PycRef name, PycRef fromlist) - : ASTNode(NODE_IMPORT), m_name(std::move(name)), m_fromlist(std::move(fromlist)) { } + ASTImport(PycRef _name, PycRef _fromlist) + : ASTNode(NODE_IMPORT), m_name(std::move(_name)), m_fromlist(std::move(_fromlist)) { } PycRef name() const { return m_name; } list_t stores() const { return m_stores; } @@ -336,8 +336,8 @@ class ASTTuple : public ASTNode { public: typedef std::vector> value_t; - ASTTuple(value_t values) - : ASTNode(NODE_TUPLE), m_values(std::move(values)), + ASTTuple(value_t _values) + : ASTNode(NODE_TUPLE), m_values(std::move(_values)), m_requireParens(true) { } const value_t& values() const { return m_values; } @@ -356,8 +356,8 @@ class ASTList : public ASTNode { public: typedef std::list> value_t; - ASTList(value_t values) - : ASTNode(NODE_LIST), m_values(std::move(values)) { } + ASTList(value_t _values) + : ASTNode(NODE_LIST), m_values(std::move(_values)) { } const value_t& values() const { return m_values; } @@ -369,8 +369,8 @@ class ASTSet : public ASTNode { public: typedef std::deque> value_t; - ASTSet(value_t values) - : ASTNode(NODE_SET), m_values(std::move(values)) { } + ASTSet(value_t _values) + : ASTNode(NODE_SET), m_values(std::move(_values)) { } const value_t& values() const { return m_values; } @@ -416,8 +416,8 @@ class ASTConstMap : public ASTNode { public: typedef std::vector> values_t; - ASTConstMap(PycRef keys, const values_t& values) - : ASTNode(NODE_CONST_MAP), m_keys(std::move(keys)), m_values(std::move(values)) { } + ASTConstMap(PycRef _keys, const values_t& _values) + : ASTNode(NODE_CONST_MAP), m_keys(std::move(_keys)), m_values(std::move(_values)) { } const PycRef& keys() const { return m_keys; } const values_t& values() const { return m_values; } @@ -430,8 +430,8 @@ class ASTConstMap : public ASTNode { class ASTSubscr : public ASTNode { public: - ASTSubscr(PycRef name, PycRef key) - : ASTNode(NODE_SUBSCR), m_name(std::move(name)), m_key(std::move(key)) { } + ASTSubscr(PycRef _name, PycRef _key) + : ASTNode(NODE_SUBSCR), m_name(std::move(_name)), m_key(std::move(_key)) { } PycRef name() const { return m_name; } PycRef key() const { return m_key; } @@ -446,8 +446,8 @@ class ASTPrint : public ASTNode { public: typedef std::list> values_t; - ASTPrint(PycRef value, PycRef stream = {}) - : ASTNode(NODE_PRINT), m_stream(std::move(stream)), m_eol() + ASTPrint(PycRef value, PycRef _stream = {}) + : ASTNode(NODE_PRINT), m_stream(std::move(_stream)), m_eol() { if (value != nullptr) m_values.emplace_back(std::move(value)); @@ -460,7 +460,7 @@ class ASTPrint : public ASTNode { bool eol() const { return m_eol; } void add(PycRef value) { m_values.emplace_back(std::move(value)); } - void setEol(bool eol) { m_eol = eol; } + void setEol(bool _eol) { m_eol = _eol; } private: values_t m_values; @@ -471,8 +471,8 @@ class ASTPrint : public ASTNode { class ASTConvert : public ASTNode { public: - ASTConvert(PycRef name) - : ASTNode(NODE_CONVERT), m_name(std::move(name)) { } + ASTConvert(PycRef _name) + : ASTNode(NODE_CONVERT), m_name(std::move(_name)) { } PycRef name() const { return m_name; } @@ -487,7 +487,7 @@ class ASTKeyword : public ASTNode { KW_PASS, KW_BREAK, KW_CONTINUE }; - ASTKeyword(Word key) : ASTNode(NODE_KEYWORD), m_key(key) { } + ASTKeyword(Word _key) : ASTNode(NODE_KEYWORD), m_key(_key) { } Word key() const { return m_key; } const char* word_str() const; @@ -501,7 +501,7 @@ class ASTRaise : public ASTNode { public: typedef std::list> param_t; - ASTRaise(param_t params) : ASTNode(NODE_RAISE), m_params(std::move(params)) { } + ASTRaise(param_t _params) : ASTNode(NODE_RAISE), m_params(std::move(_params)) { } const param_t& params() const { return m_params; } @@ -537,8 +537,8 @@ class ASTBlock : public ASTNode { BLK_WHILE, BLK_FOR, BLK_WITH, BLK_ASYNCFOR }; - ASTBlock(BlkType blktype, int end = 0, int inited = 0) - : ASTNode(NODE_BLOCK), m_blktype(blktype), m_end(end), m_inited(inited) { } + ASTBlock(BlkType _blktype, int _end = 0, int _inited = 0) + : ASTNode(NODE_BLOCK), m_blktype(_blktype), m_end(_end), m_inited(_inited) { } BlkType blktype() const { return m_blktype; } int end() const { return m_end; } @@ -551,9 +551,9 @@ class ASTBlock : public ASTNode { virtual int inited() const { return m_inited; } virtual void init() { m_inited = 1; } - virtual void init(int init) { m_inited = init; } + virtual void init(int _init) { m_inited = _init; } - void setEnd(int end) { m_end = end; } + void setEnd(int _end) { m_end = _end; } private: BlkType m_blktype; @@ -571,9 +571,9 @@ class ASTCondBlock : public ASTBlock { UNINITED, POPPED, PRE_POPPED }; - ASTCondBlock(ASTBlock::BlkType blktype, int end, PycRef cond, - bool negative = false) - : ASTBlock(blktype, end), m_cond(std::move(cond)), m_negative(negative) { } + ASTCondBlock(ASTBlock::BlkType _blktype, int _end, PycRef _cond, + bool _negative = false) + : ASTBlock(_blktype, _end), m_cond(std::move(_cond)), m_negative(_negative) { } PycRef cond() const { return m_cond; } bool negative() const { return m_negative; } @@ -586,8 +586,8 @@ class ASTCondBlock : public ASTBlock { class ASTIterBlock : public ASTBlock { public: - ASTIterBlock(ASTBlock::BlkType blktype, int start, int end, PycRef iter) - : ASTBlock(blktype, end), m_iter(std::move(iter)), m_idx(), m_comp(), m_start(start) { } + ASTIterBlock(ASTBlock::BlkType _blktype, int _start, int _end, PycRef _iter) + : ASTBlock(_blktype, _end), m_iter(std::move(_iter)), m_idx(), m_comp(), m_start(_start) { } PycRef iter() const { return m_iter; } PycRef index() const { return m_idx; } @@ -609,15 +609,15 @@ class ASTIterBlock : public ASTBlock { class ASTContainerBlock : public ASTBlock { public: - ASTContainerBlock(int finally, int except = 0) - : ASTBlock(ASTBlock::BLK_CONTAINER, 0), m_finally(finally), m_except(except) { } + ASTContainerBlock(int _finally, int _except = 0) + : ASTBlock(ASTBlock::BLK_CONTAINER, 0), m_finally(_finally), m_except(_except) { } bool hasFinally() const { return m_finally != 0; } bool hasExcept() const { return m_except != 0; } int finally() const { return m_finally; } int except() const { return m_except; } - void setExcept(int except) { m_except = except; } + void setExcept(int _except) { m_except = _except; } private: int m_finally; @@ -626,14 +626,14 @@ class ASTContainerBlock : public ASTBlock { class ASTWithBlock : public ASTBlock { public: - ASTWithBlock(int end) - : ASTBlock(ASTBlock::BLK_WITH, end) { } + ASTWithBlock(int _end) + : ASTBlock(ASTBlock::BLK_WITH, _end) { } PycRef expr() const { return m_expr; } PycRef var() const { return m_var; } - void setExpr(PycRef expr) { m_expr = std::move(expr); init(); } - void setVar(PycRef var) { m_var = std::move(var); } + void setExpr(PycRef _expr) { m_expr = std::move(_expr); init(); } + void setVar(PycRef _var) { m_var = std::move(_var); } private: PycRef m_expr; @@ -644,8 +644,8 @@ class ASTComprehension : public ASTNode { public: typedef std::list> generator_t; - ASTComprehension(PycRef result) - : ASTNode(NODE_COMPREHENSION), m_result(std::move(result)) { } + ASTComprehension(PycRef _result) + : ASTNode(NODE_COMPREHENSION), m_result(std::move(_result)) { } PycRef result() const { return m_result; } generator_t generators() const { return m_generators; } @@ -692,12 +692,12 @@ class ASTFormattedValue : public ASTNode { FMTSPEC = 4 }; - ASTFormattedValue(PycRef val, ConversionFlag conversion, - PycRef format_spec) + ASTFormattedValue(PycRef _val, ConversionFlag _conversion, + PycRef _format_spec) : ASTNode(NODE_FORMATTEDVALUE), - m_val(std::move(val)), - m_conversion(conversion), - m_format_spec(std::move(format_spec)) + m_val(std::move(_val)), + m_conversion(_conversion), + m_format_spec(std::move(_format_spec)) { } PycRef val() const { return m_val; } @@ -715,8 +715,8 @@ class ASTJoinedStr : public ASTNode { public: typedef std::list> value_t; - ASTJoinedStr(value_t values) - : ASTNode(NODE_JOINEDSTR), m_values(std::move(values)) { } + ASTJoinedStr(value_t _values) + : ASTNode(NODE_JOINEDSTR), m_values(std::move(_values)) { } const value_t& values() const { return m_values; } @@ -726,8 +726,8 @@ class ASTJoinedStr : public ASTNode { class ASTAnnotatedVar : public ASTNode { public: - ASTAnnotatedVar(PycRef name, PycRef type) - : ASTNode(NODE_ANNOTATED_VAR), m_name(std::move(name)), m_type(std::move(type)) { } + ASTAnnotatedVar(PycRef _name, PycRef _type) + : ASTNode(NODE_ANNOTATED_VAR), m_name(std::move(_name)), m_type(std::move(_type)) { } PycRef name() const noexcept { return m_name; } PycRef annotation() const noexcept { return m_type; } @@ -740,10 +740,10 @@ class ASTAnnotatedVar : public ASTNode { class ASTTernary : public ASTNode { public: - ASTTernary(PycRef if_block, PycRef if_expr, - PycRef else_expr) - : ASTNode(NODE_TERNARY), m_if_block(std::move(if_block)), - m_if_expr(std::move(if_expr)), m_else_expr(std::move(else_expr)) { } + ASTTernary(PycRef _if_block, PycRef _if_expr, + PycRef _else_expr) + : ASTNode(NODE_TERNARY), m_if_block(std::move(_if_block)), + m_if_expr(std::move(_if_expr)), m_else_expr(std::move(_else_expr)) { } PycRef if_block() const noexcept { return m_if_block; } PycRef if_expr() const noexcept { return m_if_expr; } diff --git a/pyc_code.h b/pyc_code.h index 4d6e47cd0..8e26eb254 100644 --- a/pyc_code.h +++ b/pyc_code.h @@ -31,8 +31,8 @@ class PycCode : public PycObject { CO_FUTURE_GENERATOR_STOP = 0x80000, }; - PycCode(int type = TYPE_CODE) - : PycObject(type), m_argCount(), m_posOnlyArgCount(), m_kwOnlyArgCount(), + PycCode(int _type = TYPE_CODE) + : PycObject(_type), m_argCount(), m_posOnlyArgCount(), m_kwOnlyArgCount(), m_numLocals(), m_stackSize(), m_flags(), m_firstLine() { } void load(PycData* stream, PycModule* mod) override; diff --git a/pyc_numeric.h b/pyc_numeric.h index 46ddb98be..252356e74 100644 --- a/pyc_numeric.h +++ b/pyc_numeric.h @@ -8,8 +8,8 @@ class PycInt : public PycObject { public: - PycInt(int value = 0, int type = TYPE_INT) - : PycObject(type), m_value(value) { } + PycInt(int _value = 0, int _type = TYPE_INT) + : PycObject(_type), m_value(_value) { } bool isEqual(PycRef obj) const override { @@ -27,8 +27,8 @@ class PycInt : public PycObject { class PycLong : public PycObject { public: - PycLong(int type = TYPE_LONG) - : PycObject(type), m_size(0) { } + PycLong(int _type = TYPE_LONG) + : PycObject(_type), m_size(0) { } bool isEqual(PycRef obj) const override; @@ -46,8 +46,8 @@ class PycLong : public PycObject { class PycFloat : public PycObject { public: - PycFloat(int type = TYPE_FLOAT) - : PycObject(type) { } + PycFloat(int _type = TYPE_FLOAT) + : PycObject(_type) { } bool isEqual(PycRef obj) const override; @@ -61,8 +61,8 @@ class PycFloat : public PycObject { class PycComplex : public PycFloat { public: - PycComplex(int type = TYPE_COMPLEX) - : PycFloat(type) { } + PycComplex(int _type = TYPE_COMPLEX) + : PycFloat(_type) { } bool isEqual(PycRef obj) const override; @@ -76,8 +76,8 @@ class PycComplex : public PycFloat { class PycCFloat : public PycObject { public: - PycCFloat(int type = TYPE_BINARY_FLOAT) - : PycObject(type), m_value(0.0) { } + PycCFloat(int _type = TYPE_BINARY_FLOAT) + : PycObject(_type), m_value(0.0) { } bool isEqual(PycRef obj) const override { @@ -95,8 +95,8 @@ class PycCFloat : public PycObject { class PycCComplex : public PycCFloat { public: - PycCComplex(int type = TYPE_BINARY_COMPLEX) - : PycCFloat(type), m_imag(0.0) { } + PycCComplex(int _type = TYPE_BINARY_COMPLEX) + : PycCFloat(_type), m_imag(0.0) { } bool isEqual(PycRef obj) const override { diff --git a/pyc_object.h b/pyc_object.h index ade46c784..c80aeb83b 100644 --- a/pyc_object.h +++ b/pyc_object.h @@ -129,7 +129,7 @@ class PycObject { TYPE_SHORT_ASCII_INTERNED = 'Z', // Python 3.4 -> }; - PycObject(int type = TYPE_UNKNOWN) : m_refs(0), m_type(type) { } + PycObject(int _type = TYPE_UNKNOWN) : m_refs(0), m_type(_type) { } virtual ~PycObject() { } int type() const { return m_type; } diff --git a/pyc_sequence.h b/pyc_sequence.h index 64ff66ca5..5624bb957 100644 --- a/pyc_sequence.h +++ b/pyc_sequence.h @@ -7,7 +7,7 @@ class PycSequence : public PycObject { public: - PycSequence(int type) : PycObject(type), m_size(0) { } + PycSequence(int _type) : PycObject(_type), m_size(0) { } int size() const { return m_size; } virtual PycRef get(int idx) const = 0; @@ -20,7 +20,7 @@ class PycSimpleSequence : public PycSequence { public: typedef std::vector> value_t; - PycSimpleSequence(int type) : PycSequence(type) { } + PycSimpleSequence(int _type) : PycSequence(_type) { } bool isEqual(PycRef obj) const override; @@ -36,7 +36,7 @@ class PycSimpleSequence : public PycSequence { class PycTuple : public PycSimpleSequence { public: typedef PycSimpleSequence::value_t value_t; - PycTuple(int type = TYPE_TUPLE) : PycSimpleSequence(type) { } + PycTuple(int _type = TYPE_TUPLE) : PycSimpleSequence(_type) { } void load(class PycData* stream, class PycModule* mod) override; }; @@ -44,13 +44,13 @@ class PycTuple : public PycSimpleSequence { class PycList : public PycSimpleSequence { public: typedef PycSimpleSequence::value_t value_t; - PycList(int type = TYPE_LIST) : PycSimpleSequence(type) { } + PycList(int _type = TYPE_LIST) : PycSimpleSequence(_type) { } }; class PycSet : public PycSimpleSequence { public: typedef PycSimpleSequence::value_t value_t; - PycSet(int type = TYPE_SET) : PycSimpleSequence(type) { } + PycSet(int _type = TYPE_SET) : PycSimpleSequence(_type) { } }; class PycDict : public PycObject { @@ -58,7 +58,7 @@ class PycDict : public PycObject { typedef std::tuple, PycRef> item_t; typedef std::vector value_t; - PycDict(int type = TYPE_DICT) : PycObject(type) { } + PycDict(int _type = TYPE_DICT) : PycObject(_type) { } bool isEqual(PycRef obj) const override; diff --git a/pyc_string.cpp b/pyc_string.cpp index 5dd78065a..4609d3533 100644 --- a/pyc_string.cpp +++ b/pyc_string.cpp @@ -22,18 +22,18 @@ void PycString::load(PycData* stream, PycModule* mod) m_type = str->m_type; m_value = str->m_value; } else { - int length; + int _length; if (type() == TYPE_SHORT_ASCII || type() == TYPE_SHORT_ASCII_INTERNED) - length = stream->getByte(); + _length = stream->getByte(); else - length = stream->get32(); + _length = stream->get32(); - if (length < 0) + if (_length < 0) throw std::bad_alloc(); - m_value.resize(length); - if (length) { - stream->getBuffer(length, &m_value.front()); + m_value.resize(_length); + if (_length) { + stream->getBuffer(_length, &m_value.front()); if (type() == TYPE_ASCII || type() == TYPE_ASCII_INTERNED || type() == TYPE_SHORT_ASCII || type() == TYPE_SHORT_ASCII_INTERNED) { if (!check_ascii(m_value)) diff --git a/pyc_string.h b/pyc_string.h index 43ae2ed7b..5596664c8 100644 --- a/pyc_string.h +++ b/pyc_string.h @@ -8,8 +8,8 @@ class PycString : public PycObject { public: - PycString(int type = TYPE_STRING) - : PycObject(type) { } + PycString(int _type = TYPE_STRING) + : PycObject(_type) { } bool isEqual(PycRef obj) const override; bool isEqual(const std::string& str) const { return m_value == str; }