* as/link/hc08/lkelf.c, as/link/lkaomf51.c, as/link/lklibr.c,
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 30 Dec 2008 13:27:20 +0000 (13:27 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 30 Dec 2008 13:27:20 +0000 (13:27 +0000)
  as/link/z80/lkgb.c, debugger/mcs51/cmd.c, sim/ucsim/utils.cc,
  src/SDCCasm.c, support/Util/dbuf_string.c, support/cpp/c-ppoutput.c,
  support/cpp/libcpp/lex.c, support/cpp/libcpp/macro.c,
  support/librarian/sdcclib.c, support/makebin/makebin.c:
  partially revert changes from r5293..r5295

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5310 4a8a32a2-be11-0410-ad9d-d568d2c75423

14 files changed:
ChangeLog
as/link/hc08/lkelf.c
as/link/lkaomf51.c
as/link/lklibr.c
as/link/z80/lkgb.c
debugger/mcs51/cmd.c
sim/ucsim/utils.cc
src/SDCCasm.c
support/Util/dbuf_string.c
support/cpp/c-ppoutput.c
support/cpp/libcpp/lex.c
support/cpp/libcpp/macro.c
support/librarian/sdcclib.c
support/makebin/makebin.c

index e1da4128a6ea827f1302a9db235c348f1fb7ca00..34d809ca5ffdf1eaf9fa7e81daa3372574d6e93a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-12-30 Raphael Neider <rneider AT web.de>
+
+       * as/link/hc08/lkelf.c, as/link/lkaomf51.c, as/link/lklibr.c,
+         as/link/z80/lkgb.c, debugger/mcs51/cmd.c, sim/ucsim/utils.cc,
+         src/SDCCasm.c, support/Util/dbuf_string.c, support/cpp/c-ppoutput.c,
+         support/cpp/libcpp/lex.c, support/cpp/libcpp/macro.c,
+         support/librarian/sdcclib.c, support/makebin/makebin.c:
+         partially revert changes from r5293..r5295
+
 2008-12-29 Philipp Klaus Krause <pkk AT spth.de>
 
        * src/z80/peeph-z80.def:
index d37bfa514c5e3752ffe18da119c86702ed8bd7df..3cc602fd483de07718419311c0c42af01075ddd5 100644 (file)
@@ -18,7 +18,6 @@
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 -------------------------------------------------------------------------*/
 
-#include <assert.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
@@ -481,7 +480,6 @@ elfGenerateAbs (struct area *ap, listHeader * segments, listHeader * sections)
   Elf32_Word size;
   Elf32_Phdr * phdrp;
   Elf32_Shdr * shdrp;
-  size_t res;
 
   if (!ap->a_image)
     {
@@ -539,8 +537,7 @@ elfGenerateAbs (struct area *ap, listHeader * segments, listHeader * sections)
       shdrp->sh_entsize = 0;
       listAdd (sections, shdrp);
       
-      res = fwrite (&ap->a_image[addr-ap->a_addr], 1, size, ofp);
-      assert(res == size);
+      fwrite (&ap->a_image[addr-ap->a_addr], 1, size, ofp);
     }  
 }
 
