/* Find matching transformation algorithms and initialize steps.
- Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|| __builtin_expect (__gconv_translit_find (runp), 0) == 0)
lastp = runp;
else
- /* This means we haven't found the module. Remove it. */
- (lastp == NULL ? trans : lastp->next) = runp->next;
+ {
+ /* This means we haven't found the module. Remove it. */
+ if (lastp == NULL)
+ trans = runp->next;
+ else
+ lastp->next = runp->next;
+ }
}
/* Allocate room for handle. */
/* Simple transformations functions.
- Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
#if __BYTE_ORDER == __LITTLE_ENDIAN
/* Sigh, we have to do some real work. */
size_t cnt;
+ uint32_t *outptr32 = (uint32_t *) outptr;
for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
- *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
+ *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
+ outptr = (unsigned char *) outptr32;
*inptrp = inptr;
*outptrp = outptr;
(*outptrp)[2] = state->__value.__wchb[1];
(*outptrp)[3] = state->__value.__wchb[0];
- *outptrp += 4;
#elif __BYTE_ORDER == __BIG_ENDIAN
/* XXX unaligned */
- *(*((uint32_t **) outptrp)++) = state->__value.__wch;
+ (*outptrp)[0] = state->__value.__wchb[0];
+ (*outptrp)[1] = state->__value.__wchb[1];
+ (*outptrp)[2] = state->__value.__wchb[2];
+ (*outptrp)[3] = state->__value.__wchb[3];
#else
# error "This endianess is not supported."
#endif
+ *outptrp += 4;
/* Clear the state buffer. */
state->__count &= ~7;
return __GCONV_ILLEGAL_INPUT;
}
- *((uint32_t *) outptr)++ = inval;
+ *((uint32_t *) outptr) = inval;
+ outptr += sizeof (uint32_t);
}
*inptrp = inptr;
*outptrp += 4;
#else
/* XXX unaligned */
- *(*((uint32_t **) outptrp)++) = state->__value.__wch;
+ (*outptrp)[0] = state->__value.__wchb[0];
+ (*outptrp)[1] = state->__value.__wchb[1];
+ (*outptrp)[2] = state->__value.__wchb[2];
+ (*outptrp)[3] = state->__value.__wchb[3];
+
#endif
+ *outptrp += 4;
/* Clear the state buffer. */
state->__count &= ~7;
return __GCONV_ILLEGAL_INPUT;
}
- *((uint32_t *) outptr)++ = inval;
+ *((uint32_t *) outptr) = inval;
+ outptr += sizeof (uint32_t);
}
*inptrp = inptr;
} \
else \
/* It's an one byte sequence. */ \
- *((uint32_t *) outptr)++ = *inptr++; \
+ *((uint32_t *) outptr) = *inptr++; \
+ outptr += sizeof (uint32_t); \
}
#define LOOP_NEED_FLAGS
#include <iconv/loop.c>
} \
else \
/* It's an one byte sequence. */ \
- *outptr++ = *((const uint32_t *) inptr)++; \
+ *outptr++ = *((const uint32_t *) inptr); \
+ inptr += sizeof (uint32_t); \
}
#define LOOP_NEED_FLAGS
#include <iconv/loop.c>
} \
\
/* Now adjust the pointers and store the result. */ \
- *((uint32_t *) outptr)++ = ch; \
+ *((uint32_t *) outptr) = ch; \
+ outptr += sizeof (uint32_t); \
}
#define LOOP_NEED_FLAGS
STANDARD_FROM_LOOP_ERR_HANDLER (2); \
} \
\
- *((uint32_t *) outptr)++ = u1; \
+ *((uint32_t *) outptr) = u1; \
+ outptr += sizeof (uint32_t); \
inptr += 2; \
}
#define LOOP_NEED_FLAGS
} \
else \
{ \
- *((uint16_t *) outptr)++ = val; \
+ *((uint16_t *) outptr) = val; \
+ outptr += sizeof (uint16_t); \
inptr += 4; \
} \
}
continue; \
} \
\
- *((uint32_t *) outptr)++ = u1; \
+ *((uint32_t *) outptr) = u1; \
+ outptr += sizeof (uint32_t); \
inptr += 2; \
}
#define LOOP_NEED_FLAGS
} \
else \
{ \
- *((uint16_t *) outptr)++ = bswap_16 (val); \
+ *((uint16_t *) outptr) = bswap_16 (val); \
+ outptr += sizeof (uint16_t); \
inptr += 4; \
} \
}