comitted Bernhard's peephole 182a
[fw/sdcc] / src / SDCCglue.c
index 2b1a1f1d2aecaedb4f022ebe31339a220f01d6d7..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
@@ -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)
     {
@@ -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
     {