public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de>
To: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: iconvdata: Get rid of lvalue casts
Date: Sun, 07 Mar 2004 07:29:00 -0000	[thread overview]
Message-ID: <m3fzclt8r8.fsf@gromit.moeb> (raw)

[-- Attachment #1: Type: text/plain, Size: 5396 bytes --]


Here's one more patch to get rid of lvalues to make GCC 3.5 happy.  It
generates the same code as before on my machine and passes the
testsuite.

Ok to commit?

Andreas

2004-03-07  Andreas Jaeger  <aj@suse.de>

	* iconvdata/iso-2022-cn-ext.c (BODY): Remove cast used as lvalue.
	* iconvdata/tcvn5712-1.c (EMIT_SHIFT_TO_INIT): Likewise.
	* iconvdata/euc-jisx0213.c (EMIT_SHIFT_TO_INIT): Likewise.
	* iconvdata/shift_jisx0213.c (EMIT_SHIFT_TO_INIT): Likewise.
	* iconvdata/tscii.c (EMIT_SHIFT_TO_INIT): Likewise.

============================================================
Index: iconvdata/tscii.c
--- iconvdata/tscii.c	24 Sep 2002 03:39:45 -0000	1.1
+++ iconvdata/tscii.c	7 Mar 2004 07:10:46 -0000
@@ -1,5 +1,5 @@
 /* Conversion from and to TSCII.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Bruno Haible <bruno@clisp.org>, 2002.
 
@@ -98,7 +98,8 @@
 		  break;						      \
 		}							      \
 	      /* Write out the pending character.  */			      \
-	      *((uint32_t *) outbuf)++ = data->__statep->__count >> 8;	      \
+	      *((uint32_t *) outbuf) = data->__statep->__count >> 8;	      \
+	      outbuf += sizeof (uint32_t);				      \
 	      /* Retrieve the successor state.  */			      \
 	      data->__statep->__count =					      \
 		tscii_next_state[(data->__statep->__count >> 4) & 0x0f];      \
============================================================
Index: iconvdata/iso-2022-cn-ext.c
--- iconvdata/iso-2022-cn-ext.c	28 Jun 2002 21:13:14 -0000	1.12
+++ iconvdata/iso-2022-cn-ext.c	7 Mar 2004 07:10:47 -0000
@@ -1,5 +1,5 @@
 /* Conversion module for ISO-2022-CN-EXT.
-   Copyright (C) 2000-2002 Free Software Foundation, Inc.
+   Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 2000.
 
@@ -377,7 +377,8 @@ enum
 	  }								      \
       }									      \
 									      \
-    *((uint32_t *) outptr)++ = ch;					      \
+    *((uint32_t *) outptr) = ch;					      \
+    outptr += sizeof (uint32_t);					      \
   }
 #define EXTRA_LOOP_DECLS	, int *setp
 #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \
============================================================
Index: iconvdata/tcvn5712-1.c
--- iconvdata/tcvn5712-1.c	2 Dec 2002 22:07:52 -0000	1.7
+++ iconvdata/tcvn5712-1.c	7 Mar 2004 07:10:47 -0000
@@ -1,5 +1,5 @@
 /* Conversion to and from TCVN5712-1.
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
 
@@ -68,7 +68,8 @@
 	  if (__builtin_expect (outbuf + 4 <= outend, 1))		      \
 	    {								      \
 	      /* Write out the last character.  */			      \
-	      *((uint32_t *) outbuf)++ = data->__statep->__count >> 3;	      \
+	      *((uint32_t *) outbuf) = data->__statep->__count >> 3;	      \
+	      outbuf += sizeof (uint32_t);				      \
 	      data->__statep->__count = 0;				      \
 	    }								      \
 	  else								      \
============================================================
Index: iconvdata/euc-jisx0213.c
--- iconvdata/euc-jisx0213.c	2 Dec 2002 22:07:54 -0000	1.8
+++ iconvdata/euc-jisx0213.c	7 Mar 2004 07:10:47 -0000
@@ -1,5 +1,5 @@
 /* Conversion from and to EUC-JISX0213.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Bruno Haible <bruno@clisp.org>, 2002.
 
@@ -83,7 +83,8 @@
 	  if (__builtin_expect (outbuf + 4 <= outend, 1))		      \
 	    {								      \
 	      /* Write out the last character.  */			      \
-	      *((uint32_t *) outbuf)++ = data->__statep->__count >> 3;	      \
+	      *((uint32_t *) outbuf) = data->__statep->__count >> 3;	      \
+	      outbuf += sizeof (uint32_t);				      \
 	      data->__statep->__count = 0;				      \
 	    }								      \
 	  else								      \
============================================================
Index: iconvdata/shift_jisx0213.c
--- iconvdata/shift_jisx0213.c	2 Dec 2002 22:07:56 -0000	1.8
+++ iconvdata/shift_jisx0213.c	7 Mar 2004 07:10:47 -0000
@@ -1,5 +1,5 @@
 /* Conversion from and to Shift_JISX0213.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Bruno Haible <bruno@clisp.org>, 2002.
 
@@ -83,7 +83,8 @@
 	  if (__builtin_expect (outbuf + 4 <= outend, 1))		      \
 	    {								      \
 	      /* Write out the last character.  */			      \
-	      *((uint32_t *) outbuf)++ = data->__statep->__count >> 3;	      \
+	      *((uint32_t *) outbuf) = data->__statep->__count >> 3;	      \
+	      outbuf += sizeof (uint32_t);				      \
 	      data->__statep->__count = 0;				      \
 	    }								      \
 	  else								      \

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

             reply	other threads:[~2004-03-07  7:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-07  7:29 Andreas Jaeger [this message]
2004-03-07  7:37 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3fzclt8r8.fsf@gromit.moeb \
    --to=aj@suse.de \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).