]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
format-table: don't use unsigned when there's no point in it 10381/head
authorLennart Poettering <lennart@poettering.net>
Fri, 12 Oct 2018 17:02:23 +0000 (19:02 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 13 Oct 2018 10:37:13 +0000 (12:37 +0200)
CID 1394372

src/basic/format-table.c

index e30460eab6248f8ec727ad0c8292af72b9d1e88a..5c99c398c2d6ed8ed3a81834ce8ec33a5f0ec91c 100644 (file)
@@ -73,11 +73,11 @@ typedef struct TableData {
 } TableData;
 
 static size_t TABLE_CELL_TO_INDEX(TableCell *cell) {
-        unsigned i;
+        size_t i;
 
         assert(cell);
 
-        i = PTR_TO_UINT(cell);
+        i = PTR_TO_SIZE(cell);
         assert(i > 0);
 
         return i-1;
@@ -85,7 +85,7 @@ static size_t TABLE_CELL_TO_INDEX(TableCell *cell) {
 
 static TableCell* TABLE_INDEX_TO_CELL(size_t index) {
         assert(index != (size_t) -1);
-        return UINT_TO_PTR((unsigned) (index + 1));
+        return SIZE_TO_PTR(index + 1);
 }
 
 struct Table {