more cleaups on error message table: get rid of duplicated elements
[fw/sdcc] / src / SDCCglue.c
index 267154311972055447ceea8abc95857241d141f5..b95d90dbc65cf2075b051442c634da0535b3a870 100644 (file)
@@ -48,7 +48,7 @@ set *publics = NULL;          /* public variables */
 set *externs = NULL;           /* Varibles that are declared as extern */
 
 /* TODO: this should be configurable (DS803C90 uses more than 6) */
-int maxInterrupts = 6;
+unsigned maxInterrupts = 6;
 int allocInfo = 1;
 symbol *mainf;
 extern char *VersionString;
@@ -112,7 +112,7 @@ aopLiteralLong (value * val, int offset, int size)
        /* if it is a float then it gets tricky */
        /* otherwise it is fairly simple */
        if (!IS_FLOAT (val->type)) {
-               unsigned long v = floatFromVal (val);
+               unsigned long v = (unsigned long) floatFromVal (val);
 
                v >>= (offset * 8);
                switch (size) {
@@ -395,12 +395,12 @@ printChar (FILE * ofile, char *s, int plen)
       i = 60;
       while (i && *s && pplen < plen)
        {
-         if (*s < ' ' || *s == '\"')
+         if (*s < ' ' || *s == '\"' || *s=='\\')
            {
              *p = '\0';
              if (p != buf)
                tfprintf (ofile, "\t!ascii\n", buf);
-             tfprintf (ofile, "\t!db !constbyte\n", *s);
+             tfprintf (ofile, "\t!db !constbyte\n", (unsigned char)*s);
              p = buf;
            }
          else
@@ -814,9 +814,9 @@ printIvalCharPtr (symbol * sym, sym_link * type, value * val, FILE * oFile)
        }
     }
 
-
-  if (val->sym && val->sym->isstrlit)
+  if (val->sym && val->sym->isstrlit && !isinSet(statsg->syms, val->sym)) {
     addSet (&statsg->syms, val->sym);
+  }
 
   return 1;
 }
@@ -883,7 +883,11 @@ printIvalPtr (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
     }
   else if (size == FPTRSIZE)
     {
-      tfprintf (oFile, "\t!dws\n", val->name);
+      if (port->use_dw_for_init) {
+       tfprintf (oFile, "\t!dws\n", val->name);
+      } else {
+       printPointerType (oFile, val->name);
+      }
     }
   else if (size == GPTRSIZE)
     {
@@ -994,7 +998,7 @@ emitStaticSeg (memmap * map, FILE * out)
            fprintf (out, " == .\n");
 
          /* if it has an initial value */
-         if (!TARGET_IS_MCS51 && !TARGET_IS_DS390 && sym->ival)
+         if (sym->ival)
            {
              fprintf (out, "%s:\n", sym->rname);
              noAlloc++;
@@ -1056,7 +1060,7 @@ flushStatics (void)
 void 
 createInterruptVect (FILE * vFile)
 {
-  int i = 0;
+  unsigned i = 0;
   mainf = newSymbol ("main", 0);
   mainf->block = 0;
 
@@ -1297,7 +1301,7 @@ glue ()
   if (!options.c1mode)
     {
       sprintf (buffer, srcFileName);
-      strcat (buffer, ".asm");
+      strcat (buffer, port->assembler.file_ext);
     }
   else
     {