* device/include/stdarg.h: changed SDCC specific keywords to double
authormaartenbrock <maartenbrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 6 Apr 2005 20:09:07 +0000 (20:09 +0000)
committermaartenbrock <maartenbrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 6 Apr 2005 20:09:07 +0000 (20:09 +0000)
  underlined form.
* device/include/stdint.h: changed intptr_t and uintptr_t for others than
  mcs51 and ds390.
* device/include/hc08/mc68hc908gp32.h,
* device/include/hc08/mc68hc908jb8.h,
* device/include/hc08/mc68hc908jkjl.h,
* device/include/hc08/mc68hc908qy.h: fixed comments
* device/include/mcs51/README: updated
* device/include/mcs51/c8051f120.h: added PINRSF
* device/lib/pic16/libc/stdlib/crc16.c: fixed comments
* src/pic16/pcode.c: MSVC6 doesn't accept declaring new variables
  amidst code. Also inline is not supported.

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3721 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/include/hc08/mc68hc908gp32.h
device/include/hc08/mc68hc908jb8.h
device/include/hc08/mc68hc908jkjl.h
device/include/hc08/mc68hc908qy.h
device/include/mcs51/README
device/include/mcs51/c8051f120.h
device/include/stdarg.h
device/include/stdint.h
device/lib/pic16/libc/stdlib/crc16.c
src/pic16/pcode.c

index 39475bebdce09698e1cae98b3dcc5d2001e9ad57..a8802cd8912869f272a998a1a9e3f2a58ce10626 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2005-04-06 Maarten Brock <sourceforge.brock AT dse.nl>
+
+       * device/include/stdarg.h: changed SDCC specific keywords to double
+         underlined form.
+       * device/include/stdint.h: changed intptr_t and uintptr_t for others than
+         mcs51 and ds390.
+       * device/include/hc08/mc68hc908gp32.h,
+       * device/include/hc08/mc68hc908jb8.h,
+       * device/include/hc08/mc68hc908jkjl.h,
+       * device/include/hc08/mc68hc908qy.h: fixed comments
+       * device/include/mcs51/README: updated
+       * device/include/mcs51/c8051f120.h: added PINRSF
+       * device/lib/pic16/libc/stdlib/crc16.c: fixed comments
+       * src/pic16/pcode.c: MSVC6 doesn't accept declaring new variables
+         amidst code. Also inline is not supported.
+
 2005-04-06 Raphael Neider <rneider AT web.de>
 
        * src/pic16/pcode.c (pic16_pCodeReplace): also update pcflow->end
 
 2005-04-06 Vangelis Rokas <vrokas AT users.sourceforge.net>
 
-        * device/include/pic16/usart.h: added, missing in previous commit,
-        * device/include/pic16/adc.h: fixed typo,
-        * device/lib/pic16/libc/utils/cvtdec.S: added missing in previous
-        commit,
-        * device/lib/pic16/libc/stdlib/g_ftoa.S: modified to include
-        <p18fxxx.inc>
-        * device/lib/pic16/libc/stdio/streams.c: leave stdin, stdout
-        uninitialized because a bug appears with gplink
-        * device/lib/pic16/{some makefiles}: moved $(CSTD) from CFLAGS to
-        COMPILE_FLAGS and added CPPFLAGS with -nostdinc because sdcpp
-        complains for unrecognised option
+       * device/include/pic16/usart.h: added, missing in previous commit,
+       * device/include/pic16/adc.h: fixed typo,
+       * device/lib/pic16/libc/utils/cvtdec.S: added missing in previous
+       commit,
+       * device/lib/pic16/libc/stdlib/g_ftoa.S: modified to include
+       <p18fxxx.inc>
+       * device/lib/pic16/libc/stdio/streams.c: leave stdin, stdout
+       uninitialized because a bug appears with gplink
+       * device/lib/pic16/{some makefiles}: moved $(CSTD) from CFLAGS to
+       COMPILE_FLAGS and added CPPFLAGS with -nostdinc because sdcpp
+       complains for unrecognised option
 
 2005-04-05 Raphael Neider <rneider AT web.de>
 
        * device/include/mcs51/c8051f350.h,
        * device/include/z180.h: Changed SDCC specific keywords to double
        underlined form.
-        
+
 2005-03-31 Vangelis Rokas <vrokas AT users.sourceforge.net>
 
        * src/pic16/device.c (Pics16[]): added devices 18F2550, 18F4331,
         should be removed from local register store/restore in/from stack
         block,
         * src/pic16/ralloc.c (pic16_decodeOp): added decode for
-        DUMMY_READ_VOLATILE, 
+        DUMMY_READ_VOLATILE,
 
         * device/include/pic16/adc.h: minor prototype modifications and
         update,
