Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/eglib
diff options
context:
space:
mode:
authorJeffrey Stedfast <jeff@xamarin.com>2013-08-13 19:44:58 +0400
committerJeffrey Stedfast <jeff@xamarin.com>2013-08-13 19:44:58 +0400
commit82219acd3c65ef4939e35e4db6cac561b7e60560 (patch)
tree0f9f3f9065f2202e467b6741da3d69ad099713ba /eglib
parent94f12d815e76aab29645597b2a35707959fd3d24 (diff)
Fixed eglib compiler warnings about g_string_truncate() and g_iconv()
Diffstat (limited to 'eglib')
-rw-r--r--eglib/src/giconv.c18
-rw-r--r--eglib/src/gstring.c3
2 files changed, 17 insertions, 4 deletions
diff --git a/eglib/src/giconv.c b/eglib/src/giconv.c
index 9fe0edd3324..55e2e8a62b8 100644
--- a/eglib/src/giconv.c
+++ b/eglib/src/giconv.c
@@ -180,8 +180,22 @@ g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft,
int rc = 0;
#ifdef HAVE_ICONV
- if (cd->cd != (iconv_t) -1)
- return iconv (cd->cd, inbytes, inbytesleft, outbytes, outbytesleft);
+ if (cd->cd != (iconv_t) -1) {
+ /* Note: gsize may have a different size than size_t, so we need to
+ remap inbytesleft and outbytesleft to size_t's. */
+ size_t *outleftptr;
+
+ if (outbytesleft) {
+ outleft = *outbytesleft;
+ outleftptr = &outleft;
+ } else {
+ outleftptr = NULL;
+ }
+
+ inleft = inbytesleft ? *inbytesleft : 0;
+
+ return iconv (cd->cd, inbytes, &inleft, outbytes, outleftptr);
+ }
#endif
if (outbytes == NULL || outbytesleft == NULL) {
diff --git a/eglib/src/gstring.c b/eglib/src/gstring.c
index 9df5d73c28e..ba75789bc80 100644
--- a/eglib/src/gstring.c
+++ b/eglib/src/gstring.c
@@ -235,9 +235,8 @@ g_string_truncate (GString *string, gsize len)
g_return_val_if_fail (string != NULL, string);
/* Silent return */
- if (len < 0 || len >= string->len) {
+ if (len >= string->len)
return string;
- }
string->len = len;
string->str[len] = 0;