pidgin: 59e2b989: Clean up the GtkSmileyTrees on active Gt...

John Bailey rekkanoryo at rekkanoryo.org
Wed Oct 29 01:10:49 EDT 2008


malu at pidgin.im wrote:
> -----------------------------------------------------------------
> Revision: 59e2b9896f25e8517b3f0f4d742c143e6fccd6e0
> Ancestor: 6f5339668b310efa60c047d0ee4613ccc6454bfb
> Author: malu at pidgin.im
> Date: 2008-09-25T04:49:44
> Branch: im.pidgin.pidgin
> URL: http://d.pidgin.im/viewmtn/revision/info/59e2b9896f25e8517b3f0f4d742c143e6fccd6e0
> 
> Modified files:
>         pidgin/gtkimhtml.c
> 
> ChangeLog: 
> 
> Clean up the GtkSmileyTrees on active GtkIMHtml instances when a custom smiley
> is deleted.
> Closes #7159

<snip>

> @@ -1974,7 +1976,7 @@ static void gtk_smiley_tree_remove (GtkS
>  
>  		pos = strchr (t->values->str, *x);
>  		if (pos)
> -			t = t->children [(int) pos - (int) t->values->str];
> +			t = t->children [(unsigned int) pos - (unsigned int) t->values->str];

While the original state of this line was also wrong, this change is incorrect
as it assumes sizeof(void *) == sizeof (unsigned int) which is not true
everywhere.  For example, on x86_64, void * is 8 bytes and unsigned int is 4
bytes.  Perhaps a more appropriate cast here would be gsize or size_t?

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://pidgin.im/pipermail/devel/attachments/20081029/460b4eaf/attachment.sig>


More information about the Devel mailing list