Commit 2a867b1f authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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
parent b059f8d2
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;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment