diff --git a/ASTNode.h b/ASTNode.h index 30081940..22b90e1d 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 8e26eb25..4d6e47cd 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 252356e7..46ddb98b 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 c80aeb83..ade46c78 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 5624bb95..64ff66ca 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 4609d353..5dd78065 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 5596664c..43ae2ed7 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; }