]> arthur.barton.de Git - netatalk.git/commitdiff
Portability fixes
authorFrank Lahm <franklahm@googlemail.com>
Tue, 3 Jan 2012 11:35:09 +0000 (12:35 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Tue, 3 Jan 2012 11:35:09 +0000 (12:35 +0100)
include/atalk/volume.h
libatalk/adouble/ad_lock.c
libatalk/unicode/util_unistr.c

index de9f10c5aa8e785058cc063bc29aff2210de9c13..6d651128bd81178b27e3494cf06a416dce021db5 100644 (file)
@@ -7,7 +7,6 @@
 #define ATALK_VOLUME_H 1
 
 #include <stdint.h>
-#include <sys/cdefs.h>
 #include <sys/types.h>
 
 #include <atalk/unicode.h>
index 0e05a8f7d7616f6ab4fc231d113162fe4b7d6e0a..5d6e4b1a234f1e61e629e81f70d539f75d9ed271 100644 (file)
@@ -316,7 +316,7 @@ static int testlock(const struct ad_fd *adf, off_t off, off_t len)
 
 static uint16_t ad_openforks_v2(struct adouble *ad, uint16_t attrbits)
 {
-  u_int16_t ret = 0;
+  uint16_t ret = 0;
   struct ad_fd *adf;
   off_t off;
 
@@ -371,7 +371,7 @@ static uint16_t ad_openforks_v2(struct adouble *ad, uint16_t attrbits)
 
 static uint16_t ad_openforks_ea(struct adouble *ad, uint16_t attrbits)
 {
-    u_int16_t ret = 0;
+    uint16_t ret = 0;
     struct ad_fd *adf;
     off_t off;
     off_t len;
index aec13c820d35d5d87c0153acfda99abe56e7a1da..3c9a194b5dd6169813d68c40e9b94577fe1a13d2 100644 (file)
@@ -38,8 +38,8 @@ int strlower_w(ucs2_t *s)
        while (*s) {
                if ((0xD800 <= *s) && (*s < 0xDC00)) {
                        if ((0xDC00 <= s[1]) && (s[1] < 0xE000)) {
-                               u_int32_t s_sp = (u_int32_t)*s << 16 | (u_int32_t)s[1];
-                               u_int32_t v_sp = tolower_sp(s_sp);
+                               uint32_t s_sp = (uint32_t)*s << 16 | (uint32_t)s[1];
+                               uint32_t v_sp = tolower_sp(s_sp);
                                if (v_sp != s_sp) {
                                        *s = v_sp >> 16;
                                        s++;
@@ -72,8 +72,8 @@ int strupper_w(ucs2_t *s)
        while (*s) {
                if ((0xD800 <= *s) && (*s < 0xDC00)) {
                        if ((0xDC00 <= s[1]) && (s[1] < 0xE000)) {
-                               u_int32_t s_sp = (u_int32_t)*s << 16 | (u_int32_t)s[1];
-                               u_int32_t v_sp = toupper_sp(s_sp);
+                               uint32_t s_sp = (uint32_t)*s << 16 | (uint32_t)s[1];
+                               uint32_t v_sp = toupper_sp(s_sp);
                                if (v_sp != s_sp) {
                                        *s = v_sp >> 16;
                                        s++;
@@ -104,7 +104,7 @@ int islower_w(ucs2_t c)
        return ( c == tolower_w(c));
 }
 
-int islower_sp(u_int32_t c_sp)
+int islower_sp(uint32_t c_sp)
 {
        return ( c_sp == tolower_sp(c_sp));
 }
@@ -120,7 +120,7 @@ int isupper_w(ucs2_t c)
        return ( c == toupper_w(c));
 }
 
-int isupper_sp(u_int32_t c_sp)
+int isupper_sp(uint32_t c_sp)
 {
        return ( c_sp == toupper_sp(c_sp));
 }
@@ -188,11 +188,11 @@ ucs2_t *strcasechr_w(const ucs2_t *s, ucs2_t c)
        return NULL;
 }
 
-ucs2_t *strcasechr_sp(const ucs2_t *s, u_int32_t c_sp)
+ucs2_t *strcasechr_sp(const ucs2_t *s, uint32_t c_sp)
 {
        if (*s == 0) return NULL;
        while (s[1] != 0) {
-               if (toupper_sp(c_sp) == toupper_sp((u_int32_t)*s << 16 | (u_int32_t)s[1])) return (ucs2_t *)s;
+               if (toupper_sp(c_sp) == toupper_sp((uint32_t)*s << 16 | (uint32_t)s[1])) return (ucs2_t *)s;
                s++;
        }
 
@@ -279,7 +279,7 @@ int strcasecmp_w(const ucs2_t *a, const ucs2_t *b)
 
        while (*a && *b) {
                if ((0xD800 <= *a) && (*a < 0xDC00)) {
-                       if (ret = tolower_sp((u_int32_t)*a << 16 | (u_int32_t)a[1]) - tolower_sp((u_int32_t)*b << 16 | (u_int32_t)b[1])) return ret;
+                       if (ret = tolower_sp((uint32_t)*a << 16 | (uint32_t)a[1]) - tolower_sp((uint32_t)*b << 16 | (uint32_t)b[1])) return ret;
                        a++;
                        b++;
                        if (!(*a && *b)) return (tolower_w(*a) - tolower_w(*b)); /* avoid buffer over run */
@@ -305,7 +305,7 @@ int strncasecmp_w(const ucs2_t *a, const ucs2_t *b, size_t len)
 
        while ((n < len) && *a && *b) {
                if ((0xD800 <= *a) && (*a < 0xDC00)) {
-                       if (ret = tolower_sp((u_int32_t)*a << 16 | (u_int32_t)a[1]) - tolower_sp((u_int32_t)*b << 16 | (u_int32_t)b[1])) return ret;
+                       if (ret = tolower_sp((uint32_t)*a << 16 | (uint32_t)a[1]) - tolower_sp((uint32_t)*b << 16 | (uint32_t)b[1])) return ret;
                        a++;
                        b++;
                        n++;