$NetBSD: patch-as,v 1.2 2014/02/01 01:44:53 markd Exp $

nonportable, possibly alignment problems

--- src/libical/icaltz-util.c.orig	2015-12-29 06:44:53.000000000 +0900
+++ src/libical/icaltz-util.c	2017-04-17 22:52:21.000000000 +0900
@@ -29,6 +29,7 @@
 
 #include <stdlib.h>
 
+#if 0 /* XXX see below */
 #if defined(sun) && defined(__SVR4)
 #include <sys/types.h>
 #include <sys/byteorder.h>
@@ -49,6 +50,7 @@
 #endif
 #endif
 #endif
+#endif
 
 #if defined(__OpenBSD__) && !defined(bswap_32)
 #define bswap_32 swap32
@@ -127,6 +129,7 @@ typedef struct
 
 static int decode(const void *ptr)
 {
+#if 0 /* XXX nonportable, possibly alignment problems */
 #if defined(sun) && defined(__SVR4)
     if (sizeof(int) == 4) {
 #if defined(_BIG_ENDIAN)
@@ -140,10 +143,11 @@ static int decode(const void *ptr)
     } else if (BYTE_ORDER == LITTLE_ENDIAN && sizeof(int) == 4) {
         return (int)bswap_32(*(const unsigned int *)ptr);
 #endif
-    } else {
+    } else
+#endif
+    {
         const unsigned char *p = ptr;
-        int result = *p & (1 << (CHAR_BIT - 1)) ? ~0 : 0;
-
+		unsigned int result = *p & (1 << (CHAR_BIT - 1)) ? ~0 : 0;
         result = (result << 8) | *p++;
         result = (result << 8) | *p++;
         result = (result << 8) | *p++;
