OSDN Git Service

build: avoid new float-to-double warnings
authorJim Meyering <meyering@redhat.com>
Sat, 3 Dec 2011 13:28:41 +0000 (14:28 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 3 Dec 2011 14:43:29 +0000 (15:43 +0100)
* libparted/timer.c (ped_timer_new_nested): Mark literal floating point
constants with "f" suffix, since they are compared against "float"s.
* parted/parted.c (_timer_handler): Likewise.

libparted/timer.c
parted/parted.c

index d12b801..3b51b32 100644 (file)
@@ -127,8 +127,8 @@ ped_timer_new_nested (PedTimer* parent, float nest_frac)
        if (!parent)
                return NULL;
 
-       PED_ASSERT (nest_frac >= 0.0);
-       PED_ASSERT (nest_frac <= 1.0);
+       PED_ASSERT (nest_frac >= 0.0f);
+       PED_ASSERT (nest_frac <= 1.0f);
 
        context = (NestedContext*) ped_malloc (sizeof (NestedContext));
        if (!context)
index 66beba6..98524cc 100644 (file)
@@ -204,7 +204,7 @@ _timer_handler (PedTimer* timer, void* context)
                 if (timer->state_name)
                         printf ("%s... ", timer->state_name);
                 printf (_("%0.f%%\t(time left %.2d:%.2d)"),
-                        100.0 * timer->frac,
+                        (double) (100.0f * timer->frac),
                         (int) (tcontext->predicted_time_left / 60),
                         (int) (tcontext->predicted_time_left % 60));