index 25a756fa4f83cac1a25c86fb07bc2c7d4003da01..d74c021a2516f7479e7758ac2d1a6e471a6795fa 100644 (file)
@@ -9,7 +9,7 @@
     
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 2, or (__at your option) any
+   Free Software Foundation; either version 2, or (at your option) any
    later version.
    
    This program is distributed in the hope that it will be useful,
index 249a1b38489afa14eeb9713679bb537d643f2aec..5f827f99f8abac12931730ae415ed01f8b772de5 100644 (file)
@@ -9,7 +9,7 @@
     
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 2, or (__at your option) any
+   Free Software Foundation; either version 2, or (at your option) any
    later version.
    
    This program is distributed in the hope that it will be useful,
index 842b71af3588b1c2d849749355e0414f6d20b569..bcfa244b2718bc338139bf54c372813429db2ed1 100644 (file)
@@ -9,7 +9,7 @@
     
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 2, or (__at your option) any
+   Free Software Foundation; either version 2, or (at your option) any
    later version.
    
    This program is distributed in the hope that it will be useful,
index e1373642c6537b79b549aca5466314010458c3d8..7a8257003925c6fa6fc8c58ed4f3fa5dbe98d166 100644 (file)
@@ -6,7 +6,7 @@
     
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 2, or (__at your option) any
+   Free Software Foundation; either version 2, or (at your option) any
    later version.
    
    This program is distributed in the hope that it will be useful,
index 89fef239e7c7859ec83b1dbae10a461f43e00d2c..b8cde2be5b29d5cecf75c000709935f75732c6e0 100644 (file)
@@ -1,2 +1,6 @@
-sdcc/device/lib/mcs51
----------------------
+sdcc/device/include/mcs51
+-------------------------
+
+A lot of the include files in this subdirectory used to be in the directory
+one level up from here. Since CVS doesn't support moving files, these files
+were removed there and added here.
index 10ab4331d225412ea1cc73f595bd83635dd12184..1541b39fbcc9c97c0134655ab006cfb9dff57112 100644 (file)
@@ -457,6 +457,7 @@ __sbit __at 0xFF P7_7    ;
 #define CAPP              0x20    /* PCA0CPMn                            */
 #define ECOM              0x40    /* PCA0CPMn                            */
 #define PWM16             0x80    /* PCA0CPMn                            */
+#define PINRSF             0x01    /* RSTSRC                              */
 #define PORSF             0x02    /* RSTSRC                              */
 #define SWRSF             0x10    /* RSTSRC                              */
 
index 69263514bdad44657393fedc06e918dc5720d231..671b0e2bca8e888127330a77548881eb5ad8c132 100644 (file)
@@ -19,13 +19,13 @@ typedef     unsigned char * va_list ;
 
 #elif defined(SDCC_USE_XSTACK)
 
-typedef        unsigned char pdata * va_list ;
+typedef        unsigned char __pdata * va_list ;
 #define va_arg(marker,type) *((type __data *)(marker -= sizeof(type)))
 #define        va_start(marker,first) { marker = (va_list)((char __pdata *)&first); }
 
 #else
 
-typedef        unsigned char data * va_list ;
+typedef        unsigned char __data * va_list ;
 #define va_arg(marker,type) *((type __data * )(marker -= sizeof(type)))
 #define        va_start(marker,first) { marker = (va_list) ((char __data * )&first); }
 
index 12b26d5bc80f76093c9f97358258832583c3b37e..145124980e61b9cfd90c2e11a0d5ccf377a11777 100644 (file)
@@ -62,8 +62,13 @@ typedef unsigned long int       uint_fast32_t;
 
 
 /* Types for `void *' pointers.  */
-typedef long int                intptr_t;
-typedef unsigned long int       uintptr_t;
+#if defined (SDCC_mcs51) || defined (SDCC_ds390)
+  typedef long int              intptr_t;
+  typedef unsigned long int     uintptr_t;
+#else
+  typedef int                   intptr_t;
+  typedef unsigned int          uintptr_t;
+#endif
 
 
 /* Largest integral types.  */
@@ -117,9 +122,15 @@ typedef unsigned long int       uintmax_t;
 # define UINT_FAST32_MAX        (4294967295UL)
 
 /* Values to test for integral types holding `void *' pointer.  */
+#if defined (SDCC_mcs51) || defined (SDCC_ds390)
 # define INTPTR_MIN             (-2147483647L-1)
 # define INTPTR_MAX             (2147483647L)
 # define UINTPTR_MAX            (4294967295UL)
+#else
+# define INTPTR_MIN             (-32767-1)
+# define INTPTR_MAX             (32767)
+# define UINTPTR_MAX            (65535)
+#endif
 
 /* Minimum for largest signed integral type.  */
 # define INTMAX_MIN             (-__INT32_C(-2147483647L)-1)
@@ -133,8 +144,13 @@ typedef unsigned long int       uintmax_t;
 /* Limits of other integer types.  */
 
 /* Limits of `ptrdiff_t' type.  */
