From 0b43381e0aec3b204ab7b820c73827004d4412fe Mon Sep 17 00:00:00 2001 From: David King Date: Tue, 10 Feb 2015 22:41:05 +0000 Subject: [PATCH] Fix format string signedness warnings GCC 5.0, with its new -Wformat-signedness, warns about the sign being different between a type and the format string in printf-format messages. Fix the sign of the format strings and types so that they match. https://bugs.freedesktop.org/show_bug.cgi?id=89070 --- src/udisksata.c | 2 +- src/udiskscrypttabmonitor.c | 2 +- src/udisksdaemon.c | 6 +++--- src/udisksdaemonutil.c | 4 ++-- src/udiskslinuxblock.c | 4 ++-- src/udiskslinuxdrive.c | 2 +- src/udiskslinuxdriveata.c | 6 +++--- src/udiskslinuxfilesystem.c | 20 ++++++++++---------- src/udiskslinuxmanager.c | 6 +++--- src/udiskslinuxpartition.c | 16 ++++++++-------- src/udiskslinuxprovider.c | 4 ++-- src/udisksmountmonitor.c | 2 +- src/udisksstate.c | 18 +++++++++--------- tools/udisksctl.c | 6 +++--- tools/umount-udisks.c | 6 +++--- udisks/udisksclient.c | 6 +++--- udisks/udisksobjectinfo.c | 14 +++++++------- 17 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/udisksata.c b/src/udisksata.c index 99d1118..e395e51 100644 --- a/src/udisksata.c +++ b/src/udisksata.c @@ -303,7 +303,7 @@ udisks_ata_send_command_sync (gint fd, { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "ATA command failed: error=0x%02x count=0x%02x status=0x%02x", - output->error, output->count, output->status); + (guint) output->error, (guint) output->count, (guint) output->status); goto out; } diff --git a/src/udiskscrypttabmonitor.c b/src/udiskscrypttabmonitor.c index 42b2a14..7cdcf26 100644 --- a/src/udiskscrypttabmonitor.c +++ b/src/udiskscrypttabmonitor.c @@ -396,7 +396,7 @@ udisks_crypttab_monitor_ensure (UDisksCrypttabMonitor *monitor) num_tokens = g_strv_length (tokens); if (num_tokens < 2) { - udisks_warning ("Line %d of /etc/crypttab only contains %d tokens", n, num_tokens); + udisks_warning ("Line %u of /etc/crypttab only contains %u tokens", n, num_tokens); goto continue_loop; } diff --git a/src/udisksdaemon.c b/src/udisksdaemon.c index 6f194ae..1910596 100644 --- a/src/udisksdaemon.c +++ b/src/udisksdaemon.c @@ -515,7 +515,7 @@ udisks_daemon_launch_simple_job (UDisksDaemon *daemon, udisks_base_job_add_object (UDISKS_BASE_JOB (job), object); /* TODO: protect job_id by a mutex */ - job_object_path = g_strdup_printf ("/org/freedesktop/UDisks2/jobs/%d", job_id++); + job_object_path = g_strdup_printf ("/org/freedesktop/UDisks2/jobs/%u", job_id++); job_object = udisks_object_skeleton_new (job_object_path); udisks_object_skeleton_set_job (job_object, UDISKS_JOB (job)); g_free (job_object_path); @@ -588,7 +588,7 @@ udisks_daemon_launch_threaded_job (UDisksDaemon *daemon, udisks_base_job_add_object (UDISKS_BASE_JOB (job), object); /* TODO: protect job_id by a mutex */ - job_object_path = g_strdup_printf ("/org/freedesktop/UDisks2/jobs/%d", job_id++); + job_object_path = g_strdup_printf ("/org/freedesktop/UDisks2/jobs/%u", job_id++); job_object = udisks_object_skeleton_new (job_object_path); udisks_object_skeleton_set_job (job_object, UDISKS_JOB (job)); g_free (job_object_path); @@ -666,7 +666,7 @@ udisks_daemon_launch_spawned_job (UDisksDaemon *daemon, udisks_base_job_add_object (UDISKS_BASE_JOB (job), object); /* TODO: protect job_id by a mutex */ - job_object_path = g_strdup_printf ("/org/freedesktop/UDisks2/jobs/%d", job_id++); + job_object_path = g_strdup_printf ("/org/freedesktop/UDisks2/jobs/%u", job_id++); job_object = udisks_object_skeleton_new (job_object_path); udisks_object_skeleton_set_job (job_object, UDISKS_JOB (job)); g_free (job_object_path); diff --git a/src/udisksdaemonutil.c b/src/udisksdaemonutil.c index a588580..278cf20 100644 --- a/src/udisksdaemonutil.c +++ b/src/udisksdaemonutil.c @@ -157,7 +157,7 @@ udisks_safe_append_to_object_path (GString *str, else { /* Escape bytes not in [A-Z][a-z][0-9] as _ */ - g_string_append_printf (str, "_%02x", c); + g_string_append_printf (str, "_%02x", (guint) c); } } } @@ -1145,7 +1145,7 @@ udisks_daemon_util_hexdump (gconstpointer data, gsize len) if (m > n && (m%4) == 0) g_string_append_c (ret, ' '); if (m < len) - g_string_append_printf (ret, "%02x ", bdata[m]); + g_string_append_printf (ret, "%02x ", (guint) bdata[m]); else g_string_append (ret, " "); } diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c index c72dded..855acf8 100644 --- a/src/udiskslinuxblock.c +++ b/src/udiskslinuxblock.c @@ -1040,7 +1040,7 @@ escape_fstab (const gchar *source) case '\t': case '\n': case '\\': - g_string_append_printf (s, "\\%03o", source[n]); + g_string_append_printf (s, "\\%03o", (guint) source[n]); break; default: @@ -2573,7 +2573,7 @@ handle_format (UDisksBlock *block, { if (invocation != NULL) g_dbus_method_invocation_return_error (invocation, UDISKS_ERROR, UDISKS_ERROR_FAILED, - "Cannot chown %s to uid=%d and gid=%d: %m", tos_dir, caller_uid, caller_gid); + "Cannot chown %s to uid=%u and gid=%u: %m", tos_dir, caller_uid, caller_gid); if (umount (tos_dir) != 0) { udisks_warning ("Error unmounting directory %s: %m", tos_dir); diff --git a/src/udiskslinuxdrive.c b/src/udiskslinuxdrive.c index b782c7e..5a85fb3 100644 --- a/src/udiskslinuxdrive.c +++ b/src/udiskslinuxdrive.c @@ -1284,7 +1284,7 @@ send_scsi_command_sync (gint fd, { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Non-GOOD SCSI status from SGIO v4 ioctl: " - "device_status=%d transport_status=%d driver_status=%d", + "device_status=%u transport_status=%u driver_status=%u", io_v4.device_status, io_v4.transport_status, io_v4.driver_status); diff --git a/src/udiskslinuxdriveata.c b/src/udiskslinuxdriveata.c index cc9d1b1..84c0e86 100644 --- a/src/udiskslinuxdriveata.c +++ b/src/udiskslinuxdriveata.c @@ -1717,7 +1717,7 @@ apply_configuration_thread_func (gpointer user_data) &error)) { udisks_error ("Error sending ATA command SET FEATURES, sub-command 0x%02x (ata_apm_level=%d) to %s: %s (%s, %d)", - input.feature, data->ata_apm_level, device_file, + (guint) input.feature, data->ata_apm_level, device_file, error->message, g_quark_to_string (error->domain), error->code); g_clear_error (&error); } @@ -1748,7 +1748,7 @@ apply_configuration_thread_func (gpointer user_data) &error)) { udisks_error ("Error sending ATA command SET FEATURES, sub-command 0x%02x (ata_aam_level=%d) to %s: %s (%s, %d)", - input.feature, data->ata_aam_level, device_file, + (guint) input.feature, data->ata_aam_level, device_file, error->message, g_quark_to_string (error->domain), error->code); g_clear_error (&error); } @@ -1776,7 +1776,7 @@ apply_configuration_thread_func (gpointer user_data) &error)) { udisks_error ("Error sending ATA command SET FEATURES, sub-command 0x%02x to %s: %s (%s, %d)", - input.feature, device_file, + (guint) input.feature, device_file, error->message, g_quark_to_string (error->domain), error->code); g_clear_error (&error); } diff --git a/src/udiskslinuxfilesystem.c b/src/udiskslinuxfilesystem.c index 1b9e0c4..6064450 100644 --- a/src/udiskslinuxfilesystem.c +++ b/src/udiskslinuxfilesystem.c @@ -366,7 +366,7 @@ find_primary_gid (uid_t uid) rc = getpwuid_r (uid, &pwstruct, pwbuf, sizeof pwbuf, &pw); if (rc != 0 || pw == NULL) { - udisks_warning ("Error looking up uid %d: %m", uid); + udisks_warning ("Error looking up uid %u: %m", uid); goto out; } gid = pw->pw_gid; @@ -395,7 +395,7 @@ is_uid_in_gid (uid_t uid, rc = getpwuid_r (uid, &pwstruct, pwbuf, sizeof pwbuf, &pw); if (rc != 0 || pw == NULL) { - udisks_warning ("Error looking up uid %d: %m", uid); + udisks_warning ("Error looking up uid %u: %m", uid); goto out; } if (pw->pw_gid == gid) @@ -406,7 +406,7 @@ is_uid_in_gid (uid_t uid, if (getgrouplist (pw->pw_name, pw->pw_gid, supplementary_groups, &num_supplementary_groups) < 0) { - udisks_warning ("Error getting supplementary groups for uid %d: %m", uid); + udisks_warning ("Error getting supplementary groups for uid %u: %m", uid); goto out; } @@ -554,7 +554,7 @@ prepend_default_mount_options (const FSMountOptions *fsmo, if (strcmp (option, "uid=") == 0) { - s = g_strdup_printf ("uid=%d", caller_uid); + s = g_strdup_printf ("uid=%u", caller_uid); g_ptr_array_add (options, s); } else if (strcmp (option, "gid=") == 0) @@ -562,7 +562,7 @@ prepend_default_mount_options (const FSMountOptions *fsmo, gid = find_primary_gid (caller_uid); if (gid != (gid_t) - 1) { - s = g_strdup_printf ("gid=%d", gid); + s = g_strdup_printf ("gid=%u", gid); g_ptr_array_add (options, s); } } @@ -989,7 +989,7 @@ calculate_mount_point (UDisksDaemon *daemon, else { g_free (mount_point); - mount_point = g_strdup_printf ("%s%d", orig_mount_point, n++); + mount_point = g_strdup_printf ("%s%u", orig_mount_point, n++); } } g_free (orig_mount_point); @@ -1338,7 +1338,7 @@ handle_mount (UDisksFilesystem *filesystem, error_message); goto out; } - udisks_notice ("Mounted %s (system) at %s on behalf of uid %d", + udisks_notice ("Mounted %s (system) at %s on behalf of uid %u", udisks_block_get_device (block), mount_point_to_use, caller_uid); @@ -1505,7 +1505,7 @@ handle_mount (UDisksFilesystem *filesystem, caller_uid, FALSE); /* fstab_mounted */ - udisks_notice ("Mounted %s at %s on behalf of uid %d", + udisks_notice ("Mounted %s at %s on behalf of uid %u", udisks_block_get_device (block), mount_point_to_use, caller_uid); @@ -1685,7 +1685,7 @@ handle_unmount (UDisksFilesystem *filesystem, error_message); goto out; } - udisks_notice ("Unmounted %s (system) from %s on behalf of uid %d", + udisks_notice ("Unmounted %s (system) from %s on behalf of uid %u", udisks_block_get_device (block), mount_point, caller_uid); @@ -1777,7 +1777,7 @@ handle_unmount (UDisksFilesystem *filesystem, /* OK, filesystem unmounted.. the state/cleanup routines will remove the mountpoint for us */ - udisks_notice ("Unmounted %s on behalf of uid %d", + udisks_notice ("Unmounted %s on behalf of uid %u", udisks_block_get_device (block), caller_uid); diff --git a/src/udiskslinuxmanager.c b/src/udiskslinuxmanager.c index 53703d1..20b5be7 100644 --- a/src/udiskslinuxmanager.c +++ b/src/udiskslinuxmanager.c @@ -642,7 +642,7 @@ handle_mdraid_create (UDisksManager *_object, g_dbus_method_invocation_return_error (invocation, UDISKS_ERROR, UDISKS_ERROR_FAILED, - "Invalid object path %s at index %d", + "Invalid object path %s at index %u", arg_blocks[n], n); goto out; } @@ -653,7 +653,7 @@ handle_mdraid_create (UDisksManager *_object, g_dbus_method_invocation_return_error (invocation, UDISKS_ERROR, UDISKS_ERROR_FAILED, - "Object path %s for index %d is not a block device", + "Object path %s for index %u is not a block device", arg_blocks[n], n); goto out; } @@ -736,7 +736,7 @@ handle_mdraid_create (UDisksManager *_object, g_string_append_printf (str, " --level %s", arg_level); if (strlen (arg_name) > 0) g_string_append_printf (str, " --name \"%s\"", escaped_name); - g_string_append_printf (str, " --raid-devices %d", num_devices); + g_string_append_printf (str, " --raid-devices %u", num_devices); for (l = blocks; l != NULL; l = l->next) { UDisksBlock *block = UDISKS_BLOCK (l->data); diff --git a/src/udiskslinuxpartition.c b/src/udiskslinuxpartition.c index 72be991..8f0b5cf 100644 --- a/src/udiskslinuxpartition.c +++ b/src/udiskslinuxpartition.c @@ -150,7 +150,7 @@ udisks_linux_partition_update (UDisksLinuxPartition *partition, if (g_strcmp0 (g_udev_device_get_property (device->udev_device, "ID_PART_ENTRY_SCHEME"), "dos") == 0) { char *endp; - gint type_as_int = strtol (type, &endp, 0); + guint type_as_int = strtoul (type, &endp, 0); if (type[0] != '\0' && *endp == '\0') { /* ensure 'dos' partition types are always of the form 0x0c (e.g. with two digits) */ @@ -302,7 +302,7 @@ handle_set_flags (UDisksPartition *partition, escaped_device = udisks_daemon_util_escape_and_quote (udisks_block_get_device (partition_table_block)); if (g_strcmp0 (udisks_partition_table_get_type_ (partition_table), "gpt") == 0) { - command_line = g_strdup_printf ("sgdisk --attributes %d:=:0x%08x%08x %s", + command_line = g_strdup_printf ("sgdisk --attributes %u:=:0x%08x%08x %s", udisks_partition_get_number (partition), (guint32) (flags >> 32), (guint32) (flags & 0xffffffff), @@ -310,7 +310,7 @@ handle_set_flags (UDisksPartition *partition, } else if (g_strcmp0 (udisks_partition_table_get_type_ (partition_table), "dos") == 0) { - command_line = g_strdup_printf ("parted --script %s \"set %d boot %s\"", + command_line = g_strdup_printf ("parted --script %s \"set %u boot %s\"", escaped_device, udisks_partition_get_number (partition), flags & 0x80 ? "on" : "off"); @@ -479,7 +479,7 @@ handle_set_name (UDisksPartition *partition, * * TODO is this assumption true or do we need to pass UTF-16? How is that going to work? */ - command_line = g_strdup_printf ("sgdisk --change-name %d:%s %s", + command_line = g_strdup_printf ("sgdisk --change-name %u:%s %s", udisks_partition_get_number (partition), escaped_name, escaped_device); @@ -629,7 +629,7 @@ udisks_linux_partition_set_type_sync (UDisksLinuxPartition *partition, type); goto out; } - command_line = g_strdup_printf ("sgdisk --typecode %d:%s %s", + command_line = g_strdup_printf ("sgdisk --typecode %u:%s %s", udisks_partition_get_number (UDISKS_PARTITION (partition)), escaped_type, escaped_device); @@ -637,7 +637,7 @@ udisks_linux_partition_set_type_sync (UDisksLinuxPartition *partition, else if (g_strcmp0 (udisks_partition_table_get_type_ (partition_table), "dos") == 0) { gchar *endp; - gint type_as_int = strtol (type, &endp, 0); + guint type_as_int = strtoul (type, &endp, 0); if (strlen (type) == 0 || *endp != '\0') { g_set_error (error, @@ -656,7 +656,7 @@ udisks_linux_partition_set_type_sync (UDisksLinuxPartition *partition, "Delete the partition and create a new extended partition instead."); goto out; } - command_line = g_strdup_printf ("sfdisk --change-id %s %d 0x%02x", + command_line = g_strdup_printf ("sfdisk --change-id %s %u 0x%02x", escaped_device, udisks_partition_get_number (UDISKS_PARTITION (partition)), type_as_int); @@ -927,7 +927,7 @@ handle_delete (UDisksPartition *partition, NULL, /* gint *out_status */ &error_message, NULL, /* input_string */ - "parted --script %s \"rm %d\"", + "parted --script %s \"rm %u\"", escaped_device, udisks_partition_get_number (partition))) { diff --git a/src/udiskslinuxprovider.c b/src/udiskslinuxprovider.c index 0c247fe..32171c0 100644 --- a/src/udiskslinuxprovider.c +++ b/src/udiskslinuxprovider.c @@ -454,7 +454,7 @@ udisks_linux_provider_start (UDisksProvider *_provider) /* do two coldplug runs to handle dependencies between devices */ for (n = 0; n < 2; n++) { - udisks_info ("Initialization (coldplug %d/2)", n + 1); + udisks_info ("Initialization (coldplug %u/2)", n + 1); for (l = udisks_devices; l != NULL; l = l->next) { UDisksLinuxDevice *device = l->data; @@ -966,7 +966,7 @@ housekeeping_thread_func (GIOSchedulerJob *job, secs_since_last = now - provider->housekeeping_last; provider->housekeeping_last = now; - udisks_info ("Housekeeping initiated (%d seconds since last housekeeping)", secs_since_last); + udisks_info ("Housekeeping initiated (%u seconds since last housekeeping)", secs_since_last); housekeeping_all_drives (provider, secs_since_last); diff --git a/src/udisksmountmonitor.c b/src/udisksmountmonitor.c index e7097fa..891d118 100644 --- a/src/udisksmountmonitor.c +++ b/src/udisksmountmonitor.c @@ -430,7 +430,7 @@ udisks_mount_monitor_get_mountinfo (UDisksMountMonitor *monitor, continue; if (sscanf (lines[n], - "%d %d %d:%d " PATH_MAX_FMT " " PATH_MAX_FMT, + "%u %u %u:%u " PATH_MAX_FMT " " PATH_MAX_FMT, &mount_id, &parent_id, &major, diff --git a/src/udisksstate.c b/src/udisksstate.c index ee40b8a..fc7451a 100644 --- a/src/udisksstate.c +++ b/src/udisksstate.c @@ -679,17 +679,17 @@ udisks_state_check_mounted_fs_entry (UDisksState *state, { if (!device_exists) { - udisks_notice ("Cleaning up mount point %s (device %d:%d no longer exist)", + udisks_notice ("Cleaning up mount point %s (device %u:%u no longer exist)", mount_point, major (block_device), minor (block_device)); } else if (device_to_be_cleaned) { - udisks_notice ("Cleaning up mount point %s (device %d:%d is about to be cleaned up)", + udisks_notice ("Cleaning up mount point %s (device %u:%u is about to be cleaned up)", mount_point, major (block_device), minor (block_device)); } else if (!is_mounted) { - udisks_notice ("Cleaning up mount point %s (device %d:%d is not mounted)", + udisks_notice ("Cleaning up mount point %s (device %u:%u is not mounted)", mount_point, major (block_device), minor (block_device)); } @@ -1182,7 +1182,7 @@ udisks_state_check_unlocked_luks_entry (UDisksState *state, gchar *escaped_device_file; gchar *error_message; - udisks_notice ("Cleaning up LUKS device %s (backing device %d:%d no longer exist)", + udisks_notice ("Cleaning up LUKS device %s (backing device %u:%u no longer exist)", device_file_cleartext, major (crypto_device), minor (crypto_device)); @@ -1213,7 +1213,7 @@ udisks_state_check_unlocked_luks_entry (UDisksState *state, } else { - udisks_notice ("LUKS device %d:%d was manually removed", + udisks_notice ("LUKS device %u:%u was manually removed", major (cleartext_device), minor (cleartext_device)); } } @@ -1911,13 +1911,13 @@ udisks_state_check_mdraid_entry (UDisksState *state, device = g_udev_client_query_by_device_number (udev_client, G_UDEV_DEVICE_TYPE_BLOCK, raid_device); if (device == NULL) { - udisks_info ("no udev device for raid device %d:%d", major (raid_device), minor (raid_device)); + udisks_info ("no udev device for raid device %u:%u", major (raid_device), minor (raid_device)); goto out; } array_state = g_udev_device_get_sysfs_attr (device, "md/array_state"); if (array_state == NULL) { - udisks_info ("raid device %d:%d is not setup (no md/array_state sysfs file)", + udisks_info ("raid device %u:%u is not setup (no md/array_state sysfs file)", major (raid_device), minor (raid_device)); goto out; } @@ -1945,7 +1945,7 @@ udisks_state_check_mdraid_entry (UDisksState *state, if (!keep) { - udisks_notice ("No longer watching mdraid device %d:%d", major (raid_device), minor (raid_device)); + udisks_notice ("No longer watching mdraid device %u:%u", major (raid_device), minor (raid_device)); } out2: @@ -2082,7 +2082,7 @@ udisks_state_add_mdraid (UDisksState *state, /* Skip/remove stale entries */ if (entry_raid_device == raid_device) { - udisks_warning ("Removing stale entry for raid device %d:%d in /run/udisks2/mdraid file", + udisks_warning ("Removing stale entry for raid device %u:%u in /run/udisks2/mdraid file", major (raid_device), minor (raid_device)); } else diff --git a/tools/udisksctl.c b/tools/udisksctl.c index 63c7908..e715440 100644 --- a/tools/udisksctl.c +++ b/tools/udisksctl.c @@ -268,7 +268,7 @@ variant_to_string_with_indent (GVariant *value, { if (m > 0) g_string_append_printf (str, "\n%*s", - indent, ""); + (gint) indent, ""); g_string_append (str, strv[m]); } value_str = g_string_free (str, FALSE); @@ -334,7 +334,7 @@ print_interface_properties (GDBusProxy *proxy, value_str = variant_to_string_with_indent (value, indent + strlen (property_name) + 2 + value_indent); g_print ("%*s%s%s:%s %*s%s\n", - indent, "", + (gint) indent, "", _color_get (_COLOR_FG_WHITE), property_name, _color_get (_COLOR_RESET), value_indent, "", value_str); @@ -363,7 +363,7 @@ print_object (UDisksObject *object, { GDBusProxy *iproxy = G_DBUS_PROXY (l->data); g_print ("%*s%s%s%s:%s\n", - indent, "", + (gint) indent, "", _color_get (_COLOR_BOLD_ON), _color_get (_COLOR_FG_MAGENTA), g_dbus_proxy_get_interface_name (iproxy), _color_get (_COLOR_RESET)); print_interface_properties (iproxy, indent + 2); } diff --git a/tools/umount-udisks.c b/tools/umount-udisks.c index bd68192..8ce5fea 100644 --- a/tools/umount-udisks.c +++ b/tools/umount-udisks.c @@ -110,14 +110,14 @@ main (int argc, char *argv[]) object = lookup_object_for_block (client, block_device); if (object == NULL) { - g_printerr ("Error finding object for block device %d:%d\n", major (block_device), minor (block_device)); + g_printerr ("Error finding object for block device %u:%u\n", major (block_device), minor (block_device)); goto out; } filesystem = udisks_object_peek_filesystem (object); if (filesystem == NULL) { - g_printerr ("Block device %d:%d is not a mountable filesystem.\n", major (block_device), minor (block_device)); + g_printerr ("Block device %u:%u is not a mountable filesystem.\n", major (block_device), minor (block_device)); goto out; } @@ -128,7 +128,7 @@ main (int argc, char *argv[]) NULL, /* GCancellable */ &error)) { - g_printerr ("Error unmounting block device %d:%d: %s\n", major (block_device), minor (block_device), error->message); + g_printerr ("Error unmounting block device %u:%u: %s\n", major (block_device), minor (block_device), error->message); g_error_free (error); goto out; } diff --git a/udisks/udisksclient.c b/udisks/udisksclient.c index 0f2d7b2..c481cd8 100644 --- a/udisks/udisksclient.c +++ b/udisks/udisksclient.c @@ -1610,7 +1610,7 @@ get_pow2_size (guint64 size) gchar *str; gdouble displayed_size; const gchar *unit; - guint digits; + gint digits; if (size < MEBIBYTE_FACTOR) { @@ -1653,7 +1653,7 @@ get_pow10_size (guint64 size) gchar *str; gdouble displayed_size; const gchar *unit; - guint digits; + gint digits; if (size < MEGABYTE_FACTOR) { @@ -1712,7 +1712,7 @@ udisks_client_get_size_for_display (UDisksClient *client, if (long_string) { gchar *size_str; - size_str = g_strdup_printf ("%'" G_GINT64_FORMAT, size); + size_str = g_strdup_printf ("%'" G_GUINT64_FORMAT, size); if (use_pow2) { gchar *pow2_str; diff --git a/udisks/udisksobjectinfo.c b/udisks/udisksobjectinfo.c index 558f1d8..d0162db 100644 --- a/udisks/udisksobjectinfo.c +++ b/udisks/udisksobjectinfo.c @@ -262,7 +262,7 @@ udisks_client_get_object_info_for_block (UDisksClient *client, * The %d is the partition number. * The %s is the description for the block device (e.g. "5 GB Block Device"). */ - s = g_strdup_printf (C_("part-block", "Partition %d of %s"), + s = g_strdup_printf (C_("part-block", "Partition %u of %s"), udisks_partition_get_number (partition), info->description); g_free (info->description); info->description = s; @@ -276,7 +276,7 @@ udisks_client_get_object_info_for_block (UDisksClient *client, info->description, udisks_block_get_preferred_device (block)); - info->sort_key = g_strdup_printf ("02_block_%s_%d", + info->sort_key = g_strdup_printf ("02_block_%s_%u", last_segment (g_dbus_object_get_object_path (G_DBUS_OBJECT (info->object))), partition != NULL ? udisks_partition_get_number (partition) : 0); } @@ -316,7 +316,7 @@ udisks_client_get_object_info_for_loop (UDisksClient *client, * The %d is the partition number. * The %s is the description for the loop device (e.g. "5 GB Loop Device"). */ - s = g_strdup_printf (C_("part-loop", "Partition %d of %s"), + s = g_strdup_printf (C_("part-loop", "Partition %u of %s"), udisks_partition_get_number (partition), info->description); g_free (info->description); info->description = s; @@ -332,7 +332,7 @@ udisks_client_get_object_info_for_loop (UDisksClient *client, info->name, udisks_block_get_preferred_device (block)); - info->sort_key = g_strdup_printf ("03_loop_%s_%d", + info->sort_key = g_strdup_printf ("03_loop_%s_%u", last_segment (g_dbus_object_get_object_path (G_DBUS_OBJECT (info->object))), partition != NULL ? udisks_partition_get_number (partition) : 0); } @@ -412,7 +412,7 @@ udisks_client_get_object_info_for_mdraid (UDisksClient *client, * The %d is the partition number. * The %s is the description for the drive (e.g. "2 TB RAID-5"). */ - s = g_strdup_printf (C_("part-raid", "Partition %d of %s"), + s = g_strdup_printf (C_("part-raid", "Partition %u of %s"), udisks_partition_get_number (partition), info->description); g_free (info->description); info->description = s; @@ -469,7 +469,7 @@ udisks_client_get_object_info_for_mdraid (UDisksClient *client, g_clear_object (&block); - info->sort_key = g_strdup_printf ("01_mdraid_%s_%d", udisks_mdraid_get_uuid (mdraid), + info->sort_key = g_strdup_printf ("01_mdraid_%s_%u", udisks_mdraid_get_uuid (mdraid), partition != NULL ? udisks_partition_get_number (partition) : 0); } @@ -829,7 +829,7 @@ udisks_client_get_object_info_for_drive (UDisksClient *client, * The %d is the partition number. * The %s is the description for the drive (e.g. "2 GB Thumb Drive"). */ - s = g_strdup_printf (C_("part-drive", "Partition %d of %s"), + s = g_strdup_printf (C_("part-drive", "Partition %u of %s"), udisks_partition_get_number (partition), info->description); g_free (info->description); info->description = s; -- 2.3.0