* device/include/pic16/stdbool.h: removed, since already exists in
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 16 Dec 2007 16:18:03 +0000 (16:18 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 16 Dec 2007 16:18:03 +0000 (16:18 +0000)
 device/include/; this also fixes bitopcse.c regression test for pic16
 target
* support/regression/fwk/inclusw/testfwk.h: added macro ASSERT_FAILED
* src/pic16/glue.c: fixed bug #1851855: generic static pointer
  dereference doesn't work; covered by regression test bug1399290

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

ChangeLog
src/pic16/glue.c

index 1cbe192a014e5aa1daa8b21a13b4389bed3f5a6a..5f3d8c843f78ce4c25dc547709f534df678a774b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@
         device/include/; this also fixes bitopcse.c regression test for pic16
         target
        * support/regression/fwk/inclusw/testfwk.h: added macro ASSERT_FAILED
+       * src/pic16/glue.c: fixed bug #1851855: generic static pointer
+         dereference doesn't work; covered by regression test bug1399290
 
 2007-12-05 Borut Razem <borut.razem AT siol.net>
 
index df0201da3815491826e593d747777403f29306f2..a0a1e257d3a14ce289af71d1428c2695ed6de9a5 100644 (file)
@@ -520,10 +520,10 @@ void _pic16_printPointerType (const char *name, char ptype, void *p)
 {
   char buf[256];
 
-        sprintf(buf, "LOW(%s)", name);
-        pic16_emitDS(buf, ptype, p);
-        sprintf(buf, "HIGH(%s)", name);
-        pic16_emitDS(buf, ptype, p);
+  sprintf (buf, "LOW(%s)", name);
+  pic16_emitDS (buf, ptype, p);
+  sprintf (buf, "HIGH(%s)", name);
+  pic16_emitDS (buf, ptype, p);
 }
 
 /*-----------------------------------------------------------------*/
@@ -543,28 +543,33 @@ void pic16_printGPointerType (const char *iname, const unsigned int itype,
 {
   char buf[256];
 
-    _pic16_printPointerType (iname, ptype, p);
+  _pic16_printPointerType (iname, ptype, p);
 
-    switch( itype ) {
+  switch (itype)
+    {
+    case CPOINTER:
+    case FUNCTION:
+      sprintf (buf, "UPPER(%s)", iname);
+      pic16_emitDS (buf, ptype, p);
+      break;
+
+    case GPOINTER:
+    case POINTER:
+      sprintf (buf, "0x80");
+      pic16_emitDS (buf, ptype, p);
+      break;
+
+    /*
+     * FPOINTER and IPOINTER are not used in pic16 port
       case FPOINTER:
-      case CPOINTER:
-      case GPOINTER:
-      case FUNCTION:
-        {
-          sprintf(buf, "UPPER(%s)", iname);
-          pic16_emitDS(buf, ptype, p);
-        }; break;
-      case POINTER:
       case IPOINTER:
-        sprintf(buf, "0x80");
-        pic16_emitDS(buf, ptype, p);
-        break;
-      default:
-        debugf("itype = %d\n", itype );
-        assert( 0 );
+     */
+    default:
+      debugf ("itype = %d\n", itype );
+      assert (0);
     }
 
-    //pic16_flushDB(ptype, p); /* might break char* const arr[] = {...}; */
+  //pic16_flushDB(ptype, p); /* might break char* const arr[] = {...}; */
 }