chiark / gitweb /
fix a couple of issues found with llvm-analyze
[elogind.git] / src / readahead / readahead-analyze.c
index 8f1d7f9c4fa188442c67585c47e88bf0660361df..11b2b2dc11819e385a9f323433c4ffb5015d82ec 100644 (file)
@@ -115,7 +115,7 @@ int main_analyze(const char *pack_path) {
                         tsize += size;
 
                         printf("  %4d%% (%2d) %12ld: %s\n",
-                                sections ? (int)(size / st.st_size * 100.0) : 100,
+                                sections ? (int) (size * 100 / st.st_size) : 100,
                                 sections ? sections : 1,
                                 (unsigned long)size,
                                 path);
@@ -135,11 +135,11 @@ int main_analyze(const char *pack_path) {
         printf("\nHOST:    %s"
                "TYPE:    %c\n"
                "MISSING: %d\n"
-               "TOTAL:   %ld\n",
+               "TOTAL:   %llu\n",
                line,
                a,
                missing,
-               tsize);
+               (unsigned long long) tsize);
 
         return EXIT_SUCCESS;