GNOME Bugzilla – Bug 699147
Fixes signedness mismatches.
Last modified: 2013-05-27 09:16:13 UTC
Created attachment 242721 [details] [review] Fixes signedness mismatches. The previous fix for CFLAGS enabled various warning flags . Those are fixes for all the signedness mismatches that were revealed..
Review of attachment 242721 [details] [review]: Thanks for the patch. Could you make the following changes and fixes before it goes in? ::: libseahorse/seahorse-object-model.c @@ +312,3 @@ GtkTreePath *path; GtkTreePath *ipath; + guint i; This change makes the (i--) code below rely on rolling over from zero to G_MAXUINT and then back again. Is this defined behavior (on all platforms, ie: in the C standard)? ::: libseahorse/seahorse-util.c @@ +225,3 @@ seahorse_util_read_to_memory (GInputStream *input, guint *len) { + guint size = 128; Shouldn't this be a gsize? ::: pgp/seahorse-gpgme-generate.c @@ +299,3 @@ sel = gtk_combo_box_get_active (GTK_COMBO_BOX (widget)); + num_algorithms = G_N_ELEMENTS(available_algorithms); + g_assert (sel <= num_algorithms); This seems rather pointless extra variable. Why not just use a cast? ::: pgp/seahorse-gpgme-photos.c @@ +93,1 @@ int written; Shouldn't written be a gssize? And again, why are we using another variable here? ::: pgp/seahorse-pgp-key-properties.c @@ +1531,3 @@ SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data); GObject *object; + gint trust; I think this should be a SeahorseValidity ::: ssh/seahorse-ssh-key-data.c @@ +309,2 @@ SeahorseSSHKeyData* +seahorse_ssh_key_data_parse_line (const gchar *line, gint length) Can we use gssize and then not have to use the temporary variable? ::: ssh/seahorse-ssh-operation.c @@ +412,3 @@ + closure->sin = g_string_new_len (input, strlen(input)); + else + closure->sin = g_string_new_len (input, length); Ditto about gssize.
Created attachment 245287 [details] [review] Fixes signedness mismatches and length check. > :: libseahorse/seahorse-object-model.c > @@ +312,3 @@ > GtkTreePath *path; > GtkTreePath *ipath; > + guint i; > > This change makes the (i--) code below rely on rolling over from zero to > G_MAXUINT and then back again. Is this defined behavior (on all platforms, ie: > in the C standard)? g_ptr_array_index expects a guint . so even if there is i-- in libseahorse/seahorse-object-model.c line 353 I guess it was not intended to go below zero. Other points I have applied and compiled. Indeed better. Thanks.
Attachment 245287 [details] pushed as 0688d47 - Fixes signedness mismatches and length check.