]> andersk Git - splint.git/blobdiff - src/inputStream.c
Fixed all /*@i...@*/ tags (except 1).
[splint.git] / src / inputStream.c
index c77990b3d7314f477d10216ebd1d15b126295810..70931d02209eda960510641366a11baea6d2934f 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
@@ -45,7 +45,7 @@
 */
 
 # include "splintMacros.nf"
-# include "llbasic.h"
+# include "basic.h"
 # include "osd.h"
 # include "portab.h"
 
@@ -80,14 +80,12 @@ inputStream_create (cstring name, cstring suffix, bool echo)
 {
   char *ps;
   inputStream s = (inputStream) dmalloc (sizeof (*s));
-  cstring oname;
 
   s->name = name;
   s->file = NULL;
 
   /*@access cstring@*/
   llassert (cstring_isDefined (s->name));
-  /*@i534 clean this up...*/
   ps = strrchr (s->name, CONNECTCHAR);
 
   if (ps == NULL)
@@ -101,9 +99,7 @@ inputStream_create (cstring name, cstring suffix, bool echo)
       s->name = cstring_concatFree1 (s->name, suffix);
     }
 
-  oname = s->name;
   s->name = fileLib_cleanName (s->name);
-  cstring_free (oname); /* evans 2002-07-12: why no error without this?! */
 
   s->lineNo = 0;
   s->charNo = 0;
@@ -203,7 +199,7 @@ extern /*@dependent@*/ /*@null@*/
 char *inputStream_nextLine (inputStream s)
 {
   char *currentLine;
-  int len;
+  size_t len;
 
   llassert (inputStream_isDefined (s));
   llassert (s->curLine == NULL);
@@ -226,15 +222,15 @@ char *inputStream_nextLine (inputStream s)
              c = strchr (s->stringSourceTail, '\0');
            }
 
-         len = c - s->stringSourceTail + 1;
+         len = size_fromInt (c - s->stringSourceTail + 1);
 
-         if (len > STUBMAXRECORDSIZE - 2)
+         if (len > size_fromInt (STUBMAXRECORDSIZE - 2))
            {
-             len = (STUBMAXRECORDSIZE - 2);
+             len = size_fromInt (STUBMAXRECORDSIZE - 2);
            }
 
          currentLine = &(s->buffer)[0];
-         strncpy (currentLine, s->stringSourceTail, size_fromInt (len));
+         strncpy (currentLine, s->stringSourceTail, len);
          currentLine[len] = '\0';
          s->stringSourceTail += len;
          /*@noaccess cstring@*/
@@ -260,7 +256,7 @@ char *inputStream_nextLine (inputStream s)
        }
       else 
        {
-         if (len >= STUBMAXRECORDSIZE - 2)
+         if (len >= size_fromInt (STUBMAXRECORDSIZE - 2))
            {
              lldiagmsg (message ("Input line too long: %s",
                                  cstring_fromChars (currentLine)));
This page took 0.054356 seconds and 4 git commands to generate.