mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 19:22:11 +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=/branches/glib-2-12/; revision=5391
This commit is contained in:
parent
39996df303
commit
438143ad94
@ -1,3 +1,12 @@
|
|||||||
|
2007-03-08 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Merge from trunk:
|
||||||
|
|
||||||
|
* glib/gstrfuncs.c (g_strtoll): Return negative values.
|
||||||
|
(#416062)
|
||||||
|
|
||||||
|
* tests/strtoll-test.c: Add more testcases.
|
||||||
|
|
||||||
2007-03-08 Matthias Clasen <mclasen@redhat.com>
|
2007-03-08 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gthreadpool.c: Remove leftover debug spew.
|
* glib/gthreadpool.c: Remove leftover debug spew.
|
||||||
|
@ -813,6 +813,8 @@ g_ascii_strtoll (const gchar *nptr,
|
|||||||
errno = ERANGE;
|
errno = ERANGE;
|
||||||
return G_MAXINT64;
|
return G_MAXINT64;
|
||||||
}
|
}
|
||||||
|
else if (negative)
|
||||||
|
return - (gint64) result;
|
||||||
else
|
else
|
||||||
return (gint64) result;
|
return (gint64) result;
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,10 @@ main (int argc, char *argv[])
|
|||||||
test_int64 ("9223372036854775808", "", 10, G_MAXINT64, ERANGE);
|
test_int64 ("9223372036854775808", "", 10, G_MAXINT64, ERANGE);
|
||||||
test_int64 ("-9223372036854775808", "", 10, G_MININT64, 0);
|
test_int64 ("-9223372036854775808", "", 10, G_MININT64, 0);
|
||||||
test_int64 ("-9223372036854775809", "", 10, G_MININT64, ERANGE);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user