From 71b46db8d099c5f6d632a9d5fed331ca26fc8089 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Thu, 26 Jan 2023 22:50:43 +0100 Subject: [PATCH] Cleanup: remove commented out code --- src/3rdparty/squirrel/squirrel/sqcompiler.cpp | 9 --------- src/3rdparty/squirrel/squirrel/sqlexer.cpp | 1 - src/3rdparty/squirrel/squirrel/sqvm.h | 1 - src/blitter/40bpp_anim.hpp | 1 - src/misc/countedptr.hpp | 6 ------ src/pathfinder/npf/aystar.h | 2 -- src/pathfinder/npf/npf.cpp | 2 -- src/string.cpp | 2 -- src/viewport.cpp | 4 ++-- 9 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp index 3af111a28a..9ba1597120 100644 --- a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp +++ b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp @@ -607,7 +607,6 @@ public: switch(_token) { case TK_STRING_LITERAL: { - //SQObjectPtr id(SQString::Create(_ss(_vm), _lex._svalue,_lex._longstr.size()-1)); _fs->AddInstruction(_OP_LOAD, _fs->PushTarget(), _fs->GetConstant(_fs->CreateString(_lex._svalue,_lex._longstr.size()-1))); Lex(); } @@ -840,7 +839,6 @@ public: unsigned char flags = (hasattrs?NEW_SLOT_ATTRIBUTES_FLAG:0)|(isstatic?NEW_SLOT_STATIC_FLAG:0); SQInteger table = _fs->TopTarget(); //<AddInstruction(_OP_NEWSLOTA, flags, table, key, val); - //_fs->PopTarget(); } if(separator == ',') //hack recognizes a table from the separator _fs->SetIntructionParam(tpos, 1, nkeys); @@ -1053,7 +1051,6 @@ public: if(tonextcondjmp != -1) _fs->SetIntructionParam(tonextcondjmp, 1, _fs->GetCurrentPos() - tonextcondjmp); if(_token == TK_DEFAULT) { - // _fs->AddLineInfos(_lex._currentline, _lineinfo); Lex(); Expect(':'); SQInteger stacksize = _fs->GetStackSize(); _last_stacksize = _fs->GetStackSize(); @@ -1167,11 +1164,6 @@ public: } SQTable *enums = _table(_ss(_vm)->_consts); SQObjectPtr strongid = id; - /*SQObjectPtr dummy; - if(enums->Get(strongid,dummy)) { - dummy.Null(); strongid.Null(); - Error("enumeration already exists"); - }*/ enums->NewSlot(SQObjectPtr(strongid),SQObjectPtr(table)); strongid.Null(); Lex(); @@ -1318,7 +1310,6 @@ public: funcstate->AddLineInfos(_lex._prevtoken == '\n'?_lex._lasttokenline:_lex._currentline, _lineinfo, true); funcstate->AddInstruction(_OP_RETURN, -1); funcstate->SetStackSize(0); - //_fs->->_stacksize = _fs->_stacksize; SQFunctionProto *func = funcstate->BuildProto(); #ifdef _DEBUG_DUMP funcstate->Dump(func); diff --git a/src/3rdparty/squirrel/squirrel/sqlexer.cpp b/src/3rdparty/squirrel/squirrel/sqlexer.cpp index a4bac82279..c4fb852991 100644 --- a/src/3rdparty/squirrel/squirrel/sqlexer.cpp +++ b/src/3rdparty/squirrel/squirrel/sqlexer.cpp @@ -177,7 +177,6 @@ SQInteger SQLexer::Lex() else if ( CUR_CHAR == '-' ) { NEXT(); RETURN_TOKEN(TK_NEWSLOT); } else if ( CUR_CHAR == '<' ) { NEXT(); RETURN_TOKEN(TK_SHIFTL); } else if ( CUR_CHAR == '/' ) { NEXT(); RETURN_TOKEN(TK_ATTR_OPEN); } - //else if ( CUR_CHAR == '[' ) { NEXT(); ReadMultilineString(); RETURN_TOKEN(TK_STRING_LITERAL); } else { RETURN_TOKEN('<') } case '>': NEXT(); diff --git a/src/3rdparty/squirrel/squirrel/sqvm.h b/src/3rdparty/squirrel/squirrel/sqvm.h index dbfe2309c7..6389058923 100644 --- a/src/3rdparty/squirrel/squirrel/sqvm.h +++ b/src/3rdparty/squirrel/squirrel/sqvm.h @@ -36,7 +36,6 @@ struct SQVM : public CHAINABLE_OBJ }; struct CallInfo{ - //CallInfo() { _generator._type = OT_NULL;} SQInstruction *_ip; SQObjectPtr *_literals; SQObjectPtr _closure; diff --git a/src/blitter/40bpp_anim.hpp b/src/blitter/40bpp_anim.hpp index 6b7a6d0dc6..c530889f49 100644 --- a/src/blitter/40bpp_anim.hpp +++ b/src/blitter/40bpp_anim.hpp @@ -18,7 +18,6 @@ class Blitter_40bppAnim : public Blitter_32bppOptimized { public: - // void *MoveTo(void *video, int x, int y) override; void SetPixel(void *video, int x, int y, uint8 colour) override; void DrawRect(void *video, int width, int height, uint8 colour) override; void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override; diff --git a/src/misc/countedptr.hpp b/src/misc/countedptr.hpp index 8ced8d48e1..ee0edea67c 100644 --- a/src/misc/countedptr.hpp +++ b/src/misc/countedptr.hpp @@ -125,12 +125,6 @@ public: return m_pT == nullptr; } - /** another way how to test for nullptr value */ - //inline bool operator == (const CCountedPtr &sp) const {return m_pT == sp.m_pT;} - - /** yet another way how to test for nullptr value */ - //inline bool operator != (const CCountedPtr &sp) const {return m_pT != sp.m_pT;} - /** assign pointer w/o incrementing ref count */ inline void Attach(Tcls *pT) { diff --git a/src/pathfinder/npf/aystar.h b/src/pathfinder/npf/aystar.h index cbbe8a4157..aa57037d16 100644 --- a/src/pathfinder/npf/aystar.h +++ b/src/pathfinder/npf/aystar.h @@ -20,8 +20,6 @@ #include "../../tile_type.h" #include "../../track_type.h" -//#define AYSTAR_DEBUG - /** Return status of #AyStar methods. */ enum AystarStatus { AYSTAR_FOUND_END_NODE, ///< An end node was found. diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp index 25681507c7..c880124dd9 100644 --- a/src/pathfinder/npf/npf.cpp +++ b/src/pathfinder/npf/npf.cpp @@ -314,7 +314,6 @@ static Vehicle *CountShipProc(Vehicle *v, void *data) static int32 NPFWaterPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent) { - /* TileIndex tile = current->tile; */ int32 cost = 0; Trackdir trackdir = current->direction; @@ -1114,7 +1113,6 @@ void InitializeNPF() } _npf_aystar.loops_per_tick = 0; _npf_aystar.max_path_cost = 0; - //_npf_aystar.max_search_nodes = 0; /* We will limit the number of nodes for now, until we have a better * solution to really fix performance */ _npf_aystar.max_search_nodes = _settings_game.pf.npf.npf_max_search_nodes; diff --git a/src/string.cpp b/src/string.cpp index 9bdbafa46a..0886f2805a 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -618,7 +618,6 @@ size_t Utf8Decode(WChar *c, const char *s) } } - /* Debug(misc, 1, "[utf8] invalid UTF-8 sequence"); */ *c = '?'; return 1; } @@ -654,7 +653,6 @@ inline size_t Utf8Encode(T buf, WChar c) return 4; } - /* Debug(misc, 1, "[utf8] can't UTF-8 encode value 0x{:X}", c); */ *buf = '?'; return 1; } diff --git a/src/viewport.cpp b/src/viewport.cpp index 5310a02dc5..c52449f5e1 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -262,8 +262,8 @@ void InitializeWindowViewport(Window *w, int x, int y, vp->overlay = nullptr; w->viewport = vp; - vp->virtual_left = 0; // pt.x; - vp->virtual_top = 0; // pt.y; + vp->virtual_left = 0; + vp->virtual_top = 0; } static Point _vp_move_offs;