From: cuz Date: Sat, 26 May 2001 10:04:15 +0000 (+0000) Subject: cleanup X-Git-Tag: V2.12.0~2806 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=916a0879d53d72b28638f4849b384e6567b6d807;p=cc65 cleanup git-svn-id: svn://svn.cc65.org/cc65/trunk@760 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/codeent.c b/src/cc65/codeent.c index 7b2e7dbbc..ef3f50728 100644 --- a/src/cc65/codeent.c +++ b/src/cc65/codeent.c @@ -239,9 +239,6 @@ int CodeEntriesAreEqual (const CodeEntry* E1, const CodeEntry* E2) void AttachCodeLabel (CodeEntry* E, CodeLabel* L) /* Attach the label to the entry */ { - /* Mark the label as defined */ - L->Flags |= LF_DEF; - /* Add it to the entries label list */ CollAppend (&E->Labels, L); diff --git a/src/cc65/codelab.c b/src/cc65/codelab.c index 89b45b0e6..483891aeb 100644 --- a/src/cc65/codelab.c +++ b/src/cc65/codelab.c @@ -59,7 +59,6 @@ CodeLabel* NewCodeLabel (const char* Name, unsigned Hash) L->Next = 0; L->Name = xstrdup (Name); L->Hash = Hash; - L->Flags = 0; L->Owner = 0; InitCollection (&L->JumpFrom); diff --git a/src/cc65/codelab.h b/src/cc65/codelab.h index bd24fc5d5..4fefebb68 100644 --- a/src/cc65/codelab.h +++ b/src/cc65/codelab.h @@ -61,16 +61,12 @@ struct CodeEntry; -/* Label flags, bitmapped */ -#define LF_DEF 0x0001U /* Label was defined */ - /* Label structure */ typedef struct CodeLabel CodeLabel; struct CodeLabel { CodeLabel* Next; /* Next in hash list */ char* Name; /* Label name */ - unsigned short Hash; /* Hash over the name */ - unsigned short Flags; /* Flag flags */ + unsigned Hash; /* Hash over the name */ struct CodeEntry* Owner; /* Owner entry */ Collection JumpFrom; /* Entries that jump here */ }; diff --git a/src/cc65/codeseg.c b/src/cc65/codeseg.c index adf023971..ba89ccdda 100644 --- a/src/cc65/codeseg.c +++ b/src/cc65/codeseg.c @@ -68,7 +68,6 @@ static void MoveLabelsToPool (CodeSeg* S, CodeEntry* E) unsigned LabelCount = GetCodeLabelCount (E); while (LabelCount--) { CodeLabel* L = GetCodeLabel (E, LabelCount); - L->Flags &= ~LF_DEF; L->Owner = 0; CollAppend (&S->Labels, L); } diff --git a/src/cc65/opcodes.c b/src/cc65/opcodes.c index 12b779ef8..0467b0352 100644 --- a/src/cc65/opcodes.c +++ b/src/cc65/opcodes.c @@ -197,7 +197,7 @@ unsigned GetInsnSize (opc_t OPC, am_t AM) case AM_ZPX_IND: return 2; case AM_ZP_INDY: return 2; case AM_ZP_IND: return 2; - default: + default: Internal ("Invalid addressing mode"); return 0; } @@ -234,7 +234,7 @@ opc_t GetInverseBranch (opc_t OPC) case OPC_BMI: return OPC_BPL; case OPC_BNE: return OPC_BEQ; case OPC_BPL: return OPC_BMI; - case OPC_BVC: return OPC_BVS; + case OPC_BVC: return OPC_BVS; case OPC_BVS: return OPC_BVC; case OPC_JCC: return OPC_JCS; case OPC_JCS: return OPC_JCC; @@ -244,7 +244,7 @@ opc_t GetInverseBranch (opc_t OPC) case OPC_JPL: return OPC_JMI; case OPC_JVC: return OPC_JVS; case OPC_JVS: return OPC_JVC; - default: + default: Internal ("GetInverseBranch: Invalid opcode: %d", OPC); return 0; } @@ -276,8 +276,8 @@ opc_t MakeShortBranch (opc_t OPC) case OPC_JVS: return OPC_BVS; case OPC_BRA: case OPC_JMP: return (CPU == CPU_65C02)? OPC_BRA : OPC_JMP; - default: - Internal ("GetShortBranch: Invalid opcode: %d", OPC); + default: + Internal ("MakeShortBranch: Invalid opcode: %d", OPC); return 0; } } @@ -308,8 +308,8 @@ opc_t MakeLongBranch (opc_t OPC) case OPC_JVS: return OPC_JVS; case OPC_BRA: case OPC_JMP: return OPC_JMP; - default: - Internal ("GetShortBranch: Invalid opcode: %d", OPC); + default: + Internal ("MakeLongBranch: Invalid opcode: %d", OPC); return 0; } } @@ -336,7 +336,7 @@ bc_t GetBranchCond (opc_t OPC) case OPC_JPL: return BC_PL; case OPC_JVC: return BC_VC; case OPC_JVS: return BC_VS; - default: + default: Internal ("GetBranchCond: Invalid opcode: %d", OPC); return 0; } @@ -356,7 +356,7 @@ bc_t GetInverseCond (bc_t BC) case BC_PL: return BC_MI; case BC_VC: return BC_VS; case BC_VS: return BC_VC; - default: + default: Internal ("GetInverseCond: Invalid condition: %d", BC); return 0; } @@ -364,43 +364,3 @@ bc_t GetInverseCond (bc_t BC) -opc_t GetLongBranch (bc_t BC) -/* Return a long branch for the given branch condition */ -{ - switch (BC) { - case BC_CC: return OPC_JCC; - case BC_CS: return OPC_JCS; - case BC_EQ: return OPC_JEQ; - case BC_MI: return OPC_JMI; - case BC_NE: return OPC_JNE; - case BC_PL: return OPC_JPL; - case BC_VC: return OPC_JVC; - case BC_VS: return OPC_JVS; - default: - Internal ("GetLongBranch: Invalid condition: %d", BC); - return 0; - } -} - - - -opc_t GetShortBranch (bc_t BC) -/* Return a short branch for the given branch condition */ -{ - switch (BC) { - case BC_CC: return OPC_BCC; - case BC_CS: return OPC_BCS; - case BC_EQ: return OPC_BEQ; - case BC_MI: return OPC_BMI; - case BC_NE: return OPC_BNE; - case BC_PL: return OPC_BPL; - case BC_VC: return OPC_BVC; - case BC_VS: return OPC_BVS; - default: - Internal ("GetShortBranch: Invalid condition: %d", BC); - return 0; - } -} - - - diff --git a/src/cc65/opcodes.h b/src/cc65/opcodes.h index 41c117dce..95c48bd3f 100644 --- a/src/cc65/opcodes.h +++ b/src/cc65/opcodes.h @@ -151,7 +151,6 @@ typedef enum { BC_MI, BC_NE, BC_PL, - BC_SR, BC_VC, BC_VS } bc_t; @@ -244,12 +243,6 @@ bc_t GetBranchCond (opc_t OPC); bc_t GetInverseCond (bc_t BC); /* Return the inverse condition of the given one */ -opc_t GetLongBranch (bc_t BC); -/* Return a long branch for the given branch condition */ - -opc_t GetShortBranch (bc_t BC); -/* Return a short branch for the given branch condition */ - /* End of opcodes.h */ diff --git a/src/cc65/stmt.c b/src/cc65/stmt.c index 54934cd19..1cb03576a 100644 --- a/src/cc65/stmt.c +++ b/src/cc65/stmt.c @@ -625,7 +625,7 @@ static void ForStatement (void) /* Label for the test expressions */ g_defcodelabel (TestLabel); - /* Parse the text expression */ + /* Parse the test expression */ if (CurTok.Tok != TOK_SEMI) { boolexpr (&lval2); g_truejump (CF_NONE, lstat);