X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=support%2Flibrarian%2Fsdcclib.c;h=5ab4c4a5b34dd9d111f6ce7f74d396eabd061901;hb=2f00ce617b44fd09d815a65d3489ed49fb8f65db;hp=48e13e8b1873b4f2612909533c9976acdde16497;hpb=3dc8038c8b8b8affcac918268cef56b923829525;p=fw%2Fsdcc diff --git a/support/librarian/sdcclib.c b/support/librarian/sdcclib.c index 48e13e8b..5ab4c4a5 100644 --- a/support/librarian/sdcclib.c +++ b/support/librarian/sdcclib.c @@ -51,12 +51,6 @@ int NumRelFiles=0; #if 1 #include -#define fgets(S, SIZE, STREAM) do { \ - char *__s4567 = S; \ - char *__res4567 = fgets(__s4567, SIZE, STREAM); \ - assert(__s4567 == __res4567); \ -} while (0) - #define system(CMD) do { \ int __res4568 = system(CMD); \ assert(-1 != __res4568); \ @@ -317,7 +311,7 @@ void AddRel(char * RelName) fprintf(libindex, "\n%s %ld\n", FLine, newlibpos); state++; } - } + } break; case 1: fprintf(newlib, "%s\n", FLine); @@ -365,7 +359,7 @@ void AddRel(char * RelName) fclose(rel); fprintf(libindex, "\n"); fprintf(newlib, "\n\n"); - + adb=fopen(AdbName, "r"); if(adb!=NULL) { @@ -482,7 +476,7 @@ void ExtractRel(char * RelName) fgets(FLine, MAXLINE, lib); CleanLine(FLine); if(EQ(FLine, ModName)) state=1; - } + } break; case 1: if(EQ(FLine, "")) state=2; @@ -501,10 +495,10 @@ void ExtractRel(char * RelName) state=5; else fprintf(adb, "%s\n", FLine); - break; + break; } } - + fclose(rel); fclose(lib); fclose(adb); @@ -526,10 +520,10 @@ void DumpSymbols(void) CleanLine(FLine); if(NEQ(FLine, "")) { - printf("ERROR: File '%s' was not created with '%s'\n", LibName, ProgName); + printf("ERROR: File '%s' was not created with '%s'\n", LibName, ProgName); return; } - + while(!feof(lib)) { if(state==3) break; @@ -574,14 +568,14 @@ void DumpSymbols(void) break; } } - + fclose(lib); } int fileexist(char * fname) { FILE * fp; - + fp=fopen(fname, "r"); if(fp==NULL) return 0; fclose(fp); @@ -675,7 +669,7 @@ int main(int argc, char **argv) for(j=0; j