]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
solving the rest of C90 issues in defining local variables in middle of code and...
authorAhmed Abdellah <ahmedabdellah@fb.com>
Wed, 23 Oct 2019 19:22:07 +0000 (20:22 +0100)
committerAhmed Abdellah <ahmedabdellah@fb.com>
Wed, 23 Oct 2019 19:22:07 +0000 (20:22 +0100)
programs/util.c
programs/zstdcli.c

index cb2e6410b65475a67a281920d4ce307e2d5e0050..e28e4a96b4f869a2b5027a6072ae6c5c241e268f 100644 (file)
@@ -283,7 +283,7 @@ UTIL_createFileNamesTable_fromFileName(const char* inputFileName) {
     UTIL_DISPLAY("[TRACE] migration done\n");
 
 
-    UTIL_DISPLAY("[TRACE] pos %zu  inputFileSize %lu\n", pos, inputFileSize);
+    UTIL_DISPLAY("[TRACE] pos %zu  inputFileSize %llu\n", pos, inputFileSize);
     if(pos > inputFileSize){
       UTIL_freeFileNamesTable(filesTable);
       if(buf) free(buf);
@@ -330,7 +330,7 @@ UTIL_concatenateTwoTables(FileNamesTable* table1, FileNamesTable* table2) {
     }
 
     size_t newTotalTableSize = getTotalTableSize(table1) + getTotalTableSize(table2);
-    UTIL_DISPLAY("[TRACE] buf total size is: %d\n", newTotalTableSize);
+    UTIL_DISPLAY("[TRACE] buf total size is: %zu\n", newTotalTableSize);
 
     char* buf = (char*) malloc(newTotalTableSize * sizeof(char));
     if(!buf) {
index ade7ca00a230746325c65bb3c85a8b43b4ceed88..9a05cf72c79486a2b8ca146665650443b9f50b0c 100644 (file)
@@ -808,9 +808,8 @@ int main(int argCount, const char* argv[])
 
                     if (longCommandWArg(&argument, "--file=")) {
                         DISPLAYLEVEL(4, "[TRACE] argument catched\n");
-                        const char* fileName = argument;
                         DISPLAYLEVEL(4, "[TRACE] fileName: %s\n", argument);
-                        if(!UTIL_fileExist(fileName) || !UTIL_isRegularFile(argument)){
+                        if(!UTIL_fileExist(argument) || !UTIL_isRegularFile(argument)){
                           DISPLAYLEVEL(1, "[ERROR] wrong fileName: %s\n", argument);
                           CLEAN_RETURN(badusage(programName));
                         }
@@ -824,7 +823,7 @@ int main(int argCount, const char* argv[])
                         DISPLAYLEVEL(4, "[TRACE] call read function is finished\n");
                         DISPLAYLEVEL(4, "[TRACE] extendedFileNamesTable:\n");
 
-                        unsigned i = 0;
+                        unsigned i;
                         for(i = 0; i < extendedTable->tableSize; ++i)
                             printf("%s\n",extendedTable->fileNames[i]);