2
0
Fork 0

Rewrite l_g_string_from_int to l_g_string_append_int

This commit is contained in:
Stefan Bühler 2009-03-17 11:44:44 +01:00
parent e020850dc8
commit b423170266
2 changed files with 5 additions and 11 deletions

View File

@ -66,7 +66,7 @@ LI_API GString *l_g_string_assign_len(GString *string, const gchar *val, gssize
LI_API gboolean l_g_string_prefix(GString *str, const gchar *s, gsize len);
LI_API gboolean l_g_string_suffix(GString *str, const gchar *s, gsize len);
LI_API GString *l_g_string_from_int(GString *dest, gint64 val);
LI_API void l_g_string_append_int(GString *dest, gint64 val);
LI_API gsize dirent_buf_size(DIR * dirp);

View File

@ -580,19 +580,14 @@ GString *l_g_string_assign_len(GString *string, const gchar *val, gssize len) {
return string;
}
GString *l_g_string_from_int(GString *dest, gint64 v) {
void l_g_string_append_int(GString *dest, gint64 v) {
gchar *buf, *end, swap;
guint len;
guint64 val;
if (!dest) {
dest = g_string_sized_new(21);
} else {
g_string_set_size(dest, 21);
}
len = 1;
buf = dest->str;
buf = dest->str + dest->len;
len = dest->len + 1;
g_string_set_size(dest, dest->len + 21);
if (v < 0) {
len++;
@ -622,7 +617,6 @@ GString *l_g_string_from_int(GString *dest, gint64 v) {
}
dest->len = len;
return dest;
}
/* http://womble.decadentplace.org.uk/readdir_r-advisory.html */