From 2eac69a94361323bf7556d2cdde8f61c85c5ef99 Mon Sep 17 00:00:00 2001 From: Bas Wassink Date: Fri, 22 Mar 2019 22:54:05 +0100 Subject: [PATCH 1/5] Remove trailings spaces from CBM-related asm files --- libsrc/c128/kbhit.s | 3 --- libsrc/c64/acc_chameleon_speed.s | 2 +- libsrc/c64/emd/c64-ram.s | 4 ++-- libsrc/c64/emd/c64-reu.s | 2 +- libsrc/c64/mouse_stddrv.s | 1 - libsrc/c64/randomize.s | 2 +- libsrc/c64/sysuname.s | 2 -- libsrc/cbm/cclear.s | 2 +- libsrc/cbm/dir.s | 2 +- libsrc/cbm/gotox.s | 4 +--- libsrc/cbm/open.s | 2 -- libsrc/cbm510/_scrsize.s | 3 +-- libsrc/cbm510/kopen.s | 6 ++---- libsrc/cbm510/kudtim.s | 2 +- libsrc/cbm610/_scrsize.s | 3 +-- libsrc/cbm610/kopen.s | 6 ++---- libsrc/cbm610/ksetnam.s | 4 +--- libsrc/cbm610/kudtim.s | 2 +- libsrc/cbm610/randomize.s | 2 +- libsrc/pet/kbsout.s | 2 -- libsrc/pet/kckout.s | 2 -- libsrc/pet/kclose.s | 3 +-- libsrc/pet/krdtim.s | 3 +-- libsrc/pet/ksetlfs.s | 3 +-- libsrc/pet/ksetnam.s | 3 +-- libsrc/pet/randomize.s | 2 +- libsrc/plus4/break.s | 3 +-- libsrc/vic20/emd/vic20-rama.s | 4 ++-- libsrc/vic20/kplot.s | 3 +-- libsrc/vic20/mainargs.s | 2 +- 30 files changed, 28 insertions(+), 56 deletions(-) diff --git a/libsrc/c128/kbhit.s b/libsrc/c128/kbhit.s index c1bca2416..0d4deacdf 100644 --- a/libsrc/c128/kbhit.s +++ b/libsrc/c128/kbhit.s @@ -20,6 +20,3 @@ L9: rts .endproc - - - diff --git a/libsrc/c64/acc_chameleon_speed.s b/libsrc/c64/acc_chameleon_speed.s index ce51b9dde..f73fddd01 100755 --- a/libsrc/c64/acc_chameleon_speed.s +++ b/libsrc/c64/acc_chameleon_speed.s @@ -5,7 +5,7 @@ ; unsigned char __fastcall__ set_chameleon_speed (unsigned char speed); ; ;/* Set the speed of the Chameleon cartridge, the following inputs -; * are accepted: +; * are accepted: ; * SPEED_SLOW : 1 Mhz mode ; * SPEED_1X : 1 Mhz mode ; * SPEED_2X : 2 Mhz mode diff --git a/libsrc/c64/emd/c64-ram.s b/libsrc/c64/emd/c64-ram.s index b41f932e6..5355b552d 100644 --- a/libsrc/c64/emd/c64-ram.s +++ b/libsrc/c64/emd/c64-ram.s @@ -167,7 +167,7 @@ loop: .repeat 8 ; Done -done: rts +done: rts ; ------------------------------------------------------------------------ ; COPYFROM: Copy from extended into linear memory. A pointer to a structure @@ -178,7 +178,7 @@ done: rts COPYFROM: sta ptr3 stx ptr3+1 ; Save the passed em_copy pointer - + ldy #EM_COPY::OFFS lda (ptr3),y sta ptr1 diff --git a/libsrc/c64/emd/c64-reu.s b/libsrc/c64/emd/c64-reu.s index bf7bb4fb0..a563305ce 100644 --- a/libsrc/c64/emd/c64-reu.s +++ b/libsrc/c64/emd/c64-reu.s @@ -190,7 +190,7 @@ done: rts ; ------------------------------------------------------------------------ ; USE: Tell the driver that the window is now associated with a given page. - + USE: sta curpage stx curpage+1 ; Remember the page lda # Date: Sat, 23 Mar 2019 01:14:04 +0100 Subject: [PATCH 2/5] Fix 32/64-bit int/pointer casts --- src/cc65/locals.c | 5 +++-- src/cc65/symtab.c | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/cc65/locals.c b/src/cc65/locals.c index 36afb6223..024c1c5fc 100644 --- a/src/cc65/locals.c +++ b/src/cc65/locals.c @@ -275,8 +275,9 @@ static void ParseAutoDecl (Declaration* Decl) ** We abuse the Collection somewhat by using it to store line ** numbers. */ - CollReplace (&CurrentFunc->LocalsBlockStack, (void *)(long)GetCurrentLine (), - CollCount (&CurrentFunc->LocalsBlockStack) - 1); + CollReplace (&CurrentFunc->LocalsBlockStack, + (void *)(size_t)GetCurrentLine (), + CollCount (&CurrentFunc->LocalsBlockStack) - 1); } else { /* Non-initialized local variable. Just keep track of diff --git a/src/cc65/symtab.c b/src/cc65/symtab.c index 9eb0346e8..bdbec55bb 100644 --- a/src/cc65/symtab.c +++ b/src/cc65/symtab.c @@ -671,7 +671,7 @@ DefOrRef* AddDefOrRef (SymEntry* E, unsigned Flags) DOR = xmalloc (sizeof (DefOrRef)); CollAppend (E->V.L.DefsOrRefs, DOR); DOR->Line = GetCurrentLine (); - DOR->LocalsBlockId = (long)CollLast (&CurrentFunc->LocalsBlockStack); + DOR->LocalsBlockId = (ssize_t)CollLast (&CurrentFunc->LocalsBlockStack); DOR->Flags = Flags; DOR->StackPtr = StackPtr; DOR->Depth = CollCount (&CurrentFunc->LocalsBlockStack); @@ -729,9 +729,9 @@ SymEntry* AddLabelSym (const char* Name, unsigned Flags) /* Are we jumping into a block with initalization of an object that ** has automatic storage duration? Let's emit a warning. */ - if ((long)CollLast (AIC) != DOR->LocalsBlockId && + if ((size_t)CollLast (AIC) != (size_t)(DOR->LocalsBlockId) && (CollCount (AIC) < DOR->Depth || - (long)CollAt (AIC, DOR->Depth - 1) != DOR->LocalsBlockId)) { + (size_t)CollAt (AIC, DOR->Depth - 1) != DOR->LocalsBlockId)) { Warning ("Goto at line %d to label %s jumps into a block with " "initialization of an object that has automatic storage duration", GetCurrentLine (), Name); @@ -758,9 +758,9 @@ SymEntry* AddLabelSym (const char* Name, unsigned Flags) /* Are we jumping into a block with initalization of an object that ** has automatic storage duration? Let's emit a warning. */ - if ((long)CollLast (AIC) != DOR->LocalsBlockId && + if ((ssize_t)CollLast (AIC) != DOR->LocalsBlockId && (CollCount (AIC) >= DOR->Depth || - (long)CollLast (AIC) >= (long)DOR->Line)) + (ssize_t)CollLast (AIC) >= (long)DOR->Line)) Warning ("Goto at line %d to label %s jumps into a block with " "initialization of an object that has automatic storage duration", DOR->Line, Name); From 56c96e8ab0f1d0b80c86f0d24d48c64ada4f00ed Mon Sep 17 00:00:00 2001 From: Bas Wassink Date: Sun, 24 Mar 2019 21:15:34 +0100 Subject: [PATCH 3/5] Revert accidentally committed changes for a future PR --- src/cc65/locals.c | 2 +- src/cc65/symtab.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cc65/locals.c b/src/cc65/locals.c index 02155f412..e2e71e96c 100644 --- a/src/cc65/locals.c +++ b/src/cc65/locals.c @@ -276,7 +276,7 @@ static void ParseAutoDecl (Declaration* Decl) ** numbers. */ CollReplace (&CurrentFunc->LocalsBlockStack, - (void *)(size_t)GetCurrentLine (), + (void *)(long)GetCurrentLine (), CollCount (&CurrentFunc->LocalsBlockStack) - 1); } else { diff --git a/src/cc65/symtab.c b/src/cc65/symtab.c index 72f7f54da..02b7f0501 100644 --- a/src/cc65/symtab.c +++ b/src/cc65/symtab.c @@ -671,7 +671,7 @@ DefOrRef* AddDefOrRef (SymEntry* E, unsigned Flags) DOR = xmalloc (sizeof (DefOrRef)); CollAppend (E->V.L.DefsOrRefs, DOR); DOR->Line = GetCurrentLine (); - DOR->LocalsBlockId = (ssize_t)CollLast (&CurrentFunc->LocalsBlockStack); + DOR->LocalsBlockId = CollLast (&CurrentFunc->LocalsBlockStack); DOR->Flags = Flags; DOR->StackPtr = StackPtr; DOR->Depth = CollCount (&CurrentFunc->LocalsBlockStack); @@ -729,9 +729,9 @@ SymEntry* AddLabelSym (const char* Name, unsigned Flags) /* Are we jumping into a block with initalization of an object that ** has automatic storage duration? Let's emit a warning. */ - if ((size_t)CollLast (AIC) != (size_t)(DOR->LocalsBlockId) && + if ((long)CollLast (AIC) != DOR->LocalsBlockId && (CollCount (AIC) < DOR->Depth || - (size_t)CollAt (AIC, DOR->Depth - 1) != DOR->LocalsBlockId)) { + (long)CollAt (AIC, DOR->Depth - 1) != DOR->LocalsBlockId)) { Warning ("Goto at line %d to label %s jumps into a block with " "initialization of an object that has automatic storage duration", GetCurrentLine (), Name); @@ -758,9 +758,9 @@ SymEntry* AddLabelSym (const char* Name, unsigned Flags) /* Are we jumping into a block with initalization of an object that ** has automatic storage duration? Let's emit a warning. */ - if ((ssize_t)CollLast (AIC) != DOR->LocalsBlockId && + if ((long)CollLast (AIC) != DOR->LocalsBlockId && (CollCount (AIC) >= DOR->Depth || - (ssize_t)CollLast (AIC) >= (long)DOR->Line)) + (long)CollLast (AIC) >= (long)DOR->Line)) Warning ("Goto at line %d to label %s jumps into a block with " "initialization of an object that has automatic storage duration", DOR->Line, Name); From 41e449b306ca207052a481e7be505a4fc490708c Mon Sep 17 00:00:00 2001 From: Bas Wassink Date: Sun, 24 Mar 2019 21:41:00 +0100 Subject: [PATCH 4/5] Forgot a cast, sorry --- src/cc65/symtab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc65/symtab.c b/src/cc65/symtab.c index 02b7f0501..56196ea5a 100644 --- a/src/cc65/symtab.c +++ b/src/cc65/symtab.c @@ -671,7 +671,7 @@ DefOrRef* AddDefOrRef (SymEntry* E, unsigned Flags) DOR = xmalloc (sizeof (DefOrRef)); CollAppend (E->V.L.DefsOrRefs, DOR); DOR->Line = GetCurrentLine (); - DOR->LocalsBlockId = CollLast (&CurrentFunc->LocalsBlockStack); + DOR->LocalsBlockId = (long)CollLast (&CurrentFunc->LocalsBlockStack); DOR->Flags = Flags; DOR->StackPtr = StackPtr; DOR->Depth = CollCount (&CurrentFunc->LocalsBlockStack); From 9e0ab14cfe0bc107e99d1867792b7c127b1465a8 Mon Sep 17 00:00:00 2001 From: Bas Wassink Date: Sun, 24 Mar 2019 23:05:11 +0100 Subject: [PATCH 5/5] Restore src/cc65/locals.c:278 to its orignal state --- src/cc65/locals.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cc65/locals.c b/src/cc65/locals.c index e2e71e96c..d0aab7f9c 100644 --- a/src/cc65/locals.c +++ b/src/cc65/locals.c @@ -275,9 +275,8 @@ static void ParseAutoDecl (Declaration* Decl) ** We abuse the Collection somewhat by using it to store line ** numbers. */ - CollReplace (&CurrentFunc->LocalsBlockStack, - (void *)(long)GetCurrentLine (), - CollCount (&CurrentFunc->LocalsBlockStack) - 1); + CollReplace (&CurrentFunc->LocalsBlockStack, (void *)(long)GetCurrentLine (), + CollCount (&CurrentFunc->LocalsBlockStack) - 1); } else { /* Non-initialized local variable. Just keep track of