浏览代码

driverlib: fix some compilation warnings

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63461 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 年之前
父节点
当前提交
519ca7f42a
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      lib/driver/text3.c

+ 5 - 4
lib/driver/text3.c

@@ -137,18 +137,19 @@ static int convert_str(const char *from, const char *in, unsigned char **out)
     res = 2 * (len + 1);
 
     *out = G_calloc(1, res);
-    p1 = in;
+    p1 = (const unsigned char *)in;
     p2 = *out;
 
 #ifdef HAVE_ICONV_H
     {
-	size_t ret;
 	iconv_t cd;
 
 	i = res;
-	if ((cd = iconv_open("UCS-2BE", from)) < 0)
+        cd = iconv_open("UCS-2BE", from);
+	if (cd == (iconv_t) -1)
 	    return -1;
-	ret = iconv(cd, (char **)&p1, &len, (char **)&p2, &i);
+	if (iconv(cd, (char **)&p1, &len, (char **)&p2, &i) == (size_t) -1)
+            return -1;
 	iconv_close(cd);
 
 	res -= i;