Store invocation-specific data of conversion modules in __gconv_step_data
[platform/upstream/glibc.git] / iconvdata / unicode.c
index df452d2..dba4c34 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion module for Unicode
-   Copyright (C) 1999, 2000-2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000-2002, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
@@ -57,7 +57,7 @@
            *inptrp = inptr += 2;                                             \
          else if (get16u (inptr) == BOM_OE)                                  \
            {                                                                 \
-             ((struct unicode_data *) step->__data)->swap = 1;               \
+             data->__flags |= __GCONV_SWAP;                                  \
              *inptrp = inptr += 2;                                           \
            }                                                                 \
        }                                                                     \
@@ -71,7 +71,7 @@
       put16u (outbuf, BOM);                                                  \
       outbuf += 2;                                                           \
     }                                                                        \
-  swap = ((struct unicode_data *) step->__data)->swap;
+  swap = data->__flags & __GCONV_SWAP;
 #define EXTRA_LOOP_ARGS                , swap
 
 
@@ -86,7 +86,6 @@ enum direction
 struct unicode_data
 {
   enum direction dir;
-  int swap;
 };
 
 
@@ -110,7 +109,6 @@ gconv_init (struct __gconv_step *step)
   if (new_data != NULL)
     {
       new_data->dir = dir;
-      new_data->swap = 0;
       step->__data = new_data;
 
       if (dir == from_unicode)