diff -ur z88dk/src/copt/copt.c z88dk-64bit/src/copt/copt.c --- z88dk/src/copt/copt.c 2002-09-15 19:10:07.000000000 +0200 +++ z88dk-64bit/src/copt/copt.c 2009-07-21 05:11:59.000000000 +0200 @@ -507,12 +507,12 @@ /* check for activation rules */ if (o->o_new && strcmp(o->o_new->l_text, "%activate\n") == 0) { /* we have to prevent repeated activation of rules */ - char signature[160]; + char signature[240]; struct lnode *lnp; struct onode *nn, *last; int skip = 0; /* since we 'install()' strings, we can compare pointers */ - sprintf(signature, "%s%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x\n", + sprintf(signature, (sizeof(char*)>4)?"%s%016lx%016lx%016lx%016lx%016lx%016lx%016lx%016lx%016lx%016lx\n":"%s%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx\n", activated, vars[0], vars[1], vars[2], vars[3], vars[4], vars[5], vars[6], vars[7], vars[8], vars[9]); diff -ur z88dk/src/sccz80/io.c z88dk-64bit/src/sccz80/io.c --- z88dk/src/sccz80/io.c 2009-06-21 23:16:52.000000000 +0200 +++ z88dk-64bit/src/sccz80/io.c 2009-07-21 05:11:59.000000000 +0200 @@ -334,7 +334,7 @@ } -void outdec(long number) +void outdec(int number) { if ( number < 0 ) { number=-number; @@ -344,7 +344,7 @@ outd2(number); } -void outd2(long n) +void outd2(int n) { if ( n > 9 ) { outd2(n/10) ; diff -ur z88dk/src/sccz80/io.h z88dk-64bit/src/sccz80/io.h --- z88dk/src/sccz80/io.h 2009-06-21 23:16:52.000000000 +0200 +++ z88dk-64bit/src/sccz80/io.h 2009-07-21 05:11:59.000000000 +0200 @@ -26,8 +26,8 @@ extern void ol(char *ptr); extern void ot(char *ptr); extern void blanks(void); -extern void outdec(long number); -extern void outd2(long n); +extern void outdec(int number); +extern void outd2(int n); extern void queuelabel(int); typedef struct { diff -ur z88dk/src/sccz80/primary.c z88dk-64bit/src/sccz80/primary.c --- z88dk/src/sccz80/primary.c 2007-07-05 20:39:00.000000000 +0200 +++ z88dk-64bit/src/sccz80/primary.c 2009-07-21 05:11:59.000000000 +0200 @@ -739,7 +739,7 @@ SYMBOL *ptr; char temp_type; int itag; - char nam[20]; + char nam[26]; @@ -794,7 +794,7 @@ * returning pointers - to do this, we will define dummy symbols in * the local symbol table so that they do what we want them to do! */ - sprintf(nam,"0dptr%d",(int)locptr); + sprintf(nam,"0dptr%lu",(unsigned long)locptr); temp_type = ( (lval->c_flags&FARPTR) ? CPTR : CINT ); itag=0; if ( lval->c_tag) diff -ur z88dk/src/z80asm/config.h z88dk-64bit/src/z80asm/config.h --- z88dk/src/z80asm/config.h 2007-06-24 18:41:41.000000000 +0200 +++ z88dk-64bit/src/z80asm/config.h 2009-07-21 05:11:59.000000000 +0200 @@ -64,6 +64,12 @@ #define MAXCODESIZE 65536 #endif +#ifdef __linux__ +#include <endian.h> +#if __BYTE_ORDER == __BIG_ENDIAN +#define ENDIAN 1 +#endif +#else /* Some clever config-ing if we're using GNUC */ #ifdef __BIG_ENDIAN__ /* Sadly the compiler on OS-X falls over with the #if below... */ @@ -75,3 +81,4 @@ #endif #endif /* __GNUC__ */ #endif +#endif diff -ur z88dk/src/z80asm/modlink.c z88dk-64bit/src/z80asm/modlink.c --- z88dk/src/z80asm/modlink.c 2002-11-05 12:45:56.000000000 +0100 +++ z88dk-64bit/src/z80asm/modlink.c 2009-07-21 05:11:59.000000000 +0200 @@ -106,11 +106,11 @@ int LinkLibModule (struct libfile *library, long curmodule, char *modname); int SearchLibfile (struct libfile *curlib, char *modname); char *ReadName (void); -long ReadLong (FILE * fileid); +int ReadLong (FILE * fileid); void redefinedmsg (void); void CreateLib (void); void SearchLibraries (char *modname); -void WriteLong (long fptr, FILE * fileid); +void WriteLong (int fptr, FILE * fileid); void LinkModules (void); void ModuleExpr (void); void CreateBinFile (void); @@ -160,7 +160,7 @@ ReadNames (long nextname, long endnames) { char scope, symtype; - long value; + int value; symbol *foundsymbol; do @@ -509,7 +509,7 @@ while (CURRENTMODULE != lastobjmodule->nextmodule); /* parse only object modules, not added library modules */ if (verbose == ON) - printf ("Code size of linked modules is %d bytes\n", CODESIZE); + printf ("Code size of linked modules is %lu bytes\n", (unsigned long) CODESIZE); if (ASMERROR == OFF) ModuleExpr (); /* Evaluate expressions in all modules */ @@ -531,7 +531,7 @@ int LinkModule (char *filename, long fptr_base) { - long fptr_namedecl, fptr_modname, fptr_modcode, fptr_libnmdecl; + int fptr_namedecl, fptr_modname, fptr_modcode, fptr_libnmdecl; size_t lowbyte, highbyte, size; int flag = 0; @@ -661,7 +661,7 @@ SearchLibfile (struct libfile *curlib, char *modname) { - long currentlibmodule, modulesize, fptr_mname; + int currentlibmodule, modulesize, fptr_mname; int flag; char *mname; @@ -755,8 +755,8 @@ void ModuleExpr (void) { - long fptr_namedecl, fptr_modname, fptr_exprdecl, fptr_libnmdecl; - long fptr_base; + int fptr_namedecl, fptr_modname, fptr_exprdecl, fptr_libnmdecl; + int fptr_base; struct linkedmod *curlink; if (verbose) @@ -837,7 +837,7 @@ *(reloctable + 3) = (unsigned short) sizeof_reloctable / 256U;/* total size of relocation table elements */ fwrite (reloctable, 1U, sizeof_reloctable + 4, binaryfile); /* write relocation table, inclusive 4 byte header */ - printf ("Relocation header is %d bytes.\n", sizeof_relocroutine + sizeof_reloctable + 4); + printf ("Relocation header is %lu bytes.\n", (unsigned long) (sizeof_relocroutine + sizeof_reloctable + 4)); fwrite (codearea, sizeof (char), CODESIZE, binaryfile); /* write code as one big chunk */ fclose (binaryfile); } @@ -880,9 +880,9 @@ void CreateLib (void) { - long Codesize; + int Codesize; FILE *objectfile = NULL; - long fptr; + int fptr; char *filebuffer, *fname; if (verbose) @@ -1035,13 +1035,13 @@ -long +int ReadLong (FILE * fileid) { #ifdef ENDIAN /* high byte, low byte order... */ int i; - unsigned long c, fptr = 0; + unsigned int c, fptr = 0; for (i = 1; i <= 3; i++) { @@ -1052,7 +1052,7 @@ return fptr; #else /* low byte, high byte order... */ - long fptr = 0; + int fptr = 0; /* long is *at least* 4 bytes long, and we have to write exactly 4 bytes */ fread (&fptr, 4, 1, fileid); @@ -1063,7 +1063,7 @@ void -WriteLong (long fptr, FILE * fileid) +WriteLong (int fptr, FILE * fileid) { #ifdef ENDIAN /* high byte, low byte order... */ int i; diff -ur z88dk/src/z80asm/symbol.h z88dk-64bit/src/z80asm/symbol.h --- z88dk/src/z80asm/symbol.h 2003-10-11 17:41:04.000000000 +0200 +++ z88dk-64bit/src/z80asm/symbol.h 2009-07-21 05:11:59.000000000 +0200 @@ -113,7 +113,7 @@ struct libfile { struct libfile *nextlib; /* pointer to next library file in list */ char *libfilename; /* filename of library (incl. extension) */ - long nextobjfile; /* file pointer to next object file in library */ + int nextobjfile; /* file pointer to next object file in library */ }; struct linklist { struct linkedmod *firstlink; /* pointer to first linked object module */ diff -ur z88dk/src/z80asm/z80asm.c z88dk-64bit/src/z80asm/z80asm.c --- z88dk/src/z80asm/z80asm.c 2009-06-23 00:12:53.000000000 +0200 +++ z88dk-64bit/src/z80asm/z80asm.c 2009-07-21 05:11:59.000000000 +0200 @@ -834,7 +834,7 @@ } if (*flagid == 'r') { - sscanf (flagid + 1, "%x", &EXPLICIT_ORIGIN); + sscanf (flagid + 1, "%lx", &EXPLICIT_ORIGIN); deforigin = ON; /* explicit origin has been defined */ return; } diff -ur z88dk/src/z80asm/z80pass.c z88dk-64bit/src/z80asm/z80pass.c --- z88dk/src/z80asm/z80pass.c 2002-05-11 22:09:38.000000000 +0200 +++ z88dk-64bit/src/z80asm/z80pass.c 2009-07-21 05:11:59.000000000 +0200 @@ -853,9 +853,9 @@ fprintf (listfile, "%*.*s", 122 - strlen (_prog_name) - strlen (_version) - strlen (_copyright) - 3, strlen (date), date); #else fprintf (listfile, "%s", copyrightmsg); - fprintf (listfile, "%*.*s", (int) 122 - strlen (copyrightmsg), (int) strlen (date), date); + fprintf (listfile, "%*.*s", (int) (122 - strlen (copyrightmsg)), (int) strlen (date), date); #endif - fprintf (listfile, "Page %03d%*s'%s'\n\n\n", ++PAGENR, (int) 122 - 9 - 2 - strlen (lstfilename), "", lstfilename); + fprintf (listfile, "Page %03d%*s'%s'\n\n\n", ++PAGENR, (int) (122 - 9 - 2 - strlen (lstfilename)), "", lstfilename); }