diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml new file mode 100644 index 000000000..f5477d191 --- /dev/null +++ b/.github/workflows/build-on-pull-request.yml @@ -0,0 +1,62 @@ +name: Build Pull Request +on: [pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_linux: + name: Build and Test (Linux) + runs-on: ubuntu-latest + + steps: + - name: Install Dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64 + + - shell: bash + run: git config --global core.autocrlf input + - name: Checkout Source + uses: actions/checkout@v2 + + - name: Build the tools. + shell: bash + run: make -j2 bin USER_CFLAGS=-Werror + - name: Build the platform libraries. + shell: bash + run: make -j2 lib QUIET=1 + - name: Run the regression tests. + shell: bash + run: make test QUIET=1 + - name: Test that the samples can be built. + shell: bash + run: make -j2 samples + - name: Build the document files. + shell: bash + run: make -j2 doc + - name: Build 64-bit Windows versions of the tools. + run: | + make -C src clean + make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32- + + build_windows: + name: Build (Windows) + runs-on: windows-latest + + steps: + - shell: bash + run: git config --global core.autocrlf input + + - name: Checkout Source + uses: actions/checkout@v2 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + + - name: Build app (debug) + run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug + + - name: Build app (release) + run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release diff --git a/.github/workflows/snapshot-on-push-master.yml b/.github/workflows/snapshot-on-push-master.yml new file mode 100644 index 000000000..110edbbf0 --- /dev/null +++ b/.github/workflows/snapshot-on-push-master.yml @@ -0,0 +1,91 @@ +name: Snapshot Build +on: + push: + branches: + master +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_windows: + name: Build (Windows) + runs-on: windows-latest + + steps: + - shell: bash + run: git config --global core.autocrlf input + + - name: Checkout Source + uses: actions/checkout@v2 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + + - name: Build app (debug) + run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug + + - name: Build app (release) + run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release + + build_linux: + name: Build, Test and Snaphot (Linux) + runs-on: ubuntu-latest + needs: build_windows + + steps: + - name: Install Dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 + + - shell: bash + run: git config --global core.autocrlf input + - name: Checkout Source + uses: actions/checkout@v2 + + - name: Build the tools. + shell: bash + run: make -j2 bin USER_CFLAGS=-Werror + - name: Build the platform libraries. + shell: bash + run: make -j2 lib QUIET=1 + - name: Run the regression tests. + shell: bash + run: make test QUIET=1 + - name: Test that the samples can be built. + shell: bash + run: make -j2 samples + - name: Remove the output from the samples tests. + shell: bash + run: make -C samples clean + - name: Build the document files. + shell: bash + run: make -j2 doc + - name: Build and package 64-bit Windows versions of the tools. + run: | + make -C src clean + make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32- + make zip + mv cc65.zip cc65-win64.zip + - name: Build and package 32-bit Windows versions of the tools. + run: | + make -C src clean + make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32- + make zip + mv cc65.zip cc65-win32.zip + + - name: Upload a 32-bit Snapshot Zip + uses: actions/upload-artifact@v2 + with: + name: cc65-snapshot-win32.zip + path: cc65-win32.zip + - name: Upload a 64-bit Snapshot Zip + uses: actions/upload-artifact@v2 + with: + name: cc65-snapshot-win64.zip + path: cc65-win64.zip + + # TODO: Update docs at https://github.com/cc65/doc + # TODO: Publish snapshot zip at https://github.com/cc65/cc65.github.io diff --git a/README.md b/README.md index f6142e2c1..33c7d2830 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ [Wiki](https://github.com/cc65/wiki/wiki) +[![Snapshot Build](https://github.com/cc65/cc65/actions/workflows/snapshot-on-push-master.yml/badge.svg?branch=master)](https://github.com/cc65/cc65/actions/workflows/snapshot-on-push-master.yml) + cc65 is a complete cross development package for 65(C)02 systems, including a powerful macro assembler, a C compiler, linker, librarian and several other tools. diff --git a/doc/apple2.sgml b/doc/apple2.sgml index bd01b68dc..cf83dacc9 100644 --- a/doc/apple2.sgml +++ b/doc/apple2.sgml @@ -33,7 +33,7 @@ more information. The standard binary file format generated by the linker for the Apple ][ target is an file. +url="https://nulib.com/library/AppleSingle_AppleDouble.pdf"> file. The default load address is $803. , but uses the heap either explicitly or implicitly (i.e. by loading a driver) then -the memory from $800 to $2000 can be added to the heap by calling +the memory from $800 to $1FFF can be added to the heap by calling file. +url="https://nulib.com/library/AppleSingle_AppleDouble.pdf"> file. The default load address is $803. , but uses the heap either explicitly or implicitly (i.e. by loading a driver) then -the memory from $800 to $2000 can be added to the heap by calling +the memory from $800 to $1FFF can be added to the heap by calling LocalsBlockStack, (void *)(long)GetCurrentLine (), + CollReplace (&CurrentFunc->LocalsBlockStack, (void *)(size_t)GetCurrentLine (), CollCount (&CurrentFunc->LocalsBlockStack) - 1); } else { diff --git a/src/cc65/symentry.h b/src/cc65/symentry.h index bb87c7472..bcf586510 100644 --- a/src/cc65/symentry.h +++ b/src/cc65/symentry.h @@ -115,7 +115,7 @@ struct CodeEntry; typedef struct DefOrRef DefOrRef; struct DefOrRef { unsigned Line; - long LocalsBlockId; + size_t LocalsBlockId; unsigned Flags; int StackPtr; unsigned Depth; diff --git a/src/cc65/symtab.c b/src/cc65/symtab.c index 5d7bd1436..3de0bb460 100644 --- a/src/cc65/symtab.c +++ b/src/cc65/symtab.c @@ -951,7 +951,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 = (size_t)CollLast (&CurrentFunc->LocalsBlockStack); DOR->Flags = Flags; DOR->StackPtr = StackPtr; DOR->Depth = CollCount (&CurrentFunc->LocalsBlockStack); @@ -1013,9 +1013,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) != 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); @@ -1044,9 +1044,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) != DOR->LocalsBlockId && (CollCount (AIC) >= DOR->Depth || - (long)CollLast (AIC) >= (long)DOR->Line)) + (size_t)CollLast (AIC) >= (size_t)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); diff --git a/src/dbginfo/dbginfo.c b/src/dbginfo/dbginfo.c index 42001ed07..fdebe6910 100644 --- a/src/dbginfo/dbginfo.c +++ b/src/dbginfo/dbginfo.c @@ -183,7 +183,7 @@ typedef struct DbgInfo DbgInfo; struct DbgInfo { /* First we have all items in collections sorted by id. The ids are - ** continous, so an access by id is almost as cheap as an array access. + ** continuous, so an access by id is almost as cheap as an array access. ** The collections are also used when the objects are deleted, so they're ** actually the ones that "own" the items. */ @@ -680,7 +680,7 @@ static char* SB_StrDup (const StrBuf* B) static Collection* CollInit (Collection* C) /* Initialize a collection and return it. */ { - /* Intialize the fields. */ + /* Initialize the fields. */ C->Count = 0; C->Size = 0; C->Items = 0; @@ -1349,7 +1349,7 @@ static int CompareFileInfoByName (const void* L, const void* R) static LibInfo* NewLibInfo (const StrBuf* Name) -/* Create a new LibInfo struct, intialize and return it */ +/* Create a new LibInfo struct, initialize and return it */ { /* Allocate memory */ LibInfo* L = xmalloc (sizeof (LibInfo) + SB_GetLen (Name)); @@ -1463,7 +1463,7 @@ static int CompareLineInfoByLine (const void* L, const void* R) static ModInfo* NewModInfo (const StrBuf* Name) -/* Create a new ModInfo struct, intialize and return it */ +/* Create a new ModInfo struct, initialize and return it */ { /* Allocate memory */ ModInfo* M = xmalloc (sizeof (ModInfo) + SB_GetLen (Name)); @@ -1536,7 +1536,7 @@ static int CompareModInfoByName (const void* L, const void* R) static ScopeInfo* NewScopeInfo (const StrBuf* Name) -/* Create a new ScopeInfo struct, intialize and return it */ +/* Create a new ScopeInfo struct, initialize and return it */ { /* Allocate memory */ ScopeInfo* S = xmalloc (sizeof (ScopeInfo) + SB_GetLen (Name)); @@ -1697,7 +1697,7 @@ static int CompareSegInfoByName (const void* L, const void* R) static SpanInfo* NewSpanInfo (void) -/* Create a new SpanInfo struct, intialize and return it */ +/* Create a new SpanInfo struct, initialize and return it */ { /* Allocate memory */ SpanInfo* S = xmalloc (sizeof (SpanInfo)); @@ -1779,7 +1779,7 @@ static int CompareSpanInfoByAddr (const void* L, const void* R) static SymInfo* NewSymInfo (const StrBuf* Name) -/* Create a new SymInfo struct, intialize and return it */ +/* Create a new SymInfo struct, initialize and return it */ { /* Allocate memory */ SymInfo* S = xmalloc (sizeof (SymInfo) + SB_GetLen (Name)); @@ -2147,7 +2147,7 @@ static TypeInfo* ParseTypeString (InputData* D, StrBuf* Type) I += GT_GET_SIZE (A[I]) + 1; } else { /* Unknown type in type string */ - ParseError (D, CC65_ERROR, "Unkown type in type value"); + ParseError (D, CC65_ERROR, "Unknown type in type value"); return 0; } break; @@ -2733,7 +2733,7 @@ static int StrConstFollows (InputData* D) static int Consume (InputData* D, Token Tok, const char* Name) -/* Check for a token and consume it. Return true if the token was comsumed, +/* Check for a token and consume it. Return true if the token was consumed, ** return false otherwise. */ { @@ -6936,7 +6936,7 @@ const cc65_scopeinfo* cc65_scope_byspan (cc65_dbginfo Handle, unsigned SpanId) const cc65_scopeinfo* cc65_childscopes_byid (cc65_dbginfo Handle, unsigned Id) /* Return the direct child scopes of a scope with a given id. The function ** returns NULL if no scope with this id was found, otherwise a list of the -** direct childs. +** direct children. */ { const DbgInfo* Info; diff --git a/src/ld65/scanner.c b/src/ld65/scanner.c index 256d47f07..718951aa5 100644 --- a/src/ld65/scanner.c +++ b/src/ld65/scanner.c @@ -196,7 +196,7 @@ static void StrVal (void) default: CfgWarning (&CfgErrorPos, - "Unkown escape sequence '%%%c'", C); + "Unknown escape sequence '%%%c'", C); SB_AppendChar (&CfgSVal, '%'); SB_AppendChar (&CfgSVal, C); NextChar ();