From 80fe6e63eb8ec9a396b4383cb8210fd5ded6ad35 Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Thu, 2 Jun 2011 22:26:02 +0200 Subject: [PATCH] Convert all u_int to ISO uint --- bin/afppasswd/afppasswd.c | 2 +- bin/misc/fce.c | 2 - bin/uniconv/uniconv.c | 4 +- etc/afpd/acl_mappings.h | 12 ++-- etc/afpd/acls.c | 2 +- etc/afpd/afp_dsi.c | 4 +- etc/afpd/afs.c | 12 ++-- etc/afpd/appl.c | 24 +++---- etc/afpd/auth.c | 24 +++---- etc/afpd/catsearch.c | 42 +++++------ etc/afpd/desktop.c | 28 ++++---- etc/afpd/directory.c | 74 ++++++++++---------- etc/afpd/directory.h | 6 +- etc/afpd/enumerate.c | 12 ++-- etc/afpd/file.c | 70 +++++++++--------- etc/afpd/file.h | 10 +-- etc/afpd/filedir.c | 26 +++---- etc/afpd/fork.c | 32 ++++----- etc/afpd/fork.h | 4 +- etc/afpd/mangle.c | 8 +-- etc/afpd/messages.c | 6 +- etc/afpd/nfsquota.c | 2 +- etc/afpd/ofork.c | 6 +- etc/afpd/quota.c | 24 +++---- etc/afpd/status.c | 24 +++---- etc/afpd/uam.c | 2 +- etc/afpd/unix.c | 2 +- etc/afpd/unix.h | 6 +- etc/afpd/volume.c | 40 +++++------ etc/afpd/volume.h | 4 +- etc/uams/uams_dhx2_pam.c | 14 ++-- etc/uams/uams_dhx2_passwd.c | 14 ++-- etc/uams/uams_dhx_pam.c | 14 ++-- etc/uams/uams_dhx_passwd.c | 12 ++-- etc/uams/uams_gss.c | 18 ++--- etc/uams/uams_pam.c | 2 +- etc/uams/uams_passwd.c | 2 +- etc/uams/uams_pgp.c | 4 +- etc/uams/uams_randnum.c | 12 ++-- include/atalk/adouble.h | 10 +-- include/atalk/afp.h | 2 +- include/atalk/cnid.h | 4 +- include/atalk/cnid_dbd_private.h | 2 +- include/atalk/dsi.h | 20 +++--- include/atalk/globals.h | 2 +- include/atalk/server_child.h | 2 +- include/atalk/unicode.h | 10 +-- include/atalk/volinfo.h | 2 +- include/atalk/volume.h | 8 +-- libatalk/adouble/ad_attr.c | 18 ++--- libatalk/adouble/ad_date.c | 6 +- libatalk/adouble/ad_flush.c | 12 ++-- libatalk/adouble/ad_lock.c | 8 +-- libatalk/adouble/ad_open.c | 4 +- libatalk/adouble/ad_read.c | 2 +- libatalk/adouble/ad_size.c | 2 +- libatalk/cnid/cnid.c | 6 +- libatalk/cnid/tdb/cnid_tdb.h | 2 +- libatalk/cnid/tdb/cnid_tdb_add.c | 4 +- libatalk/cnid/tdb/cnid_tdb_lookup.c | 6 +- libatalk/cnid/tdb/cnid_tdb_open.c | 2 +- libatalk/dsi/dsi_attn.c | 4 +- libatalk/dsi/dsi_init.c | 2 +- libatalk/dsi/dsi_opensess.c | 2 +- libatalk/dsi/dsi_stream.c | 12 ++-- libatalk/dsi/dsi_tcp.c | 2 +- libatalk/dsi/dsi_tickle.c | 2 +- libatalk/tdb/tdb_private.h | 1 + libatalk/unicode/byteorder.h | 20 +++--- libatalk/unicode/charcnv.c | 10 +-- libatalk/unicode/charsets/generic_cjk.c | 36 +++++----- libatalk/unicode/charsets/generic_cjk.h | 18 ++--- libatalk/unicode/charsets/mac_chinese_simp.c | 12 ++-- libatalk/unicode/charsets/mac_chinese_simp.h | 36 +++++----- libatalk/unicode/charsets/mac_chinese_trad.c | 12 ++-- libatalk/unicode/charsets/mac_chinese_trad.h | 30 ++++---- libatalk/unicode/charsets/mac_japanese.c | 18 ++--- libatalk/unicode/charsets/mac_japanese.h | 30 ++++---- libatalk/unicode/charsets/mac_korean.c | 14 ++-- libatalk/unicode/charsets/mac_korean.h | 32 ++++----- libatalk/unicode/utf16_casetable.h | 46 ++++++------ libatalk/unicode/util_unistr.c | 38 +++++----- libatalk/util/server_ipc.c | 4 +- 83 files changed, 560 insertions(+), 561 deletions(-) diff --git a/bin/afppasswd/afppasswd.c b/bin/afppasswd/afppasswd.c index 2d788baa..c3e60fb5 100644 --- a/bin/afppasswd/afppasswd.c +++ b/bin/afppasswd/afppasswd.c @@ -66,7 +66,7 @@ static char buf[MAXPATHLEN + 1]; #define unhex(x) (isdigit(x) ? (x) - '0' : toupper(x) + 10 - 'A') static void convert_passwd(char *buf, char *newpwd, const int keyfd) { - u_int8_t key[HEXPASSWDLEN]; + uint8_t key[HEXPASSWDLEN]; Key_schedule schedule; unsigned int i, j; diff --git a/bin/misc/fce.c b/bin/misc/fce.c index 76ca0a8e..d6969907 100644 --- a/bin/misc/fce.c +++ b/bin/misc/fce.c @@ -14,9 +14,7 @@ #include #include #include - #include -#include #include #include diff --git a/bin/uniconv/uniconv.c b/bin/uniconv/uniconv.c index 5dfc8231..8a786a60 100644 --- a/bin/uniconv/uniconv.c +++ b/bin/uniconv/uniconv.c @@ -60,7 +60,7 @@ char* to_charset; static charset_t ch_mac; char* mac_charset; static int usedots = 0; -static u_int16_t conv_flags = 0; +static uint16_t conv_flags = 0; static int dry_run = 0; static int verbose=0; char *cnid_type; @@ -149,7 +149,7 @@ static char *convert_name(char *name, struct stat *st, cnid_t cur_did) size_t outlen = 0; unsigned char *p,*q; int require_conversion = 0; - u_int16_t flags = conv_flags; + uint16_t flags = conv_flags; cnid_t id; p = (unsigned char *)name; diff --git a/etc/afpd/acl_mappings.h b/etc/afpd/acl_mappings.h index b7c4b6d2..87ff5dec 100644 --- a/etc/afpd/acl_mappings.h +++ b/etc/afpd/acl_mappings.h @@ -31,8 +31,8 @@ #endif struct ace_rights_map { - u_int32_t from; - u_int32_t to; + uint32_t from; + uint32_t to; }; #ifdef HAVE_SOLARIS_ACLS @@ -71,8 +71,8 @@ struct ace_rights_map darwin_to_nfsv4_rights[] = { }; struct nfsv4_to_darwin_flags_map { - u_int16_t from; - u_int32_t to; + uint16_t from; + uint32_t to; }; struct nfsv4_to_darwin_flags_map nfsv4_to_darwin_flags[] = { @@ -85,8 +85,8 @@ struct nfsv4_to_darwin_flags_map nfsv4_to_darwin_flags[] = { }; struct darwin_to_nfsv4_flags_map { - u_int32_t from; - u_int16_t to; + uint32_t from; + uint16_t to; }; struct darwin_to_nfsv4_flags_map darwin_to_nfsv4_flags[] = { diff --git a/etc/afpd/acls.c b/etc/afpd/acls.c index c87ef9a0..34a7e92c 100644 --- a/etc/afpd/acls.c +++ b/etc/afpd/acls.c @@ -836,7 +836,7 @@ static int get_and_map_acl(char *name, char *rbuf, size_t *rbuflen) EC_INIT; int mapped_aces = 0; int dirflag; - uint32_t *darwin_ace_count = (u_int32_t *)rbuf; + uint32_t *darwin_ace_count = (uint32_t *)rbuf; #ifdef HAVE_SOLARIS_ACLS int ace_count = 0; ace_t *aces = NULL; diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index bde1818b..0af1c26f 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -375,8 +375,8 @@ void afp_over_dsi(AFPObj *obj) { DSI *dsi = (DSI *) obj->handle; int rc_idx; - u_int32_t err, cmd; - u_int8_t function; + uint32_t err, cmd; + uint8_t function; struct sigaction action; AFPobj = obj; diff --git a/etc/afpd/afs.c b/etc/afpd/afs.c index d045cd4e..3b33c1ee 100644 --- a/etc/afpd/afs.c +++ b/etc/afpd/afs.c @@ -32,7 +32,7 @@ int afs_getvolspace( vol, bfree, btotal, bsize ) struct vol *vol; VolSpace *bfree, *btotal; -u_int32_t *bsize; +uint32_t *bsize; { struct ViceIoctl vi; struct VolumeStatus *vs; @@ -81,8 +81,8 @@ int afp_getdiracl(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *r struct vol *vol; struct dir *dir; struct path *path; - u_int32_t did; - u_int16_t vid; + uint32_t did; + uint16_t vid; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); @@ -169,8 +169,8 @@ int afp_setdiracl(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *r struct dir *dir; char *iend; struct path *path; - u_int32_t did; - u_int16_t vid; + uint32_t did; + uint16_t vid; *rbuflen = 0; iend = ibuf + ibuflen; @@ -235,7 +235,7 @@ int afp_afschangepw(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t char realm[ MAXKTCREALMLEN ]; char oldpw[ 9 ], newpw[ 9 ]; int len, rc; - u_int16_t clen; + uint16_t clen; struct ktc_encryptionKey oldkey, newkey; struct ktc_token adtok; struct ubik_client *conn; diff --git a/etc/afpd/appl.c b/etc/afpd/appl.c index 51b64ef2..2f3079f4 100644 --- a/etc/afpd/appl.c +++ b/etc/afpd/appl.c @@ -87,8 +87,8 @@ static int copyapplfile(int sfd, int dfd, char *mpath, u_short mplen) { int cc; char *p; - u_int16_t len; - u_char appltag[ 4 ]; + uint16_t len; + unsigned char appltag[ 4 ]; char buf[ MAXPATHLEN ]; while (( cc = read( sfd, buf, sizeof(appltag) + sizeof( u_short ))) > 0 ) { @@ -199,12 +199,12 @@ int afp_addappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, siz struct vol *vol; struct dir *dir; int tfd, cc; - u_int32_t did; - u_int16_t vid, mplen; + uint32_t did; + uint16_t vid, mplen; struct path *path; char *dtf, *p, *mp; - u_char creator[ 4 ]; - u_char appltag[ 4 ]; + unsigned char creator[ 4 ]; + unsigned char appltag[ 4 ]; char *mpath, *tempfile; *rbuflen = 0; @@ -286,11 +286,11 @@ int afp_rmvappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, siz struct vol *vol; struct dir *dir; int tfd, cc; - u_int32_t did; - u_int16_t vid, mplen; + uint32_t did; + uint16_t vid, mplen; struct path *path; char *dtf, *mp; - u_char creator[ 4 ]; + unsigned char creator[ 4 ]; char *tempfile, *mpath; *rbuflen = 0; @@ -358,9 +358,9 @@ int afp_getappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t char *p, *q; int cc; size_t buflen; - u_int16_t vid, aindex, bitmap, len; - u_char creator[ 4 ]; - u_char appltag[ 4 ]; + uint16_t vid, aindex, bitmap, len; + unsigned char creator[ 4 ]; + unsigned char appltag[ 4 ]; char *buf, *cbuf; struct path *path; diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c index fef13eb8..852fa33f 100644 --- a/etc/afpd/auth.c +++ b/etc/afpd/auth.c @@ -91,7 +91,7 @@ static struct uam_obj *afp_uam = NULL; void status_versions( char *data, const DSI *dsi) { char *start = data; - u_int16_t status; + uint16_t status; int len, num, i, count = 0; memcpy(&status, start + AFPSTATUS_VERSOFF, sizeof(status)); @@ -118,7 +118,7 @@ void status_versions( char *data, const DSI *dsi) void status_uams(char *data, const char *authlist) { char *start = data; - u_int16_t status; + uint16_t status; struct uam_obj *uams; int len, num = 0; @@ -475,10 +475,10 @@ int afp_getsession( char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { - u_int16_t type; - u_int32_t idlen = 0; - u_int32_t boottime; - u_int32_t tklen, tp; + uint16_t type; + uint32_t idlen = 0; + uint32_t boottime; + uint32_t tklen, tp; char *token; char *p; @@ -577,8 +577,8 @@ int afp_getsession( int afp_disconnect(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { DSI *dsi = (DSI *)obj->handle; - u_int16_t type; - u_int32_t tklen; + uint16_t type; + uint32_t tklen; pid_t token; int i; @@ -744,7 +744,7 @@ int afp_login_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *r size_t len; int i; char type; - u_int16_t len16; + uint16_t len16; char *username; *rbuflen = 0; @@ -976,9 +976,9 @@ int afp_changepw(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rb /* FPGetUserInfo */ int afp_getuserinfo(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { - u_int8_t thisuser; - u_int32_t id; - u_int16_t bitmap; + uint8_t thisuser; + uint32_t id; + uint16_t bitmap; char *bitmapp; LOG(log_debug, logtype_afpd, "begin afp_getuserinfo:"); diff --git a/etc/afpd/catsearch.c b/etc/afpd/catsearch.c index a488501e..18fca228 100644 --- a/etc/afpd/catsearch.c +++ b/etc/afpd/catsearch.c @@ -59,10 +59,10 @@ struct finderinfo { - u_int32_t f_type; - u_int32_t creator; - u_int16_t attrs; /* File attributes (high 8 bits)*/ - u_int16_t label; /* Label (low 8 bits )*/ + uint32_t f_type; + uint32_t creator; + uint16_t attrs; /* File attributes (high 8 bits)*/ + uint16_t label; /* Label (low 8 bits )*/ char reserved[22]; /* Unknown (at least for now...) */ }; @@ -86,14 +86,14 @@ typedef char packed_finder[ADEDLEN_FINDERI]; /* This is our search-criteria structure. */ struct scrit { - u_int32_t rbitmap; /* Request bitmap - which values should we check ? */ - u_int16_t fbitmap, dbitmap; /* file & directory bitmap - which values should we return ? */ - u_int16_t attr; /* File attributes */ + uint32_t rbitmap; /* Request bitmap - which values should we check ? */ + uint16_t fbitmap, dbitmap; /* file & directory bitmap - which values should we return ? */ + uint16_t attr; /* File attributes */ time_t cdate; /* Creation date */ time_t mdate; /* Last modification date */ time_t bdate; /* Last backup date */ - u_int32_t pdid; /* Parent DID */ - u_int16_t offcnt; /* Offspring count */ + uint32_t pdid; /* Parent DID */ + uint16_t offcnt; /* Offspring count */ struct finderinfo finfo; /* Finder info */ char lname[64]; /* Long name */ char utf8name[514]; /* UTF8 or UCS2 name */ /* for convert_charset dest_len parameter +2 */ @@ -257,11 +257,11 @@ unpack_finderinfo(struct vol *vol, struct path *path, struct adouble **adp, stru */ static int crit_check(struct vol *vol, struct path *path) { int result = 0; - u_int16_t attr, flags = CONV_PRECOMPOSE; + uint16_t attr, flags = CONV_PRECOMPOSE; struct finderinfo *finfo = NULL, finderinfo; struct adouble *adp = NULL; time_t c_date, b_date; - u_int32_t ac_date, ab_date; + uint32_t ac_date, ab_date; static char convbuf[514]; /* for convert_charset dest_len parameter +2 */ size_t len; int islnk; @@ -429,7 +429,7 @@ static int rslt_add ( struct vol *vol, struct path *path, char **buf, int ext) char *p = *buf; int ret; size_t tbuf =0; - u_int16_t resultsize; + uint16_t resultsize; int isdir = S_ISDIR(path->st.st_mode); /* Skip resultsize */ @@ -502,7 +502,7 @@ static int catsearch(struct vol *vol, int *rsize, int ext) { - static u_int32_t cur_pos; /* Saved position index (ID) - used to remember "position" across FPCatSearch calls */ + static uint32_t cur_pos; /* Saved position index (ID) - used to remember "position" across FPCatSearch calls */ static DIR *dirpos; /* UNIX structure describing currently opened directory. */ struct dir *curdir; /* struct dir of current directory */ int cidx, r; @@ -840,17 +840,17 @@ static int catsearch_afp(AFPObj *obj _U_, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen, int ext) { struct vol *vol; - u_int16_t vid; - u_int16_t spec_len; - u_int32_t rmatches, reserved; - u_int32_t catpos[4]; - u_int32_t pdid = 0; + uint16_t vid; + uint16_t spec_len; + uint32_t rmatches, reserved; + uint32_t catpos[4]; + uint32_t pdid = 0; int ret, rsize; - u_int32_t nrecs = 0; + uint32_t nrecs = 0; unsigned char *spec1, *spec2, *bspec1, *bspec2; size_t len; - u_int16_t namelen; - u_int16_t flags; + uint16_t namelen; + uint16_t flags; char tmppath[256]; char *uname; diff --git a/etc/afpd/desktop.c b/etc/afpd/desktop.c index eda917b1..96e2fccf 100644 --- a/etc/afpd/desktop.c +++ b/etc/afpd/desktop.c @@ -38,7 +38,7 @@ int afp_opendt(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; - u_int16_t vid; + uint16_t vid; ibuf += 2; @@ -117,8 +117,8 @@ int afp_addicon(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t u_char fcreator[ 4 ], imh[ 12 ], irh[ 12 ], *p; int itype, cc = AFP_OK, iovcnt = 0; size_t buflen; - u_int32_t ftype, itag; - u_int16_t bsize, rsize, vid; + uint32_t ftype, itag; + uint16_t bsize, rsize, vid; buflen = *rbuflen; *rbuflen = 0; @@ -292,8 +292,8 @@ static const u_char uicon[] = { int afp_geticoninfo(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; - u_char fcreator[ 4 ], ih[ 12 ]; - u_int16_t vid, iindex, bsize; + unsigned char fcreator[ 4 ], ih[ 12 ]; + uint16_t vid, iindex, bsize; *rbuflen = 0; ibuf += 2; @@ -366,7 +366,7 @@ int afp_geticon(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t off_t offset; ssize_t rc, buflen; u_char fcreator[ 4 ], ftype[ 4 ], itype, ih[ 12 ]; - u_int16_t vid, bsize, rsize; + uint16_t vid, bsize, rsize; buflen = *rbuflen; *rbuflen = 0; @@ -552,7 +552,7 @@ char *mtoupath(const struct vol *vol, char *mpath, cnid_t did, int utf8) char *m, *u; size_t inplen; size_t outlen; - u_int16_t flags; + uint16_t flags; if ( *mpath == '\0' ) { strcpy(upath, "."); @@ -591,7 +591,7 @@ char *utompath(const struct vol *vol, char *upath, cnid_t id, int utf8) { static char mpath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */ char *m, *u; - u_int16_t flags; + uint16_t flags; size_t outlen; m = mpath; @@ -679,8 +679,8 @@ int afp_addcomment(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _ struct vol *vol; struct dir *dir; struct path *path; - u_int32_t did; - u_int16_t vid; + uint32_t did; + uint16_t vid; *rbuflen = 0; ibuf += 2; @@ -757,8 +757,8 @@ int afp_getcomment(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, struct vol *vol; struct dir *dir; struct path *s_path; - u_int32_t did; - u_int16_t vid; + uint32_t did; + uint16_t vid; *rbuflen = 0; ibuf += 2; @@ -827,8 +827,8 @@ int afp_rmvcomment(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _ struct vol *vol; struct dir *dir; struct path *s_path; - u_int32_t did; - u_int16_t vid; + uint32_t did; + uint16_t vid; *rbuflen = 0; ibuf += 2; diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index 9d3e18f3..c87c9c93 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -696,7 +696,7 @@ int caseenumerate(const struct vol *vol, struct path *path, struct dir *dir) DIR *dp; struct dirent *de; int ret; - static u_int32_t did = 0; + static uint32_t did = 0; static char cname[MAXPATHLEN]; static char lname[MAXPATHLEN]; ucs2_t u2_path[MAXPATHLEN]; @@ -1129,8 +1129,8 @@ struct path *cname(struct vol *vol, struct dir *dir, char **cpath) struct dir *cdir; char *data, *p; int len; - u_int32_t hint; - u_int16_t len16; + uint32_t hint; + uint16_t len16; int size = 0; int toUTF8 = 0; @@ -1442,7 +1442,7 @@ int file_access(struct path *path, int mode) } /* --------------------- */ -void setdiroffcnt(struct dir *dir, struct stat *st, u_int32_t count) +void setdiroffcnt(struct dir *dir, struct stat *st, uint32_t count) { dir->d_offcnt = count; dir->d_ctime = st->st_ctime; @@ -1464,7 +1464,7 @@ int dirreenumerate(struct dir *dir, struct stat *st) */ int getdirparams(const struct vol *vol, - u_int16_t bitmap, struct path *s_path, + uint16_t bitmap, struct path *s_path, struct dir *dir, char *buf, size_t *buflen ) { @@ -1472,10 +1472,10 @@ int getdirparams(const struct vol *vol, struct adouble ad; char *data, *l_nameoff = NULL, *utf_nameoff = NULL; int bit = 0, isad = 0; - u_int32_t aint; - u_int16_t ashort; + uint32_t aint; + uint16_t ashort; int ret; - u_int32_t utf8 = 0; + uint32_t utf8 = 0; cnid_t pdid; struct stat *st = &s_path->st; char *upath = s_path->u_name; @@ -1585,13 +1585,13 @@ int getdirparams(const struct vol *vol, if (dir->d_m_name) /* root of parent can have a null name */ l_nameoff = data; else - memset(data, 0, sizeof(u_int16_t)); - data += sizeof( u_int16_t ); + memset(data, 0, sizeof(uint16_t)); + data += sizeof( uint16_t ); break; case DIRPBIT_SNAME : - memset(data, 0, sizeof(u_int16_t)); - data += sizeof( u_int16_t ); + memset(data, 0, sizeof(uint16_t)); + data += sizeof( uint16_t ); break; case DIRPBIT_DID : @@ -1646,8 +1646,8 @@ int getdirparams(const struct vol *vol, if (dir->d_m_name) /* root of parent can have a null name */ utf_nameoff = data; else - memset(data, 0, sizeof(u_int16_t)); - data += sizeof( u_int16_t ); + memset(data, 0, sizeof(uint16_t)); + data += sizeof( uint16_t ); aint = 0; memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); @@ -1730,8 +1730,8 @@ int afp_setdirparams(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_ struct vol *vol; struct dir *dir; struct path *path; - u_int16_t vid, bitmap; - u_int32_t did; + uint16_t vid, bitmap; + uint32_t did; int rc; *rbuflen = 0; @@ -1786,7 +1786,7 @@ int afp_setdirparams(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_ * * assume path == '\0' eg. it's a directory in canonical form */ -int setdirparams(struct vol *vol, struct path *path, u_int16_t d_bitmap, char *buf ) +int setdirparams(struct vol *vol, struct path *path, uint16_t d_bitmap, char *buf ) { struct maccess ma; struct adouble ad; @@ -1798,16 +1798,16 @@ int setdirparams(struct vol *vol, struct path *path, u_int16_t d_bitmap, char *b int bit, isad = 1; int cdate, bdate; int owner, group; - u_int16_t ashort, bshort, oshort; + uint16_t ashort, bshort, oshort; int err = AFP_OK; int change_mdate = 0; int change_parent_mdate = 0; int newdate = 0; - u_int16_t bitmap = d_bitmap; + uint16_t bitmap = d_bitmap; u_char finder_buf[32]; - u_int32_t upriv; + uint32_t upriv; mode_t mpriv = 0; - u_int16_t upriv_bit = 0; + uint16_t upriv_bit = 0; bit = 0; upath = path->u_name; @@ -1980,7 +1980,7 @@ int setdirparams(struct vol *vol, struct path *path, u_int16_t d_bitmap, char *b case DIRPBIT_FINFO : if (isad) { /* Fixes #2802236 */ - u_int16_t *fflags = (u_int16_t *)(finder_buf + FINDERINFO_FRFLAGOFF); + uint16_t *fflags = (uint16_t *)(finder_buf + FINDERINFO_FRFLAGOFF); *fflags &= htons(~FINDERINFO_ISHARED); /* #2802236 end */ if ( dir->d_did == DIRDID_ROOT ) { @@ -2125,8 +2125,8 @@ int afp_syncdir(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, int dfd; struct vol *vol; struct dir *dir; - u_int32_t did; - u_int16_t vid; + uint32_t did; + uint16_t vid; *rbuflen = 0; ibuf += 2; @@ -2214,8 +2214,8 @@ int afp_createdir(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_ struct dir *dir; char *upath; struct path *s_path; - u_int32_t did; - u_int16_t vid; + uint32_t did; + uint16_t vid; int err; *rbuflen = 0; @@ -2282,8 +2282,8 @@ int afp_createdir(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_ ad_close_metadata( &ad); createdir_done: - memcpy( rbuf, &dir->d_did, sizeof( u_int32_t )); - *rbuflen = sizeof( u_int32_t ); + memcpy( rbuf, &dir->d_did, sizeof( uint32_t )); + *rbuflen = sizeof( uint32_t ); setvoltime(obj, vol ); return( AFP_OK ); } @@ -2353,7 +2353,7 @@ int deletecurdir(struct vol *vol) struct dir *fdir, *pdir; DIR *dp; struct adouble ad; - u_int16_t ashort; + uint16_t ashort; int err; if ((pdir = dirlookup(vol, curdir->d_pdid)) == NULL) { @@ -2434,7 +2434,7 @@ int afp_mapid(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *r struct passwd *pw; struct group *gr; char *name; - u_int32_t id; + uint32_t id; int len, sfunc; int utf8 = 0; @@ -2528,7 +2528,7 @@ int afp_mapid(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *r len = strlen( name ); if (utf8) { - u_int16_t tp = htons(len); + uint16_t tp = htons(len); memcpy(rbuf, &tp, sizeof(tp)); rbuf += sizeof(tp); *rbuflen += 2; @@ -2551,8 +2551,8 @@ int afp_mapname(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, siz struct passwd *pw; struct group *gr; int len, sfunc; - u_int32_t id; - u_int16_t ulen; + uint32_t id; + uint16_t ulen; ibuf++; sfunc = (unsigned char) *ibuf++; @@ -2639,8 +2639,8 @@ int afp_closedir(AFPObj *obj _U_, char *ibuf _U_, size_t ibuflen _U_, char *rbuf #if 0 struct vol *vol; struct dir *dir; - u_int16_t vid; - u_int32_t did; + uint16_t vid; + uint32_t did; #endif /* 0 */ *rbuflen = 0; @@ -2675,8 +2675,8 @@ int afp_opendir(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, si struct vol *vol; struct dir *parentdir; struct path *path; - u_int32_t did; - u_int16_t vid; + uint32_t did; + uint16_t vid; *rbuflen = 0; ibuf += 2; diff --git a/etc/afpd/directory.h b/etc/afpd/directory.h index 82daa86c..533d30f9 100644 --- a/etc/afpd/directory.h +++ b/etc/afpd/directory.h @@ -112,14 +112,14 @@ extern struct path *cname (struct vol *, struct dir *, char **); extern int deletecurdir (struct vol *); extern mode_t mtoumode (struct maccess *); extern void utommode (struct stat *, struct maccess *); -extern int getdirparams (const struct vol *, u_int16_t, struct path *, +extern int getdirparams (const struct vol *, uint16_t, struct path *, struct dir *, char *, size_t *); -extern int setdirparams(struct vol *, struct path *, u_int16_t, char *); +extern int setdirparams(struct vol *, struct path *, uint16_t, char *); extern int renamedir(const struct vol *, int, char *, char *, struct dir *, struct dir *, char *); extern int path_error(struct path *, int error); -extern void setdiroffcnt(struct dir *dir, struct stat *st, u_int32_t count); +extern void setdiroffcnt(struct dir *dir, struct stat *st, uint32_t count); extern int dirreenumerate(struct dir *dir, struct stat *st); extern int for_each_dirent(const struct vol *, char *, dir_loop , void *); extern int check_access(char *name , int mode); diff --git a/etc/afpd/enumerate.c b/etc/afpd/enumerate.c index fe5a66d9..4867640d 100644 --- a/etc/afpd/enumerate.c +++ b/etc/afpd/enumerate.c @@ -40,7 +40,7 @@ */ struct savedir { u_short sd_vid; - u_int32_t sd_did; + uint32_t sd_did; int sd_buflen; char *sd_buf; char *sd_last; @@ -169,9 +169,9 @@ static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, int did, ret, len, first = 1; size_t esz; char *data, *start; - u_int16_t vid, fbitmap, dbitmap, reqcnt, actcnt = 0; - u_int16_t temp16; - u_int32_t sindex, maxsz, sz = 0; + uint16_t vid, fbitmap, dbitmap, reqcnt, actcnt = 0; + uint16_t temp16; + uint32_t sindex, maxsz, sz = 0; struct path *o_path; struct path s_path; int header; @@ -272,8 +272,8 @@ static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, LOG(log_debug, logtype_afpd, "enumerate(\"%s/%s\", f/d:%04x/%04x, rc:%u, i:%u, max:%u)", getcwdpath(), o_path->u_name, fbitmap, dbitmap, reqcnt, sindex, maxsz); - data = rbuf + 3 * sizeof( u_int16_t ); - sz = 3 * sizeof( u_int16_t ); /* fbitmap, dbitmap, reqcount */ + data = rbuf + 3 * sizeof( uint16_t ); + sz = 3 * sizeof( uint16_t ); /* fbitmap, dbitmap, reqcount */ /* * Read the directory into a pre-malloced buffer, stored diff --git a/etc/afpd/file.c b/etc/afpd/file.c index 549f19dd..779b93ca 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -93,7 +93,7 @@ void *get_finderinfo(const struct vol *vol, const char *upath, struct adouble *a memcpy(data, ufinderi, ADEDLEN_FINDERI); chk_ext = 1; if (vol_inv_dots(vol) && *upath == '.') { /* make it invisible */ - u_int16_t ashort; + uint16_t ashort; ashort = htons(FINDERINFO_INVISIBLE); memcpy((char *)data + FINDERINFO_FRFLAGOFF, &ashort, sizeof(ashort)); @@ -101,7 +101,7 @@ void *get_finderinfo(const struct vol *vol, const char *upath, struct adouble *a } if (islink){ - u_int16_t linkflag; + uint16_t linkflag; memcpy(&linkflag, (char *)data + FINDERINFO_FRFLAGOFF, 2); linkflag |= htons(FINDERINFO_ISALIAS); memcpy((char *)data + FINDERINFO_FRFLAGOFF, &linkflag, 2); @@ -120,9 +120,9 @@ void *get_finderinfo(const struct vol *vol, const char *upath, struct adouble *a /* --------------------- */ -char *set_name(const struct vol *vol, char *data, cnid_t pid, char *name, cnid_t id, u_int32_t utf8) +char *set_name(const struct vol *vol, char *data, cnid_t pid, char *name, cnid_t id, uint32_t utf8) { - u_int32_t aint; + uint32_t aint; char *tp = NULL; char *src = name; aint = strlen( name ); @@ -149,7 +149,7 @@ char *set_name(const struct vol *vol, char *data, cnid_t pid, char *name, cnid_t *data++ = aint; } else { - u_int16_t temp; + uint16_t temp; if (aint > UTF8FILELEN_EARLY) /* FIXME safeguard, anyway if no ascii char it's game over*/ aint = UTF8FILELEN_EARLY; @@ -209,8 +209,8 @@ uint32_t get_id(struct vol *vol, const int len) { static int first = 1; /* mark if this func is called the first time */ - u_int32_t adcnid; - u_int32_t dbcnid = CNID_INVALID; + uint32_t adcnid; + uint32_t dbcnid = CNID_INVALID; restart: if (vol->v_cdb != NULL) { @@ -287,18 +287,18 @@ exit: /* -------------------------- */ int getmetadata(struct vol *vol, - u_int16_t bitmap, + uint16_t bitmap, struct path *path, struct dir *dir, char *buf, size_t *buflen, struct adouble *adp) { char *data, *l_nameoff = NULL, *upath; char *utf_nameoff = NULL; int bit = 0; - u_int32_t aint; + uint32_t aint; cnid_t id = 0; - u_int16_t ashort; + uint16_t ashort; u_char achar, fdType[4]; - u_int32_t utf8 = 0; + uint32_t utf8 = 0; struct stat *st; struct maccess ma; @@ -394,8 +394,8 @@ int getmetadata(struct vol *vol, break; case FILPBIT_PDID : - memcpy(data, &dir->d_did, sizeof( u_int32_t )); - data += sizeof( u_int32_t ); + memcpy(data, &dir->d_did, sizeof( uint32_t )); + data += sizeof( uint32_t ); LOG(log_debug, logtype_afpd, "metadata('%s'): Parent DID: %u", path->u_name, ntohl(dir->d_did)); break; @@ -433,12 +433,12 @@ int getmetadata(struct vol *vol, case FILPBIT_LNAME : l_nameoff = data; - data += sizeof( u_int16_t ); + data += sizeof( uint16_t ); break; case FILPBIT_SNAME : - memset(data, 0, sizeof(u_int16_t)); - data += sizeof( u_int16_t ); + memset(data, 0, sizeof(uint16_t)); + data += sizeof( uint16_t ); break; case FILPBIT_FNUM : @@ -480,7 +480,7 @@ int getmetadata(struct vol *vol, if (afp_version >= 30) { /* UTF8 name */ utf8 = kTextEncodingUTF8; utf_nameoff = data; - data += sizeof( u_int16_t ); + data += sizeof( uint16_t ); aint = 0; memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); @@ -602,7 +602,7 @@ int getmetadata(struct vol *vol, /* ----------------------- */ int getfilparams(struct vol *vol, - u_int16_t bitmap, + uint16_t bitmap, struct path *path, struct dir *dir, char *buf, size_t *buflen ) { @@ -653,7 +653,7 @@ int afp_createfile(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, struct ofork *of = NULL; char *path, *upath; int creatf, did, openf, retvalue = AFP_OK; - u_int16_t vid; + uint16_t vid; struct path *s_path; *rbuflen = 0; @@ -762,7 +762,7 @@ int afp_setfilparams(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_ struct dir *dir; struct path *s_path; int did, rc; - u_int16_t vid, bitmap; + uint16_t vid, bitmap; *rbuflen = 0; ibuf += 2; @@ -816,17 +816,17 @@ int afp_setfilparams(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_ extern struct path Cur_Path; int setfilparams(struct vol *vol, - struct path *path, u_int16_t f_bitmap, char *buf ) + struct path *path, uint16_t f_bitmap, char *buf ) { struct adouble ad, *adp; struct extmap *em; int bit, isad = 1, err = AFP_OK; char *upath; u_char achar, *fdType, xyy[4]; /* uninitialized, OK 310105 */ - u_int16_t ashort, bshort, oshort; - u_int32_t aint; - u_int32_t upriv; - u_int16_t upriv_bit = 0; + uint16_t ashort, bshort, oshort; + uint32_t aint; + uint32_t upriv; + uint16_t upriv_bit = 0; struct utimbuf ut; @@ -836,8 +836,8 @@ int setfilparams(struct vol *vol, struct timeval tv; uid_t f_uid; gid_t f_gid; - u_int16_t bitmap = f_bitmap; - u_int32_t cdate,bdate; + uint16_t bitmap = f_bitmap; + uint32_t cdate,bdate; u_char finder_buf[32]; #ifdef DEBUG @@ -1172,8 +1172,8 @@ int copy_path_name(const struct vol *vol, char *newname, char *ibuf) { char type = *ibuf; size_t plen = 0; -u_int16_t len16; -u_int32_t hint; +uint16_t len16; +uint32_t hint; if ( type != 2 && !(afp_version >= 30 && type == 3) ) { return -1; @@ -1231,9 +1231,9 @@ int afp_copyfile(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, si struct dir *dir; char *newname, *p, *upath; struct path *s_path; - u_int32_t sdid, ddid; + uint32_t sdid, ddid; int err, retvalue = AFP_OK; - u_int16_t svid, dvid; + uint16_t svid, dvid; struct adouble ad, *adp; int denyreadset; @@ -1575,7 +1575,7 @@ done: static int check_attrib(struct adouble *adp) { -u_int16_t bshort = 0; +uint16_t bshort = 0; ad_getattr(adp, &bshort); /* @@ -1817,7 +1817,7 @@ int afp_resolveid(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, s int err, retry=0; size_t buflen; cnid_t id, cnid; - u_int16_t vid, bitmap; + uint16_t vid, bitmap; static char buffer[12 + MAXPATHLEN + 1]; int len = 12 + MAXPATHLEN + 1; @@ -2063,8 +2063,8 @@ int afp_exchangefiles(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U int crossdev; int slen, dlen; - u_int32_t sid, did; - u_int16_t vid; + uint32_t sid, did; + uint16_t vid; uid_t uid; gid_t gid; diff --git a/etc/afpd/file.h b/etc/afpd/file.h index 654ce830..76485a3f 100644 --- a/etc/afpd/file.h +++ b/etc/afpd/file.h @@ -103,20 +103,20 @@ typedef enum { kTextEncodingMacKeyboardGlyphs = 41, } kTextEncoding_t; -extern char *set_name (const struct vol *, char *, cnid_t, char *, cnid_t, u_int32_t ); +extern char *set_name (const struct vol *, char *, cnid_t, char *, cnid_t, uint32_t ); extern struct extmap *getextmap (const char *); extern struct extmap *getdefextmap (void); -extern int getfilparams (struct vol *, u_int16_t, struct path *, - struct dir *, char *buf, size_t *); +extern int getfilparams (struct vol *, uint16_t, struct path *, + struct dir *, char *buf, size_t *); -extern int setfilparams (struct vol *, struct path *, u_int16_t, char *); +extern int setfilparams (struct vol *, struct path *, uint16_t, char *); extern int renamefile (const struct vol *, int, char *, char *, char *, struct adouble *); extern int copyfile (const struct vol *, const struct vol *, int, char *, char *, char *, struct adouble *); extern int deletefile (const struct vol *, int, char *, int); -extern int getmetadata (struct vol *vol, u_int16_t bitmap, struct path *path, +extern int getmetadata (struct vol *vol, uint16_t bitmap, struct path *path, struct dir *dir, char *buf, size_t *buflen, struct adouble *adp); extern void *get_finderinfo (const struct vol *, const char *, struct adouble *, void *, int); diff --git a/etc/afpd/filedir.c b/etc/afpd/filedir.c index c6fecadc..61386d66 100644 --- a/etc/afpd/filedir.c +++ b/etc/afpd/filedir.c @@ -40,10 +40,10 @@ int afp_getfildirparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *r struct stat *st; struct vol *vol; struct dir *dir; - u_int32_t did; + uint32_t did; int ret; size_t buflen; - u_int16_t fbitmap, dbitmap, vid; + uint16_t fbitmap, dbitmap, vid; struct path *s_path; *rbuflen = 0; @@ -104,21 +104,21 @@ int afp_getfildirparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *r return AFPERR_NOOBJ; ret = getdirparams(vol, dbitmap, s_path, dir, - rbuf + 3 * sizeof( u_int16_t ), &buflen ); + rbuf + 3 * sizeof( uint16_t ), &buflen ); if (ret != AFP_OK ) return( ret ); } /* this is a directory */ - *(rbuf + 2 * sizeof( u_int16_t )) = (char) FILDIRBIT_ISDIR; + *(rbuf + 2 * sizeof( uint16_t )) = (char) FILDIRBIT_ISDIR; } else { if (fbitmap && AFP_OK != (ret = getfilparams(vol, fbitmap, s_path, curdir, - rbuf + 3 * sizeof( u_int16_t ), &buflen )) ) { + rbuf + 3 * sizeof( uint16_t ), &buflen )) ) { return( ret ); } /* this is a file */ - *(rbuf + 2 * sizeof( u_int16_t )) = FILDIRBIT_ISFILE; + *(rbuf + 2 * sizeof( uint16_t )) = FILDIRBIT_ISFILE; } - *rbuflen = buflen + 3 * sizeof( u_int16_t ); + *rbuflen = buflen + 3 * sizeof( uint16_t ); fbitmap = htons( fbitmap ); memcpy( rbuf, &fbitmap, sizeof( fbitmap )); rbuf += sizeof( fbitmap ); @@ -136,7 +136,7 @@ int afp_setfildirparams(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf struct vol *vol; struct dir *dir; struct path *path; - u_int16_t vid, bitmap; + uint16_t vid, bitmap; int did, rc; *rbuflen = 0; @@ -301,7 +301,7 @@ static int moveandrename(const struct vol *vol, } } if (!ad_metadata(oldunixname, adflags, adp)) { - u_int16_t bshort; + uint16_t bshort; ad_getattr(adp, &bshort); @@ -402,9 +402,9 @@ int afp_rename(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size struct dir *sdir; char *oldname, *newname; struct path *path; - u_int32_t did; + uint32_t did; int plen; - u_int16_t vid; + uint16_t vid; int isdir = 0; int rc; @@ -478,7 +478,7 @@ int afp_delete(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size struct path *s_path; char *upath; int did, rc; - u_int16_t vid; + uint16_t vid; *rbuflen = 0; ibuf += 2; @@ -592,7 +592,7 @@ int afp_moveandrename(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U int did; int pdid; int plen; - u_int16_t vid; + uint16_t vid; int rc; int sdir_fd = -1; diff --git a/etc/afpd/fork.c b/etc/afpd/fork.c index e075945c..f2c42b4f 100644 --- a/etc/afpd/fork.c +++ b/etc/afpd/fork.c @@ -35,7 +35,7 @@ struct ofork *writtenfork; #endif -static int getforkparams(struct ofork *ofork, u_int16_t bitmap, char *buf, size_t *buflen) +static int getforkparams(struct ofork *ofork, uint16_t bitmap, char *buf, size_t *buflen) { struct path path; struct stat *st; @@ -89,7 +89,7 @@ static int getforkparams(struct ofork *ofork, u_int16_t bitmap, char *buf, size_ static off_t get_off_t(char **ibuf, int is64) { - u_int32_t temp; + uint32_t temp; off_t ret; ret = 0; @@ -110,7 +110,7 @@ static off_t get_off_t(char **ibuf, int is64) static int set_off_t(off_t offset, char *rbuf, int is64) { - u_int32_t temp; + uint32_t temp; int ret; ret = 0; @@ -427,10 +427,10 @@ int afp_openfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, si goto openfork_err; } - *rbuflen = buflen + 2 * sizeof( u_int16_t ); + *rbuflen = buflen + 2 * sizeof( uint16_t ); bitmap = htons( bitmap ); - memcpy(rbuf, &bitmap, sizeof( u_int16_t )); - rbuf += sizeof( u_int16_t ); + memcpy(rbuf, &bitmap, sizeof( uint16_t )); + rbuf += sizeof( uint16_t ); /* check WriteInhibit bit if we have a ressource fork * the test is done here, after some Mac trafic capture @@ -494,7 +494,7 @@ int afp_setforkparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen, char *rbuf _U { struct ofork *ofork; off_t size; - u_int16_t ofrefnum, bitmap; + uint16_t ofrefnum, bitmap; int err; int is64; int eid; @@ -632,8 +632,8 @@ static int byte_lock(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf struct ofork *ofork; off_t offset, length; int eid; - u_int16_t ofrefnum; - u_int8_t flags; + uint16_t ofrefnum; + uint8_t flags; int lockop; *rbuflen = 0; @@ -813,7 +813,7 @@ static int read_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, si off_t offset, saveoff, reqcount, savereqcount; ssize_t cc, err; int eid, xlate = 0; - u_int16_t ofrefnum; + uint16_t ofrefnum; u_char nlmask, nlchar; ibuf += 2; @@ -977,7 +977,7 @@ int afp_read_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rb int afp_flush(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; - u_int16_t vid; + uint16_t vid; *rbuflen = 0; ibuf += 2; @@ -994,7 +994,7 @@ int afp_flush(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, s int afp_flushfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct ofork *ofork; - u_int16_t ofrefnum; + uint16_t ofrefnum; *rbuflen = 0; ibuf += 2; @@ -1026,7 +1026,7 @@ int afp_flushfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U int afp_syncfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct ofork *ofork; - u_int16_t ofrefnum; + uint16_t ofrefnum; *rbuflen = 0; ibuf += 2; @@ -1097,7 +1097,7 @@ int flushfork(struct ofork *ofork) int afp_closefork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct ofork *ofork; - u_int16_t ofrefnum; + uint16_t ofrefnum; *rbuflen = 0; ibuf += 2; @@ -1169,7 +1169,7 @@ static int write_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, s struct ofork *ofork; off_t offset, saveoff, reqcount; int endflag, eid, xlate = 0, err = AFP_OK; - u_int16_t ofrefnum; + uint16_t ofrefnum; ssize_t cc; /* figure out parameters */ @@ -1342,7 +1342,7 @@ int afp_getforkparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbu { struct ofork *ofork; int ret; - u_int16_t ofrefnum, bitmap; + uint16_t ofrefnum, bitmap; size_t buflen; ibuf += 2; memcpy(&ofrefnum, ibuf, sizeof( ofrefnum )); diff --git a/etc/afpd/fork.h b/etc/afpd/fork.h index 7aaff0f5..9355c5e5 100644 --- a/etc/afpd/fork.h +++ b/etc/afpd/fork.h @@ -54,11 +54,11 @@ extern struct ofork *writtenfork; #define of_name(a) (a)->of_ad->ad_m_name /* in ofork.c */ extern struct ofork *of_alloc (struct vol *, struct dir *, - char *, u_int16_t *, const int, + char *, uint16_t *, const int, struct adouble *, struct stat *); extern void of_dealloc (struct ofork *); -extern struct ofork *of_find (const u_int16_t); +extern struct ofork *of_find (const uint16_t); extern struct ofork *of_findname (struct path *); extern int of_rename (const struct vol *, struct ofork *, diff --git a/etc/afpd/mangle.c b/etc/afpd/mangle.c index cb2b60ed..e4cbd311 100644 --- a/etc/afpd/mangle.c +++ b/etc/afpd/mangle.c @@ -30,7 +30,7 @@ static size_t mangle_extension(const struct vol *vol, const char* uname, char *p = strrchr(uname, '.'); if (p && p != uname) { - u_int16_t flags = CONV_FORCE | CONV_UNESCAPEHEX; + uint16_t flags = CONV_FORCE | CONV_UNESCAPEHEX; size_t len = convert_charset(vol->v_volcharset, charset, vol->v_maccharset, p, strlen(p), extension, MAX_EXT_LENGTH, &flags); @@ -42,7 +42,7 @@ static size_t mangle_extension(const struct vol *vol, const char* uname, static char *demangle_checks(const struct vol *vol, char* uname, char * mfilename, size_t prefix, char * ext) { - u_int16_t flags; + uint16_t flags; static char buffer[MAXPATHLEN +2]; /* for convert_charset dest_len parameter +2 */ size_t len; size_t mfilenamelen; @@ -136,7 +136,7 @@ private_demangle(const struct vol *vol, char *mfilename, cnid_t did, cnid_t *osx { char *t; char *u_name; - u_int32_t id, file_id; + uint32_t id, file_id; static char buffer[12 + MAXPATHLEN + 1]; int len = 12 + MAXPATHLEN + 1; struct dir *dir; @@ -266,7 +266,7 @@ mangle(const struct vol *vol, char *filename, size_t filenamelen, char *uname, c k = sprintf(mangle_suffix, "%c%X", MANGLE_CHAR, ntohl(id)); if (filenamelen + k + ext_len > maxlen) { - u_int16_t opt = CONV_FORCE | CONV_UNESCAPEHEX; + uint16_t opt = CONV_FORCE | CONV_UNESCAPEHEX; size_t n = convert_charset(vol->v_volcharset, (flags & 2) ? CH_UTF8_MAC : vol->v_maccharset, vol->v_maccharset, uname, strlen(uname), diff --git a/etc/afpd/messages.c b/etc/afpd/messages.c index e48585e3..ba72e382 100644 --- a/etc/afpd/messages.c +++ b/etc/afpd/messages.c @@ -42,7 +42,7 @@ void readmessage(AFPObj *obj) int rc; static int c; uid_t euid; - u_int32_t maxmsgsize; + uint32_t maxmsgsize; maxmsgsize = (obj->proto == AFPPROTO_DSI)?MIN(MAX(((DSI*)obj->handle)->attn_quantum, MAXMESGSIZE),MAXPATHLEN):MAXMESGSIZE; @@ -113,8 +113,8 @@ void readmessage(AFPObj *obj) int afp_getsrvrmesg(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { char *message; - u_int16_t type, bitmap; - u_int16_t msgsize; + uint16_t type, bitmap; + uint16_t msgsize; size_t outlen = 0; size_t msglen = 0; int utf8 = 0; diff --git a/etc/afpd/nfsquota.c b/etc/afpd/nfsquota.c index 60622733..90b84c21 100644 --- a/etc/afpd/nfsquota.c +++ b/etc/afpd/nfsquota.c @@ -91,7 +91,7 @@ callaurpc(struct vol *vol, #define GQR_RQUOTA getquota_rslt_u.gqr_rquota #endif /* USE_OLD_RQUOTA */ -int getnfsquota(struct vol *vol, const int uid, const u_int32_t bsize, +int getnfsquota(struct vol *vol, const int uid, const uint32_t bsize, struct dqblk *dqp) { diff --git a/etc/afpd/ofork.c b/etc/afpd/ofork.c index 4e0eb886..02e250a4 100644 --- a/etc/afpd/ofork.c +++ b/etc/afpd/ofork.c @@ -115,13 +115,13 @@ struct ofork * of_alloc(struct vol *vol, struct dir *dir, char *path, - u_int16_t *ofrefnum, + uint16_t *ofrefnum, const int eid, struct adouble *ad, struct stat *st) { struct ofork *of; - u_int16_t refnum, of_refnum; + uint16_t refnum, of_refnum; int i; @@ -220,7 +220,7 @@ of_alloc(struct vol *vol, return( of ); } -struct ofork *of_find(const u_int16_t ofrefnum ) +struct ofork *of_find(const uint16_t ofrefnum ) { if (!oforks || !nforks) return NULL; diff --git a/etc/afpd/quota.c b/etc/afpd/quota.c index 1a04ada0..66c49489 100644 --- a/etc/afpd/quota.c +++ b/etc/afpd/quota.c @@ -185,13 +185,13 @@ static int get_linux_xfs_quota(int what, char *path, uid_t euser_id, struct dqbl if ((ret = quotactl(QCMD(Q_XGETQUOTA,(what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t)&D))) return ret; - dqb->bsize = (u_int64_t)512; - dqb->dqb_bsoftlimit = (u_int64_t)D.d_blk_softlimit; - dqb->dqb_bhardlimit = (u_int64_t)D.d_blk_hardlimit; - dqb->dqb_ihardlimit = (u_int64_t)D.d_ino_hardlimit; - dqb->dqb_isoftlimit = (u_int64_t)D.d_ino_softlimit; - dqb->dqb_curinodes = (u_int64_t)D.d_icount; - dqb->dqb_curblocks = (u_int64_t)D.d_bcount; + dqb->bsize = (uint64_t)512; + dqb->dqb_bsoftlimit = (uint64_t)D.d_blk_softlimit; + dqb->dqb_bhardlimit = (uint64_t)D.d_blk_hardlimit; + dqb->dqb_ihardlimit = (uint64_t)D.d_ino_hardlimit; + dqb->dqb_isoftlimit = (uint64_t)D.d_ino_softlimit; + dqb->dqb_curinodes = (uint64_t)D.d_icount; + dqb->dqb_curblocks = (uint64_t)D.d_bcount; #endif return ret; } @@ -500,12 +500,12 @@ static int getfsquota(struct vol *vol, const int uid, struct dqblk *dq) if( /* if overquota, free space is 0 otherwise hard-current */ ( overquota( dq ) ? 0 : ( dq->dqb_bhardlimit ? dq->dqb_bhardlimit - - dq->dqb_curblocks : ~((u_int64_t) 0) ) ) + dq->dqb_curblocks : ~((uint64_t) 0) ) ) > ( overquota( &dqg ) ? 0 : ( dqg.dqb_bhardlimit ? dqg.dqb_bhardlimit - - dqg.dqb_curblocks : ~((u_int64_t) 0) ) ) + dqg.dqb_curblocks : ~((uint64_t) 0) ) ) ) /* if */ { @@ -525,7 +525,7 @@ static int getfsquota(struct vol *vol, const int uid, struct dqblk *dq) } -static int getquota( struct vol *vol, struct dqblk *dq, const u_int32_t bsize) +static int getquota( struct vol *vol, struct dqblk *dq, const uint32_t bsize) { char *p; @@ -663,9 +663,9 @@ static int overquota( struct dqblk *dqblk) #define tobytes(a, b) dbtob((VolSpace) (a)) #endif -int uquota_getvolspace( struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize) +int uquota_getvolspace( struct vol *vol, VolSpace *bfree, VolSpace *btotal, const uint32_t bsize) { - u_int64_t this_bsize; + uint64_t this_bsize; struct dqblk dqblk; this_bsize = bsize; diff --git a/etc/afpd/status.c b/etc/afpd/status.c index 0782228a..b24748a1 100644 --- a/etc/afpd/status.c +++ b/etc/afpd/status.c @@ -74,7 +74,7 @@ static int status_server(char *data, const char *server, const struct afp_option char *start = data; char *Obj, *Type, *Zone; char buf[32]; - u_int16_t status; + uint16_t status; size_t len; /* make room for all offsets before server name */ @@ -119,7 +119,7 @@ static int status_server(char *data, const char *server, const struct afp_option static void status_machine(char *data) { char *start = data; - u_int16_t status; + uint16_t status; int len; #ifdef AFS const char *machine = "afs"; @@ -142,11 +142,11 @@ static void status_machine(char *data) } /* server signature is a 16-byte quantity */ -static u_int16_t status_signature(char *data, int *servoffset, +static uint16_t status_signature(char *data, int *servoffset, const struct afp_options *options) { char *status; - u_int16_t offset, sigoff; + uint16_t offset, sigoff; status = data; @@ -173,7 +173,7 @@ static size_t status_netaddress(char *data, int *servoffset, const struct afp_options *options) { char *begin; - u_int16_t offset; + uint16_t offset; size_t addresses_len = 0; begin = data; @@ -281,7 +281,7 @@ static size_t status_directorynames(char *data, int *diroffset, const struct afp_options *options) { char *begin = data; - u_int16_t offset; + uint16_t offset; memcpy(&offset, data + *diroffset, sizeof(offset)); offset = ntohs(offset); data += offset; @@ -321,9 +321,9 @@ static size_t status_directorynames(char *data, int *diroffset, } /* Calculate and store offset for UTF8ServerName */ - *diroffset += sizeof(u_int16_t); + *diroffset += sizeof(uint16_t); offset = htons(data - begin); - memcpy(begin + *diroffset, &offset, sizeof(u_int16_t)); + memcpy(begin + *diroffset, &offset, sizeof(uint16_t)); /* return length of buffer */ return (data - begin); @@ -334,10 +334,10 @@ static size_t status_utf8servername(char *data, int *nameoffset, const struct afp_options *options) { char *Obj, *Type, *Zone; - u_int16_t namelen; + uint16_t namelen; size_t len; char *begin = data; - u_int16_t offset, status; + uint16_t offset, status; memcpy(&offset, data + *nameoffset, sizeof(offset)); offset = ntohs(offset); @@ -367,7 +367,7 @@ static size_t status_utf8servername(char *data, int *nameoffset, data += sizeof(namelen); data += len; offset = htons(offset); - memcpy(begin + *nameoffset, &offset, sizeof(u_int16_t)); + memcpy(begin + *nameoffset, &offset, sizeof(uint16_t)); } /* return length of buffer */ @@ -381,7 +381,7 @@ static void status_icon(char *data, const unsigned char *icondata, { char *start = data; char *sigdata = data + sigoffset; - u_int16_t ret, status; + uint16_t ret, status; memcpy(&status, start + AFPSTATUS_ICONOFF, sizeof(status)); if ( icondata == NULL ) { diff --git a/etc/afpd/uam.c b/etc/afpd/uam.c index 0f5afb41..2abf3698 100644 --- a/etc/afpd/uam.c +++ b/etc/afpd/uam.c @@ -296,7 +296,7 @@ int uam_checkuser(const struct passwd *pwd) int uam_random_string (AFPObj *obj, char *buf, int len) { - u_int32_t result; + uint32_t result; int ret; int fd; diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index 232fb303..e1358cc6 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -33,7 +33,7 @@ /* * Get the free space on a partition. */ -int ustatfs_getvolspace(const struct vol *vol, VolSpace *bfree, VolSpace *btotal, u_int32_t *bsize) +int ustatfs_getvolspace(const struct vol *vol, VolSpace *bfree, VolSpace *btotal, uint32_t *bsize) { VolSpace maxVolSpace = (~(VolSpace)0); diff --git a/etc/afpd/unix.h b/etc/afpd/unix.h index d2987706..a3d234ba 100644 --- a/etc/afpd/unix.h +++ b/etc/afpd/unix.h @@ -202,11 +202,11 @@ extern long quotactl (unsigned int, const char *, int, caddr_t); #endif /* linux */ -extern int getnfsquota (struct vol *, const int, const u_int32_t, - struct dqblk *); +extern int getnfsquota (struct vol *, const int, const uint32_t, + struct dqblk *); extern int uquota_getvolspace (struct vol *, VolSpace *, VolSpace *, - const u_int32_t); + const uint32_t); #endif /* NO_QUOTA_SUPPORT */ extern struct afp_options default_options; diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index 1b442093..9e09334d 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -64,7 +64,7 @@ extern int afprun(int root, char *cmd, int *outfd); struct vol *current_vol; /* last volume from getvolbyvid() */ static struct vol *Volumes = NULL; -static u_int16_t lastvid = 0; +static uint16_t lastvid = 0; static char *Trash = "\02\024Network Trash Folder"; static struct extmap *Extmap = NULL, *Defextmap = NULL; @@ -535,7 +535,7 @@ static int creatvol(AFPObj *obj, struct passwd *pwd, char tmpname[AFPVOL_U8MNAMELEN+1]; ucs2_t u8mtmpname[(AFPVOL_U8MNAMELEN+1)*2], mactmpname[(AFPVOL_MACNAMELEN+1)*2]; char suffix[6]; /* max is #FFFF */ - u_int16_t flags; + uint16_t flags; LOG(log_debug, logtype_afpd, "createvol: Volume '%s'", name); @@ -1404,11 +1404,11 @@ static int getused(struct vol *vol) } static int getvolspace(struct vol *vol, - u_int32_t *bfree, u_int32_t *btotal, - VolSpace *xbfree, VolSpace *xbtotal, u_int32_t *bsize) + uint32_t *bfree, uint32_t *btotal, + VolSpace *xbfree, VolSpace *xbtotal, uint32_t *bsize) { int spaceflag, rc; - u_int32_t maxsize; + uint32_t maxsize; VolSpace used; #ifndef NO_QUOTA_SUPPORT VolSpace qfree, qtotal; @@ -1483,7 +1483,7 @@ void vol_fce_tm_event(void) * set volume creation date * avoid duplicate, well at least it tries */ -static void vol_setdate(u_int16_t id, struct adouble *adp, time_t date) +static void vol_setdate(uint16_t id, struct adouble *adp, time_t date) { struct vol *volume; struct vol *vol = Volumes; @@ -1502,13 +1502,13 @@ static void vol_setdate(u_int16_t id, struct adouble *adp, time_t date) } /* ----------------------- */ -static int getvolparams( u_int16_t bitmap, struct vol *vol, struct stat *st, char *buf, size_t *buflen) +static int getvolparams( uint16_t bitmap, struct vol *vol, struct stat *st, char *buf, size_t *buflen) { struct adouble ad; int bit = 0, isad = 1; - u_int32_t aint; + uint32_t aint; u_short ashort; - u_int32_t bfree, btotal, bsize; + uint32_t bfree, btotal, bsize; VolSpace xbfree, xbtotal; /* extended bytes */ char *data, *nameoff = NULL; char *slash; @@ -1665,7 +1665,7 @@ static int getvolparams( u_int16_t bitmap, struct vol *vol, struct stat *st, cha case VOLPBIT_NAME : nameoff = data; - data += sizeof( u_int16_t ); + data += sizeof( uint16_t ); break; case VOLPBIT_BSIZE: /* block size */ @@ -1704,7 +1704,7 @@ static int getvolparams( u_int16_t bitmap, struct vol *vol, struct stat *st, cha } /* ------------------------- */ -static int stat_vol(u_int16_t bitmap, struct vol *vol, char *rbuf, size_t *rbuflen) +static int stat_vol(uint16_t bitmap, struct vol *vol, char *rbuf, size_t *rbuflen) { struct stat st; int ret; @@ -1874,8 +1874,8 @@ int afp_getsrvrparms(AFPObj *obj, char *ibuf _U_, size_t ibuflen _U_, char *rbuf return AFPERR_PARAM; } tv.tv_sec = AD_DATE_FROM_UNIX(tv.tv_sec); - memcpy(data, &tv.tv_sec, sizeof( u_int32_t)); - data += sizeof( u_int32_t); + memcpy(data, &tv.tv_sec, sizeof( uint32_t)); + data += sizeof( uint32_t); *data = vcnt; return( AFP_OK ); } @@ -2045,7 +2045,7 @@ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t struct dir *dir; int len, ret; size_t namelen; - u_int16_t bitmap; + uint16_t bitmap; char path[ MAXPATHLEN + 1]; char *vol_uname; char *vol_mname; @@ -2325,7 +2325,7 @@ static void deletevol(struct vol *vol) int afp_closevol(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; - u_int16_t vid; + uint16_t vid; *rbuflen = 0; ibuf += 2; @@ -2341,7 +2341,7 @@ int afp_closevol(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_ } /* ------------------------- */ -struct vol *getvolbyvid(const u_int16_t vid ) +struct vol *getvolbyvid(const uint16_t vid ) { struct vol *vol; @@ -2461,7 +2461,7 @@ void setvoltime(AFPObj *obj, struct vol *vol) int afp_getvolparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_,char *rbuf, size_t *rbuflen) { struct vol *vol; - u_int16_t vid, bitmap; + uint16_t vid, bitmap; ibuf += 2; memcpy(&vid, ibuf, sizeof( vid )); @@ -2482,8 +2482,8 @@ int afp_setvolparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf { struct adouble ad; struct vol *vol; - u_int16_t vid, bitmap; - u_int32_t aint; + uint16_t vid, bitmap; + uint32_t aint; ibuf += 2; *rbuflen = 0; @@ -2556,7 +2556,7 @@ static int create_special_folder (const struct vol *vol, const struct _special_f { char *p,*q,*r; struct adouble ad; - u_int16_t attr; + uint16_t attr; struct stat st; int ret; diff --git a/etc/afpd/volume.h b/etc/afpd/volume.h index f06dcd7b..0a9f0f01 100644 --- a/etc/afpd/volume.h +++ b/etc/afpd/volume.h @@ -14,10 +14,10 @@ #include #include -extern struct vol *getvolbyvid (const u_int16_t); +extern struct vol *getvolbyvid (const uint16_t); extern int ustatfs_getvolspace (const struct vol *, VolSpace *, VolSpace *, - u_int32_t *); + uint32_t *); extern void setvoltime (AFPObj *, struct vol *); extern int pollvoltime (AFPObj *); extern void load_volumes (AFPObj *obj); diff --git a/etc/uams/uams_dhx2_pam.c b/etc/uams/uams_dhx2_pam.c index b95e1587..f2976b45 100644 --- a/etc/uams/uams_dhx2_pam.c +++ b/etc/uams/uams_dhx2_pam.c @@ -46,7 +46,7 @@ static gcry_mpi_t p, g, Ra; static gcry_mpi_t serverNonce; static char *K_MD5hash = NULL; static int K_hash_len; -static u_int16_t ID; +static uint16_t ID; /* The initialization vectors for CAST128 are fixed by Apple. */ static unsigned char dhx_c2siv[] = { 'L', 'W', 'a', 'l', 'l', 'a', 'c', 'e' }; @@ -267,7 +267,7 @@ static int dhx2_setup(void *obj, char *ibuf _U_, size_t ibuflen _U_, /* Session ID first */ ID = dhxhash(obj); - *(u_int16_t *)rbuf = htons(ID); + *(uint16_t *)rbuf = htons(ID); rbuf += 2; *rbuflen += 2; @@ -281,7 +281,7 @@ static int dhx2_setup(void *obj, char *ibuf _U_, size_t ibuflen _U_, *rbuflen += 4; /* len = length of p = PRIMEBITS/8 */ - *(u_int16_t *)rbuf = htons((u_int16_t) PRIMEBITS/8); + *(uint16_t *)rbuf = htons((uint16_t) PRIMEBITS/8); rbuf += 2; *rbuflen += 2; @@ -365,7 +365,7 @@ static int pam_login_ext(void *obj, char *uname, struct passwd **uam_pwd, { char *username; size_t len, ulen; - u_int16_t temp16; + uint16_t temp16; *rbuflen = 0; @@ -488,7 +488,7 @@ static int logincont1(void *obj _U_, char *ibuf, size_t ibuflen, char *rbuf, siz /* ---- Start building reply packet ---- */ /* Session ID + 1 first */ - *(u_int16_t *)rbuf = htons(ID+1); + *(uint16_t *)rbuf = htons(ID+1); rbuf += 2; *rbuflen += 2; @@ -669,11 +669,11 @@ static int pam_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { - u_int16_t retID; + uint16_t retID; int ret; /* check for session id */ - retID = ntohs(*(u_int16_t *)ibuf); + retID = ntohs(*(uint16_t *)ibuf); if (retID == ID) ret = logincont1(obj, ibuf, ibuflen, rbuf, rbuflen); else if (retID == ID+1) diff --git a/etc/uams/uams_dhx2_passwd.c b/etc/uams/uams_dhx2_passwd.c index 52c1d16d..c7ac2434 100644 --- a/etc/uams/uams_dhx2_passwd.c +++ b/etc/uams/uams_dhx2_passwd.c @@ -51,7 +51,7 @@ static gcry_mpi_t p, Ra; static gcry_mpi_t serverNonce; static char *K_MD5hash = NULL; static int K_hash_len; -static u_int16_t ID; +static uint16_t ID; /* The initialization vectors for CAST128 are fixed by Apple. */ static unsigned char dhx_c2siv[] = { 'L', 'W', 'a', 'l', 'l', 'a', 'c', 'e' }; @@ -207,7 +207,7 @@ static int dhx2_setup(void *obj, char *ibuf _U_, size_t ibuflen _U_, /* Session ID first */ ID = dhxhash(obj); - *(u_int16_t *)rbuf = htons(ID); + *(uint16_t *)rbuf = htons(ID); rbuf += 2; *rbuflen += 2; @@ -221,7 +221,7 @@ static int dhx2_setup(void *obj, char *ibuf _U_, size_t ibuflen _U_, *rbuflen += 4; /* len = length of p = PRIMEBITS/8 */ - *(u_int16_t *)rbuf = htons((u_int16_t) PRIMEBITS/8); + *(uint16_t *)rbuf = htons((uint16_t) PRIMEBITS/8); rbuf += 2; *rbuflen += 2; @@ -305,7 +305,7 @@ static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd, { char *username; size_t len, ulen; - u_int16_t temp16; + uint16_t temp16; *rbuflen = 0; @@ -433,7 +433,7 @@ static int logincont1(void *obj _U_, struct passwd **uam_pwd _U_, /* ---- Start building reply packet ---- */ /* Session ID + 1 first */ - *(u_int16_t *)rbuf = htons(ID+1); + *(uint16_t *)rbuf = htons(ID+1); rbuf += 2; *rbuflen += 2; @@ -580,11 +580,11 @@ static int passwd_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { - u_int16_t retID; + uint16_t retID; int ret; /* check for session id */ - retID = ntohs(*(u_int16_t *)ibuf); + retID = ntohs(*(uint16_t *)ibuf); if (retID == ID) ret = logincont1(obj, uam_pwd, ibuf, ibuflen, rbuf, rbuflen); else if (retID == ID+1) diff --git a/etc/uams/uams_dhx_pam.c b/etc/uams/uams_dhx_pam.c index bba519de..7bad2fa0 100644 --- a/etc/uams/uams_dhx_pam.c +++ b/etc/uams/uams_dhx_pam.c @@ -58,14 +58,14 @@ /* the secret key */ static CAST_KEY castkey; static struct passwd *dhxpwd; -static u_int8_t randbuf[KEYSIZE]; +static uint8_t randbuf[KEYSIZE]; /* diffie-hellman bits */ static unsigned char msg2_iv[] = "CJalbert"; static unsigned char msg3_iv[] = "LWallace"; -static const u_int8_t p[] = {0xBA, 0x28, 0x73, 0xDF, 0xB0, 0x60, 0x57, 0xD4, +static const uint8_t p[] = {0xBA, 0x28, 0x73, 0xDF, 0xB0, 0x60, 0x57, 0xD4, 0x3F, 0x20, 0x24, 0x74, 0x4C, 0xEE, 0xE7, 0x5B}; -static const u_int8_t g = 0x07; +static const uint8_t g = 0x07; /* Static variables used to communicate between the conversation function @@ -187,7 +187,7 @@ static struct pam_conv PAM_conversation = { static int dhx_setup(void *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { - u_int16_t sessid; + uint16_t sessid; size_t i; BIGNUM *bn, *gbn, *pbn; DH *dh; @@ -377,7 +377,7 @@ static int pam_login_ext(void *obj, char *uname, struct passwd **uam_pwd, char *username; int len; size_t ulen; - u_int16_t temp16; + uint16_t temp16; *rbuflen = 0; @@ -413,7 +413,7 @@ static int pam_logincont(void *obj, struct passwd **uam_pwd, { const char *hostname; BIGNUM *bn1, *bn2, *bn3; - u_int16_t sessid; + uint16_t sessid; int err, PAM_error; *rbuflen = 0; @@ -573,7 +573,7 @@ static int pam_changepw(void *obj, char *username, char *hostname; pam_handle_t *lpamh; uid_t uid; - u_int16_t sessid; + uint16_t sessid; int PAM_error; if (ibuflen < sizeof(sessid)) { diff --git a/etc/uams/uams_dhx_passwd.c b/etc/uams/uams_dhx_passwd.c index 76dd7ddd..8b772b6c 100644 --- a/etc/uams/uams_dhx_passwd.c +++ b/etc/uams/uams_dhx_passwd.c @@ -59,7 +59,7 @@ /* the secret key */ static CAST_KEY castkey; static struct passwd *dhxpwd; -static u_int8_t randbuf[16]; +static uint8_t randbuf[16]; #ifdef TRU64 #include @@ -74,14 +74,14 @@ static int pwd_login(void *obj, char *username, int ulen, struct passwd **uam_pw char *rbuf, size_t *rbuflen) { unsigned char iv[] = "CJalbert"; - u_int8_t p[] = {0xBA, 0x28, 0x73, 0xDF, 0xB0, 0x60, 0x57, 0xD4, + uint8_t p[] = {0xBA, 0x28, 0x73, 0xDF, 0xB0, 0x60, 0x57, 0xD4, 0x3F, 0x20, 0x24, 0x74, 0x4C, 0xEE, 0xE7, 0x5B }; - u_int8_t g = 0x07; + uint8_t g = 0x07; #ifdef SHADOWPW struct spwd *sp; #endif /* SHADOWPW */ BIGNUM *bn, *gbn, *pbn; - u_int16_t sessid; + uint16_t sessid; size_t i; DH *dh; @@ -250,7 +250,7 @@ static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd, { char *username; size_t len, ulen; - u_int16_t temp16; + uint16_t temp16; *rbuflen = 0; @@ -280,7 +280,7 @@ static int passwd_logincont(void *obj, struct passwd **uam_pwd, #endif /* SHADOWPW */ unsigned char iv[] = "LWallace"; BIGNUM *bn1, *bn2, *bn3; - u_int16_t sessid; + uint16_t sessid; char *p; int err = AFPERR_NOTAUTH; diff --git a/etc/uams/uams_gss.c b/etc/uams/uams_gss.c index 5596497e..da0411f9 100644 --- a/etc/uams/uams_gss.c +++ b/etc/uams/uams_gss.c @@ -410,7 +410,7 @@ static int do_gss_auth(void *obj, char *ibuf, int ticket_len, if (!ret) { /* FIXME: Is copying the authenticator really necessary? Where is this documented? */ - u_int16_t auth_len = htons( authenticator_buff.length ); + uint16_t auth_len = htons( authenticator_buff.length ); /* copy the authenticator length into the reply buffer */ memcpy( rbuf, &auth_len, sizeof(auth_len) ); @@ -443,7 +443,7 @@ static int gss_login(void *obj, struct passwd **uam_pwd, char *rbuf, size_t *rbuflen) { - u_int16_t temp16; + uint16_t temp16; *rbuflen = 0; @@ -461,9 +461,9 @@ static int gss_logincont(void *obj, struct passwd **uam_pwd, char *rbuf, size_t *rbuflen) { struct passwd *pwd = NULL; - u_int16_t login_id; + uint16_t login_id; char *username; - u_int16_t ticket_len; + uint16_t ticket_len; char *p; int rblen; size_t userlen; @@ -472,9 +472,9 @@ static int gss_logincont(void *obj, struct passwd **uam_pwd, /* Apple's AFP 3.1 documentation specifies that this command * takes the following format: * pad (byte) - * id returned in LoginExt response (u_int16_t) + * id returned in LoginExt response (uint16_t) * username (format unspecified) padded, when necessary, to end on an even boundary - * ticket length (u_int16_t) + * ticket length (uint16_t) * ticket */ @@ -482,14 +482,14 @@ static int gss_logincont(void *obj, struct passwd **uam_pwd, * format of this request is as follows: * pad (byte) [consumed before login_ext is called] * ?? (byte) - always observed to be 0 - * id returned in LoginExt response (u_int16_t) + * id returned in LoginExt response (uint16_t) * username, encoding unspecified, null terminated C string, * padded when the terminating null is an even numbered byte. * The packet is formated such that the username begins on an * odd numbered byte. Eg if the username is 3 characters and the * terminating null makes 4, expect to pad the the result. * The encoding of this string is unknown. - * ticket length (u_int16_t) + * ticket length (uint16_t) * ticket */ @@ -579,7 +579,7 @@ static int gss_login_ext(void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { - u_int16_t temp16; + uint16_t temp16; *rbuflen = 0; diff --git a/etc/uams/uams_pam.c b/etc/uams/uams_pam.c index a0e5335a..6f15ac0a 100644 --- a/etc/uams/uams_pam.c +++ b/etc/uams/uams_pam.c @@ -239,7 +239,7 @@ static int pam_login_ext(void *obj, char *uname, struct passwd **uam_pwd, { char *username; size_t len, ulen; - u_int16_t temp16; + uint16_t temp16; *rbuflen = 0; diff --git a/etc/uams/uams_passwd.c b/etc/uams/uams_passwd.c index 19571aa7..72d024d2 100644 --- a/etc/uams/uams_passwd.c +++ b/etc/uams/uams_passwd.c @@ -185,7 +185,7 @@ static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd, { char *username; size_t len, ulen; - u_int16_t temp16; + uint16_t temp16; *rbuflen = 0; diff --git a/etc/uams/uams_pgp.c b/etc/uams/uams_pgp.c index e3892573..22aa8ae4 100644 --- a/etc/uams/uams_pgp.c +++ b/etc/uams/uams_pgp.c @@ -53,7 +53,7 @@ /* the secret key */ static struct passwd *pgppwd; static CAST_KEY castkey; -static u_int8_t randbuf[16]; +static uint8_t randbuf[16]; /* pgp passwd */ static int pgp_login(void *obj, struct passwd **uam_pwd, @@ -109,7 +109,7 @@ static int pgp_logincont(void *obj, struct passwd **uam_pwd, { unsigned char iv[] = "RJscorat"; BIGNUM *bn1, *bn2, *bn3; - u_int16_t sessid; + uint16_t sessid; char *p; *rbuflen = 0; diff --git a/etc/uams/uams_randnum.c b/etc/uams/uams_randnum.c index 866e7354..301fdd0f 100644 --- a/etc/uams/uams_randnum.c +++ b/etc/uams/uams_randnum.c @@ -37,7 +37,7 @@ static C_Block seskey; static Key_schedule seskeysched; static struct passwd *randpwd; -static u_int8_t randbuf[8]; +static uint8_t randbuf[8]; /* hash to a 16-bit number. this will generate completely harmless * warnings on 64-bit machines. */ @@ -123,7 +123,7 @@ static int afppasswd(const struct passwd *pwd, unsigned char *passwd, int len, const int set) { - u_int8_t key[DES_KEY_SZ*2]; + uint8_t key[DES_KEY_SZ*2]; char buf[MAXPATHLEN + 1], *p; Key_schedule schedule; FILE *fp; @@ -284,7 +284,7 @@ static int rand_login(void *obj, char *username, int ulen, struct passwd **uam_p { char *passwdfile; - u_int16_t sessid; + uint16_t sessid; size_t len; int err; @@ -329,7 +329,7 @@ static int randnum_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { - u_int16_t sessid; + uint16_t sessid; *rbuflen = 0; @@ -368,7 +368,7 @@ static int rand2num_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { - u_int16_t sessid; + uint16_t sessid; unsigned int i; *rbuflen = 0; @@ -511,7 +511,7 @@ static int randnum_login_ext(void *obj, char *uname, struct passwd **uam_pwd, { char *username; size_t len, ulen; - u_int16_t temp16; + uint16_t temp16; *rbuflen = 0; diff --git a/include/atalk/adouble.h b/include/atalk/adouble.h index 8e0b11e1..5de2b4eb 100644 --- a/include/atalk/adouble.h +++ b/include/atalk/adouble.h @@ -143,7 +143,7 @@ #define RFORK_EA_ALLOCSIZE (128*1024) /* 128k */ -typedef u_int32_t cnid_t; +typedef uint32_t cnid_t; struct ad_entry { uint32_t ade_off; @@ -185,8 +185,8 @@ struct adouble_fops { }; struct adouble { - u_int32_t ad_magic; /* Official adouble magic */ - u_int32_t ad_version; /* Official adouble version number */ + uint32_t ad_magic; /* Official adouble magic */ + uint32_t ad_version; /* Official adouble version number */ char ad_filler[16]; struct ad_entry ad_eid[ADEID_MAX]; struct ad_fd ad_data_fork; /* the data fork */ @@ -441,8 +441,8 @@ extern int ad_setattr(const struct adouble *, uint16_t); extern int ad_getattr(const struct adouble *, uint16_t *); extern int ad_setname(struct adouble *, const char *); extern int ad_setid(struct adouble *, dev_t dev, ino_t ino, uint32_t, uint32_t, const void *); -extern u_int32_t ad_getid(struct adouble *, dev_t, ino_t, cnid_t, const void *); -extern u_int32_t ad_forcegetid(struct adouble *adp); +extern uint32_t ad_getid(struct adouble *, dev_t, ino_t, cnid_t, const void *); +extern uint32_t ad_forcegetid(struct adouble *adp); #ifdef WITH_SENDFILE extern int ad_readfile_init(const struct adouble *ad, int eid, off_t *off, int end); diff --git a/include/atalk/afp.h b/include/atalk/afp.h index ec923816..1681c23a 100644 --- a/include/atalk/afp.h +++ b/include/atalk/afp.h @@ -26,7 +26,7 @@ #include -typedef u_int16_t AFPUserBytes; +typedef uint16_t AFPUserBytes; /* protocols */ #define AFPPROTO_ASP 1 diff --git a/include/atalk/cnid.h b/include/atalk/cnid.h index 2c673fbc..2d3aa062 100644 --- a/include/atalk/cnid.h +++ b/include/atalk/cnid.h @@ -49,7 +49,7 @@ * This is instance of CNID database object. */ struct _cnid_db { - u_int32_t flags; /* Flags describing some CNID backend aspects. */ + uint32_t flags; /* Flags describing some CNID backend aspects. */ char *volpath; /* Volume path this particular CNID db refers to. */ void *_private; /* back-end speficic data */ @@ -91,7 +91,7 @@ struct _cnid_module { char *name; struct list_head db_list; /* CNID modules are also stored on a bidirectional list. */ struct _cnid_db *(*cnid_open)(struct cnid_open_args *args); - u_int32_t flags; /* Flags describing some CNID backend aspects. */ + uint32_t flags; /* Flags describing some CNID backend aspects. */ }; typedef struct _cnid_module cnid_module; diff --git a/include/atalk/cnid_dbd_private.h b/include/atalk/cnid_dbd_private.h index e1464125..d7484e42 100644 --- a/include/atalk/cnid_dbd_private.h +++ b/include/atalk/cnid_dbd_private.h @@ -56,7 +56,7 @@ struct cnid_dbd_rply { }; typedef struct CNID_private { - u_int32_t magic; + uint32_t magic; char db_dir[MAXPATHLEN + 1]; /* Database directory without /.AppleDB appended */ char *cnidserver; char *cnidport; diff --git a/include/atalk/dsi.h b/include/atalk/dsi.h index baaa960c..dbe3eb5b 100644 --- a/include/atalk/dsi.h +++ b/include/atalk/dsi.h @@ -42,12 +42,12 @@ typedef enum { #define DSI_BLOCKSIZ 16 struct dsi_block { - u_int8_t dsi_flags; /* packet type: request or reply */ - u_int8_t dsi_command; /* command */ - u_int16_t dsi_requestID; /* request ID */ - u_int32_t dsi_code; /* error code or data offset */ - u_int32_t dsi_len; /* total data length */ - u_int32_t dsi_reserved; /* reserved field */ + uint8_t dsi_flags; /* packet type: request or reply */ + uint8_t dsi_command; /* command */ + uint16_t dsi_requestID; /* request ID */ + uint32_t dsi_code; /* error code or data offset */ + uint32_t dsi_len; /* total data length */ + uint32_t dsi_reserved; /* reserved field */ }; #define DSI_CMDSIZ 8192 @@ -67,10 +67,10 @@ typedef struct DSI { int msg_request; /* pending message to the client */ int down_request; /* pending SIGUSR1 down in 5 mn */ - u_int32_t attn_quantum, datasize, server_quantum; - u_int16_t serverID, clientID; + uint32_t attn_quantum, datasize, server_quantum; + uint16_t serverID, clientID; char *status; - u_int8_t commands[DSI_CMDSIZ], data[DSI_DATASIZ]; + uint8_t commands[DSI_CMDSIZ], data[DSI_DATASIZ]; size_t statuslen; size_t datalen, cmdlen; off_t read_count, write_count; @@ -162,7 +162,7 @@ extern DSI *dsi_init (const dsi_proto /*protocol*/, const char * /*program*/, const char * /*host*/, const char * /*address*/, const char * /*port*/, const int /*proxy*/, - const u_int32_t /* server quantum */); + const uint32_t /* server quantum */); extern void dsi_setstatus (DSI *, char *, const size_t); /* in dsi_getsess.c */ diff --git a/include/atalk/globals.h b/include/atalk/globals.h index f1b8bd53..3f65fbad 100644 --- a/include/atalk/globals.h +++ b/include/atalk/globals.h @@ -58,7 +58,7 @@ struct afp_options { int disconnected; /* Maximum time in disconnected state (in tickles) */ unsigned int tcp_sndbuf, tcp_rcvbuf; unsigned char passwdbits, passwdminlen, loginmaxfail; - u_int32_t server_quantum; + uint32_t server_quantum; int dsireadbuf; /* scale factor for sizefof(dsi->buffer) = server_quantum * dsireadbuf */ char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *port, *configfile; char *uampath, *fqdn; diff --git a/include/atalk/server_child.h b/include/atalk/server_child.h index 6e4575ee..a86a7568 100644 --- a/include/atalk/server_child.h +++ b/include/atalk/server_child.h @@ -45,7 +45,7 @@ extern void server_child_free (server_child *); extern void server_child_kill (server_child *, const int, const int); extern void server_child_kill_one_by_id (server_child *children, const int forkid, const pid_t pid, const uid_t, - const u_int32_t len, char *id, u_int32_t boottime); + const uint32_t len, char *id, uint32_t boottime); extern int server_child_transfer_session(server_child *children, int forkid, pid_t, uid_t, int, uint16_t); extern void server_child_setup (server_child *, const int, void (*)(const pid_t)); extern void server_child_handler (server_child *); diff --git a/include/atalk/unicode.h b/include/atalk/unicode.h index 27441549..4c4759ef 100644 --- a/include/atalk/unicode.h +++ b/include/atalk/unicode.h @@ -4,7 +4,7 @@ #include #include -#define ucs2_t u_int16_t +#define ucs2_t uint16_t #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) @@ -78,7 +78,7 @@ struct charset_functions { char **outbuf, size_t *outbytesleft); size_t (*push)(void *, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); - u_int32_t flags; + uint32_t flags; const char *iname; struct charset_functions *prev, *next; }; @@ -92,9 +92,9 @@ extern int atalk_register_charset (struct charset_functions *); /* from utf16_case.c */ extern ucs2_t toupper_w (ucs2_t); -extern u_int32_t toupper_sp (u_int32_t); +extern uint32_t toupper_sp (uint32_t); extern ucs2_t tolower_w (ucs2_t); -extern u_int32_t tolower_sp (u_int32_t); +extern uint32_t tolower_sp (uint32_t); /* from util_unistr.c */ extern int strupper_w (ucs2_t *); @@ -138,7 +138,7 @@ extern size_t ucs2_to_charset_allocate (charset_t, char **dest, const ucs2_t * extern size_t utf8_to_charset_allocate (charset_t, char **dest, const char *src); extern size_t ucs2_to_charset (charset_t, const ucs2_t *src, char *dest, size_t); -extern size_t convert_charset (charset_t, charset_t, charset_t, const char *, size_t, char *, size_t, u_int16_t *); +extern size_t convert_charset (charset_t, charset_t, charset_t, const char *, size_t, char *, size_t, uint16_t *); extern size_t charset_precompose ( charset_t, char *, size_t, char *, size_t); extern size_t charset_decompose ( charset_t, char *, size_t, char *, size_t); diff --git a/include/atalk/volinfo.h b/include/atalk/volinfo.h index 1124b139..51bf30fc 100644 --- a/include/atalk/volinfo.h +++ b/include/atalk/volinfo.h @@ -9,7 +9,7 @@ #define VOLINFOFILE ".volinfo" typedef struct { - const u_int32_t option; + const uint32_t option; const char *name; } vol_opt_name_t; diff --git a/include/atalk/volume.h b/include/atalk/volume.h index 2d801928..615ecd63 100644 --- a/include/atalk/volume.h +++ b/include/atalk/volume.h @@ -16,11 +16,11 @@ #define AFPVOL_U8MNAMELEN 255 /* AFP3 sepc */ #define AFPVOL_MACNAMELEN 27 /* AFP2 spec */ -typedef u_int64_t VolSpace; +typedef uint64_t VolSpace; struct vol { struct vol *v_next; - u_int16_t v_vid; + uint16_t v_vid; int v_flags; char *v_path; struct dir *v_root; @@ -28,8 +28,8 @@ struct vol { charset_t v_volcharset; charset_t v_maccharset; - u_int16_t v_mtou_flags; /* flags for convert_charset in mtoupath */ - u_int16_t v_utom_flags; + uint16_t v_mtou_flags; /* flags for convert_charset in mtoupath */ + uint16_t v_utom_flags; long v_kTextEncoding; /* mac charset encoding in network order * FIXME: should be a u_int32_t ? */ size_t max_filename; diff --git a/libatalk/adouble/ad_attr.c b/libatalk/adouble/ad_attr.c index 37c84e03..6579f0de 100644 --- a/libatalk/adouble/ad_attr.c +++ b/libatalk/adouble/ad_attr.c @@ -15,9 +15,9 @@ retrieved from the FinderFlags. This fixes Bug #2802236: */ -int ad_getattr(const struct adouble *ad, u_int16_t *attr) +int ad_getattr(const struct adouble *ad, uint16_t *attr) { - u_int16_t fflags; + uint16_t fflags; *attr = 0; if (ad->ad_version == AD_VERSION2) { @@ -49,12 +49,12 @@ int ad_getattr(const struct adouble *ad, u_int16_t *attr) } /* ----------------- */ -int ad_setattr(const struct adouble *ad, const u_int16_t attribute) +int ad_setattr(const struct adouble *ad, const uint16_t attribute) { uint16_t fflags; /* we don't save open forks indicator */ - u_int16_t attr = attribute & ~htons(ATTRBIT_DOPEN | ATTRBIT_ROPEN); + uint16_t attr = attribute & ~htons(ATTRBIT_DOPEN | ATTRBIT_ROPEN); /* Proactively (10.4 does indeed try to set ATTRBIT_MULTIUSER (=ATTRBIT_EXPFLDR) for dirs with SetFile -a M ) disable all flags not defined for dirs. */ @@ -90,7 +90,7 @@ int ad_setattr(const struct adouble *ad, const u_int16_t attribute) * save file/folder ID in AppleDoubleV2 netatalk private parameters * return 1 if resource fork has been modified */ -int ad_setid (struct adouble *adp, const dev_t dev, const ino_t ino , const u_int32_t id, const cnid_t did, const void *stamp) +int ad_setid (struct adouble *adp, const dev_t dev, const ino_t ino , const uint32_t id, const cnid_t did, const void *stamp) { if ((adp->ad_flags == AD_VERSION2) && (adp->ad_options & ADVOL_CACHE)) { @@ -119,9 +119,9 @@ int ad_setid (struct adouble *adp, const dev_t dev, const ino_t ino , const u_in } /* ----------------------------- */ -u_int32_t ad_getid (struct adouble *adp, const dev_t st_dev, const ino_t st_ino , const cnid_t did, const void *stamp) +uint32_t ad_getid (struct adouble *adp, const dev_t st_dev, const ino_t st_ino , const cnid_t did, const void *stamp) { - u_int32_t aint = 0; + uint32_t aint = 0; dev_t dev; ino_t ino; cnid_t a_did; @@ -153,9 +153,9 @@ u_int32_t ad_getid (struct adouble *adp, const dev_t st_dev, const ino_t st_ino } /* ----------------------------- */ -u_int32_t ad_forcegetid (struct adouble *adp) +uint32_t ad_forcegetid (struct adouble *adp) { - u_int32_t aint = 0; + uint32_t aint = 0; if (adp && (adp->ad_options & ADVOL_CACHE)) { memcpy(&aint, ad_entry(adp, ADEID_PRIVID), sizeof(aint)); diff --git a/libatalk/adouble/ad_date.c b/libatalk/adouble/ad_date.c index 0a9c7ccc..304642d5 100644 --- a/libatalk/adouble/ad_date.c +++ b/libatalk/adouble/ad_date.c @@ -7,7 +7,7 @@ #include int ad_setdate(struct adouble *ad, - unsigned int dateoff, u_int32_t date) + unsigned int dateoff, uint32_t date) { int xlate = (dateoff & AD_DATE_UNIX); @@ -26,7 +26,7 @@ int ad_setdate(struct adouble *ad, } int ad_getdate(const struct adouble *ad, - unsigned int dateoff, u_int32_t *date) + unsigned int dateoff, uint32_t *date) { int xlate = (dateoff & AD_DATE_UNIX); @@ -36,7 +36,7 @@ int ad_getdate(const struct adouble *ad, if (dateoff > AD_DATE_ACCESS) return -1; - memcpy(date, ad_entry(ad, ADEID_FILEDATESI) + dateoff, sizeof(u_int32_t)); + memcpy(date, ad_entry(ad, ADEID_FILEDATESI) + dateoff, sizeof(uint32_t)); if (xlate) *date = AD_DATE_TO_UNIX(*date); diff --git a/libatalk/adouble/ad_flush.c b/libatalk/adouble/ad_flush.c index 413bb16b..ed9aa95d 100644 --- a/libatalk/adouble/ad_flush.c +++ b/libatalk/adouble/ad_flush.c @@ -40,7 +40,7 @@ #include "ad_lock.h" -static const u_int32_t set_eid[] = { +static const uint32_t set_eid[] = { 0,1,2,3,4,5,6,7,8, 9,10,11,12,13,14,15, AD_DEV, AD_INO, AD_SYN, AD_ID @@ -53,9 +53,9 @@ static const u_int32_t set_eid[] = { */ int ad_rebuild_adouble_header(struct adouble *ad) { - u_int32_t eid; - u_int32_t temp; - u_int16_t nent; + uint32_t eid; + uint32_t temp; + uint16_t nent; char *buf, *nentp; int len; @@ -116,8 +116,8 @@ int ad_rebuild_adouble_header(struct adouble *ad) */ int ad_copy_header(struct adouble *add, struct adouble *ads) { - u_int32_t eid; - u_int32_t len; + uint32_t eid; + uint32_t len; for ( eid = 0; eid < ADEID_MAX; eid++ ) { if ( ads->ad_eid[ eid ].ade_off == 0 ) { diff --git a/libatalk/adouble/ad_lock.c b/libatalk/adouble/ad_lock.c index 6fab9028..5899afa6 100644 --- a/libatalk/adouble/ad_lock.c +++ b/libatalk/adouble/ad_lock.c @@ -265,7 +265,7 @@ int start = off; } /* ------------------ */ -static int ad_fcntl_lock(struct adouble *ad, const u_int32_t eid, const int locktype, +static int ad_fcntl_lock(struct adouble *ad, const uint32_t eid, const int locktype, const off_t off, const off_t len, const int fork) { #if 0 @@ -456,7 +456,7 @@ static int testlock(struct ad_fd *adf, off_t off, off_t len) /* ------------------------- */ -static int ad_fcntl_tmplock(struct adouble *ad, const u_int32_t eid, const int locktype, +static int ad_fcntl_tmplock(struct adouble *ad, const uint32_t eid, const int locktype, const off_t off, const off_t len, const int fork) { struct flock lock; @@ -575,7 +575,7 @@ int ad_testlock(struct adouble *ad, int eid, const off_t off) - there's no locks held by another process (clients) - or we already know the answer and don't need to test. */ -uint16_t ad_openforks(struct adouble *ad, u_int16_t attrbits) +uint16_t ad_openforks(struct adouble *ad, uint16_t attrbits) { return 0; #if 0 @@ -637,7 +637,7 @@ uint16_t ad_openforks(struct adouble *ad, u_int16_t attrbits) the fork is opened in Read Write, Deny Read, Deny Write mode lock the whole file once */ -int ad_excl_lock(struct adouble *ad, const u_int32_t eid) +int ad_excl_lock(struct adouble *ad, const uint32_t eid) { return 0; #if 0 diff --git a/libatalk/adouble/ad_open.c b/libatalk/adouble/ad_open.c index bc4c7c5f..ea4ee240 100644 --- a/libatalk/adouble/ad_open.c +++ b/libatalk/adouble/ad_open.c @@ -179,7 +179,7 @@ static uint32_t get_eid(uint32_t eid) static int new_ad_header(const char *path, struct adouble *ad, int adflags) { const struct entry *eid; - u_int16_t ashort; + uint16_t ashort; struct stat st; ad->ad_magic = AD_MAGIC; @@ -276,7 +276,7 @@ static void parse_entries(struct adouble *ad, char *buf, uint16_t nentries) static int ad_header_read(struct adouble *ad, struct stat *hst) { char *buf = ad->ad_data; - u_int16_t nentries; + uint16_t nentries; int len; ssize_t header_len; struct stat st; diff --git a/libatalk/adouble/ad_read.c b/libatalk/adouble/ad_read.c index 877ab574..e6d2669d 100644 --- a/libatalk/adouble/ad_read.c +++ b/libatalk/adouble/ad_read.c @@ -60,7 +60,7 @@ ssize_t adf_pread(struct ad_fd *ad_fd, void *buf, size_t count, off_t offset) /* XXX: locks have to be checked before each stream of consecutive * ad_reads to prevent a denial in the middle from causing * problems. */ -ssize_t ad_read( struct adouble *ad, const u_int32_t eid, off_t off, char *buf, const size_t buflen) +ssize_t ad_read( struct adouble *ad, const uint32_t eid, off_t off, char *buf, const size_t buflen) { ssize_t cc; diff --git a/libatalk/adouble/ad_size.c b/libatalk/adouble/ad_size.c index 0b45babd..337ff6ed 100644 --- a/libatalk/adouble/ad_size.c +++ b/libatalk/adouble/ad_size.c @@ -15,7 +15,7 @@ #include #include -off_t ad_size(const struct adouble *ad, const u_int32_t eid) +off_t ad_size(const struct adouble *ad, const uint32_t eid) { if (eid == ADEID_DFORK) { struct stat st; diff --git a/libatalk/cnid/cnid.c b/libatalk/cnid/cnid.c index fae5067c..ab18f50c 100644 --- a/libatalk/cnid/cnid.c +++ b/libatalk/cnid/cnid.c @@ -162,7 +162,7 @@ struct _cnid_db *cnid_open(const char *volpath, mode_t mask, char *type, int fla } /* ------------------- */ -static void block_signal( u_int32_t flags) +static void block_signal(uint32_t flags) { if ((flags & CNID_FLAG_BLOCK)) { pthread_sigmask(SIG_BLOCK, &sigblockset, NULL); @@ -170,7 +170,7 @@ static void block_signal( u_int32_t flags) } /* ------------------- */ -static void unblock_signal(u_int32_t flags) +static void unblock_signal(uint32_t flags) { if ((flags & CNID_FLAG_BLOCK)) { pthread_sigmask(SIG_UNBLOCK, &sigblockset, NULL); @@ -200,7 +200,7 @@ static cnid_t valide(cnid_t id) /* Closes CNID database. Currently it's just a wrapper around db->cnid_close(). */ void cnid_close(struct _cnid_db *db) { -u_int32_t flags; + uint32_t flags; if (NULL == db) { LOG(log_error, logtype_afpd, "Error: cnid_close called with NULL argument !"); diff --git a/libatalk/cnid/tdb/cnid_tdb.h b/libatalk/cnid/tdb/cnid_tdb.h index 5d176324..64cc214b 100644 --- a/libatalk/cnid/tdb/cnid_tdb.h +++ b/libatalk/cnid/tdb/cnid_tdb.h @@ -70,6 +70,6 @@ extern int cnid_tdb_delete (struct _cnid_db *, const cnid_t); extern cnid_t cnid_tdb_nextid (struct _cnid_db *); /* construct db_cnid data. NOTE: this is not re-entrant. */ -extern unsigned char *make_tdb_data(u_int32_t flags, const struct stat *st, const cnid_t did, const char *name, const size_t len); +extern unsigned char *make_tdb_data(uint32_t flags, const struct stat *st, const cnid_t did, const char *name, const size_t len); #endif /* include/atalk/cnid_tdb.h */ diff --git a/libatalk/cnid/tdb/cnid_tdb_add.c b/libatalk/cnid/tdb/cnid_tdb_add.c index e49fdd30..fcb43fa2 100644 --- a/libatalk/cnid/tdb/cnid_tdb_add.c +++ b/libatalk/cnid/tdb/cnid_tdb_add.c @@ -38,12 +38,12 @@ static void make_devino_data(unsigned char *buf, dev_t dev, ino_t ino) buf[CNID_DEV_LEN + CNID_INO_LEN - 8] = ino; } -unsigned char *make_tdb_data(u_int32_t flags, const struct stat *st,const cnid_t did, +unsigned char *make_tdb_data(uint32_t flags, const struct stat *st,const cnid_t did, const char *name, const size_t len) { static unsigned char start[CNID_HEADER_LEN + MAXPATHLEN + 1]; unsigned char *buf = start +CNID_LEN; - u_int32_t i; + uint32_t i; if (len > MAXPATHLEN) return NULL; diff --git a/libatalk/cnid/tdb/cnid_tdb_lookup.c b/libatalk/cnid/tdb/cnid_tdb_lookup.c index 457362bf..f095cd54 100644 --- a/libatalk/cnid/tdb/cnid_tdb_lookup.c +++ b/libatalk/cnid/tdb/cnid_tdb_lookup.c @@ -15,9 +15,9 @@ cnid_t cnid_tdb_lookup(struct _cnid_db *cdb, const struct stat *st, cnid_t did, int devino = 1, didname = 1; char dev[CNID_DEV_LEN]; char ino[CNID_INO_LEN]; - u_int32_t type_devino = (unsigned)-1; - u_int32_t type_didname = (unsigned)-1; - u_int32_t type; + uint32_t type_devino = (unsigned)-1; + uint32_t type_didname = (unsigned)-1; + uint32_t type; int update = 0; cnid_t id_devino = 0, id_didname = 0,id = 0; diff --git a/libatalk/cnid/tdb/cnid_tdb_open.c b/libatalk/cnid/tdb/cnid_tdb_open.c index 4c2e050b..d02ef0bc 100644 --- a/libatalk/cnid/tdb/cnid_tdb_open.c +++ b/libatalk/cnid/tdb/cnid_tdb_open.c @@ -129,7 +129,7 @@ struct _cnid_db *cnid_tdb_open(struct cnid_open_args *args) data = tdb_fetch(db->tdb_didname, key); if (!data.dptr) { - u_int32_t version = htonl(DBVERSION); + uint32_t version = htonl(DBVERSION); data.dptr = (char *)&version; data.dsize = sizeof(version); diff --git a/libatalk/dsi/dsi_attn.c b/libatalk/dsi/dsi_attn.c index 383ff58b..5a60c24d 100644 --- a/libatalk/dsi/dsi_attn.c +++ b/libatalk/dsi/dsi_attn.c @@ -31,8 +31,8 @@ int dsi_attention(DSI *dsi, AFPUserBytes flags) { /* header + AFPUserBytes */ char block[DSI_BLOCKSIZ + sizeof(AFPUserBytes)]; - u_int32_t len, nlen; - u_int16_t id; + uint32_t len, nlen; + uint16_t id; if (dsi->flags & DSI_SLEEPING) return 1; diff --git a/libatalk/dsi/dsi_init.c b/libatalk/dsi/dsi_init.c index 547eed99..ee75fcc7 100644 --- a/libatalk/dsi/dsi_init.c +++ b/libatalk/dsi/dsi_init.c @@ -17,7 +17,7 @@ DSI *dsi_init(const dsi_proto protocol, const char *program, const char *hostname, const char *address, - const char *port, const int proxy, const u_int32_t quantum) + const char *port, const int proxy, const uint32_t quantum) { DSI *dsi; diff --git a/libatalk/dsi/dsi_opensess.c b/libatalk/dsi/dsi_opensess.c index 2d7fd23b..e074a112 100644 --- a/libatalk/dsi/dsi_opensess.c +++ b/libatalk/dsi/dsi_opensess.c @@ -33,7 +33,7 @@ static void dsi_init_buffer(DSI *dsi) /* OpenSession. set up the connection */ void dsi_opensession(DSI *dsi) { - u_int32_t i = 0; /* this serves double duty. it must be 4-bytes long */ + uint32_t i = 0; /* this serves double duty. it must be 4-bytes long */ int offs; dsi_init_buffer(dsi); diff --git a/libatalk/dsi/dsi_stream.c b/libatalk/dsi/dsi_stream.c index 4b92d225..dd7b9ef6 100644 --- a/libatalk/dsi/dsi_stream.c +++ b/libatalk/dsi/dsi_stream.c @@ -124,7 +124,7 @@ static int dsi_peek(DSI *dsi) /* * Return all bytes up to count from dsi->buffer if there are any buffered there */ -static size_t from_buf(DSI *dsi, u_int8_t *buf, size_t count) +static size_t from_buf(DSI *dsi, uint8_t *buf, size_t count) { size_t nbe = 0; @@ -159,7 +159,7 @@ static size_t from_buf(DSI *dsi, u_int8_t *buf, size_t count) * Note: this may return fewer bytes then requested in count !! * 3. If the buffer was empty, read from the socket. */ -static ssize_t buf_read(DSI *dsi, u_int8_t *buf, size_t count) +static ssize_t buf_read(DSI *dsi, uint8_t *buf, size_t count) { ssize_t len; @@ -183,7 +183,7 @@ static ssize_t buf_read(DSI *dsi, u_int8_t *buf, size_t count) * Get "length" bytes from buffer and/or socket. In order to avoid frequent small reads * this tries to read larger chunks (8192 bytes) into a buffer. */ -static size_t dsi_buffered_stream_read(DSI *dsi, u_int8_t *data, const size_t length) +static size_t dsi_buffered_stream_read(DSI *dsi, uint8_t *data, const size_t length) { size_t len; size_t buflen; @@ -269,7 +269,7 @@ ssize_t dsi_stream_write(DSI *dsi, void *data, const size_t length, int mode) return -1; while (written < length) { - len = send(dsi->socket, (u_int8_t *) data + written, length - written, flags); + len = send(dsi->socket, (uint8_t *) data + written, length - written, flags); if (len >= 0) { written += len; continue; @@ -380,7 +380,7 @@ size_t dsi_stream_read(DSI *dsi, void *data, const size_t length) stored = 0; while (stored < length) { - len = buf_read(dsi, (u_int8_t *) data + stored, length - stored); + len = buf_read(dsi, (uint8_t *) data + stored, length - stored); if (len == -1 && (errno == EINTR || errno == EAGAIN)) { LOG(log_maxdebug, logtype_dsi, "dsi_stream_read: select read loop"); continue; @@ -498,7 +498,7 @@ int dsi_stream_receive(DSI *dsi, void *buf, const size_t ilength, return 0; /* read in the header */ - if (dsi_buffered_stream_read(dsi, (u_int8_t *)block, sizeof(block)) != sizeof(block)) + if (dsi_buffered_stream_read(dsi, (uint8_t *)block, sizeof(block)) != sizeof(block)) return 0; dsi->header.dsi_flags = block[0]; diff --git a/libatalk/dsi/dsi_tcp.c b/libatalk/dsi/dsi_tcp.c index b87c253b..c7076126 100644 --- a/libatalk/dsi/dsi_tcp.c +++ b/libatalk/dsi/dsi_tcp.c @@ -117,7 +117,7 @@ static int dsi_tcp_open(DSI *dsi) if (0 == (pid = fork()) ) { /* child */ static struct itimerval timer = {{0, 0}, {DSI_TCPTIMEOUT, 0}}; struct sigaction newact, oldact; - u_int8_t block[DSI_BLOCKSIZ]; + uint8_t block[DSI_BLOCKSIZ]; size_t stored; /* Immediateyl mark globally that we're a child now */ diff --git a/libatalk/dsi/dsi_tickle.c b/libatalk/dsi/dsi_tickle.c index bdc748c4..40d0c0ad 100644 --- a/libatalk/dsi/dsi_tickle.c +++ b/libatalk/dsi/dsi_tickle.c @@ -21,7 +21,7 @@ int dsi_tickle(DSI *dsi) { char block[DSI_BLOCKSIZ]; - u_int16_t id; + uint16_t id; if ((dsi->flags & DSI_SLEEPING) || dsi->in_write) return 1; diff --git a/libatalk/tdb/tdb_private.h b/libatalk/tdb/tdb_private.h index 77951c62..41389c41 100644 --- a/libatalk/tdb/tdb_private.h +++ b/libatalk/tdb/tdb_private.h @@ -67,6 +67,7 @@ #define __location__ __FILE__ ":" __LINESTR__ #endif +#include #include "atalk/tdb.h" /* #define TDB_TRACE 1 */ diff --git a/libatalk/unicode/byteorder.h b/libatalk/unicode/byteorder.h index b295b54c..cc9a7f02 100644 --- a/libatalk/unicode/byteorder.h +++ b/libatalk/unicode/byteorder.h @@ -122,8 +122,8 @@ it also defines lots of intermediate macros, just ignore those :-) #define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16)) #define SVALS(buf,pos) ((int16)SVAL(buf,pos)) #define IVALS(buf,pos) ((int32_t)IVAL(buf,pos)) -#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((u_int16_t)(val))) -#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((u_int32_t)(val))) +#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16_t)(val))) +#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32_t)(val))) #define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val))) #define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32_t)(val))) @@ -135,8 +135,8 @@ it also defines lots of intermediate macros, just ignore those :-) #define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16)) #define SVALS(buf,pos) ((int16)SVAL(buf,pos)) #define IVALS(buf,pos) ((int32_t)IVAL(buf,pos)) -#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((u_int16_t)(val))) -#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((u_int32_t)(val))) +#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16_t)(val))) +#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32_t)(val))) #define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val))) #define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32_t)(val))) @@ -152,18 +152,18 @@ it also defines lots of intermediate macros, just ignore those :-) */ /* get single value from an SMB buffer */ -#define SVAL(buf,pos) (*(const u_int16_t *)((const char *)(buf) + (pos))) -#define SVAL_NC(buf,pos) (*(u_int16_t *)((char *)(buf) + (pos))) /* Non const version of above. */ -#define IVAL(buf,pos) (*(const u_int32_t *)((const char *)(buf) + (pos))) -#define IVAL_NC(buf,pos) (*(u_int32_t *)((char *)(buf) + (pos))) /* Non const version of above. */ +#define SVAL(buf,pos) (*(const uint16_t *)((const char *)(buf) + (pos))) +#define SVAL_NC(buf,pos) (*(uint16_t *)((char *)(buf) + (pos))) /* Non const version of above. */ +#define IVAL(buf,pos) (*(const uint32_t *)((const char *)(buf) + (pos))) +#define IVAL_NC(buf,pos) (*(uint32_t *)((char *)(buf) + (pos))) /* Non const version of above. */ #define SVALS(buf,pos) (*(const int16_t *)((const char *)(buf) + (pos))) #define SVALS_NC(buf,pos) (*(int16 *)((char *)(buf) + (pos))) /* Non const version of above. */ #define IVALS(buf,pos) (*(const int32_t *)((const char *)(buf) + (pos))) #define IVALS_NC(buf,pos) (*(int32_t *)((char *)(buf) + (pos))) /* Non const version of above. */ /* store single value in an SMB buffer */ -#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((u_int16_t)(val)) -#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((u_int32_t)(val)) +#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((uint16_t)(val)) +#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((uint32_t)(val)) #define SSVALS(buf,pos,val) SVALS_NC(buf,pos)=((int16)(val)) #define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((int32_t)(val)) diff --git a/libatalk/unicode/charcnv.c b/libatalk/unicode/charcnv.c index 4a4dda5d..7859a228 100644 --- a/libatalk/unicode/charcnv.c +++ b/libatalk/unicode/charcnv.c @@ -768,9 +768,9 @@ char * debug_out ( char * seq, size_t len) * for e.g. HFS cdroms. */ -static size_t pull_charset_flags (charset_t from_set, charset_t cap_set, const char *src, size_t srclen, char* dest, size_t destlen, u_int16_t *flags) +static size_t pull_charset_flags (charset_t from_set, charset_t cap_set, const char *src, size_t srclen, char* dest, size_t destlen, uint16_t *flags) { - const u_int16_t option = (flags ? *flags : 0); + const uint16_t option = (flags ? *flags : 0); size_t i_len, o_len; size_t j = 0; const char* inbuf = (const char*)src; @@ -880,9 +880,9 @@ end: */ -static size_t push_charset_flags (charset_t to_set, charset_t cap_set, char* src, size_t srclen, char* dest, size_t destlen, u_int16_t *flags) +static size_t push_charset_flags (charset_t to_set, charset_t cap_set, char* src, size_t srclen, char* dest, size_t destlen, uint16_t *flags) { - const u_int16_t option = (flags ? *flags : 0); + const uint16_t option = (flags ? *flags : 0); size_t i_len, o_len, i; size_t j = 0; const char* inbuf = (const char*)src; @@ -1029,7 +1029,7 @@ end: * FIXME the size is a mess we really need a malloc/free logic *`dest size must be dest_len +2 */ -size_t convert_charset ( charset_t from_set, charset_t to_set, charset_t cap_charset, const char *src, size_t src_len, char *dest, size_t dest_len, u_int16_t *flags) +size_t convert_charset ( charset_t from_set, charset_t to_set, charset_t cap_charset, const char *src, size_t src_len, char *dest, size_t dest_len, uint16_t *flags) { size_t i_len, o_len; ucs2_t *u; diff --git a/libatalk/unicode/charsets/generic_cjk.c b/libatalk/unicode/charsets/generic_cjk.c index 29358a8c..461af345 100644 --- a/libatalk/unicode/charsets/generic_cjk.c +++ b/libatalk/unicode/charsets/generic_cjk.c @@ -36,14 +36,14 @@ static size_t cjk_iconv(void *cd, char **inbuf, char *end, return n; } -size_t cjk_generic_push(size_t (*char_func)(u_int8_t*, const ucs2_t*, size_t*), +size_t cjk_generic_push(size_t (*char_func)(uint8_t*, const ucs2_t*, size_t*), void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { char *in = *inbuf; while (*inbytesleft >= sizeof(ucs2_t) && *outbytesleft > 0) { - u_int8_t buf[CJK_PUSH_BUFFER]; + uint8_t buf[CJK_PUSH_BUFFER]; size_t size = *inbytesleft / sizeof(ucs2_t); size_t n = (char_func)(buf, (const ucs2_t*)in, &size); if (n == 0) { @@ -78,7 +78,7 @@ size_t cjk_generic_push(size_t (*char_func)(u_int8_t*, const ucs2_t*, size_t*), return 0; } -size_t cjk_generic_pull(size_t (*char_func)(ucs2_t*, const u_int8_t*, size_t*), +size_t cjk_generic_pull(size_t (*char_func)(ucs2_t*, const uint8_t*, size_t*), void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { @@ -87,7 +87,7 @@ size_t cjk_generic_pull(size_t (*char_func)(ucs2_t*, const u_int8_t*, size_t*), while (*inbytesleft > 0 && *outbytesleft >= sizeof(ucs2_t)) { ucs2_t buf[CJK_PULL_BUFFER]; size_t size = *inbytesleft; - size_t n = (char_func)(buf, (const u_int8_t*)in, &size); + size_t n = (char_func)(buf, (const uint8_t*)in, &size); if (n == 0) { in += size; *inbytesleft -= size; @@ -120,30 +120,30 @@ size_t cjk_generic_pull(size_t (*char_func)(ucs2_t*, const u_int8_t*, size_t*), return 0; } -size_t cjk_char_push(u_int16_t c, u_int8_t *out) +size_t cjk_char_push(uint16_t c, uint8_t *out) { if (!c) return 0; - if (c == (u_int16_t)-1) { + if (c == (uint16_t)-1) { errno = EILSEQ; return (size_t)-1; } if (c <= 0xff) { - out[0] = (u_int8_t)c; + out[0] = (uint8_t)c; return 1; } - out[0] = (u_int8_t)(c >> 8); - out[1] = (u_int8_t)c; + out[0] = (uint8_t)(c >> 8); + out[1] = (uint8_t)c; return 2; } -size_t cjk_char_pull(ucs2_t wc, ucs2_t* out, const u_int32_t* compose) +size_t cjk_char_pull(ucs2_t wc, ucs2_t* out, const uint32_t* compose) { if (!wc) return 0; if ((wc & 0xf000) == 0xe000) { ucs2_t buf[CJK_PULL_BUFFER]; size_t i = sizeof(buf) / sizeof(*buf) - 1; do { - u_int32_t v = compose[wc & 0xfff]; + uint32_t v = compose[wc & 0xfff]; buf[i] = (ucs2_t)v; wc = (ucs2_t)(v >> 16); } while (--i && (wc & 0xf000) == 0xe000); @@ -155,12 +155,12 @@ size_t cjk_char_pull(ucs2_t wc, ucs2_t* out, const u_int32_t* compose) return 1; } -u_int16_t cjk_lookup(u_int16_t c, const cjk_index_t *index, const u_int16_t *charset) +uint16_t cjk_lookup(uint16_t c, const cjk_index_t *index, const uint16_t *charset) { while (index->summary && c >= index->range[0]) { if (c <= index->range[1]) { - const u_int16_t* summary = index->summary[(c - index->range[0]) >> 4]; - u_int16_t used = 1 << (c & 15); + const uint16_t* summary = index->summary[(c - index->range[0]) >> 4]; + uint16_t used = 1 << (c & 15); if (summary[0] & used) { used = summary[0] & (used - 1); @@ -175,9 +175,9 @@ u_int16_t cjk_lookup(u_int16_t c, const cjk_index_t *index, const u_int16_t *cha return 0; } -ucs2_t cjk_compose(ucs2_t base, ucs2_t comb, const u_int32_t* table, size_t size) +ucs2_t cjk_compose(ucs2_t base, ucs2_t comb, const uint32_t* table, size_t size) { - u_int32_t v = ((u_int32_t)base << 16) | comb; + uint32_t v = ((uint32_t)base << 16) | comb; size_t low = 0; while (size > low) { size_t n = (low + size) / 2; @@ -191,9 +191,9 @@ ucs2_t cjk_compose(ucs2_t base, ucs2_t comb, const u_int32_t* table, size_t size return 0; } -ucs2_t cjk_compose_seq(const ucs2_t* in, size_t* len, const u_int32_t* table, size_t size) +ucs2_t cjk_compose_seq(const ucs2_t* in, size_t* len, const uint32_t* table, size_t size) { - static u_int8_t sz[] = { 3, 4, 5, 5, 5, 5, 5, 3 }; + static uint8_t sz[] = { 3, 4, 5, 5, 5, 5, 5, 3 }; ucs2_t wc = in[0]; size_t n = sz[wc & 7]; size_t i = 0; diff --git a/libatalk/unicode/charsets/generic_cjk.h b/libatalk/unicode/charsets/generic_cjk.h index 8c6cbaaf..5dab15a6 100644 --- a/libatalk/unicode/charsets/generic_cjk.h +++ b/libatalk/unicode/charsets/generic_cjk.h @@ -25,18 +25,18 @@ #define CJK_PULL_BUFFER 8 typedef struct { - u_int16_t range[2]; - const u_int16_t (*summary)[2]; + uint16_t range[2]; + const uint16_t (*summary)[2]; } cjk_index_t; -extern size_t cjk_generic_push (size_t (*)(u_int8_t*, const ucs2_t*, size_t*), +extern size_t cjk_generic_push (size_t (*)(uint8_t*, const ucs2_t*, size_t*), void*, char**, size_t*, char**, size_t*); -extern size_t cjk_generic_pull (size_t (*)(ucs2_t*, const u_int8_t*, size_t*), +extern size_t cjk_generic_pull (size_t (*)(ucs2_t*, const uint8_t*, size_t*), void*, char**, size_t*, char**, size_t*); -extern size_t cjk_char_push (u_int16_t, u_int8_t*); -extern size_t cjk_char_pull (ucs2_t, ucs2_t*, const u_int32_t*); +extern size_t cjk_char_push (uint16_t, uint8_t*); +extern size_t cjk_char_pull (ucs2_t, ucs2_t*, const uint32_t*); -extern u_int16_t cjk_lookup (u_int16_t, const cjk_index_t*, const u_int16_t*); -extern ucs2_t cjk_compose (ucs2_t, ucs2_t, const u_int32_t*, size_t); -extern ucs2_t cjk_compose_seq (const ucs2_t*, size_t*, const u_int32_t*, size_t); +extern uint16_t cjk_lookup (uint16_t, const cjk_index_t*, const uint16_t*); +extern ucs2_t cjk_compose (ucs2_t, ucs2_t, const uint32_t*, size_t); +extern ucs2_t cjk_compose_seq (const ucs2_t*, size_t*, const uint32_t*, size_t); diff --git a/libatalk/unicode/charsets/mac_chinese_simp.c b/libatalk/unicode/charsets/mac_chinese_simp.c index f0ad4640..2ff6c2a0 100644 --- a/libatalk/unicode/charsets/mac_chinese_simp.c +++ b/libatalk/unicode/charsets/mac_chinese_simp.c @@ -43,20 +43,20 @@ struct charset_functions charset_mac_chinese_simp = { NULL, NULL }; -static size_t mac_chinese_simp_char_push(u_int8_t* out, const ucs2_t* in, size_t* size) +static size_t mac_chinese_simp_char_push(uint8_t* out, const ucs2_t* in, size_t* size) { ucs2_t wc = in[0]; if (wc <= 0x7f) { *size = 1; - out[0] = (u_int8_t)wc; + out[0] = (uint8_t)wc; return 1; } else if ((wc & 0xf000) == 0xe000) { *size = 1; return 0; } else if (*size >= 2 && (in[1] & ~15) == 0xf870) { ucs2_t comp = cjk_compose(wc, in[1], mac_chinese_simp_compose, - sizeof(mac_chinese_simp_compose) / sizeof(u_int32_t)); + sizeof(mac_chinese_simp_compose) / sizeof(uint32_t)); if (comp) { wc = comp; *size = 2; @@ -77,9 +77,9 @@ static size_t mac_chinese_simp_push(void *cd, char **inbuf, size_t *inbytesleft, cd, inbuf, inbytesleft, outbuf, outbytesleft); } -static size_t mac_chinese_simp_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size) +static size_t mac_chinese_simp_char_pull(ucs2_t* out, const uint8_t* in, size_t* size) { - u_int16_t c = in[0]; + uint16_t c = in[0]; if (c <= 0x7f) { *size = 1; @@ -87,7 +87,7 @@ static size_t mac_chinese_simp_char_pull(ucs2_t* out, const u_int8_t* in, size_t return 1; } else if (c >= 0xa1 && c <= 0xfc) { if (*size >= 2) { - u_int8_t c2 = in[1]; + uint8_t c2 = in[1]; if (c2 >= 0xa1 && c2 <= 0xfe) { *size = 2; diff --git a/libatalk/unicode/charsets/mac_chinese_simp.h b/libatalk/unicode/charsets/mac_chinese_simp.h index 9e7d8cea..25216256 100644 --- a/libatalk/unicode/charsets/mac_chinese_simp.h +++ b/libatalk/unicode/charsets/mac_chinese_simp.h @@ -20,7 +20,7 @@ * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ -static const u_int16_t mac_chinese_simp_uni2_page00[][2] = { +static const uint16_t mac_chinese_simp_uni2_page00[][2] = { /* 0x00a */ { 0x022d, 0 }, { 0x0080, 5 }, /* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x010 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, @@ -31,42 +31,42 @@ static const u_int16_t mac_chinese_simp_uni2_page00[][2] = { /* 0x024 */ { 0x0000, 0 }, { 0x0002, 9 }, { 0x0002, 10 }, }; -static const u_int16_t mac_chinese_simp_uni2_page1e[][2] = { +static const uint16_t mac_chinese_simp_uni2_page1e[][2] = { /* 0x1e3 */ { 0x8000, 11 }, }; -static const u_int16_t mac_chinese_simp_uni2_page20[][2] = { +static const uint16_t mac_chinese_simp_uni2_page20[][2] = { /* 0x201 */ { 0x0070, 12 }, { 0x0040, 15 }, { 0x4000, 16 }, }; -static const u_int16_t mac_chinese_simp_uni2_page21[][2] = { +static const uint16_t mac_chinese_simp_uni2_page21[][2] = { /* 0x212 */ { 0x0004, 17 }, }; -static const u_int16_t mac_chinese_simp_uni2_page22[][2] = { +static const uint16_t mac_chinese_simp_uni2_page22[][2] = { /* 0x22e */ { 0x8000, 18 }, }; -static const u_int16_t mac_chinese_simp_uni2_page30[][2] = { +static const uint16_t mac_chinese_simp_uni2_page30[][2] = { /* 0x301 */ { 0x1000, 19 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x304 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x308 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x30c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0800, 20 }, }; -static const u_int16_t mac_chinese_simp_uni2_pagee0[][2] = { +static const uint16_t mac_chinese_simp_uni2_pagee0[][2] = { /* 0xe00 */ { 0x07ff, 21 }, }; -static const u_int16_t mac_chinese_simp_uni2_pagef8[][2] = { +static const uint16_t mac_chinese_simp_uni2_pagef8[][2] = { /* 0xf88 */ { 0x0003, 32 }, }; -static const u_int16_t mac_chinese_simp_uni2_pagefe[][2] = { +static const uint16_t mac_chinese_simp_uni2_pagefe[][2] = { /* 0xfe3 */ { 0xfffa, 34 }, { 0x001f, 48 }, }; -static const u_int16_t mac_chinese_simp_uni2_pageff[][2] = { +static const uint16_t mac_chinese_simp_uni2_pageff[][2] = { /* 0xff5 */ { 0x4000, 53 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xff8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xffc */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x002b, 54 }, @@ -86,7 +86,7 @@ static const cjk_index_t mac_chinese_simp_uni2_index[] = { { { 0, 0 }, NULL } }; -static const u_int16_t mac_chinese_simp_uni2_charset[] = { +static const uint16_t mac_chinese_simp_uni2_charset[] = { 0x00a0, 0xa1e9, 0xa1ea, 0xa3a4, 0x00fd, 0xa1a4, 0xa8bd, 0xa8be, 0xa8bf, 0xa8bb, 0xa8c0, 0xa8bc, 0xa1aa, 0xffff, 0xa1ac, 0x00ff, 0xa3fe, 0x00fe, 0xa1ad, 0xa1ab, 0xffff, 0x0080, 0xa6f3, 0xa6db, @@ -97,26 +97,26 @@ static const u_int16_t mac_chinese_simp_uni2_charset[] = { 0xffff, 0xffff, }; -static const u_int16_t mac_chinese_simp_2uni_page00[][2] = { +static const uint16_t mac_chinese_simp_2uni_page00[][2] = { /* 0x008 */ { 0x0007, 0 }, { 0x0000, 0 }, { 0x0001, 3 }, { 0x0000, 0 }, /* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xe000, 4 }, }; -static const u_int16_t mac_chinese_simp_2uni_pagea1[][2] = { +static const uint16_t mac_chinese_simp_2uni_pagea1[][2] = { /* 0xa1a */ { 0x3c10, 7 }, { 0x0000, 0 }, /* 0xa1c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0600, 12 }, }; -static const u_int16_t mac_chinese_simp_2uni_pagea3[][2] = { +static const uint16_t mac_chinese_simp_2uni_pagea3[][2] = { /* 0xa3a */ { 0x0010, 14 }, { 0x0000, 0 }, /* 0xa3c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x4000, 15 }, }; -static const u_int16_t mac_chinese_simp_2uni_pagea6[][2] = { +static const uint16_t mac_chinese_simp_2uni_pagea6[][2] = { /* 0xa6d */ { 0xfe00, 16 }, { 0xffff, 23 }, { 0x003f, 39 }, }; -static const u_int16_t mac_chinese_simp_2uni_pagea8[][2] = { +static const uint16_t mac_chinese_simp_2uni_pagea8[][2] = { /* 0xa8b */ { 0xf800, 45 }, { 0x0001, 50 }, }; @@ -129,7 +129,7 @@ static const cjk_index_t mac_chinese_simp_2uni_index[] = { { { 0, 0 }, NULL } }; -static const u_int16_t mac_chinese_simp_2uni_charset[] = { +static const uint16_t mac_chinese_simp_2uni_charset[] = { 0xe000, 0xf880, 0xf881, 0x00a0, 0x00a9, 0x2122, 0x2026, 0x00b7, 0x2014, 0x301c, 0x2016, 0x22ef, 0x00a2, 0x00a3, 0x00a5, 0x203e, 0xe007, 0xe003, 0xe002, 0xe008, 0xe009, 0xe006, 0xe00a, 0xfe35, @@ -139,7 +139,7 @@ static const u_int16_t mac_chinese_simp_2uni_charset[] = { 0x0148, 0x01f9, 0x0261, }; -static const u_int32_t mac_chinese_simp_compose[] = { +static const uint32_t mac_chinese_simp_compose[] = { 0x00fcf87f, 0x22eff87e, 0x3001f87e, 0x3002f87e, 0x3016f87e, 0x3017f87e, 0xff01f87e, 0xff0cf87e, 0xff1af87e, 0xff1bf87e, 0xff1ff87e, diff --git a/libatalk/unicode/charsets/mac_chinese_trad.c b/libatalk/unicode/charsets/mac_chinese_trad.c index 7412beec..116e8cd5 100644 --- a/libatalk/unicode/charsets/mac_chinese_trad.c +++ b/libatalk/unicode/charsets/mac_chinese_trad.c @@ -43,7 +43,7 @@ struct charset_functions charset_mac_chinese_trad = { NULL, NULL }; -static size_t mac_chinese_trad_char_push(u_int8_t* out, const ucs2_t* in, size_t* size) +static size_t mac_chinese_trad_char_push(uint8_t* out, const ucs2_t* in, size_t* size) { ucs2_t wc = in[0]; @@ -53,7 +53,7 @@ static size_t mac_chinese_trad_char_push(u_int8_t* out, const ucs2_t* in, size_t out[0] = 0x80; } else { *size = 1; - out[0] = (u_int8_t)wc; + out[0] = (uint8_t)wc; } return 1; } else if ((wc & 0xf000) == 0xe000) { @@ -61,7 +61,7 @@ static size_t mac_chinese_trad_char_push(u_int8_t* out, const ucs2_t* in, size_t return 0; } else if (*size >= 2 && (in[1] & ~15) == 0xf870) { ucs2_t comp = cjk_compose(wc, in[1], mac_chinese_trad_compose, - sizeof(mac_chinese_trad_compose) / sizeof(u_int32_t)); + sizeof(mac_chinese_trad_compose) / sizeof(uint32_t)); if (comp) { wc = comp; *size = 2; @@ -82,9 +82,9 @@ static size_t mac_chinese_trad_push(void *cd, char **inbuf, size_t *inbytesleft, cd, inbuf, inbytesleft, outbuf, outbytesleft); } -static size_t mac_chinese_trad_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size) +static size_t mac_chinese_trad_char_pull(ucs2_t* out, const uint8_t* in, size_t* size) { - u_int16_t c = in[0]; + uint16_t c = in[0]; if (c <= 0x7f) { *size = 1; @@ -92,7 +92,7 @@ static size_t mac_chinese_trad_char_pull(ucs2_t* out, const u_int8_t* in, size_t return 1; } else if (c >= 0xa1 && c <= 0xfc) { if (*size >= 2) { - u_int8_t c2 = in[1]; + uint8_t c2 = in[1]; if ((c2 >= 0x40 && c2 <= 0x7e) || (c2 >= 0xa1 && c2 <= 0xfe)) { *size = 2; diff --git a/libatalk/unicode/charsets/mac_chinese_trad.h b/libatalk/unicode/charsets/mac_chinese_trad.h index a5c94eb1..00e0c518 100644 --- a/libatalk/unicode/charsets/mac_chinese_trad.h +++ b/libatalk/unicode/charsets/mac_chinese_trad.h @@ -20,44 +20,44 @@ * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ -static const u_int16_t mac_chinese_trad_uni2_page00[][2] = { +static const uint16_t mac_chinese_trad_uni2_page00[][2] = { /* 0x00a */ { 0x0201, 0 }, { 0x0080, 2 }, }; -static const u_int16_t mac_chinese_trad_uni2_page20[][2] = { +static const uint16_t mac_chinese_trad_uni2_page20[][2] = { /* 0x202 */ { 0x0044, 3 }, }; -static const u_int16_t mac_chinese_trad_uni2_page21[][2] = { +static const uint16_t mac_chinese_trad_uni2_page21[][2] = { /* 0x212 */ { 0x0004, 5 }, }; -static const u_int16_t mac_chinese_trad_uni2_page22[][2] = { +static const uint16_t mac_chinese_trad_uni2_page22[][2] = { /* 0x229 */ { 0x0020, 6 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x22c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x8000, 7 }, }; -static const u_int16_t mac_chinese_trad_uni2_page25[][2] = { +static const uint16_t mac_chinese_trad_uni2_page25[][2] = { /* 0x259 */ { 0x0020, 8 }, }; -static const u_int16_t mac_chinese_trad_uni2_page26[][2] = { +static const uint16_t mac_chinese_trad_uni2_page26[][2] = { /* 0x264 */ { 0x0002, 9 }, }; -static const u_int16_t mac_chinese_trad_uni2_pagee0[][2] = { +static const uint16_t mac_chinese_trad_uni2_pagee0[][2] = { /* 0xe00 */ { 0xffff, 10 }, { 0x00ff, 26 }, }; -static const u_int16_t mac_chinese_trad_uni2_pagef8[][2] = { +static const uint16_t mac_chinese_trad_uni2_pagef8[][2] = { /* 0xf88 */ { 0x0003, 34 }, }; -static const u_int16_t mac_chinese_trad_uni2_pagefe[][2] = { +static const uint16_t mac_chinese_trad_uni2_pagefe[][2] = { /* 0xfe4 */ { 0x1000, 36 }, { 0x7ef5, 37 }, }; -static const u_int16_t mac_chinese_trad_uni2_pageff[][2] = { +static const uint16_t mac_chinese_trad_uni2_pageff[][2] = { /* 0xff6 */ { 0x0010, 49 }, }; @@ -75,7 +75,7 @@ static const cjk_index_t mac_chinese_trad_uni2_index[] = { { { 0, 0 }, NULL } }; -static const u_int16_t mac_chinese_trad_uni2_charset[] = { +static const uint16_t mac_chinese_trad_uni2_charset[] = { 0x00a0, 0x00fd, 0xa145, 0xffff, 0x00ff, 0x00fe, 0xa1f2, 0xa14b, 0xffff, 0xffff, 0x0080, 0xa1c3, 0xa279, 0xa14e, 0xa1a3, 0xa1a4, 0xa2cc, 0xa2ce, 0xa1cb, 0xa154, 0xa17d, 0xa17e, 0xa14d, 0xa14f, @@ -85,12 +85,12 @@ static const u_int16_t mac_chinese_trad_uni2_charset[] = { 0xffff, 0xffff, }; -static const u_int16_t mac_chinese_trad_2uni_page00[][2] = { +static const uint16_t mac_chinese_trad_2uni_page00[][2] = { /* 0x008 */ { 0x0007, 0 }, { 0x0000, 0 }, { 0x0001, 3 }, { 0x0000, 0 }, /* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xe000, 4 }, }; -static const u_int16_t mac_chinese_trad_2uni_pagea1[][2] = { +static const uint16_t mac_chinese_trad_2uni_pagea1[][2] = { /* 0xa14 */ { 0xe820, 7 }, { 0x041f, 12 }, { 0x0000, 0 }, { 0x6000, 18 }, /* 0xa18 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x001e, 20 }, { 0x0000, 0 }, /* 0xa1c */ { 0x0828, 24 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x4004, 27 }, @@ -106,7 +106,7 @@ static const cjk_index_t mac_chinese_trad_2uni_index[] = { { { 0, 0 }, NULL } }; -static const u_int16_t mac_chinese_trad_2uni_charset[] = { +static const uint16_t mac_chinese_trad_2uni_charset[] = { 0xe000, 0xf880, 0xf881, 0x00a0, 0x00a9, 0x2122, 0x2026, 0x00b7, 0x22ef, 0xe00c, 0xe003, 0xe00d, 0xe00e, 0xe011, 0xe010, 0xe012, 0xe009, 0xe015, 0xe00a, 0xe00b, 0xe016, 0xe017, 0xe004, 0xe005, @@ -114,7 +114,7 @@ static const u_int16_t mac_chinese_trad_2uni_charset[] = { 0xe007, }; -static const u_int32_t mac_chinese_trad_compose[] = { +static const uint32_t mac_chinese_trad_compose[] = { 0x005cf87f, 0x203ef87c, 0x2502f87f, 0x3001f87d, 0x3014f87f, 0x3015f87f, 0x5341f87f, 0x5345f87f, 0xfe4bf87c, 0xff01f87d, 0xff08f87f, 0xff09f87f, diff --git a/libatalk/unicode/charsets/mac_japanese.c b/libatalk/unicode/charsets/mac_japanese.c index b78ce014..9f32f662 100644 --- a/libatalk/unicode/charsets/mac_japanese.c +++ b/libatalk/unicode/charsets/mac_japanese.c @@ -43,29 +43,29 @@ struct charset_functions charset_mac_japanese = { NULL, NULL }; -static size_t mac_japanese_char_push(u_int8_t* out, const ucs2_t* in, size_t* size) +static size_t mac_japanese_char_push(uint8_t* out, const ucs2_t* in, size_t* size) { ucs2_t wc = in[0]; if (wc <= 0x7f) { *size = 1; - out[0] = (u_int8_t)(wc == 0x5c ? 0x80 : wc); + out[0] = (uint8_t)(wc == 0x5c ? 0x80 : wc); return 1; } else if ((wc & 0xf000) == 0xe000) { /* user defined */ *size = 1; if (wc > 0xe98b) return 0; wc -= 0xe000; - out[0] = (u_int8_t)(wc / 188 + 0xf0); - out[1] = (u_int8_t)(wc % 188 + 0x40); + out[0] = (uint8_t)(wc / 188 + 0xf0); + out[1] = (uint8_t)(wc % 188 + 0x40); if (out[1] >= 0x7f) ++out[1]; return 2; } else if ((wc & ~7) == 0xf860) { wc = cjk_compose_seq(in, size, mac_japanese_compose, - sizeof(mac_japanese_compose) / sizeof(u_int32_t)); + sizeof(mac_japanese_compose) / sizeof(uint32_t)); if (!wc) return (size_t)-1; } else if (*size >= 2 && ((in[1] & ~15) == 0xf870 || in[1] == 0x20dd)) { ucs2_t comp = cjk_compose(wc, in[1], mac_japanese_compose, - sizeof(mac_japanese_compose) / sizeof(u_int32_t)); + sizeof(mac_japanese_compose) / sizeof(uint32_t)); if (comp) { wc = comp; *size = 2; @@ -86,9 +86,9 @@ static size_t mac_japanese_push(void *cd, char **inbuf, size_t *inbytesleft, cd, inbuf, inbytesleft, outbuf, outbytesleft); } -static size_t mac_japanese_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size) +static size_t mac_japanese_char_pull(ucs2_t* out, const uint8_t* in, size_t* size) { - u_int16_t c = in[0]; + uint16_t c = in[0]; if (c <= 0x7f) { *size = 1; @@ -96,7 +96,7 @@ static size_t mac_japanese_char_pull(ucs2_t* out, const u_int8_t* in, size_t* si return 1; } else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) { if (*size >= 2) { - u_int8_t c2 = in[1]; + uint8_t c2 = in[1]; if ((c2 >= 0x40 && c2 <= 0x7e) || (c2 >= 0x80 && c2 <= 0xfc)) { *size = 2; diff --git a/libatalk/unicode/charsets/mac_japanese.h b/libatalk/unicode/charsets/mac_japanese.h index b0be8697..e27e450d 100644 --- a/libatalk/unicode/charsets/mac_japanese.h +++ b/libatalk/unicode/charsets/mac_japanese.h @@ -20,11 +20,11 @@ * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ -static const u_int16_t mac_japanese_uni2_page00[][2] = { +static const uint16_t mac_japanese_uni2_page00[][2] = { /* 0x00a */ { 0x0201, 1 }, }; -static const u_int16_t mac_japanese_uni2_page20[][2] = { +static const uint16_t mac_japanese_uni2_page20[][2] = { /* 0x201 */ { 0x0030, 3 }, { 0x0000, 0 }, { 0x4000, 5 }, /* 0x204 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x208 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, @@ -38,12 +38,12 @@ static const u_int16_t mac_japanese_uni2_page20[][2] = { /* 0x228 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x8000, 44 }, }; -static const u_int16_t mac_japanese_uni2_page24[][2] = { +static const uint16_t mac_japanese_uni2_page24[][2] = { /* 0x246 */ { 0xffff, 45 }, { 0xffff, 61 }, /* 0x248 */ { 0xffff, 77 }, { 0xf001, 93 }, { 0xffff, 98 }, { 0x003f, 114 }, }; -static const u_int16_t mac_japanese_uni2_page26[][2] = { +static const uint16_t mac_japanese_uni2_page26[][2] = { /* 0x260 */ { 0x4000, 120 }, { 0xf000, 121 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x264 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x00ff, 125 }, { 0x0000, 0 }, /* 0x268 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, @@ -52,14 +52,14 @@ static const u_int16_t mac_japanese_uni2_page26[][2] = { /* 0x274 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x7fc0, 133 }, }; -static const u_int16_t mac_japanese_uni2_page30[][2] = { +static const uint16_t mac_japanese_uni2_page30[][2] = { /* 0x300 */ { 0x0010, 142 }, { 0xa000, 143 }, { 0x0001, 145 }, { 0x0000, 0 }, /* 0x304 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x308 */ { 0x0000, 0 }, { 0x0010, 146 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x30c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0780, 147 }, }; -static const u_int16_t mac_japanese_uni2_page32[][2] = { +static const uint16_t mac_japanese_uni2_page32[][2] = { /* 0x322 */ { 0xfc00, 151 }, { 0xffff, 157 }, /* 0x324 */ { 0x000d, 173 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x328 */ { 0x0000, 0 }, { 0x6340, 176 }, { 0x03f0, 181 }, { 0x0000, 0 }, @@ -70,12 +70,12 @@ static const u_int16_t mac_japanese_uni2_page32[][2] = { /* 0x33c */ { 0x2810, 242 }, { 0x0010, 245 }, }; -static const u_int16_t mac_japanese_uni2_pagee0[][2] = { +static const uint16_t mac_japanese_uni2_pagee0[][2] = { /* 0xe00 */ { 0xffff, 246 }, { 0xffff, 262 }, { 0x0fff, 278 }, { 0x001f, 290 }, /* 0xe04 */ { 0x7f00, 295 }, }; -static const u_int16_t mac_japanese_uni2_pagefe[][2] = { +static const uint16_t mac_japanese_uni2_pagefe[][2] = { /* 0xfe3 */ { 0xffeb, 302 }, /* 0xfe4 */ { 0x001f, 316 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xfe8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, @@ -95,7 +95,7 @@ static const cjk_index_t mac_japanese_uni2_index[] = { { { 0, 0 }, NULL } }; -static const u_int16_t mac_japanese_uni2_charset[] = { +static const uint16_t mac_japanese_uni2_charset[] = { 0x0080, 0x00a0, 0x00fd, 0x815c, 0xffff, 0xffff, 0x8656, 0x8650, 0x869b, 0x869d, 0x00fe, 0x859f, 0x85a0, 0x85a1, 0x85a2, 0x85a3, 0x85a4, 0x85a5, 0x85a6, 0x85a7, 0x85a8, 0x85a9, 0x85aa, 0x85b3, @@ -139,16 +139,16 @@ static const u_int16_t mac_japanese_uni2_charset[] = { 0xeb78, 0x815f, }; -static const u_int16_t mac_japanese_2uni_page00[][2] = { +static const uint16_t mac_japanese_2uni_page00[][2] = { /* 0x008 */ { 0x0001, 0 }, { 0x0000, 0 }, { 0x0001, 1 }, { 0x0000, 0 }, /* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xe000, 2 }, }; -static const u_int16_t mac_japanese_2uni_page81[][2] = { +static const uint16_t mac_japanese_2uni_page81[][2] = { /* 0x815 */ { 0x9000, 5 }, }; -static const u_int16_t mac_japanese_2uni_page85[][2] = { +static const uint16_t mac_japanese_2uni_page85[][2] = { /* 0x854 */ { 0xffff, 7 }, { 0xc00f, 23 }, { 0xffff, 29 }, { 0x7003, 45 }, /* 0x858 */ { 0x003f, 50 }, { 0x87fe, 56 }, { 0x3fff, 67 }, { 0xfff8, 81 }, /* 0x85c */ { 0x0003, 94 }, { 0xf800, 96 }, { 0xffff, 101 }, { 0x001f, 117 }, @@ -164,7 +164,7 @@ static const u_int16_t mac_japanese_2uni_page85[][2] = { /* 0x884 */ { 0x0007, 257 }, { 0x0030, 260 }, { 0x3d00, 262 }, }; -static const u_int16_t mac_japanese_2uni_pageeb[][2] = { +static const uint16_t mac_japanese_2uni_pageeb[][2] = { /* 0xeb4 */ { 0x0006, 267 }, { 0x3803, 269 }, { 0xfe1f, 274 }, { 0x07ff, 286 }, /* 0xeb8 */ { 0x0002, 297 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xebc */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, @@ -185,7 +185,7 @@ static const cjk_index_t mac_japanese_2uni_index[] = { { { 0, 0 }, NULL } }; -static const u_int16_t mac_japanese_2uni_charset[] = { +static const uint16_t mac_japanese_2uni_charset[] = { 0x005c, 0x00a0, 0x00a9, 0x2122, 0xe003, 0x2014, 0xff3c, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x246f, 0x2470, @@ -228,7 +228,7 @@ static const u_int16_t mac_japanese_2uni_charset[] = { 0xe019, 0xe01a, 0xe01b, 0xe01c, 0xe01d, 0xe01e, 0xe01f, 0xe020, }; -static const u_int32_t mac_japanese_compose[] = { +static const uint32_t mac_japanese_compose[] = { 0x2010f87e, 0x2016f87e, 0x2026f87e, 0x2026f87f, 0x21e6f87a, 0x21e7f87a, 0x21e8f87a, 0x21e9f87a, 0x3001f87e, 0x3002f87e, 0x301cf87e, 0x3041f87e, diff --git a/libatalk/unicode/charsets/mac_korean.c b/libatalk/unicode/charsets/mac_korean.c index a16f4a03..26f387d7 100644 --- a/libatalk/unicode/charsets/mac_korean.c +++ b/libatalk/unicode/charsets/mac_korean.c @@ -43,13 +43,13 @@ struct charset_functions charset_mac_korean = { NULL, NULL }; -static size_t mac_korean_char_push(u_int8_t* out, const ucs2_t* in, size_t* size) +static size_t mac_korean_char_push(uint8_t* out, const ucs2_t* in, size_t* size) { ucs2_t wc = in[0]; if ((wc & ~7) == 0xf860) { wc = cjk_compose_seq(in, size, mac_korean_compose, - sizeof(mac_korean_compose) / sizeof(u_int32_t)); + sizeof(mac_korean_compose) / sizeof(uint32_t)); if (!wc) return (size_t)-1; } else if ((wc & 0xf000) == 0xe000) { *size = 1; @@ -62,7 +62,7 @@ static size_t mac_korean_char_push(u_int8_t* out, const ucs2_t* in, size_t* size (comb >= 0x0300 && comb <= 0x036f) || (comb >= 0x20d0 && comb <= 0x20ea)) { ucs2_t comp = cjk_compose(wc, comb, mac_korean_compose, - sizeof(mac_korean_compose) / sizeof(u_int32_t)); + sizeof(mac_korean_compose) / sizeof(uint32_t)); if (!comp) break; wc = comp; if (++n == *size) break; @@ -73,7 +73,7 @@ static size_t mac_korean_char_push(u_int8_t* out, const ucs2_t* in, size_t* size *size = 1; } if (wc <= 0x7f) { - out[0] = (u_int8_t)wc; + out[0] = (uint8_t)wc; return 1; } return cjk_char_push(cjk_lookup(wc, mac_korean_uni2_index, @@ -87,9 +87,9 @@ static size_t mac_korean_push(void *cd, char **inbuf, size_t *inbytesleft, cd, inbuf, inbytesleft, outbuf, outbytesleft); } -static size_t mac_korean_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size) +static size_t mac_korean_char_pull(ucs2_t* out, const uint8_t* in, size_t* size) { - u_int16_t c = in[0]; + uint16_t c = in[0]; if (c <= 0x7f) { *size = 1; @@ -97,7 +97,7 @@ static size_t mac_korean_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size return 1; } else if (c >= 0xa1 && c <= 0xfe) { if (*size >= 2) { - u_int8_t c2 = in[1]; + uint8_t c2 = in[1]; if ((c2 >= 0x41 && c2 <= 0x7d) || (c2 >= 0x81 && c2 <= 0xfe)) { *size = 2; c = (c << 8) + c2; diff --git a/libatalk/unicode/charsets/mac_korean.h b/libatalk/unicode/charsets/mac_korean.h index 4e990533..2febaa28 100644 --- a/libatalk/unicode/charsets/mac_korean.h +++ b/libatalk/unicode/charsets/mac_korean.h @@ -20,11 +20,11 @@ * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ -static const u_int16_t mac_korean_uni2_page00[][2] = { +static const uint16_t mac_korean_uni2_page00[][2] = { /* 0x00a */ { 0x7a2d, 0 }, { 0x0880, 9 }, }; -static const u_int16_t mac_korean_uni2_page02[][2] = { +static const uint16_t mac_korean_uni2_page02[][2] = { /* 0x02b */ { 0x1000, 11 }, /* 0x02c */ { 0x0000, 0 }, { 0x1001, 12 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x030 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, @@ -33,7 +33,7 @@ static const u_int16_t mac_korean_uni2_page02[][2] = { /* 0x03c */ { 0x0000, 0 }, { 0x0020, 14 }, }; -static const u_int16_t mac_korean_uni2_page20[][2] = { +static const uint16_t mac_korean_uni2_page20[][2] = { /* 0x201 */ { 0x8878, 15 }, { 0x0004, 21 }, { 0x5670, 22 }, /* 0x204 */ { 0x7284, 29 }, { 0x0002, 35 }, { 0x0000, 0 }, { 0x7c00, 36 }, /* 0x208 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x1200, 41 }, { 0x0000, 0 }, @@ -49,7 +49,7 @@ static const u_int16_t mac_korean_uni2_page20[][2] = { /* 0x230 */ { 0x0040, 118 }, { 0x0010, 119 }, }; -static const u_int16_t mac_korean_uni2_page24[][2] = { +static const uint16_t mac_korean_uni2_page24[][2] = { /* 0x246 */ { 0x8000, 120 }, { 0x000f, 121 }, /* 0x248 */ { 0x00f8, 125 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xffc0, 130 }, /* 0x24c */ { 0xffff, 140 }, { 0x0000, 0 }, { 0xf800, 156 }, { 0x001f, 161 }, @@ -66,7 +66,7 @@ static const u_int16_t mac_korean_uni2_page24[][2] = { /* 0x278 */ { 0xfc00, 210 }, { 0x581f, 216 }, { 0x0012, 224 }, { 0x0024, 226 }, }; -static const u_int16_t mac_korean_uni2_page29[][2] = { +static const uint16_t mac_korean_uni2_page29[][2] = { /* 0x293 */ { 0x02f0, 228 }, /* 0x294 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x003c, 233 }, { 0x0000, 0 }, /* 0x298 */ { 0x0062, 237 }, { 0x0180, 240 }, { 0x0008, 242 }, { 0xc000, 243 }, @@ -77,21 +77,21 @@ static const u_int16_t mac_korean_uni2_page29[][2] = { /* 0x2ac */ { 0x1860, 253 }, { 0x0000, 0 }, { 0x0100, 257 }, }; -static const u_int16_t mac_korean_uni2_page30[][2] = { +static const uint16_t mac_korean_uni2_page30[][2] = { /* 0x301 */ { 0xd3c4, 258 }, { 0x0001, 266 }, { 0x0040, 267 }, }; -static const u_int16_t mac_korean_uni2_page32[][2] = { +static const uint16_t mac_korean_uni2_page32[][2] = { /* 0x323 */ { 0x0202, 268 }, /* 0x324 */ { 0x0000, 0 }, { 0x07fe, 270 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x328 */ { 0xfc00, 280 }, { 0x4011, 286 }, { 0x0020, 289 }, }; -static const u_int16_t mac_korean_uni2_page33[][2] = { +static const uint16_t mac_korean_uni2_page33[][2] = { /* 0x33c */ { 0x0800, 290 }, }; -static const u_int16_t mac_korean_uni2_pagee0[][2] = { +static const uint16_t mac_korean_uni2_pagee0[][2] = { /* 0xe00 */ { 0xffff, 291 }, { 0xffff, 307 }, { 0xffff, 323 }, { 0xffff, 339 }, /* 0xe04 */ { 0xffff, 355 }, { 0xffff, 371 }, { 0xffff, 387 }, { 0xffff, 403 }, /* 0xe08 */ { 0xffff, 419 }, { 0xffff, 435 }, { 0xffff, 451 }, { 0xffff, 467 }, @@ -111,12 +111,12 @@ static const u_int16_t mac_korean_uni2_pagee0[][2] = { /* 0xe40 */ { 0x0000, 0 }, { 0x1ffc, 1126 }, }; -static const u_int16_t mac_korean_uni2_pagef8[][2] = { +static const uint16_t mac_korean_uni2_pagef8[][2] = { /* 0xf80 */ { 0x1fe0, 1137 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x2000, 1145 }, /* 0xf84 */ { 0xffff, 1146 }, }; -static const u_int16_t mac_korean_uni2_pagefe[][2] = { +static const uint16_t mac_korean_uni2_pagefe[][2] = { /* 0xfe5 */ { 0x0600, 1162 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xfe8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xfec */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, @@ -141,7 +141,7 @@ static const cjk_index_t mac_korean_uni2_index[] = { { { 0, 0 }, NULL } }; -static const u_int16_t mac_korean_uni2_charset[] = { +static const uint16_t mac_korean_uni2_charset[] = { 0x0080, 0xa1cb, 0xa1cc, 0xa1cd, 0x0083, 0xa65c, 0xa1fe, 0xffff, 0xffff, 0xa1a4, 0xa65d, 0xa198, 0xa2b0, 0xa2a6, 0xa76a, 0xa1a9, 0xa1aa, 0xffff, 0xa1ab, 0xa170, 0xa16f, 0xa655, 0xa5de, 0xadad, @@ -291,12 +291,12 @@ static const u_int16_t mac_korean_uni2_charset[] = { 0xffff, 0xffff, }; -static const u_int16_t mac_korean_2uni_page00[][2] = { +static const uint16_t mac_korean_2uni_page00[][2] = { /* 0x008 */ { 0x001f, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x8000, 5 }, }; -static const u_int16_t mac_korean_2uni_pagea1[][2] = { +static const uint16_t mac_korean_2uni_pagea1[][2] = { /* 0xa14 */ { 0xfffe, 6 }, { 0xffff, 21 }, { 0xffff, 37 }, { 0x3fff, 53 }, /* 0xa18 */ { 0xfffe, 67 }, { 0xf7ff, 82 }, { 0x2e11, 97 }, { 0x0000, 0 }, /* 0xa1c */ { 0x3800, 103 }, { 0x0000, 0 }, { 0x3000, 106 }, { 0x4000, 108 }, @@ -355,7 +355,7 @@ static const cjk_index_t mac_korean_2uni_index[] = { { { 0, 0 }, NULL } }; -static const u_int16_t mac_korean_2uni_charset[] = { +static const uint16_t mac_korean_2uni_charset[] = { 0x00a0, 0x20a9, 0xe022, 0x00a9, 0xe41c, 0xe02b, 0xe12a, 0xe12e, 0xe128, 0xe12c, 0xe129, 0xe12d, 0xe130, 0xe132, 0xe125, 0xe126, 0xe123, 0xe124, 0xfe59, 0xfe5a, 0xe413, 0xe415, 0xe118, 0xe11e, @@ -503,7 +503,7 @@ static const u_int16_t mac_korean_2uni_charset[] = { 0x2036, 0xe02e, 0x2035, 0xe02c, 0xe08d, 0xe001, }; -static const u_int32_t mac_korean_compose[] = { +static const uint32_t mac_korean_compose[] = { 0x0021f877, 0x0021f87f, 0x0028f87c, 0x0028f87f, 0x0029f87c, 0x0029f87f, 0x002af877, 0x002d0308, 0x003020de, 0x003120de, 0x003220de, 0x003320de, diff --git a/libatalk/unicode/utf16_casetable.h b/libatalk/unicode/utf16_casetable.h index 9a1366e3..dab605f7 100644 --- a/libatalk/unicode/utf16_casetable.h +++ b/libatalk/unicode/utf16_casetable.h @@ -8,7 +8,7 @@ UnicodeData.txt is got from http://www.unicode.org/Public/UNIDATA/UnicodeData.txt */ -static const u_int16_t upper_table_1[704] = { +static const uint16_t upper_table_1[704] = { 0x0000, /*U+0000*/ /**/ 0x0001, /*U+0001*/ /**/ 0x0002, /*U+0002*/ /**/ @@ -715,7 +715,7 @@ static const u_int16_t upper_table_1[704] = { 0x02BF, /*U+02BF*/ /**/ }; -static const u_int16_t upper_table_2[640] = { +static const uint16_t upper_table_2[640] = { 0x0340, /*U+0340*/ /**/ 0x0341, /*U+0341*/ /**/ 0x0342, /*U+0342*/ /**/ @@ -1358,7 +1358,7 @@ static const u_int16_t upper_table_2[640] = { 0x05BF, /*U+05BF*/ /**/ }; -static const u_int16_t upper_table_3[64] = { +static const uint16_t upper_table_3[64] = { 0x1D40, /*U+1D40*/ /**/ 0x1D41, /*U+1D41*/ /**/ 0x1D42, /*U+1D42*/ /**/ @@ -1425,7 +1425,7 @@ static const u_int16_t upper_table_3[64] = { 0x1D7F, /*U+1D7F*/ /**/ }; -static const u_int16_t upper_table_4[512] = { +static const uint16_t upper_table_4[512] = { 0x1E00, /*U+1E00*/ /**/ 0x1E00, /*U+1E01*/ /*LATIN SMALL LETTER A WITH RING BELOW*/ 0x1E02, /*U+1E02*/ /**/ @@ -1940,7 +1940,7 @@ static const u_int16_t upper_table_4[512] = { 0x1FFF, /*U+1FFF*/ /**/ }; -static const u_int16_t upper_table_5[128] = { +static const uint16_t upper_table_5[128] = { 0x2140, /*U+2140*/ /**/ 0x2141, /*U+2141*/ /**/ 0x2142, /*U+2142*/ /**/ @@ -2071,7 +2071,7 @@ static const u_int16_t upper_table_5[128] = { 0x21BF, /*U+21BF*/ /**/ }; -static const u_int16_t upper_table_6[64] = { +static const uint16_t upper_table_6[64] = { 0x24C0, /*U+24C0*/ /**/ 0x24C1, /*U+24C1*/ /**/ 0x24C2, /*U+24C2*/ /**/ @@ -2138,7 +2138,7 @@ static const u_int16_t upper_table_6[64] = { 0x24FF, /*U+24FF*/ /**/ }; -static const u_int16_t upper_table_7[320] = { +static const uint16_t upper_table_7[320] = { 0x2C00, /*U+2C00*/ /**/ 0x2C01, /*U+2C01*/ /**/ 0x2C02, /*U+2C02*/ /**/ @@ -2461,7 +2461,7 @@ static const u_int16_t upper_table_7[320] = { 0x2D3F, /*U+2D3F*/ /**/ }; -static const u_int16_t upper_table_8[128] = { +static const uint16_t upper_table_8[128] = { 0xA640, /*U+A640*/ /**/ 0xA640, /*U+A641*/ /*CYRILLIC SMALL LETTER ZEMLYA*/ 0xA642, /*U+A642*/ /**/ @@ -2592,7 +2592,7 @@ static const u_int16_t upper_table_8[128] = { 0xA6BF, /*U+A6BF*/ /**/ }; -static const u_int16_t upper_table_9[192] = { +static const uint16_t upper_table_9[192] = { 0xA700, /*U+A700*/ /**/ 0xA701, /*U+A701*/ /**/ 0xA702, /*U+A702*/ /**/ @@ -2787,7 +2787,7 @@ static const u_int16_t upper_table_9[192] = { 0xA7BF, /*U+A7BF*/ /**/ }; -static const u_int16_t upper_table_10[64] = { +static const uint16_t upper_table_10[64] = { 0xFF40, /*U+FF40*/ /**/ 0xFF21, /*U+FF41*/ /*FULLWIDTH LATIN SMALL LETTER A*/ 0xFF22, /*U+FF42*/ /*FULLWIDTH LATIN SMALL LETTER B*/ @@ -2854,7 +2854,7 @@ static const u_int16_t upper_table_10[64] = { 0xFF7F, /*U+FF7F*/ /**/ }; -static const u_int32_t upper_table_sp_1[128] = { +static const uint32_t upper_table_sp_1[128] = { 0xD801DC00, /*0xD801DC00*/ /*U+010400*/ /*U+010400*/ /**/ 0xD801DC01, /*0xD801DC01*/ /*U+010401*/ /*U+010401*/ /**/ 0xD801DC02, /*0xD801DC02*/ /*U+010402*/ /*U+010402*/ /**/ @@ -2985,7 +2985,7 @@ static const u_int32_t upper_table_sp_1[128] = { 0xD801DC7F, /*0xD801DC7F*/ /*U+01047F*/ /*U+01047F*/ /**/ }; -static const u_int16_t lower_table_1[128] = { +static const uint16_t lower_table_1[128] = { 0x0000, /*U+0000*/ /**/ 0x0001, /*U+0001*/ /**/ 0x0002, /*U+0002*/ /**/ @@ -3116,7 +3116,7 @@ static const u_int16_t lower_table_1[128] = { 0x007F, /*U+007F*/ /**/ }; -static const u_int16_t lower_table_2[448] = { +static const uint16_t lower_table_2[448] = { 0x00E0, /*U+00C0*/ /*LATIN CAPITAL LETTER A WITH GRAVE*/ 0x00E1, /*U+00C1*/ /*LATIN CAPITAL LETTER A WITH ACUTE*/ 0x00E2, /*U+00C2*/ /*LATIN CAPITAL LETTER A WITH CIRCUMFLEX*/ @@ -3567,7 +3567,7 @@ static const u_int16_t lower_table_2[448] = { 0x027F, /*U+027F*/ /**/ }; -static const u_int16_t lower_table_3[576] = { +static const uint16_t lower_table_3[576] = { 0x0340, /*U+0340*/ /**/ 0x0341, /*U+0341*/ /**/ 0x0342, /*U+0342*/ /**/ @@ -4146,7 +4146,7 @@ static const u_int16_t lower_table_3[576] = { 0x057F, /*U+057F*/ /**/ }; -static const u_int16_t lower_table_4[128] = { +static const uint16_t lower_table_4[128] = { 0x1080, /*U+1080*/ /**/ 0x1081, /*U+1081*/ /**/ 0x1082, /*U+1082*/ /**/ @@ -4277,7 +4277,7 @@ static const u_int16_t lower_table_4[128] = { 0x10FF, /*U+10FF*/ /**/ }; -static const u_int16_t lower_table_5[512] = { +static const uint16_t lower_table_5[512] = { 0x1E01, /*U+1E00*/ /*LATIN CAPITAL LETTER A WITH RING BELOW*/ 0x1E01, /*U+1E01*/ /**/ 0x1E03, /*U+1E02*/ /*LATIN CAPITAL LETTER B WITH DOT ABOVE*/ @@ -4792,7 +4792,7 @@ static const u_int16_t lower_table_5[512] = { 0x1FFF, /*U+1FFF*/ /**/ }; -static const u_int16_t lower_table_6[192] = { +static const uint16_t lower_table_6[192] = { 0x2100, /*U+2100*/ /**/ 0x2101, /*U+2101*/ /**/ 0x2102, /*U+2102*/ /**/ @@ -4987,7 +4987,7 @@ static const u_int16_t lower_table_6[192] = { 0x21BF, /*U+21BF*/ /**/ }; -static const u_int16_t lower_table_7[128] = { +static const uint16_t lower_table_7[128] = { 0x2480, /*U+2480*/ /**/ 0x2481, /*U+2481*/ /**/ 0x2482, /*U+2482*/ /**/ @@ -5118,7 +5118,7 @@ static const u_int16_t lower_table_7[128] = { 0x24FF, /*U+24FF*/ /**/ }; -static const u_int16_t lower_table_8[256] = { +static const uint16_t lower_table_8[256] = { 0x2C30, /*U+2C00*/ /*GLAGOLITIC CAPITAL LETTER AZU*/ 0x2C31, /*U+2C01*/ /*GLAGOLITIC CAPITAL LETTER BUKY*/ 0x2C32, /*U+2C02*/ /*GLAGOLITIC CAPITAL LETTER VEDE*/ @@ -5377,7 +5377,7 @@ static const u_int16_t lower_table_8[256] = { 0x2CFF, /*U+2CFF*/ /**/ }; -static const u_int16_t lower_table_9[128] = { +static const uint16_t lower_table_9[128] = { 0xA641, /*U+A640*/ /*CYRILLIC CAPITAL LETTER ZEMLYA*/ 0xA641, /*U+A641*/ /**/ 0xA643, /*U+A642*/ /*CYRILLIC CAPITAL LETTER DZELO*/ @@ -5508,7 +5508,7 @@ static const u_int16_t lower_table_9[128] = { 0xA6BF, /*U+A6BF*/ /**/ }; -static const u_int16_t lower_table_10[192] = { +static const uint16_t lower_table_10[192] = { 0xA700, /*U+A700*/ /**/ 0xA701, /*U+A701*/ /**/ 0xA702, /*U+A702*/ /**/ @@ -5703,7 +5703,7 @@ static const u_int16_t lower_table_10[192] = { 0xA7BF, /*U+A7BF*/ /**/ }; -static const u_int16_t lower_table_11[64] = { +static const uint16_t lower_table_11[64] = { 0xFF00, /*U+FF00*/ /**/ 0xFF01, /*U+FF01*/ /**/ 0xFF02, /*U+FF02*/ /**/ @@ -5770,7 +5770,7 @@ static const u_int16_t lower_table_11[64] = { 0xFF3F, /*U+FF3F*/ /**/ }; -static const u_int32_t lower_table_sp_1[64] = { +static const uint32_t lower_table_sp_1[64] = { 0xD801DC28, /*0xD801DC00*/ /*U+010428*/ /*U+010400*/ /*DESERET CAPITAL LETTER LONG I*/ 0xD801DC29, /*0xD801DC01*/ /*U+010429*/ /*U+010401*/ /*DESERET CAPITAL LETTER LONG E*/ 0xD801DC2A, /*0xD801DC02*/ /*U+01042A*/ /*U+010402*/ /*DESERET CAPITAL LETTER LONG A*/ diff --git a/libatalk/unicode/util_unistr.c b/libatalk/unicode/util_unistr.c index 5e4ae859..9b018baa 100644 --- a/libatalk/unicode/util_unistr.c +++ b/libatalk/unicode/util_unistr.c @@ -285,7 +285,7 @@ static ucs2_t do_precomposition(unsigned int base, unsigned int comb) int min = 0; int max = PRECOMP_COUNT - 1; int mid; - u_int32_t sought = (base << 16) | comb, that; + uint32_t sought = (base << 16) | comb, that; /* binary search */ while (max >= min) { @@ -304,17 +304,17 @@ static ucs2_t do_precomposition(unsigned int base, unsigned int comb) } /* ------------------------ */ -static u_int32_t do_precomposition_sp(unsigned int base_sp, unsigned int comb_sp) +static uint32_t do_precomposition_sp(unsigned int base_sp, unsigned int comb_sp) { int min = 0; int max = PRECOMP_SP_COUNT - 1; int mid; - u_int64_t sought_sp = ((u_int64_t)base_sp << 32) | (u_int64_t)comb_sp, that_sp; + uint64_t sought_sp = ((uint64_t)base_sp << 32) | (uint64_t)comb_sp, that_sp; /* binary search */ while (max >= min) { mid = (min + max) / 2; - that_sp = ((u_int64_t)precompositions_sp[mid].base_sp << 32) | ((u_int64_t)precompositions_sp[mid].comb_sp); + that_sp = ((uint64_t)precompositions_sp[mid].base_sp << 32) | ((uint64_t)precompositions_sp[mid].comb_sp); if (that_sp < sought_sp) { min = mid + 1; } else if (that_sp > sought_sp) { @@ -328,13 +328,13 @@ static u_int32_t do_precomposition_sp(unsigned int base_sp, unsigned int comb_sp } /* -------------------------- */ -static u_int32_t do_decomposition(ucs2_t base) +static uint32_t do_decomposition(ucs2_t base) { int min = 0; int max = DECOMP_COUNT - 1; int mid; - u_int32_t sought = base; - u_int32_t result, that; + uint32_t sought = base; + uint32_t result, that; /* binary search */ while (max >= min) { @@ -354,14 +354,14 @@ static u_int32_t do_decomposition(ucs2_t base) } /* -------------------------- */ -static u_int64_t do_decomposition_sp(unsigned int base_sp) +static uint64_t do_decomposition_sp(unsigned int base_sp) { int min = 0; int max = DECOMP_SP_COUNT - 1; int mid; - u_int32_t sought_sp = base_sp; - u_int32_t that_sp; - u_int64_t result_sp; + uint32_t sought_sp = base_sp; + uint32_t that_sp; + uint64_t result_sp; /* binary search */ while (max >= min) { @@ -372,7 +372,7 @@ static u_int64_t do_decomposition_sp(unsigned int base_sp) } else if (that_sp > sought_sp) { max = mid - 1; } else { - result_sp = ((u_int64_t)decompositions_sp[mid].base_sp << 32) | ((u_int64_t)decompositions_sp[mid].comb_sp); + result_sp = ((uint64_t)decompositions_sp[mid].base_sp << 32) | ((uint64_t)decompositions_sp[mid].comb_sp); return result_sp; } } @@ -399,11 +399,11 @@ size_t precompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) { size_t i; ucs2_t base, comb; - u_int32_t base_sp, comb_sp; + uint32_t base_sp, comb_sp; ucs2_t *in, *out; ucs2_t lindex, vindex; ucs2_t result; - u_int32_t result_sp; + uint32_t result_sp; size_t o_len = *outlen; if (!inplen || (inplen & 1) || inplen > o_len) @@ -454,9 +454,9 @@ size_t precompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) /* Binary Search for Surrogate Pair */ else if ((0xD800 <= base) && (base < 0xDC00)) { if ((0xDC00 <= comb) && (comb < 0xE000) && (i + 4 <= inplen)) { - base_sp = ((u_int32_t)base << 16) | (u_int32_t)comb; + base_sp = ((uint32_t)base << 16) | (uint32_t)comb; do { - comb_sp = ((u_int32_t)in[1] << 16) | (u_int32_t)in[2]; + comb_sp = ((uint32_t)in[1] << 16) | (uint32_t)in[2]; if (result_sp = do_precomposition_sp(base_sp, comb_sp)) { base_sp = result_sp; i += 4; @@ -508,11 +508,11 @@ size_t decompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) size_t i; size_t comblen; ucs2_t base, comb[COMBBUFLEN]; - u_int32_t base_sp; + uint32_t base_sp; ucs2_t sindex, tjamo; ucs2_t *in, *out; unsigned int result; - u_int64_t result_sp; + uint64_t result_sp; size_t o_len = *outlen; if (!inplen || (inplen & 1)) @@ -550,7 +550,7 @@ size_t decompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) /* Binary Search for Surrogate Pair */ else if ((0xD800 <= base) && (base < 0xDC00)) { if (i + 2 < inplen) { - base_sp = ((u_int32_t)base << 16) | (u_int32_t)in[1]; + base_sp = ((uint32_t)base << 16) | (uint32_t)in[1]; do { if ( !(result_sp = do_decomposition_sp(base_sp))) break; comblen += 2; diff --git a/libatalk/util/server_ipc.c b/libatalk/util/server_ipc.c index c258398d..ed4e1261 100644 --- a/libatalk/util/server_ipc.c +++ b/libatalk/util/server_ipc.c @@ -69,8 +69,8 @@ static int ipc_kill_token(struct ipc_header *ipc, server_child *children) /* ----------------- */ static int ipc_get_session(struct ipc_header *ipc, server_child *children) { - u_int32_t boottime; - u_int32_t idlen; + uint32_t boottime; + uint32_t idlen; char *clientid, *p; -- 2.39.2