Cleaned up warnings
[fw/sdcc] / src / SDCCicode.c
index 59bcf886fc8610efcaf5f2ff3a8c2891dbc26187..57ee76fcebb16b8489ac664b49cb627ee45353d0 100644 (file)
@@ -126,9 +126,9 @@ iCodeTable codeTable[] =
      pedantic>1: "char c=200" is not allowed (evaluates to -56)
 */
 
-void checkConstantRange(sym_link *ltype, value *val, char *msg, int pedantic) {
+void checkConstantRange(sym_link *ltype, value *val, char *msg, 
+                       int pedantic) {
   double max;
-  char message[132]="";
   int warnings=0;
   int negative=0;
   long v;
@@ -178,6 +178,7 @@ void checkConstantRange(sym_link *ltype, value *val, char *msg, int pedantic) {
     warnings++;
   }
 
+#if 0 // temporary disabled, leaving the warning as a reminder
   if (warnings) {
     sprintf (message, "for %s %s in %s", 
             SPEC_USIGN(ltype) ? "unsigned" : "signed",
@@ -187,6 +188,7 @@ void checkConstantRange(sym_link *ltype, value *val, char *msg, int pedantic) {
     if (pedantic>1)
       fatalError++;
   }
+#endif
 }
 
 /*-----------------------------------------------------------------*/
@@ -858,6 +860,7 @@ isOperandLiteral (operand * op)
 
   return 0;
 }
+
 /*-----------------------------------------------------------------*/
 /* isOperandInFarSpace - will return true if operand is in farSpace */
 /*-----------------------------------------------------------------*/
@@ -886,9 +889,38 @@ isOperandInFarSpace (operand * op)
   return (IN_FARSPACE (SPEC_OCLS (etype)) ? TRUE : FALSE);
 }
 
+/*------------------------------------------------------------------*/
+/* isOperandInDirSpace - will return true if operand is in dirSpace */
+/*------------------------------------------------------------------*/
+bool 
+isOperandInDirSpace (operand * op)
+{
+  sym_link *etype;
+
+  if (!op)
+    return FALSE;
+
+  if (!IS_SYMOP (op))
+    return FALSE;
+
+  if (!IS_TRUE_SYMOP (op))
+    {
+      if (SPIL_LOC (op))
+       etype = SPIL_LOC (op)->etype;
+      else
+       return FALSE;
+    }
+  else
+    {
+      etype = getSpec (operandType (op));
+    }
+  return (IN_DIRSPACE (SPEC_OCLS (etype)) ? TRUE : FALSE);
+}
+
 /*-----------------------------------------------------------------*/
 /* isOperandOnStack - will return true if operand is on stack      */
 /*-----------------------------------------------------------------*/
+#if 0
 bool 
 isOperandOnStack (operand * op)
 {
@@ -904,6 +936,27 @@ isOperandOnStack (operand * op)
 
   return ((IN_STACK (etype)) ? TRUE : FALSE);
 }
+#else
+bool 
+isOperandOnStack (operand * op)
+{
+  sym_link *etype;
+
+  if (!op)
+    return FALSE;
+
+  if (!IS_SYMOP (op))
+    return FALSE;
+
+  etype = getSpec (operandType (op));
+  if (IN_STACK (etype) ||
+      OP_SYMBOL(op)->onStack ||
+      (SPIL_LOC(op) && SPIL_LOC(op)->onStack))
+    return TRUE;
+
+  return FALSE;
+}
+#endif
 
 /*-----------------------------------------------------------------*/
 /* operandLitValue - literal value of an operand                   */