[2/7] Fix _STRING_ARCH_unaligned -Wundef warnings
diff mbox

Message ID 1395059004-20960-2-git-send-email-will.newton@linaro.org
State New
Headers show

Commit Message

Will Newton March 17, 2014, 12:23 p.m. UTC
ChangeLog:

2014-03-17  Will Newton  <will.newton@linaro.org>

	* crypt/md5.c: Check whether _STRING_ARCH_unaligned
	is defined with #ifdef rather than #if.
	* crypt/sha256.c: Likewise.
	* crypt/sha512.c: Likewise.
	* include/arpa/nameser.h: Likewise.
	* stdlib/getenv.c: Likewise.
	* string/bits/string2.h: Likewise.
---
 crypt/md5.c            |  2 +-
 crypt/sha256.c         |  2 +-
 crypt/sha512.c         |  2 +-
 include/arpa/nameser.h |  2 +-
 stdlib/getenv.c        |  8 ++++----
 string/bits/string2.h  | 10 +++++-----
 6 files changed, 13 insertions(+), 13 deletions(-)

Patch
diff mbox

diff --git a/crypt/md5.c b/crypt/md5.c
index a444a18..116537a 100644
--- a/crypt/md5.c
+++ b/crypt/md5.c
@@ -242,7 +242,7 @@  md5_process_bytes (buffer, len, ctx)
   /* Process available complete blocks.  */
   if (len >= 64)
     {
-#if !_STRING_ARCH_unaligned
+#ifndef _STRING_ARCH_unaligned
 /* To check alignment gcc has an appropriate operator.  Other
    compilers don't.  */
 # if __GNUC__ >= 2
diff --git a/crypt/sha256.c b/crypt/sha256.c
index a5df83e..39f9afb 100644
--- a/crypt/sha256.c
+++ b/crypt/sha256.c
@@ -177,7 +177,7 @@  __sha256_process_bytes (buffer, len, ctx)
   /* Process available complete blocks.  */
   if (len >= 64)
     {
-#if !_STRING_ARCH_unaligned
+#ifndef _STRING_ARCH_unaligned
 /* To check alignment gcc has an appropriate operator.  Other
    compilers don't.  */
 # if __GNUC__ >= 2
diff --git a/crypt/sha512.c b/crypt/sha512.c
index f0c0725..4bbe496 100644
--- a/crypt/sha512.c
+++ b/crypt/sha512.c
@@ -199,7 +199,7 @@  __sha512_process_bytes (buffer, len, ctx)
   /* Process available complete blocks.  */
   if (len >= 128)
     {
-#if !_STRING_ARCH_unaligned
+#ifndef _STRING_ARCH_unaligned
 /* To check alignment gcc has an appropriate operator.  Other
    compilers don't.  */
 # if __GNUC__ >= 2
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index 57f7457..a0aea28 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -11,7 +11,7 @@ 
 
 extern const struct _ns_flagdata _ns_flagdata[] attribute_hidden;
 
-#if _STRING_ARCH_unaligned
+#ifdef _STRING_ARCH_unaligned
 
 # undef NS_GET16
 # define NS_GET16(s, cp) \
diff --git a/stdlib/getenv.c b/stdlib/getenv.c
index e8cb913..ed4de87 100644
--- a/stdlib/getenv.c
+++ b/stdlib/getenv.c
@@ -45,14 +45,14 @@  getenv (name)
       /* The name of the variable consists of only one character.  Therefore
 	 the first two characters of the environment entry are this character
 	 and a '=' character.  */
-#if __BYTE_ORDER == __LITTLE_ENDIAN || !_STRING_ARCH_unaligned
+#if __BYTE_ORDER == __LITTLE_ENDIAN || !defined _STRING_ARCH_unaligned
       name_start = ('=' << 8) | *(const unsigned char *) name;
 #else
       name_start = '=' | ((*(const unsigned char *) name) << 8);
 #endif
       for (ep = __environ; *ep != NULL; ++ep)
 	{
-#if _STRING_ARCH_unaligned
+#ifdef _STRING_ARCH_unaligned
 	  uint16_t ep_start = *(uint16_t *) *ep;
 #else
 	  uint16_t ep_start = (((unsigned char *) *ep)[0]
@@ -64,7 +64,7 @@  getenv (name)
     }
   else
     {
-#if _STRING_ARCH_unaligned
+#ifdef _STRING_ARCH_unaligned
       name_start = *(const uint16_t *) name;
 #else
       name_start = (((const unsigned char *) name)[0]
@@ -75,7 +75,7 @@  getenv (name)
 
       for (ep = __environ; *ep != NULL; ++ep)
 	{
-#if _STRING_ARCH_unaligned
+#ifdef _STRING_ARCH_unaligned
 	  uint16_t ep_start = *(uint16_t *) *ep;
 #else
 	  uint16_t ep_start = (((unsigned char *) *ep)[0]
diff --git a/string/bits/string2.h b/string/bits/string2.h
index 1b6a1ef..6cb0c4f 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -46,7 +46,7 @@ 
 # endif
 #endif
 
-#if _STRING_ARCH_unaligned
+#ifdef _STRING_ARCH_unaligned
 /* If we can do unaligned memory accesses we must know the endianess.  */
 # include <endian.h>
 # include <bits/types.h>
@@ -95,7 +95,7 @@  __STRING2_COPY_TYPE (8);
 /* Set N bytes of S to C.  */
 #if !defined _HAVE_STRING_ARCH_memset
 # if !__GNUC_PREREQ (3, 0)
-#  if _STRING_ARCH_unaligned
+#  ifdef _STRING_ARCH_unaligned
 #   define memset(s, c, n) \
   (__extension__ (__builtin_constant_p (n) && (n) <= 16			      \
 		  ? ((n) == 1						      \
@@ -223,7 +223,7 @@  __STRING2_COPY_TYPE (8);
 #  endif
 
 #  if !__GNUC_PREREQ (3, 0) || defined _FORCE_INLINES
-#   if _STRING_ARCH_unaligned
+#   ifdef _STRING_ARCH_unaligned
 #    ifndef _FORCE_INLINES
 #     define __mempcpy_args(src) \
      ((const char *) (src))[0], ((const char *) (src))[2],		      \
@@ -419,7 +419,7 @@  extern void *__rawmemchr (const void *__s, int __c);
 		  : strcpy (dest, src)))
 # endif
 
-# if _STRING_ARCH_unaligned
+# ifdef _STRING_ARCH_unaligned
 #  ifndef _FORCE_INLINES
 #   define __strcpy_args(src) \
      __extension__ __STRING2_SMALL_GET16 (src, 0),			      \
@@ -598,7 +598,7 @@  __strcpy_small (char *__dest,
 #  endif
 
 #  if !__GNUC_PREREQ (3, 0) || defined _FORCE_INLINES
-#   if _STRING_ARCH_unaligned
+#   ifdef _STRING_ARCH_unaligned
 #    ifndef _FORCE_INLINES
 #     define __stpcpy_args(src) \
      __extension__ __STRING2_SMALL_GET16 (src, 0),			      \