You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jf...@apache.org on 2006/04/25 10:52:06 UTC

svn commit: r396815 - in /apr/apr-iconv/trunk/ces: ucs2-internal.c ucs4-internal.c unicode-1-1-utf-7.c

Author: jfclere
Date: Tue Apr 25 01:52:03 2006
New Revision: 396815

URL: http://svn.apache.org/viewcvs?rev=396815&view=rev
Log:
Correct the error when compiling:
"error: invalid lvalue in increment"

Modified:
    apr/apr-iconv/trunk/ces/ucs2-internal.c
    apr/apr-iconv/trunk/ces/ucs4-internal.c
    apr/apr-iconv/trunk/ces/unicode-1-1-utf-7.c

Modified: apr/apr-iconv/trunk/ces/ucs2-internal.c
URL: http://svn.apache.org/viewcvs/apr/apr-iconv/trunk/ces/ucs2-internal.c?rev=396815&r1=396814&r2=396815&view=diff
==============================================================================
--- apr/apr-iconv/trunk/ces/ucs2-internal.c (original)
+++ apr/apr-iconv/trunk/ces/ucs2-internal.c Tue Apr 25 01:52:03 2006
@@ -53,13 +53,15 @@
 convert_from_ucs(struct iconv_ces *ces, ucs_t in,
 	unsigned char **outbuf, apr_size_t *outbytesleft)
 {
+	ucs2_t *ptr = (ucs2_t *) *outbuf;
 	if (in == UCS_CHAR_NONE)
 		return 1;	/* No state reinitialization for table charsets */
 	if (iconv_char32bit(in))
 		return -1;	/* No corresponding character in UCS-2 */
 	if (*outbytesleft < sizeof(ucs2_t))
 		return 0;	/* No space in the output buffer */
-	*((ucs2_t *)(*outbuf))++ = in;
+	*ptr = (ucs2_t) in;
+	*outbuf += sizeof(ucs2_t);
 	(*outbytesleft) -= sizeof(ucs2_t);
 	return 1;
 }
@@ -68,10 +70,12 @@
 convert_to_ucs(struct iconv_ces *ces,
 	const unsigned char **inbuf, apr_size_t *inbytesleft)
 {
+	ucs2_t *ret = *inbuf;
 	if (*inbytesleft < sizeof(ucs2_t))
 		return UCS_CHAR_NONE;	/* Not enough bytes in the input buffer */
 	(*inbytesleft) -= sizeof(ucs2_t);
-	return *((const ucs2_t *)(*inbuf))++;
+	*inbuf += sizeof(ucs2_t);
+	return *ret;
 }
 
 static const struct iconv_ces_desc iconv_ces_desc = {

Modified: apr/apr-iconv/trunk/ces/ucs4-internal.c
URL: http://svn.apache.org/viewcvs/apr/apr-iconv/trunk/ces/ucs4-internal.c?rev=396815&r1=396814&r2=396815&view=diff
==============================================================================
--- apr/apr-iconv/trunk/ces/ucs4-internal.c (original)
+++ apr/apr-iconv/trunk/ces/ucs4-internal.c Tue Apr 25 01:52:03 2006
@@ -53,11 +53,13 @@
 convert_from_ucs(struct iconv_ces *ces, ucs_t in,
 	unsigned char **outbuf, apr_size_t *outbytesleft)
 {
+	ucs4_t *ptr = (ucs4_t*) *outbuf;
 	if (in == UCS_CHAR_NONE)
 		return 1;	/* No state reinitialization for table charsets */
 	if (*outbytesleft < sizeof(ucs4_t))
 		return 0;	/* No space in the output buffer */
-	*((ucs4_t *)(*outbuf))++ = in;
+	*ptr = (ucs4_t) in;
+	*outbuf += sizeof(ucs4_t);
 	(*outbytesleft) -= sizeof(ucs4_t);
 	return 1;
 }
@@ -66,10 +68,12 @@
 convert_to_ucs(struct iconv_ces *ces,
 	const unsigned char **inbuf, apr_size_t *inbytesleft)
 {
+	ucs4_t *ret = *inbuf;
 	if (*inbytesleft < sizeof(ucs4_t))
 		return UCS_CHAR_NONE;	/* Not enough bytes in the input buffer */
 	(*inbytesleft) -= sizeof(ucs4_t);
-	return *((const ucs4_t *)(*inbuf))++;
+	*inbuf += sizeof(ucs4_t);
+	return *ret;
 }
 
 static const struct iconv_ces_desc iconv_ces_desc = {

Modified: apr/apr-iconv/trunk/ces/unicode-1-1-utf-7.c
URL: http://svn.apache.org/viewcvs/apr/apr-iconv/trunk/ces/unicode-1-1-utf-7.c?rev=396815&r1=396814&r2=396815&view=diff
==============================================================================
--- apr/apr-iconv/trunk/ces/unicode-1-1-utf-7.c (original)
+++ apr/apr-iconv/trunk/ces/unicode-1-1-utf-7.c Tue Apr 25 01:52:03 2006
@@ -232,6 +232,7 @@
                             const unsigned char **inbuf, apr_size_t *inbytesleft)
 {
 #define utf7_state ((char *)(module->data))
+    ucs_t ret;
     int ch = char_type(*(unsigned char *)*inbuf), needbytes = 0;
     if (ch == utf7_encoded)
         return lackofbytes(1, inbytesleft) ? UCS_CHAR_NONE
@@ -242,7 +243,8 @@
             if (*inbytesleft < 2)
                 return UCS_CHAR_NONE;
             needbytes = 1;
-            ch = char_type(*(++((unsigned char *)*inbuf)));
+            (*inbuf) ++;
+            ch = char_type(*(unsigned char *)*inbuf);
             (*inbytesleft) --;
         case utf7_printable:
             utf7_state[0] = 0;
@@ -258,7 +260,8 @@
             (*inbytesleft) += needbytes;
             return UCS_CHAR_NONE;
         }
-        switch (char_type(*(++(unsigned char *)*inbuf))) {
+        (*inbuf) ++;
+        switch (char_type(*(unsigned char *)*inbuf)) {
         case utf7_shift_out:
             (*inbuf) ++;
             (*inbytesleft) -= 2;
@@ -276,7 +279,9 @@
         return UCS_CHAR_INVALID;
     }
     (*inbytesleft) --;
-    return *((unsigned char *)*inbuf) ++;
+    ret = *((unsigned char *)*inbuf);
+    (*inbuf) ++;
+    return ret;
 #undef utf7_state
 }