]> andersk Git - splint.git/blobdiff - src/general.c
noexpand always false.
[splint.git] / src / general.c
index b4bbca91e6f51d6e53518d20d3365cda919b80ef..da2bb57ef3b8a263d1d9bbfacc3276a23b971531 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2002 University of Virginia,
+** Copyright (C) 1994-2003 University of Virginia,
 **         Massachusetts Institute of Technology
 **
 ** This program is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 
 # include "splintMacros.nf"
 # include "basic.h"
+
 # undef malloc
 # undef realloc
 # undef calloc
@@ -35,7 +36,7 @@
 # include "dmalloc.h"
 # endif
 
-# include "portab.h"
+# include "osd.h"
 
 /*
 ** redefine undef'd memory ops
@@ -187,18 +188,6 @@ void *direalloc (/*@out@*/ /*@null@*/ void *x, size_t size,
 
 /*@=mustdefine@*/
 
-char *FormatInt (int i)
-{
-  char temp[255]; /* assume the integer has at most 254 digits */
-  char *outs;
-  int sres = snprintf (temp, 255, "%i", i);
-  check (sres >= 0 && sres <= 255);
-  outs = (char *) dmalloc (sizeof (*outs) * (1 + strlen (temp)));
-  strcpy (outs, temp);
-
-  return (outs);
-}
-
 bool firstWord (char *s, char *w)
 {
   llassert (s != NULL);
@@ -394,6 +383,22 @@ size_t size_fromInt (int x) /*@ensures result==x@*/
   return res;
 }
 
+size_t size_fromLong (long x) /*@ensures result==x@*/
+{
+  size_t res = (size_t) x;
+
+  llassert ((long) res == x);
+  return res;
+}
+
+size_t size_fromLongUnsigned (unsigned long x) /*@ensures result==x@*/
+{
+  size_t res = (size_t) x;
+
+  llassert ((unsigned long) res == x);
+  return res;
+}
+
 int size_toInt (size_t x)
 {
   int res = (int) x;
This page took 1.029663 seconds and 4 git commands to generate.