From 313c4ff20f02fd63bde339398529baa50df9766f Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 29 Jan 2009 21:54:24 +0100 Subject: [PATCH] Silenced a warning of FreeBSD about shifting 32-bit dev_t by 32 bit. Silenced warnings of FreeBSD about unused variables. --- libisofs/aaip-os-freebsd.c | 8 ++++---- libisofs/rockridge_read.c | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/libisofs/aaip-os-freebsd.c b/libisofs/aaip-os-freebsd.c index 52286e8..8e4db11 100644 --- a/libisofs/aaip-os-freebsd.c +++ b/libisofs/aaip-os-freebsd.c @@ -125,10 +125,10 @@ int aaip_get_acl_text(char *path, char **text, int flag) int aaip_get_attr_list(char *path, size_t *num_attrs, char ***names, size_t **value_lengths, char ***values, int flag) { - int ret, retry= 0; + int ret; char *list= NULL; - ssize_t list_size= 0, i, num_names, value_ret; - size_t a_acl_len= 0, d_acl_len= 0, acl_len= 0; + ssize_t i, num_names; + size_t a_acl_len= 0, acl_len= 0; unsigned char *a_acl= NULL, *d_acl= NULL, *acl= NULL; char *acl_text= NULL; @@ -288,7 +288,7 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names, size_t *value_lengths, char **values, int flag) { int ret, has_default_acl= 0, was_xattr= 0; - size_t i, consumed, acl_text_fill, list_size= 0; + size_t i, consumed, acl_text_fill; char *acl_text= NULL, *list= NULL; for(i= 0; i < num_attrs; i++) { diff --git a/libisofs/rockridge_read.c b/libisofs/rockridge_read.c index 456f99b..564e86d 100644 --- a/libisofs/rockridge_read.c +++ b/libisofs/rockridge_read.c @@ -402,6 +402,8 @@ int read_rr_SL(struct susp_sys_user_entry *sl, char **dest, int *cont) */ int read_rr_PN(struct susp_sys_user_entry *pn, struct stat *st) { + int high_shift= 0; + if (pn == NULL || pn == NULL) { return ISO_NULL_POINTER; } @@ -413,8 +415,22 @@ int read_rr_PN(struct susp_sys_user_entry *pn, struct stat *st) return ISO_WRONG_RR; } + /* ts A90129 */ + /* (dev_t << 32) causes compiler warnings on FreeBSD. + RRIP 1.10 4.1.2 prescribes PN "Dev_t High" to be 0 on 32 bit dev_t. + */ + st->st_rdev = (dev_t)iso_read_bb(pn->data.PN.low, 4, NULL); + if (sizeof(st->st_rdev) > 4) { + high_shift = 32; + st->st_rdev |= (dev_t)((dev_t)iso_read_bb(pn->data.PN.high, 4, NULL) << + high_shift); + } + +/* <<< was originally: st->st_rdev = (dev_t)((dev_t)iso_read_bb(pn->data.PN.high, 4, NULL) << 32) | (dev_t)iso_read_bb(pn->data.PN.low, 4, NULL); +*/ + return ISO_SUCCESS; }