]> andersk Git - splint.git/blobdiff - src/constraintTerm.c
Fixed data on readme.
[splint.git] / src / constraintTerm.c
index e49f75d96143b42e94ff2493f4429a9924a4598a..234598a7ed5f880f16ac18cd53d379ca8841a332 100644 (file)
@@ -736,3 +736,37 @@ ctype constraintTerm_getCType (constraintTerm term)
   return ct;
 }
 
+bool constraintTerm_isConstantOnly (constraintTerm term)
+{  
+  switch (term->kind)
+    {
+    case EXPRNODE:
+      if (exprNode_isNumLiteral (term->value.expr) ||
+         exprNode_isStringLiteral (term->value.expr) ||
+         exprNode_isCharLiteral  (term->value.expr) )
+       {
+         return TRUE;
+       }
+      else
+       {
+         return FALSE;
+       }
+
+    case INTLITERAL:
+      return TRUE;
+            
+    case SREF:
+      if ( sRef_isConst (term->value.sref) )
+       {
+         return TRUE;
+       }
+      else
+       {
+         return FALSE;
+       }
+    default:
+      BADEXIT;
+    }
+  
+  BADEXIT;
+}
This page took 0.0326 seconds and 4 git commands to generate.