? s.asm
? s.c
? sccz80
? t.asm
? t.c
? zcc_opt.def
Index: ccdefs.h
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/ccdefs.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ccdefs.h
--- ccdefs.h	4 Jul 2000 15:33:30 -0000	1.1.1.1
+++ ccdefs.h	14 Aug 2009 22:15:09 -0000
@@ -12,6 +12,9 @@
  */
 
 
+#include <sys/types.h>
+#include <stdint.h>
+
 #include "define.h"
 #include "lvalue.h"
 
Index: codegen.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/codegen.c,v
retrieving revision 1.24
diff -u -r1.24 codegen.c
--- codegen.c	21 Jun 2009 21:16:52 -0000	1.24
+++ codegen.c	14 Aug 2009 22:15:09 -0000
@@ -38,8 +38,6 @@
 
 
 
-void constbc(long val);
-
 /* Begin a comment line for the assembler */
 
 void comment(void)
@@ -1876,13 +1874,13 @@
  * to have -1 entered correctly
  */
 
-void vlongconst(unsigned long val)
+void vlongconst(uint32_t val)
 {
     vconst(val%65536);
     const2(val/65536);
 }
 
-void vlongconst_noalt(unsigned long val)
+void vlongconst_noalt(uint32_t val)
 {
     constbc(val%65536);
     ol("push\tbc");
@@ -1894,7 +1892,7 @@
 /*
  * load constant into primary register
  */
-void vconst(long val)
+void vconst(int32_t val)
 {
 	if ( val < 0 )
 		val += 65536;
@@ -1906,7 +1904,7 @@
 /*
  * load constant into secondary register
  */
-void const2(long val)
+void const2(int32_t val)
 {
 	if ( val < 0 )
 		val += 65536;
@@ -1915,7 +1913,7 @@
     nl();
 }
 
-void constbc(long val)
+void constbc(int32_t val)
 {
 	if ( val < 0 )
 		val += 65536;
Index: codegen.h
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/codegen.h,v
retrieving revision 1.7
diff -u -r1.7 codegen.h
--- codegen.h	21 Jun 2009 21:16:52 -0000	1.7
+++ codegen.h	14 Aug 2009 22:15:09 -0000
@@ -92,11 +92,11 @@
 extern void convUlong2doub(void);
 extern void convdoub2int(void);
 extern void DoubSwap(void);
-extern void vlongconst(unsigned long val);
-extern void vlongconst_noalt(unsigned long val);
-extern void vconst(long val);
-extern void const2(long val);
-extern void constbc(long val);
+extern void vlongconst(uint32_t val);
+extern void vlongconst_noalt(uint32_t val);
+extern void vconst(int32_t val);
+extern void const2(int32_t val);
+extern void constbc(int32_t val);
 extern void addbchl(int val);
 extern void GlobalPrefix(char);
 extern void jumpc(int);
Index: const.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/const.c,v
retrieving revision 1.16
diff -u -r1.16 const.c
--- const.c	18 Jun 2006 13:03:13 -0000	1.16
+++ const.c	14 Aug 2009 22:15:10 -0000
@@ -54,8 +54,8 @@
                 return(1);
         }
         else if ( number(&lval->const_val) || pstr(&lval->const_val) ) {
-/* Insert long stuff/long pointer here? */
-		if ( (unsigned long )lval->const_val >= 65536LU )
+/* Insert int32_t stuff/int32_t pointer here? */
+		if ( (uint32_t )lval->const_val >= 65536LU )
 			constype = LONG;
 
                 lval->val_type = constype ;
@@ -81,7 +81,7 @@
 }
 
 
-int fnumber(long *val)
+int fnumber(int32_t *val)
 {
     unsigned char sum[6];
     unsigned char sum2[6];
@@ -169,7 +169,7 @@
 
     if( cmatch('e') ) {                       /* interpret exponent */
 	int neg;                        /* nonzero if exp is negative */
-	long expon;                     /* the exponent */
+	int32_t expon;                     /* the exponent */
 
 	if( number(&expon) == 0 ) {
 	    error(E_EXPON);
@@ -234,7 +234,7 @@
 int stash_double_str(char *start, char *end)
 {
     int  len;
-    long val;
+    int32_t val;
     unsigned char  *buf;
 
     len = end-start;
@@ -259,7 +259,7 @@
  * number - saves space etc etc
  */
 
-long searchdub(unsigned char *num)
+int32_t searchdub(unsigned char *num)
 {
         unsigned char *tempdub;
         int dubleft, k,match;
@@ -290,11 +290,11 @@
 
 
 
-int number(long *val)
+int number(int32_t *val)
 {
         char c ;
         int minus;
-        long  k ;
+        int32_t  k ;
 /*
  * djm, set the type specifiers to normal
  */
@@ -362,14 +362,14 @@
         immed() ;
         outname(ptr->name,dopref(ptr)) ;
         nl();
-/* djm if we're using long pointers, use of e=0 means absolute address,
+/* djm if we're using int32_t pointers, use of e=0 means absolute address,
  * this covers up a bit of a problem in deref() which can't distinguish
  * between ptrtoptr and ptr
  */
         if (ptr->flags&FARPTR) { const2(0); }
 }
 
-int pstr(long *val)
+int pstr(int32_t *val)
 {
         int k ;
 
@@ -390,7 +390,7 @@
  * check to see if present elsewhere, if so do the merge as for doubles
  */
 
-int tstr(long *val)
+int tstr(int32_t *val)
 {
         int k,j;
 
@@ -414,7 +414,7 @@
  * internally, but to the asm file show it to start from 0
  */
 
-int storeq(int length, unsigned char *queue,long *val)
+int storeq(int length, unsigned char *queue,int32_t *val)
 {
         int     j,k,len;
 /* Have stashed it in our temporary queue, we know the length, so lets
@@ -432,7 +432,7 @@
                 j++;
         }
 /* If we get here, then dump it in the queue as per normal... */
-        *val=(long) litptr-1;
+        *val=(int32_t) litptr-1;
         for (j=0; j<k; j++) {
 /* Have to dump it in our special queue here for function literals */
                 if ( (litptr+1) >= FNMAX ) {
@@ -445,7 +445,7 @@
 }
 
 
-int qstr(long *val)
+int qstr(int32_t *val)
 {
     int c;
     int cnt=0;
@@ -453,7 +453,7 @@
     if ( cmatch('"') == 0 ) 
 	return(-1) ;
 
-    *val=(long)gltptr;
+    *val=(int32_t)gltptr;
     do {
 	while ( ch() !='"' ) {
 	    if ( ch() == 0 ) break ;
Index: const.h
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/const.h,v
retrieving revision 1.3
diff -u -r1.3 const.h
--- const.h	29 May 2002 22:54:09 -0000	1.3
+++ const.h	14 Aug 2009 22:15:10 -0000
@@ -1,15 +1,15 @@
 /* constant.c */
 extern int constant(LVALUE *lval);
-extern int fnumber(long *val);
+extern int fnumber(int32_t *val);
 extern int stash_double_str(char *start,char *end);
-extern long searchdub(unsigned char *num);
-extern int number(long *val);
+extern int32_t searchdub(unsigned char *num);
+extern int number(int32_t *val);
 extern int hex(char c);
 extern void address(SYMBOL *ptr);
-extern int pstr(long *val);
-extern int tstr(long *val);
-extern int storeq(int length, unsigned char *queue,long *val);
-extern int qstr(long *val);
+extern int pstr(int32_t *val);
+extern int tstr(int32_t *val);
+extern int storeq(int length, unsigned char *queue,int32_t *val);
+extern int qstr(int32_t *val);
 extern void stowlit(int value, int size);
 extern unsigned char litchar(void);
 extern void size_of(LVALUE *lval);
Index: declfunc.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/declfunc.c,v
retrieving revision 1.11
diff -u -r1.11 declfunc.c
--- declfunc.c	21 Jun 2009 21:16:52 -0000	1.11
+++ declfunc.c	14 Aug 2009 22:15:10 -0000
@@ -68,7 +68,7 @@
 char sign,
 TAG_SYMBOL *otag,
 int ident,
-long *addr)
+int32_t *addr)
 {
     SYMBOL *ptr;
     int     more;
@@ -134,7 +134,7 @@
 void newfunc()
 {
         char n[NAMESIZE];               /* ptr => currfn */
-        long addr;
+        int32_t addr;
 
         if ( symname(n) == 0 ) {
                 error(E_ILLEGAL);
@@ -155,7 +155,7 @@
 SYMBOL *
 #endif
 
-AddFuncCode(char *n, char type, char ident, char sign,char zfar, int storage, int more, char check,char simple,TAG_SYMBOL *otag, long *addr)
+AddFuncCode(char *n, char type, char ident, char sign,char zfar, int storage, int more, char check,char simple,TAG_SYMBOL *otag, int32_t *addr)
 {
     unsigned char tvalue;           /* Used to hold protot value */
     char    typ;                    /* Temporary type */
@@ -466,7 +466,7 @@
 #ifndef SMALL_C
 SYMBOL *
 #endif
-dofnansi(SYMBOL *currfn, long *addr)
+dofnansi(SYMBOL *currfn, int32_t *addr)
 {
         SYMBOL *prevarg;       /* ptr to symbol table entry of most recent argument */
         SYMBOL *argptr;        /* Temporary holder.. */
Index: declfunc.h
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/declfunc.h,v
retrieving revision 1.2
diff -u -r1.2 declfunc.h
--- declfunc.h	17 Apr 2007 14:40:15 -0000	1.2
+++ declfunc.h	14 Aug 2009 22:15:10 -0000
@@ -1,10 +1,10 @@
 /* declfunc.c */
 
-extern int AddNewFunc(char *sname, int type, int storage, char zfar, char sign, TAG_SYMBOL *otag, int ident, long *addr);
+extern int AddNewFunc(char *sname, int type, int storage, char zfar, char sign, TAG_SYMBOL *otag, int ident, int32_t *addr);
 extern void newfunc(void);
-extern SYMBOL *AddFuncCode(char *n, char type, char ident, char sign, char zfar, int storage, int more, char check, char simple, TAG_SYMBOL *otag, long *addr);
+extern SYMBOL *AddFuncCode(char *n, char type, char ident, char sign, char zfar, int storage, int more, char check, char simple, TAG_SYMBOL *otag, int32_t *addr);
 extern void DoFnKR(SYMBOL *currfn, char simple);
 extern void setlocvar(SYMBOL *prevarg, SYMBOL *currfn);
-extern SYMBOL *dofnansi(SYMBOL *currfn, long *addr);
+extern SYMBOL *dofnansi(SYMBOL *currfn, int32_t *addr);
 extern int CheckANSI(void);
 extern SYMBOL *getarg(int typ, TAG_SYMBOL *otag, int deftype, SYMBOL *prevarg, char issigned, char zfar, char proto);
Index: declinit.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/declinit.c,v
retrieving revision 1.13
diff -u -r1.13 declinit.c
--- declinit.c	21 Jun 2009 21:16:52 -0000	1.13
+++ declinit.c	14 Aug 2009 22:15:10 -0000
@@ -222,8 +222,8 @@
  */
 void init(int size, int ident, int *dim, int more, int dump, int is_struct)
 {
-    long value;
-    int sz;			/* number of chars in queue */
+    int32_t value;
+    int     sz;			/* number of chars in queue */
 /*
  * djm 14/3/99 We have to rewrite this bit (ugh!) so that we store
  * our literal in a temporary queue, then if needed, we then dump
Index: declvar.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/declvar.c,v
retrieving revision 1.17
diff -u -r1.17 declvar.c
--- declvar.c	21 Jun 2009 21:16:52 -0000	1.17
+++ declvar.c	14 Aug 2009 22:15:11 -0000
@@ -130,7 +130,7 @@
 {
     SYMBOL  *ptr;
     char    name[NAMEMAX];
-    long    value;
+    int32_t value;
     /* Add it into the symbol table, we do not need to keep track of the
      * tag because we treat enums as constants
      */
@@ -198,7 +198,7 @@
 {
     char sname[NAMESIZE];
     int size, ident, more, itag, type, size_st;
-    long addr = -1;
+    int32_t addr = -1;
     char    flagdef,match,ptrtofn;
     char    libdef,fastcall,callee;
     SYMBOL *myptr ;
@@ -745,7 +745,7 @@
 int 
 needsub (void)
 {
-        long num;
+        int32_t num;
 
         if ( cmatch(']') ) return (0);   /* null size */
         if ( constexpr(&num,1) == 0 ) {
@@ -850,7 +850,7 @@
 void 
 BitFieldSwallow (void)
 {
-        long    val;
+        int32_t val;
         if      (cmatch(':')) {
                 constexpr(&val,1);
                 warning(W_BITFIELD);
Index: define.h
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/define.h,v
retrieving revision 1.10
diff -u -r1.10 define.h
--- define.h	21 Jun 2009 21:16:52 -0000	1.10
+++ define.h	14 Aug 2009 22:15:11 -0000
@@ -205,7 +205,7 @@
 
 struct sw_tab {
         int label ;             /* label for start of case */
-        long value ;             /* value associated with case */
+        int32_t value ;             /* value associated with case */
 } ;
 
 #define SW_TAB struct sw_tab
Index: float.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/float.c,v
retrieving revision 1.5
diff -u -r1.5 float.c
--- float.c	20 Feb 2002 11:11:54 -0000	1.5
+++ float.c	14 Aug 2009 22:15:11 -0000
@@ -40,7 +40,7 @@
  * Entry: val=value fa=pointer to 6 byte area for number */
 void qfloat(int va, unsigned char *fa)
 {
-    unsigned long val;
+    uint32_t val;
     int      i,minus,exp;
 
     val = va;
@@ -58,9 +58,9 @@
 }
 
 
-void norm(unsigned long a, 
-	  unsigned long b, 
-	  unsigned long c, 
+void norm(uint32_t a, 
+	  uint32_t b, 
+	  uint32_t c, 
 	  int minus,
 	  unsigned char *fa, 
 	  int exp)
@@ -183,7 +183,7 @@
 
     unsigned char fa1[EXPONENT+2], fa2[EXPONENT+2], fa3[EXPONENT+2];
     int i, j, k, temp, mask, carry;
-    unsigned long a, b, c;
+    uint32_t a, b, c;
     int     exp;
 
     unpack(i1, fa1);
@@ -256,7 +256,7 @@
 void fltadd(unsigned char *i1,unsigned char *i2)
 {
     unsigned char fa1[EXPONENT+2], fa2[EXPONENT+2];
-    unsigned long temp, carry;
+    uint32_t temp, carry;
     int i;
 
 
Index: float.h
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/float.h,v
retrieving revision 1.2
diff -u -r1.2 float.h
--- float.h	27 Jan 2002 15:47:59 -0000	1.2
+++ float.h	14 Aug 2009 22:15:11 -0000
@@ -4,4 +4,4 @@
 extern void fltmult(unsigned char *, unsigned char *);
 extern void pack(unsigned char *, unsigned char *);
 extern void unpack(unsigned char *, unsigned char *);
-extern void norm(unsigned long, unsigned long, unsigned long, int, unsigned char *, int);
+extern void norm(uint32_t, uint32_t, uint32_t, int, unsigned char *, int);
Index: lvalue.h
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/lvalue.h,v
retrieving revision 1.3
diff -u -r1.3 lvalue.h
--- lvalue.h	24 Jun 2007 14:43:45 -0000	1.3
+++ lvalue.h	14 Aug 2009 22:15:11 -0000
@@ -9,7 +9,7 @@
     int indirect ;                  /* type of indirect object, 0 for static object */
     int ptr_type ;                  /* type of pointer or array, 0 for other idents */
     int is_const ;                  /* true if constant expression */
-    signed long const_val ;                        /* value of constant expression (& other uses) */
+    int32_t const_val ;                        /* value of constant expression (& other uses) */
     TAG_SYMBOL *tagsym ;    /* tag symbol address, 0 if not struct */
     void (*binop)() ;                /* function address of highest/last binary operator */
     char *stage_add ;               /* stage addess of "oper 0" code, else 0 */
Index: main.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/main.c,v
retrieving revision 1.20
diff -u -r1.20 main.c
--- main.c	14 Aug 2009 20:10:03 -0000	1.20
+++ main.c	14 Aug 2009 22:15:12 -0000
@@ -622,7 +622,7 @@
 {
     FILE   *fp;
     char   sname[NAMESIZE];
-    long    value;
+    int32_t value;
     int     count;
 
     if ( symname(sname) ) {
@@ -641,7 +641,7 @@
 	    else
 		fprintf(fp,",");
 	    if ( number(&value) ) {
-		fprintf(fp,"%ld",value);
+		fprintf(fp,"%d",value);
 	    } else {
 		warning(W_EXPARG);
 	    }
Index: primary.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/primary.c,v
retrieving revision 1.19
diff -u -r1.19 primary.c
--- primary.c	5 Jul 2007 18:39:00 -0000	1.19
+++ primary.c	14 Aug 2009 22:15:13 -0000
@@ -649,7 +649,7 @@
  * evaluate constant expression
  * return TRUE if it is a constant expression
  */
-int constexpr(long *val,int flag)
+int constexpr(int32_t *val,int flag)
 {
         char *before, *start ;
         int con, valtemp ;
@@ -739,7 +739,7 @@
 	SYMBOL  *ptr;
     char    temp_type;
     int     itag;
-    char    nam[20];
+    char    nam[64];
 
 
 
@@ -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%p",locptr);
     temp_type = ( (lval->c_flags&FARPTR) ? CPTR : CINT );
     itag=0;
     if ( lval->c_tag) 
Index: primary.h
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/sccz80/primary.h,v
retrieving revision 1.2
diff -u -r1.2 primary.h
--- primary.h	2 Feb 2001 12:24:06 -0000	1.2
+++ primary.h	14 Aug 2009 22:15:13 -0000
@@ -20,7 +20,7 @@
 extern void rvalload(LVALUE  *lval);
 extern void rvalue(LVALUE *lval);
 extern void test(int label, int parens);
-extern int constexpr(long *val,int flag);
+extern int constexpr(int32_t *val,int flag);
 extern void cscale(int type, struct tag_symbol *tag, int *val);
 extern void addconst(int val, int opr, char zfar);
 extern int docast(LVALUE *lval,char df);