+#if defined (SDCC_mcs51) || defined (SDCC_ds390)
 # define PTRDIFF_MIN           (-2147483647L-1)
 # define PTRDIFF_MAX           (2147483647L)
+#else
+# define PTRDIFF_MIN           (-32767-1)
+# define PTRDIFF_MAX           (32767)
+#endif
 
 /* Limit of `size_t' type.  */
 # define SIZE_MAX               (65535)
index 357a9901c2604c10879d0dd27555450b74b31d6b..23c3e495fa9965c1c9ef848508bd32f9e331a021 100644 (file)
@@ -79,7 +79,7 @@ __code uint16_t crc_table[256] = {
  *
  * DESCRIPTION
  *     The OSTA-UDF(tm) 1.50 standard states that using CRCs is mandatory.
- *     The polynomial used is: x^16 + x^12 + x^15 + 1
+ *     The polynomial used is: x^16 + x^12 + x^5 + 1
  *
  * PRE-CONDITIONS
  *     data            Pointer to the data block.
index 49f86f72703350854168553a20bc1beb5e437c5c..79f6d1524a34b4e36e784c053a6cc5bda0c6afbd 100644 (file)
@@ -34,6 +34,7 @@
 
 #if defined(__BORLANDC__) || defined(_MSC_VER)
 #define STRCASECMP stricmp
+#define inline
 #else
 #define STRCASECMP strcasecmp
 #endif
@@ -9431,7 +9432,7 @@ static int pic16_safepCodeUnlink (pCode *pc, char *comment) {
   if (0 || pic16_debug_verbose || pic16_pcode_verbose) {
     len = strlen (buf) + strlen (comment) + 10;
     total = (char *) Safe_malloc (len);
-    snprintf (total, len, "%s: %s", comment, buf);
+    SNPRINTF (total, len, "%s: %s", comment, buf);
     pic16_pCodeInsertAfter (pc, pic16_newpCodeCharP(total));
     Safe_free (total);
   }
@@ -9531,9 +9532,6 @@ static symbol_t symFromStr (const char *str) {
 
   if (!map_symToStr) {
     int i;
-    map_strToSym = newHashTable (128);
-    map_symToStr = newHashTable (128);
-
     struct { char *name; symbol_t sym; } predefsyms[] = {
        {"WREG", SPO_WREG},
        {"STATUS", SPO_STATUS},
@@ -9575,6 +9573,9 @@ static symbol_t symFromStr (const char *str) {
        {NULL, 0}
     };
 
+    map_strToSym = newHashTable (128);
+    map_symToStr = newHashTable (128);
+
     for (i=0; predefsyms[i].name; i++) {
       char *name;
 
@@ -11457,8 +11458,8 @@ static void assignValnums (pCode *pc) {
   case POC_XORLW: /* modifies STATUS (Z,N) */
     /* can be optimized iff WREG contains a known literal (0x100 - 0x1FF) */
     if (pci->pcop->type == PO_LITERAL) {
-      lit = (unsigned char) PCOL(pci->pcop)->lit;
       int vallit = -1;
+      lit = (unsigned char) PCOL(pci->pcop)->lit;
       val = defmapCurr (list, SPO_WREG, pc);
       if (val) vallit = litFromValnum (val->in_val);
       if (vallit != -1) {
@@ -12059,7 +12060,7 @@ static void pic16_vcg_close (FILE *of) {
 }
 
 #define BUF_SIZE 128
-#define pcTitle(pc) (snprintf (buf, BUF_SIZE, "n_%p, %p/%u", PCODE(pc), isPCI(pc) ? PCI(pc)->pcflow : NULL, PCODE(pc)->seq), &buf[0])
+#define pcTitle(pc) (SNPRINTF (buf, BUF_SIZE, "n_%p, %p/%u", PCODE(pc), isPCI(pc) ? PCI(pc)->pcflow : NULL, PCODE(pc)->seq), &buf[0])
 
 #if 0
 static int ptrcmp (const void *p1, const void *p2) {
@@ -12236,9 +12237,9 @@ static void pic16_vcg_dump_default (pBlock *pb) {
   pc = pb->pcHead;
   while (pc && !isPCF(pc)) pc = pc->next;
   if (pc) {
-    snprintf (buf, BUF_SIZE, "%s_%s.vcg", PCF(pc)->modname, PCF(pc)->fname);
+    SNPRINTF (buf, BUF_SIZE, "%s_%s.vcg", PCF(pc)->modname, PCF(pc)->fname);
   } else {
-    snprintf (buf, BUF_SIZE, "pb_%p.vcg", pb);
+    SNPRINTF (buf, BUF_SIZE, "pb_%p.vcg", pb);
   }
 
   //fprintf (stderr, "now dumping %s\n", buf);