@@ -552,7 +549,6 @@ elfGenerateRel (struct area *ap, listHeader * segments, listHeader * sections)
 {
   Elf32_Phdr * phdrp;
   Elf32_Shdr * shdrp;
-  size_t res;
   
   if (!ap->a_image)
     {
@@ -594,8 +590,7 @@ elfGenerateRel (struct area *ap, listHeader * segments, listHeader * sections)
   shdrp->sh_entsize = 0;
   listAdd (sections, shdrp);
   
-  res = fwrite (ap->a_image, 1, ap->a_size, ofp);
-  assert(res == ap->a_size);
+  fwrite (ap->a_image, 1, ap->a_size, ofp);
 }
 
 /*--------------------------------------------------------------------------*/
index 7a52f4efd4034c00bfe7c628379e23acc43e2860..80284782c1044765bb1c6f4e02ad5d4ae66735ef 100644 (file)
@@ -18,7 +18,6 @@
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 -------------------------------------------------------------------------*/
 
-#include <assert.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
@@ -200,10 +199,8 @@ void FreeAll(void)
 
 void OutputByte(unsigned char value)
 {
-       size_t res;
        GlobalChkSum+=value;
-       res = fwrite( &value, 1, 1, aomf51out );
-       assert(res == 1);
+       fwrite( &value, 1, 1, aomf51out );
 }
 
 void OutputWord(int value)
@@ -570,9 +567,7 @@ void CollectInfoFromCDB(void)
        CurrentModule=0; /*Set the active module as the first one*/
        while(!feof(CDBin))
        {
-               char *res;
-               res = fgets(buff, sizeof(buff)-1, CDBin);
-               assert(res == buff);
+               fgets(buff, sizeof(buff)-1, CDBin);
 
                if(!feof(CDBin)) switch(buff[0])
                {
index b56340a9b0ee51facf88811c2d3ea0caf2e64693..31d2e897aa472176a5facd25e961d6a9cac5204a 100644 (file)
@@ -22,7 +22,6 @@
 #define EQ(A,B) !strcmp((A),(B))
 #define MAXLINE 254 /*when using fgets*/
 
-#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -393,7 +392,6 @@ void LoadRel(char * libfname, FILE * libfp, char * ModName)
 {
     char str[NINPUT+2];
     int state=0;
-    char *res;
 
     while (fgets(str, NINPUT, libfp) != NULL)
     {
@@ -404,8 +402,7 @@ void LoadRel(char * libfname, FILE * libfp, char * ModName)
             case 0:
                 if(EQ(str, "<FILE>"))
                 {
-                    res = fgets(str, NINPUT, libfp);
-                    assert(res == str);
+                    fgets(str, NINPUT, libfp);
                     str[NINPUT+1] = '\0';
                     chop_crlf(str);
                     if(EQ(str, ModName)) state=1;
@@ -441,9 +438,7 @@ int LoadAdb(FILE * libfp)
 
     while (fgets(str, MAXLINE, libfp) != NULL)
     {
-        if (NINPUT < MAXLINE)
-            str[NINPUT+1] = '\0';
-
+        str[NINPUT+1] = '\0';
         chop_crlf(str);
         switch(state)
         {
@@ -472,13 +467,11 @@ int SdccLib(char * PathLib, FILE * libfp, char * DirLib, char * SymName)
     char FLine[MAXLINE+1];
     int state=0;
     long IndexOffset=0, FileOffset;
-    char *res;
 
     while(!feof(libfp))
     {
         FLine[0]=0;
-        res = fgets(FLine, MAXLINE, libfp);
-        assert(res == FLine);
+        fgets(FLine, MAXLINE, libfp);
         chop_crlf(FLine);
 
         switch(state)
@@ -488,8 +481,7 @@ int SdccLib(char * PathLib, FILE * libfp, char * DirLib, char * SymName)
                 {
                     /*The next line has the size of the index*/
                     FLine[0]=0;
-                    res = fgets(FLine, MAXLINE, libfp);
-                    assert(res == FLine);
+                    fgets(FLine, MAXLINE, libfp);
                     chop_crlf(FLine);
                     IndexOffset=atol(FLine);
                     state=1;
@@ -501,8 +493,7 @@ int SdccLib(char * PathLib, FILE * libfp, char * DirLib, char * SymName)
                     /*The next line has the name of the module and the offset
                     of the corresponding embedded file in the library*/
                     FLine[0]=0;
-                    res = fgets(FLine, MAXLINE, libfp);
-                    assert(res == FLine);
+                    fgets(FLine, MAXLINE, libfp);
                     chop_crlf(FLine);
                     sscanf(FLine, "%s %ld", ModName, &FileOffset);
                     state=2;
@@ -747,11 +738,8 @@ int fndsym( char *name )
                     for(j=0; absPath1[j]!=0; j++) absPath1[j]=tolower((unsigned char)absPath1[j]);
                     for(j=0; absPath2[j]!=0; j++) absPath2[j]=tolower((unsigned char)absPath2[j]);
 #else
-                    char *res;
-                    res = realpath(FirstFound->libspc, absPath1);
-                    assert(res == absPath1);
-                    res = realpath(ThisLibr->libspc, absPath2);
-                    assert(res == absPath2);
+                    realpath(FirstFound->libspc, absPath1);
+                    realpath(ThisLibr->libspc, absPath2);
 #endif
                     if( !( EQ(absPath1, absPath2) && EQ(FirstFound->relfil, ThisLibr->relfil) ) )
                     {
@@ -783,13 +771,11 @@ pmlibraryfile buildlibraryindex_SdccLib(char * PathLib, FILE * libfp, char * Dir
     int state=0;
     long IndexOffset=0, FileOffset;
     pmlibrarysymbol ThisSym = NULL;
-    char *res;
 
     while(!feof(libfp))
     {
         FLine[0]=0;
-        res = fgets(FLine, MAXLINE, libfp);
-        assert(res == FLine);
+        fgets(FLine, MAXLINE, libfp);
         chop_crlf(FLine);
 
         switch(state)
@@ -799,8 +785,7 @@ pmlibraryfile buildlibraryindex_SdccLib(char * PathLib, FILE * libfp, char * Dir
                 {
                     /*The next line has the size of the index*/
                     FLine[0]=0;
-                    res = fgets(FLine, MAXLINE, libfp);
-                    assert(res == FLine);
+                    fgets(FLine, MAXLINE, libfp);
                     chop_crlf(FLine);
                     IndexOffset=atol(FLine);
                     state=1;
@@ -812,8 +797,7 @@ pmlibraryfile buildlibraryindex_SdccLib(char * PathLib, FILE * libfp, char * Dir
                     /*The next line has the name of the module and the offset
                     of the corresponding embedded file in the library*/
                     FLine[0]=0;
-                    res = fgets(FLine, MAXLINE, libfp);
-                    assert(res == FLine);
+                    fgets(FLine, MAXLINE, libfp);
                     chop_crlf(FLine);
                     sscanf(FLine, "%s %ld", ModName, &FileOffset);
                     state=2;
index fca7cd1e0c46f3096e69ddb595d3da2fad8a1079..55ae41ff7b020bc64f88c3742f8a5f5681c0edf2 100644 (file)
@@ -6,7 +6,6 @@
 
 #ifdef GAMEBOY
 
-#include <assert.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -183,11 +182,8 @@ VOID gb(int in)
     cart[0x014E/SEGSIZE][0x014E%SEGSIZE] = (unsigned char)((chk>>8)&0xFF);
     cart[0x014F/SEGSIZE][0x014F%SEGSIZE] = (unsigned char)(chk&0xFF);
 
-    for(i = 0; i < NBSEG; i++) {
-      size_t res;
-      res = fwrite(cart[i], 1, SEGSIZE, ofp);
-      assert(res == SEGSIZE);
-    }
+    for(i = 0; i < NBSEG; i++)
+      fwrite(cart[i], 1, SEGSIZE, ofp);
   }
 }
 
index 332ee2edaf58b512ee4345debeefa27c9b9f4dd6..4bfc16fdf33c011416ca86b07b5e816a5b95e9b1 100644 (file)
@@ -21,7 +21,6 @@
    what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
-#include <assert.h>
 #include "sdcdb.h"
 #include "symtab.h"
 #include "simi.h"
@@ -1410,12 +1409,9 @@ int cmdDelUserBp (char *s, context *cctxt)
     if (!*s ) {
         if (userBpPresent) {
             char buffer[10];
-            char *res;
-
             fprintf (stdout,"Delete all breakpoints? (y or n) ");
             fflush(stdout);
-            res = fgets(buffer,sizeof(buffer),stdin);
-            assert(res == &buffer[0]);
+            fgets(buffer,sizeof(buffer),stdin);
             if (toupper(buffer[0]) == 'Y')
                 deleteUSERbp(-1);
         }
@@ -1636,15 +1632,13 @@ int cmdRun (char *s, context *cctxt)
     resetHitCount();
         simGo(0);
     } else {
-        char *res;
 
         fprintf(stdout,
                 "The program being debugged has been started already.\n");
         fprintf(stdout,"Start it from the beginning? (y or n) ");
         fflush(stdout);
 
-        res = fgets(buff,sizeof(buff),stdin);
-        assert(res == &buff[0]);
+        fgets(buff,sizeof(buff),stdin);
         if (toupper(buff[0]) == 'Y') {
             simReset();
         resetHitCount();
index ba5f57c7c4f98f83ed19f00a701231c4e2505b63..eb648e7ff56e8cf0447cf425f2c25778b32d2d66 100644 (file)
@@ -116,14 +116,12 @@ format_string(const char *format, ...)
 
   va_start(ap, format);
 #ifdef HAVE_VASPRINTF
-  int res;
   char *msg= NULL;
-  res = vasprintf(&msg, format, ap);
+  vasprintf(&msg, format, ap);
   return(msg);
 #elif defined HAVE_VSNPRINTF
-  int res;
   char *msg= (char*)malloc(80*25);
-  res = vsnprintf(msg, 80*25, format, ap);
+  vsnprintf(msg, 80*25, format, ap);
   return(msg);
 #elif defined HAVE__VSNPRINTF
   char *msg= (char*)malloc(80*25);
index 383c40a43720ccce6623e080f5b09b6e085ddeb2..08d373031d284025f6f3bb03e32aae8fdab5adc3 100644 (file)
@@ -212,7 +212,6 @@ tfprintf (FILE *fp, const char *szFormat, ...)
   va_list ap;
   struct dbuf_s dbuf;
   size_t len;
-  size_t res;
 
   dbuf_init (&dbuf, INITIAL_INLINEASM);
 
@@ -221,8 +220,7 @@ tfprintf (FILE *fp, const char *szFormat, ...)
   va_end (ap);
 
   len = dbuf_get_length (&dbuf);
-  res = fwrite(dbuf_get_buf (&dbuf), 1, len, fp);
-  assert(res == len);
+  fwrite(dbuf_get_buf (&dbuf), 1, len, fp);
   dbuf_destroy (&dbuf);
 }
 
index 61e125e46aa5364ab98971baa511c0e82ef5f219..c2de470d204037295bb23b36c5ed88228bf92ea0 100644 (file)
@@ -282,10 +282,7 @@ dbuf_chomp (struct dbuf_s *dbuf)
 void
 dbuf_write (struct dbuf_s *dbuf, FILE *dest)
 {
-  size_t res;
-  size_t len = dbuf_get_length (dbuf);
-  res = fwrite (dbuf_get_buf (dbuf), 1, len, dest);
-  assert(res == len);
+  fwrite (dbuf_get_buf (dbuf), 1, dbuf_get_length (dbuf), dest);
 }
 
 
index 812c91adefe4bfa314312f0014a774456a1b4f11..908558354adc9ee699ce8062800c945b5dc8d922 100644 (file)
@@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#include <assert.h>
 #include "config.h"
 #include "system.h"
 #include "cpplib.h"
@@ -194,11 +193,9 @@ scan_translation_unit_trad (cpp_reader *pfile)
 {
   while (_cpp_read_logical_line_trad (pfile))
     {
-      size_t res;
       size_t len = pfile->out.cur - pfile->out.base;
       maybe_print_line (pfile->out.first_line);
-      res = fwrite (pfile->out.base, 1, len, print.outf);
-      assert(res == len);
+      fwrite (pfile->out.base, 1, len, print.outf);
       print.printed = 1;
       if (!CPP_OPTION (pfile, discard_comments))
        account_for_newlines (pfile->out.base, len);
index 7c7c03a2cc022724a7d99ded7e31c41b3a598788..ab04177ea05734ba958e087f98e1f5b5c7ef509f 100644 (file)
@@ -1782,8 +1782,6 @@ cpp_type2name (enum cpp_ttype type)
 void
 cpp_output_token (const cpp_token *token, FILE *fp)
 {
-  size_t res;
-
   switch (TOKEN_SPELL (token))
     {
     case SPELL_OPERATOR:
@@ -1817,8 +1815,7 @@ cpp_output_token (const cpp_token *token, FILE *fp)
             {
               unsigned char buffer[10];
               i += utf8_to_ucn (buffer, name + i) - 1;
-              res = fwrite (buffer, 1, 10, fp);
-              assert (10 == res);
+              fwrite (buffer, 1, 10, fp);
             }
           else
             fputc (NODE_NAME (token->val.node)[i], fp);
@@ -1826,8 +1823,7 @@ cpp_output_token (const cpp_token *token, FILE *fp)
       break;
 
     case SPELL_LITERAL:
-      res = fwrite (token->val.str.text, 1, token->val.str.len, fp);
-      assert (token->val.str.len == res);
+      fwrite (token->val.str.text, 1, token->val.str.len, fp);
       break;
 
     case SPELL_NONE:
index 26e5f03a7b27a6fee5c5d38bb202e940105878fd..764d5e3afd9bab3d66441c733d5c17f05016ee47 100644 (file)
@@ -1657,7 +1657,7 @@ create_iso_definition (cpp_reader *pfile, cpp_macro *macro)
              function-like macros, but not at the end.  */
           if (following_paste_op)
             {
-              cpp_error (pfile, CPP_DL_ERROR, "%s", paste_op_error_msg);
+              cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
               return false;
             }
           break;
@@ -1670,7 +1670,7 @@ create_iso_definition (cpp_reader *pfile, cpp_macro *macro)
              function-like macros, but not at the beginning.  */
           if (macro->count == 1)
             {
-              cpp_error (pfile, CPP_DL_ERROR, "%s", paste_op_error_msg);
+              cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
               return false;
             }
 
index 5ab4c4a5b34dd9d111f6ce7f74d396eabd061901..8537cba39ddcd041fdec917d624efb5548eab019 100644 (file)
@@ -48,15 +48,6 @@ int NumRelFiles=0;
 #define EQ(A,B) !strcmp((A),(B))
 #define NEQ(A,B) strcmp((A),(B))
 
-#if 1
-#include <assert.h>
-
-#define system(CMD)             do {                    \
-  int __res4568 = system(CMD);                          \
-  assert(-1 != __res4568);                              \
-} while (0)
-#endif
-
 int action=OPT_NONE;
 FILE *lib, *newlib, *rel, *adb, *libindex;
 char FLine[MAXLINE+1];
index b6acaf4c872dde008a089962a2be76a78aa29499..83d4ec6990991627f4fd0a36cbfd6f1a230e881d 100644 (file)
@@ -1,6 +1,5 @@
 /** @name makebin - turn a .ihx file into a binary image.
  */
-#include <assert.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -49,7 +48,6 @@ int main(int argc, char **argv)
 {
     int size = 32768, pack = 0, real_size = 0;
     BYTE *rom;
-    size_t res;
     char line[256];
     char *p;
 
@@ -114,13 +112,10 @@ int main(int argc, char **argv)
            real_size = addr;
     }
 
-    if (pack) {
-        res = fwrite(rom, 1, real_size, stdout);
-        assert(res == real_size);
-    } else {
-        res = fwrite(rom, 1, size, stdout);
-        assert(res == size);
-    }
+    if (pack)
+        fwrite(rom, 1, real_size, stdout);
+    else
+        fwrite(rom, 1, size, stdout);
     
     return 0;
 }