Commit 9c627f52 authored by Evangelos Ribeiro Tzaras's avatar Evangelos Ribeiro Tzaras
Browse files

mmsd: Use gsize type and suitable format identifier

Fixes warnings on some architectures:

../src/mm/chatty-mmsd.c: In function ‘chatty_mmsd_send_mms_create_attachments’:
../src/mm/chatty-mmsd.c:485:18: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘gsize’ {aka ‘unsigned int’} [-Wformat=]
  485 |       g_warning ("Size of attachments that can't be resized %ld greater then maximum attachment size %d",
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  486 |                  other_attachments_size, self->max_attach_size);
      |                  ~~~~~~~~~~~~~~~~~~~~~~
      |                  |
      |                  gsize {aka unsigned int}
/usr/include/glib-2.0/glib/gmessages.h:323:63: note: in definition of macro ‘g_warning’
  323 |                                                    G_STRFUNC, __VA_ARGS__)
      |                                                               ^~~~~~~~~~~
../src/mm/chatty-mmsd.c:485:63: note: format string is defined here
  485 |       g_warning ("Size of attachments that can't be resized %ld greater then maximum attachment size %d",
      |                                                             ~~^
      |                                                               |
      |                                                               long int
      |                                                             %d
parent 8aba0ba9
......@@ -76,7 +76,7 @@ struct _ChattyMmsd {
char *default_modem_number;
GPtrArray *mms_arr;
GHashTable *mms_hash_table;
int max_attach_size;
gsize max_attach_size;
int max_num_attach;
char *carrier_mmsc;
char *mms_apn;
......@@ -482,7 +482,8 @@ chatty_mmsd_send_mms_create_attachments (ChattyMmsd *self,
g_debug ("Total Number of attachments %d", total_files_count);
other_attachments_size = attachments_size-image_attachments_size;
if (other_attachments_size > self->max_attach_size) {
g_warning ("Size of attachments that can't be resized %ld greater then maximum attachment size %d",
g_warning ("Size of attachments that can't be resized %" G_GSIZE_FORMAT
" greater then maximum attachment size %" G_GSIZE_FORMAT,
other_attachments_size, self->max_attach_size);
return NULL;
}
......@@ -1356,7 +1357,8 @@ chatty_mmsd_get_mmsd_service_settings_cb (GObject *service,
} else {
g_autoptr(GVariant) all_settings = NULL;
GVariantDict dict;
int max_attach_total_size, max_attachments;
gsize max_attach_total_size;
int max_attachments;
gboolean autocreatesmil;
g_variant_get (ret, "(@a{?*})", &all_settings);
......@@ -1367,7 +1369,7 @@ chatty_mmsd_get_mmsd_service_settings_cb (GObject *service,
else
self->max_attach_size = DEFAULT_MAXIMUM_ATTACHMENT_SIZE;
g_debug ("TotalMaxAttachmentSize is set to %d", self->max_attach_size);
g_debug ("TotalMaxAttachmentSize is set to %" G_GSIZE_FORMAT, self->max_attach_size);
if (g_variant_dict_lookup (&dict, "MaxAttachments", "i", &max_attachments))
self->max_num_attach = max_attachments;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment