From 2aad72af90e9cc6b4bfc6c444233233433589395 Mon Sep 17 00:00:00 2001 From: acqn Date: Mon, 15 Feb 2021 18:37:01 +0800 Subject: [PATCH] Removed trailing whitespaces. --- src/cc65/assignment.c | 2 +- src/cc65/codeopt.c | 2 +- src/cc65/codeoptutil.c | 10 +++++----- src/cc65/coptind.c | 7 ++----- src/cc65/coptptrload.h | 2 +- src/cc65/declare.c | 4 ++-- src/cc65/exprdesc.h | 6 +++--- src/cc65/hexval.h | 2 +- src/cc65/ident.c | 2 +- src/cc65/lineinfo.h | 4 ++-- src/cc65/loop.c | 2 +- src/cc65/pragma.c | 2 +- src/cc65/reginfo.h | 2 +- src/cc65/scanstrbuf.c | 2 +- src/cc65/shiftexpr.c | 2 +- src/cc65/symtab.c | 9 ++++----- src/cc65/testexpr.c | 2 +- src/cc65/typecmp.c | 2 +- 18 files changed, 30 insertions(+), 34 deletions(-) diff --git a/src/cc65/assignment.c b/src/cc65/assignment.c index 09a10a642..737d059a0 100644 --- a/src/cc65/assignment.c +++ b/src/cc65/assignment.c @@ -169,7 +169,7 @@ void Assignment (ExprDesc* Expr) /* cc65 does not have full support for handling structs or unions. Since ** assigning structs is one of the more useful operations from this family, ** allow it here. - ** Note: IsClassStruct() is also true for union types. + ** Note: IsClassStruct() is also true for union types. */ if (IsClassStruct (ltype)) { /* Copy the struct or union by value */ diff --git a/src/cc65/codeopt.c b/src/cc65/codeopt.c index 3c10183e4..29fa79d26 100644 --- a/src/cc65/codeopt.c +++ b/src/cc65/codeopt.c @@ -380,7 +380,7 @@ void ListOptSteps (FILE* F) /* List all optimization steps */ { unsigned I; - + fprintf (F, "any\n"); for (I = 0; I < OPTFUNC_COUNT; ++I) { if (OptFuncs[I]->Func != 0) { diff --git a/src/cc65/codeoptutil.c b/src/cc65/codeoptutil.c index 375fdf541..140420e97 100644 --- a/src/cc65/codeoptutil.c +++ b/src/cc65/codeoptutil.c @@ -678,7 +678,7 @@ void SetDontRemoveEntryFlag (LoadRegInfo* LRI) if (LRI->Flags & LI_DONT_REMOVE) { if (LRI->LoadEntry != 0) { LRI->LoadEntry->Flags |= CEF_DONT_REMOVE; - + /* If the load requires Y, then Y shouldn't be removed either */ if (LRI->LoadYEntry != 0) { LRI->LoadYEntry->Flags |= CEF_DONT_REMOVE; @@ -2562,7 +2562,7 @@ int BackupArgAfter (CodeSeg* S, BackupInfo* B, int Idx, const CodeEntry* E, Coll static int LoadAAt (CodeSeg* S, int Idx, const LoadRegInfo* LRI, Collection* Indices, int After) /* Reload into A the same arg according to LoadRegInfo before or after Idx -** depending on the After param. +** depending on the After param. */ { CodeEntry* E; @@ -2582,7 +2582,7 @@ static int LoadAAt (CodeSeg* S, int Idx, const LoadRegInfo* LRI, Collection* Ind CHECK (E != 0); O = CS_GetEntry (S, OldIdx); - + /* We only recognize opc with an arg for now, as well as a special case for ldaxysp */ if ((E->OPC != OP65_JSR || strcmp (E->Arg, "ldaxysp") == 0) && E->AM != AM65_BRA && E->AM != AM65_IMP) { @@ -2645,7 +2645,7 @@ static int LoadAAt (CodeSeg* S, int Idx, const LoadRegInfo* LRI, Collection* Ind static int LoadXAt (CodeSeg* S, int Idx, const LoadRegInfo* LRI, Collection* Indices, int After) /* Reload into X the same arg according to LoadRegInfo before or after Idx -** depending on the After param. +** depending on the After param. */ { CodeEntry* E; @@ -2744,7 +2744,7 @@ static int LoadXAt (CodeSeg* S, int Idx, const LoadRegInfo* LRI, Collection* Ind static int LoadYAt (CodeSeg* S, int Idx, const LoadRegInfo* LRI, Collection* Indices, int After) /* Reload into Y the same arg according to LoadRegInfo before or after Idx -** depending on the After param. +** depending on the After param. */ { CodeEntry* E; diff --git a/src/cc65/coptind.c b/src/cc65/coptind.c index f3e17fc87..a080cfb20 100644 --- a/src/cc65/coptind.c +++ b/src/cc65/coptind.c @@ -990,7 +990,7 @@ unsigned OptTransfers4 (CodeSeg* S) ** isn't used later, and we have an address mode match, we can ** replace the transfer by a load and remove the initial load. */ - if ((GetRegInfo (S, I, LoadEntry->Chg & REG_ALL) & + if ((GetRegInfo (S, I, LoadEntry->Chg & REG_ALL) & LoadEntry->Chg & REG_ALL) == 0 && (LoadEntry->AM == AM65_ABS || LoadEntry->AM == AM65_ZP || @@ -1252,7 +1252,7 @@ unsigned OptPushPop2 (CodeSeg* S) /* Go into searching mode again */ State = Searching; } - } else if ((E->Info & OF_BRA) == 0 && + } else if ((E->Info & OF_BRA) == 0 && (E->Info & OF_STORE) == 0 && E->OPC != OP65_NOP && E->OPC != OP65_TSX) { @@ -1500,14 +1500,11 @@ unsigned OptShiftBack (CodeSeg* S) (N->OPC == OP65_LSR || N->OPC == OP65_ROR) && !CE_HasLabel (N)) { - CheckStates = PSTATE_ZN; - if (N->OPC == OP65_LSR && !PStatesAreClear (E->RI->Out.PFlags, PSTATE_C)) { CheckStates |= REG_A; } - if ((GetRegInfo (S, I+2, CheckStates) & CheckStates) == 0) { /* Remove the shifts */ diff --git a/src/cc65/coptptrload.h b/src/cc65/coptptrload.h index 84d7cc19f..d4e0e2ed4 100644 --- a/src/cc65/coptptrload.h +++ b/src/cc65/coptptrload.h @@ -233,7 +233,7 @@ unsigned OptPtrLoad11 (CodeSeg* S); */ unsigned OptPtrLoad12 (CodeSeg* S); -/* Search for the sequence: +/* Search for the sequence: ** ** lda regbank+n ** ldx regbank+n+1 diff --git a/src/cc65/declare.c b/src/cc65/declare.c index 08739f333..d952d1049 100644 --- a/src/cc65/declare.c +++ b/src/cc65/declare.c @@ -1522,7 +1522,7 @@ static Type* ParamTypeCvt (Type* T) } else if (IsTypeFunc (T)) { Tmp = PointerTo (T); } - + if (Tmp != 0) { /* Do several fixes on qualifiers */ FixQualifiers (Tmp); @@ -1786,7 +1786,7 @@ static FuncDesc* ParseFuncDecl (void) ** won't always get to know the parameter sizes here and may do that later. */ F->Flags |= FD_INCOMPLETE_PARAM; - + /* Leave the lexical level remembering the symbol tables */ RememberFunctionLevel (F); diff --git a/src/cc65/exprdesc.h b/src/cc65/exprdesc.h index 810d68965..e1bf3117f 100644 --- a/src/cc65/exprdesc.h +++ b/src/cc65/exprdesc.h @@ -73,7 +73,7 @@ enum { ** - ref-load doesn't change the rval/lval category of the expression, ** while rval-load converts it to an rvalue if it wasn't. ** - In practice, ref-load is unimplemented, and can be simulated with - ** adding E_ADDRESS_OF temporaily through LoadExpr + FinalizeLoad, + ** adding E_ADDRESS_OF temporaily through LoadExpr + FinalizeLoad, ** whilst val-load is done with LoadExpr + FinalizeRValLoad. ** ** E_LOC_NONE -- ref-load -> + E_LOADED (int rvalue) @@ -142,7 +142,7 @@ enum { ** than it are usually consided "side-effects" in this regard. ** - The compiler front end cannot know things determined by the linker, ** such as the actual address of an object with static storage. What it - ** can know is categorized as "compiler-known" here. + ** can know is categorized as "compiler-known" here. ** - The concept "immutable" here means that once something is determined ** (not necessarily by the compiler), it will never change. This is not ** the same meaning as the "constant" word in the C standard. @@ -299,7 +299,7 @@ INLINE int ED_IsLocExpr (const ExprDesc* Expr) #if defined(HAVE_INLINE) INLINE int ED_IsLocLiteral (const ExprDesc* Expr) /* Return true if the expression is a string from the literal pool */ -{ +{ return (Expr->Flags & E_MASK_LOC) == E_LOC_LITERAL; } #else diff --git a/src/cc65/hexval.h b/src/cc65/hexval.h index 0361ee0cf..68ea5e40f 100644 --- a/src/cc65/hexval.h +++ b/src/cc65/hexval.h @@ -45,7 +45,7 @@ unsigned HexVal (int C); -/* Convert a hex digit into a value. The function will emit an error for +/* Convert a hex digit into a value. The function will emit an error for ** invalid hex digits. */ diff --git a/src/cc65/ident.c b/src/cc65/ident.c index 7748095c7..dc59c4868 100644 --- a/src/cc65/ident.c +++ b/src/cc65/ident.c @@ -35,7 +35,7 @@ /* common */ #include "chartype.h" - + /* cc65 */ #include "ident.h" diff --git a/src/cc65/lineinfo.h b/src/cc65/lineinfo.h index 8dbe06846..f365b4f01 100644 --- a/src/cc65/lineinfo.h +++ b/src/cc65/lineinfo.h @@ -37,7 +37,7 @@ #define LINEINFO_H - + /* common */ #include "strbuf.h" @@ -50,7 +50,7 @@ /* Input file structure */ -struct IFile; +struct IFile; diff --git a/src/cc65/loop.c b/src/cc65/loop.c index c15c37a79..f6c53ddc4 100644 --- a/src/cc65/loop.c +++ b/src/cc65/loop.c @@ -39,7 +39,7 @@ /* cc65 */ #include "error.h" -#include "loop.h" +#include "loop.h" #include "stackptr.h" diff --git a/src/cc65/pragma.c b/src/cc65/pragma.c index 1ea86545d..2dd923cf1 100644 --- a/src/cc65/pragma.c +++ b/src/cc65/pragma.c @@ -460,7 +460,7 @@ static void SegNamePragma (StrBuf* B, segment_t Seg) Warning ("Invalid address size for segment!"); } } - + /* Set the new name and optionally address size */ if (Push) { PushSegName (Seg, Name); diff --git a/src/cc65/reginfo.h b/src/cc65/reginfo.h index 28b948e04..2066ab505 100644 --- a/src/cc65/reginfo.h +++ b/src/cc65/reginfo.h @@ -102,7 +102,7 @@ #define ZNREG_A REG_A #define ZNREG_X REG_X #define ZNREG_Y REG_Y -#define ZNREG_TMP1 REG_TMP1 +#define ZNREG_TMP1 REG_TMP1 #define ZNREG_PTR1_LO REG_PTR1_LO #define ZNREG_PTR1_HI REG_PTR1_HI #define ZNREG_PTR2_LO REG_PTR2_LO diff --git a/src/cc65/scanstrbuf.c b/src/cc65/scanstrbuf.c index bbee569d2..2e3be8854 100644 --- a/src/cc65/scanstrbuf.c +++ b/src/cc65/scanstrbuf.c @@ -185,7 +185,7 @@ int SB_GetSym (StrBuf* B, StrBuf* Ident, const char* SpecialChars) SB_AppendChar (Ident, C); SB_Skip (B); C = SB_Peek (B); - } while (IsIdent (C) || IsDigit (C) || + } while (IsIdent (C) || IsDigit (C) || (C != '\0' && strchr (SpecialChars, C) != 0)); SB_Terminate (Ident); return 1; diff --git a/src/cc65/shiftexpr.c b/src/cc65/shiftexpr.c index 0c69e96e5..d7b43dde2 100644 --- a/src/cc65/shiftexpr.c +++ b/src/cc65/shiftexpr.c @@ -193,7 +193,7 @@ void ShiftExpr (struct ExprDesc* Expr) ED_IsLocQuasiConst (Expr) && Expr2.IVal >= 8) { - Type* OldType; + Type* OldType; /* Increase the address by one and decrease the shift count */ ++Expr->IVal; diff --git a/src/cc65/symtab.c b/src/cc65/symtab.c index 3c000f3a1..db2b04f17 100644 --- a/src/cc65/symtab.c +++ b/src/cc65/symtab.c @@ -518,7 +518,7 @@ SymEntry FindStructField (const Type* T, const char* Name) */ if (Struct->V.S.SymTab) { Entry = FindSymInTable (Struct->V.S.SymTab, Name, HashStr (Name)); - + if (Entry != 0) { Offs = Entry->V.Offs; } @@ -732,7 +732,7 @@ SymEntry* AddEnumSym (const char* Name, unsigned Flags, const Type* Type, SymTab CurTagTab = FailSafeTab; } } - + if (Entry == 0) { /* Create a new entry */ @@ -817,7 +817,7 @@ SymEntry* AddStructSym (const char* Name, unsigned Flags, unsigned Size, SymTabl CurTagTab = FailSafeTab; } } - + if (Entry == 0) { /* Create a new entry */ @@ -1116,7 +1116,7 @@ SymEntry* AddLocalSym (const char* Name, const Type* T, unsigned Flags, int Offs } } } - + if (Entry == 0) { /* Create a new entry */ Entry = NewSymEntry (Name, Flags); @@ -1221,7 +1221,6 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags) /* Add the new declaration to the global symbol table instead */ Tab = SymTab0; } - if (Entry == 0 || Entry->Owner != Tab) { /* Create a new entry */ diff --git a/src/cc65/testexpr.c b/src/cc65/testexpr.c index 02ee98dae..e5db488de 100644 --- a/src/cc65/testexpr.c +++ b/src/cc65/testexpr.c @@ -32,7 +32,7 @@ /*****************************************************************************/ - + /* cc65 */ #include "codegen.h" #include "error.h" diff --git a/src/cc65/typecmp.c b/src/cc65/typecmp.c index 1f4643e73..f204b9a0b 100644 --- a/src/cc65/typecmp.c +++ b/src/cc65/typecmp.c @@ -228,7 +228,7 @@ static void DoCompare (const Type* lhs, const Type* rhs, typecmp_t* Result) return; } } - } + } } }