mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 18:36:17 +01:00
Fix signedness warning in glib/ghostutils.c
glib/ghostutils.c: In function 'punycode_encode': glib/ghostutils.c:141:35: warning: comparison of integer expressions of different signedness: 'guint' {aka 'unsigned int'} and 'glong' {aka 'long int'} for (j = num_basic_chars = 0; j < input_length; j++) ^ glib/ghostutils.c:158:24: warning: comparison of integer expressions of different signedness: 'guint' {aka 'unsigned int'} and 'glong' {aka 'long int'} while (handled_chars < input_length) ^ glib/ghostutils.c:161:36: warning: comparison of integer expressions of different signedness: 'guint' {aka 'unsigned int'} and 'glong' {aka 'long int'} for (m = G_MAXUINT, j = 0; j < input_length; j++) ^ glib/ghostutils.c:172:21: warning: comparison of integer expressions of different signedness: 'guint' {aka 'unsigned int'} and 'glong' {aka 'long int'} for (j = 0; j < input_length; j++) ^
This commit is contained in:
parent
74c3c5b75d
commit
affa41179a
@ -128,15 +128,18 @@ punycode_encode (const gchar *input_utf8,
|
|||||||
{
|
{
|
||||||
guint delta, handled_chars, num_basic_chars, bias, j, q, k, t, digit;
|
guint delta, handled_chars, num_basic_chars, bias, j, q, k, t, digit;
|
||||||
gunichar n, m, *input;
|
gunichar n, m, *input;
|
||||||
glong input_length;
|
glong written_chars;
|
||||||
|
gsize input_length;
|
||||||
gboolean success = FALSE;
|
gboolean success = FALSE;
|
||||||
|
|
||||||
/* Convert from UTF-8 to Unicode code points */
|
/* Convert from UTF-8 to Unicode code points */
|
||||||
input = g_utf8_to_ucs4 (input_utf8, input_utf8_length, NULL,
|
input = g_utf8_to_ucs4 (input_utf8, input_utf8_length, NULL,
|
||||||
&input_length, NULL);
|
&written_chars, NULL);
|
||||||
if (!input)
|
if (!input)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
input_length = (gsize) (written_chars > 0 ? written_chars : 0);
|
||||||
|
|
||||||
/* Copy basic chars */
|
/* Copy basic chars */
|
||||||
for (j = num_basic_chars = 0; j < input_length; j++)
|
for (j = num_basic_chars = 0; j < input_length; j++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user