summaryrefslogtreecommitdiff
path: root/libparted/filesys.c
diff options
context:
space:
mode:
authorShin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>2019-06-30 21:49:43 +0900
committerBrian C. Lane <bcl@redhat.com>2019-08-09 11:54:54 -0700
commit10886869bed7eef621084c977a1969b47056d78c (patch)
tree2aba6e57a4ff677cfffd0414c2472c1c145ccbc9 /libparted/filesys.c
parent9616effb852c29a193064c476ccea62e133a8410 (diff)
downloadparted-10886869bed7eef621084c977a1969b47056d78c.tar.gz
libparted: Replace abs() with llabs()
GCC 9 fails to compile a few C source files which call abs() function. An example of the error messages was as follows: CC dos.lo dos.c: In function '_best_solution': dos.c:1773:13: error: absolute value function 'abs' given an argument of type 'long long int' but has parameter of type 'int' which may cause truncation of value [-Werror=absolute-value] 1773 | a_delta = abs (part->geom.start - a->start); | ^~~ dos.c:1774:13: error: absolute value function 'abs' given an argument of type 'long long int' but has parameter of type 'int' which may cause truncation of value [-Werror=absolute-value] 1774 | b_delta = abs (part->geom.start - b->start); | ^~~ cc1: all warnings being treated as errors To avoid the errors, replace abs() function calls with llabs(). Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp> Signed-off-by: Brian C. Lane <bcl@redhat.com>
Diffstat (limited to 'libparted/filesys.c')
-rw-r--r--libparted/filesys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libparted/filesys.c b/libparted/filesys.c
index 0f8e821..0012466 100644
--- a/libparted/filesys.c
+++ b/libparted/filesys.c
@@ -211,7 +211,7 @@ _geometry_error (const PedGeometry* a, const PedGeometry* b)
PedSector start_delta = a->start - b->start;
PedSector end_delta = a->end - b->end;
- return abs (start_delta) + abs (end_delta);
+ return llabs (start_delta) + llabs (end_delta);
}
static PedFileSystemType*