fix 64 bit warnings
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 6 Mar 2003 12:02:45 +0000 (12:02 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 6 Mar 2003 12:02:45 +0000 (12:02 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2336 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCChasht.c
src/SDCCsymt.c
src/pic/pcode.c
support/regression/tests/malloc.c

index 8bfb2cb70bf9814aa205fdc9e79f2e3da218db9c..03065d47f5385fd5415a24410578029abdc7b723 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,12 @@
-2003-02-26  Bernhard Held <bernhard@bernhardheld.de>
+2003-03-06  Bernhard Held <bernhard@bernhardheld.de>
+
+       * src/pic/pcode.c (get_op): fix 64 bit warnings
+       * src/pic/pcode.c (pCode2str): fix 64 bit warnings
+       * src/SDCChasht.c (newHashTable): fix 64 bit warnings
+       * src/SDCCsymt.c (checkTypeSanity): fix 64 bit warnings
+       * support/regression/tests/malloc.c: fix 64 bit warnings
+
+2003-03-04  Bernhard Held <bernhard@bernhardheld.de>
 
        * src/mcs51/gen.c (genMinus): fixed bug 696436
 
index d7551c04ac30a53b002e03ed940bb5e1fc60885a..07aa2ec50f49c799f62200e5ae8a80b61beb9071 100644 (file)
@@ -62,7 +62,7 @@ newHashTable (int size)
   if (!(htab->table = Safe_alloc ((size + 1) * sizeof (hashtItem *))))
     {
       fprintf (stderr, "out of virtual memory %s %d\n",
-              __FILE__, (size + 1) * sizeof (hashtItem *));
+              __FILE__, (size + 1) * (int) sizeof (hashtItem *));
       exit (1);
     }
   htab->minKey = htab->size = size;
index cebe16c5f36757adbf8b323f95dbc706af850b99..73a08b84987f6345802d06eb66ca719175ef80d5 100644 (file)
@@ -508,7 +508,7 @@ void checkTypeSanity(sym_link *etype, char *name) {
   noun=nounName(etype);
 
   if (getenv("DEBUG_SANITY")) {
-    fprintf (stderr, "checking sanity for %s %x\n", name, (int)etype);
+    fprintf (stderr, "checking sanity for %s %p\n", name, etype);
   }
 
   if ((SPEC_NOUN(etype)==V_CHAR || 
index bcec34942a5429cceaf3221a162e0c2bfeab6cda..f675769ed36b2c1041cb643640cb6b296e6b710d 100644 (file)
@@ -105,7 +105,7 @@ static void pCodePrintLabel(FILE *of, pCode *pc);
 static void pCodePrintFunction(FILE *of, pCode *pc);
 static void pCodeOpPrint(FILE *of, pCodeOp *pcop);
 static char *get_op_from_instruction( pCodeInstruction *pcc);
-char *get_op( pCodeOp *pcop,char *buff,int buf_size);
+char *get_op( pCodeOp *pcop,char *buff,size_t buf_size);
 int pCodePeepMatchLine(pCodePeep *peepBlock, pCode *pcs, pCode *pcd);
 int pCodePeepMatchRule(pCode *pc);
 void pBlockStats(FILE *of, pBlock *pb);
@@ -1228,7 +1228,7 @@ void SAFE_snprintf(char **str, size_t *size, const  char  *format, ...)
   len = strlen(*str);
   if(len > *size) {
     fprintf(stderr,"WARNING, it looks like %s has overflowed\n",__FUNCTION__);
-    fprintf(stderr,"len = %d is > str size %d\n",len,*size);
+    fprintf(stderr,"len = %d is > str size %d\n",len,(int)*size);
   }
 
   *str += len;
@@ -2490,7 +2490,7 @@ void pBlockRegs(FILE *of, pBlock *pb)
 
 /*-----------------------------------------------------------------*/
 /*-----------------------------------------------------------------*/
-char *get_op(pCodeOp *pcop,char *buffer, int size)
+char *get_op(pCodeOp *pcop,char *buffer, size_t size)
 {
   regs *r;
   static char b[50];
@@ -2587,7 +2587,7 @@ static char *get_op_from_instruction( pCodeInstruction *pcc)
 
   if(pcc )
     return get_op(pcc->pcop,NULL,0);
-  
+
   /* gcc 3.2:  warning: concatenation of string literals with __FUNCTION__ is deprecated 
   return ("ERROR Null: "__FUNCTION__);
   */
@@ -2605,7 +2605,7 @@ static void pCodeOpPrint(FILE *of, pCodeOp *pcop)
 
 /*-----------------------------------------------------------------*/
 /*-----------------------------------------------------------------*/
-char *pCode2str(char *str, int size, pCode *pc)
+char *pCode2str(char *str, size_t size, pCode *pc)
 {
   char *s = str;
 
index 21e1975f49b338d9e12048bb361954ce26187941..91656c4c6157e2c966aebd183adc760ae76c8a45 100644 (file)
@@ -23,15 +23,27 @@ testMalloc(void)
 
   p1 = malloc(5);
   ASSERT(p1 != NULL);
+#ifdef HOST
+  LOG(("p1: %p\n", p1));
+#else
   LOG(("p1: %u\n", (unsigned) p1));
+#endif
 
   p2 = malloc(20);
   ASSERT(p2 != NULL);
+#ifdef HOST
+  LOG(("p2: %p\n", p2));
+#else
   LOG(("p2: %u\n", (unsigned) p2));
+#endif
 
   free(p2);
 
   p3 = malloc(10);
   ASSERT(p3 != NULL);
+#ifdef HOST
+  LOG(("p3, after freeing p2: %p\n", p3));
+#else
   LOG(("p3, after freeing p2: %u\n", (unsigned) p3));
+#endif
 }