1
0
Fork 0

Cleanup: remove commented out code

pull/10417/head
Rubidium 2023-01-26 22:50:43 +01:00 committed by rubidium42
parent 5863d78cb4
commit 71b46db8d0
9 changed files with 2 additions and 26 deletions

View File

@ -607,7 +607,6 @@ public:
switch(_token) switch(_token)
{ {
case TK_STRING_LITERAL: { 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))); _fs->AddInstruction(_OP_LOAD, _fs->PushTarget(), _fs->GetConstant(_fs->CreateString(_lex._svalue,_lex._longstr.size()-1)));
Lex(); Lex();
} }
@ -840,7 +839,6 @@ public:
unsigned char flags = (hasattrs?NEW_SLOT_ATTRIBUTES_FLAG:0)|(isstatic?NEW_SLOT_STATIC_FLAG:0); unsigned char flags = (hasattrs?NEW_SLOT_ATTRIBUTES_FLAG:0)|(isstatic?NEW_SLOT_STATIC_FLAG:0);
SQInteger table = _fs->TopTarget(); //<<BECAUSE OF THIS NO COMMON EMIT FUNC IS POSSIBLE SQInteger table = _fs->TopTarget(); //<<BECAUSE OF THIS NO COMMON EMIT FUNC IS POSSIBLE
_fs->AddInstruction(_OP_NEWSLOTA, flags, table, key, val); _fs->AddInstruction(_OP_NEWSLOTA, flags, table, key, val);
//_fs->PopTarget();
} }
if(separator == ',') //hack recognizes a table from the separator if(separator == ',') //hack recognizes a table from the separator
_fs->SetIntructionParam(tpos, 1, nkeys); _fs->SetIntructionParam(tpos, 1, nkeys);
@ -1053,7 +1051,6 @@ public:
if(tonextcondjmp != -1) if(tonextcondjmp != -1)
_fs->SetIntructionParam(tonextcondjmp, 1, _fs->GetCurrentPos() - tonextcondjmp); _fs->SetIntructionParam(tonextcondjmp, 1, _fs->GetCurrentPos() - tonextcondjmp);
if(_token == TK_DEFAULT) { if(_token == TK_DEFAULT) {
// _fs->AddLineInfos(_lex._currentline, _lineinfo);
Lex(); Expect(':'); Lex(); Expect(':');
SQInteger stacksize = _fs->GetStackSize(); SQInteger stacksize = _fs->GetStackSize();
_last_stacksize = _fs->GetStackSize(); _last_stacksize = _fs->GetStackSize();
@ -1167,11 +1164,6 @@ public:
} }
SQTable *enums = _table(_ss(_vm)->_consts); SQTable *enums = _table(_ss(_vm)->_consts);
SQObjectPtr strongid = id; SQObjectPtr strongid = id;
/*SQObjectPtr dummy;
if(enums->Get(strongid,dummy)) {
dummy.Null(); strongid.Null();
Error("enumeration already exists");
}*/
enums->NewSlot(SQObjectPtr(strongid),SQObjectPtr(table)); enums->NewSlot(SQObjectPtr(strongid),SQObjectPtr(table));
strongid.Null(); strongid.Null();
Lex(); Lex();
@ -1318,7 +1310,6 @@ public:
funcstate->AddLineInfos(_lex._prevtoken == '\n'?_lex._lasttokenline:_lex._currentline, _lineinfo, true); funcstate->AddLineInfos(_lex._prevtoken == '\n'?_lex._lasttokenline:_lex._currentline, _lineinfo, true);
funcstate->AddInstruction(_OP_RETURN, -1); funcstate->AddInstruction(_OP_RETURN, -1);
funcstate->SetStackSize(0); funcstate->SetStackSize(0);
//_fs->->_stacksize = _fs->_stacksize;
SQFunctionProto *func = funcstate->BuildProto(); SQFunctionProto *func = funcstate->BuildProto();
#ifdef _DEBUG_DUMP #ifdef _DEBUG_DUMP
funcstate->Dump(func); funcstate->Dump(func);

View File

