Silenced a warning of FreeBSD about shifting 32-bit dev_t by 32 bit.

Silenced warnings of FreeBSD about unused variables.
This commit is contained in:
Thomas Schmitt 2009-01-29 21:54:24 +01:00
parent b824db94dc
commit 313c4ff20f
2 changed files with 20 additions and 4 deletions

View File

@ -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++) {

View File

@ -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;
}