]> git.ipfire.org Git - pakfire.git/commitdiff
libpakfire: Use proper data types for sizes
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 14 Jan 2018 17:25:53 +0000 (18:25 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 14 Jan 2018 17:25:53 +0000 (18:25 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/step.h
src/libpakfire/step.c

index c7c95251939bdcb721a72772ece1132c879a85a3..b42c6b576814647cd982540079c3abc232d7be37 100644 (file)
@@ -33,8 +33,8 @@ PakfirePackage pakfire_step_get_package(PakfireStep step);
 pakfire_step_type_t pakfire_step_get_type(PakfireStep step);
 const char* pakfire_step_get_type_string(PakfireStep step);
 
-unsigned long long pakfire_step_get_downloadsize(PakfireStep step);
-long pakfire_step_get_installsizechange(PakfireStep step);
+size_t pakfire_step_get_downloadsize(PakfireStep step);
+ssize_t pakfire_step_get_installsizechange(PakfireStep step);
 
 int pakfire_step_needs_download(PakfireStep step);
 
index 3e89f743e3988cd11f306ac92bf5db48ffe9f8a1..ff1ec35f77da627328d7f29adc718d1a28b0a603 100644 (file)
@@ -172,18 +172,15 @@ static int pakfire_step_get_downloadtype(PakfireStep step) {
        return 0;
 }
 
-PAKFIRE_EXPORT unsigned long long pakfire_step_get_downloadsize(PakfireStep step) {
-       int downloadsize = 0;
+PAKFIRE_EXPORT size_t pakfire_step_get_downloadsize(PakfireStep step) {
+       if (pakfire_step_get_downloadtype(step))
+               return pakfire_package_get_downloadsize(step->package);
 
-       if (pakfire_step_get_downloadtype(step)) {
-               downloadsize = pakfire_package_get_downloadsize(step->package);
-       }
-
-       return downloadsize;
+       return 0;
 }
 
-PAKFIRE_EXPORT long pakfire_step_get_installsizechange(PakfireStep step) {
-       int installsize = pakfire_package_get_installsize(step->package);
+PAKFIRE_EXPORT ssize_t pakfire_step_get_installsizechange(PakfireStep step) {
+       ssize_t installsize = pakfire_package_get_installsize(step->package);
 
        pakfire_step_type_t type = pakfire_step_get_type(step);
        switch (type) {