@ -177,7 +177,6 @@ SQInteger SQLexer::Lex()
else if ( CUR_CHAR == '-' ) { NEXT(); RETURN_TOKEN(TK_NEWSLOT); } 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_SHIFTL); }
else if ( CUR_CHAR == '/' ) { NEXT(); RETURN_TOKEN(TK_ATTR_OPEN); } else if ( CUR_CHAR == '/' ) { NEXT(); RETURN_TOKEN(TK_ATTR_OPEN); }
//else if ( CUR_CHAR == '[' ) { NEXT(); ReadMultilineString(); RETURN_TOKEN(TK_STRING_LITERAL); }
else { RETURN_TOKEN('<') } else { RETURN_TOKEN('<') }
case '>': case '>':
NEXT(); NEXT();

View File

@ -36,7 +36,6 @@ struct SQVM : public CHAINABLE_OBJ
}; };
struct CallInfo{ struct CallInfo{
//CallInfo() { _generator._type = OT_NULL;}
SQInstruction *_ip; SQInstruction *_ip;
SQObjectPtr *_literals; SQObjectPtr *_literals;
SQObjectPtr _closure; SQObjectPtr _closure;

View File

@ -18,7 +18,6 @@
class Blitter_40bppAnim : public Blitter_32bppOptimized { class Blitter_40bppAnim : public Blitter_32bppOptimized {
public: public:
// void *MoveTo(void *video, int x, int y) override;
void SetPixel(void *video, int x, int y, uint8 colour) override; void SetPixel(void *video, int x, int y, uint8 colour) override;
void DrawRect(void *video, int width, int height, 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; 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;

View File

@ -125,12 +125,6 @@ public:
return m_pT == nullptr; 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 */ /** assign pointer w/o incrementing ref count */
inline void Attach(Tcls *pT) inline void Attach(Tcls *pT)
{ {

View File

@ -20,8 +20,6 @@
#include "../../tile_type.h" #include "../../tile_type.h"
#include "../../track_type.h" #include "../../track_type.h"
//#define AYSTAR_DEBUG
/** Return status of #AyStar methods. */ /** Return status of #AyStar methods. */
enum AystarStatus { enum AystarStatus {
AYSTAR_FOUND_END_NODE, ///< An end node was found. AYSTAR_FOUND_END_NODE, ///< An end node was found.

View File

@ -314,7 +314,6 @@ static Vehicle *CountShipProc(Vehicle *v, void *data)
static int32 NPFWaterPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent) static int32 NPFWaterPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent)
{ {
/* TileIndex tile = current->tile; */
int32 cost = 0; int32 cost = 0;
Trackdir trackdir = current->direction; Trackdir trackdir = current->direction;
@ -1114,7 +1113,6 @@ void InitializeNPF()
} }
_npf_aystar.loops_per_tick = 0; _npf_aystar.loops_per_tick = 0;
_npf_aystar.max_path_cost = 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 /* We will limit the number of nodes for now, until we have a better
* solution to really fix performance */ * solution to really fix performance */
_npf_aystar.max_search_nodes = _settings_game.pf.npf.npf_max_search_nodes; _npf_aystar.max_search_nodes = _settings_game.pf.npf.npf_max_search_nodes;

View File

@ -618,7 +618,6 @@ size_t Utf8Decode(WChar *c, const char *s)
} }
} }
/* Debug(misc, 1, "[utf8] invalid UTF-8 sequence"); */
*c = '?'; *c = '?';
return 1; return 1;
} }
@ -654,7 +653,6 @@ inline size_t Utf8Encode(T buf, WChar c)
return 4; return 4;
} }
/* Debug(misc, 1, "[utf8] can't UTF-8 encode value 0x{:X}", c); */
*buf = '?'; *buf = '?';
return 1; return 1;
} }

View File

@ -262,8 +262,8 @@ void InitializeWindowViewport(Window *w, int x, int y,
vp->overlay = nullptr; vp->overlay = nullptr;
w->viewport = vp; w->viewport = vp;
vp->virtual_left = 0; // pt.x; vp->virtual_left = 0;
vp->virtual_top = 0; // pt.y; vp->virtual_top = 0;
} }
static Point _vp_move_offs; static Point _vp_move_offs;