mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 06:32:10 +01:00
Return negative values. (#416062)
2007-03-08 Matthias Clasen <mclasen@redhat.com> * glib/gstrfuncs.c (g_strtoll): Return negative values. (#416062) * tests/strtoll-test.c: Add more testcases. svn path=/trunk/; revision=5390
This commit is contained in:
parent
b059f8d218
commit
2a867b1fca
@ -1,3 +1,10 @@
|
||||
2007-03-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* glib/gstrfuncs.c (g_strtoll): Return negative values.
|
||||
(#416062)
|
||||
|
||||
* tests/strtoll-test.c: Add more testcases.
|
||||
|
||||
2007-03-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* glib/gstring.c (g_str_equal): Clarify docs. (#364026,
|
||||
|
@ -842,6 +842,8 @@ g_ascii_strtoll (const gchar *nptr,
|
||||
errno = ERANGE;
|
||||
return G_MAXINT64;
|
||||
}
|
||||
else if (negative)
|
||||
return - (gint64) result;
|
||||
else
|
||||
return (gint64) result;
|
||||
}
|
||||
|
@ -62,6 +62,10 @@ main (int argc, char *argv[])
|
||||
test_int64 ("9223372036854775808", "", 10, G_MAXINT64, ERANGE);
|
||||
test_int64 ("-9223372036854775808", "", 10, G_MININT64, 0);
|
||||
test_int64 ("-9223372036854775809", "", 10, G_MININT64, ERANGE);
|
||||
test_int64 ("32768", "", 10, 32768, 0);
|
||||
test_int64 ("-32768", "", 10, -32768, 0);
|
||||
test_int64 ("001", "", 10, 1, 0);
|
||||
test_int64 ("-001", "", 10, -1, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user