Fix comparisons between numbers with mismatched signedness in libqpol

Fix warnings reported by "gcc -Wsign-compare"
This commit is contained in:
Nicolas Iooss 2014-11-01 14:23:19 +01:00 committed by Chris PeBenito
parent b5da5313d4
commit b029b164c4
3 changed files with 5 additions and 5 deletions

View File

@ -709,7 +709,7 @@ int add_perm_to_class(uint32_t perm_value, uint32_t class_value)
assert(class_value >= 1); assert(class_value >= 1);
scope = &decl->required; scope = &decl->required;
if (class_value > scope->class_perms_len) { if (class_value > scope->class_perms_len) {
int i; uint32_t i;
ebitmap_t *new_map = realloc(scope->class_perms_map, ebitmap_t *new_map = realloc(scope->class_perms_map,
class_value * sizeof(*new_map)); class_value * sizeof(*new_map));
if (new_map == NULL) { if (new_map == NULL) {
@ -1233,7 +1233,7 @@ int require_cat(int pass)
static int is_scope_in_stack(scope_datum_t * scope, scope_stack_t * stack) static int is_scope_in_stack(scope_datum_t * scope, scope_stack_t * stack)
{ {
int i; uint32_t i;
if (stack == NULL) { if (stack == NULL) {
return 0; /* no matching scope found */ return 0; /* no matching scope found */
} }
@ -1490,7 +1490,7 @@ int begin_optional_else(int pass)
static int copy_requirements(avrule_decl_t * dest, scope_stack_t * stack) static int copy_requirements(avrule_decl_t * dest, scope_stack_t * stack)
{ {
int i; uint32_t i;
if (stack == NULL) { if (stack == NULL) {
return 0; return 0;
} }

View File

@ -915,7 +915,7 @@ int define_sens(void)
int define_dominance(void) int define_dominance(void)
{ {
level_datum_t *datum; level_datum_t *datum;
int order; uint32_t order;
char *id; char *id;
if (!mlspol) { if (!mlspol) {

View File

@ -539,7 +539,7 @@ static int qpol_policy_match_system(qpol_policy_t * policy)
errno = error; errno = error;
return -1; return -1;
} }
if (policy->p->p.policyvers > kernvers) { if (policy->p->p.policyvers > (unsigned)kernvers) {
if (sepol_policydb_set_vers(policy->p, kernvers)) { if (sepol_policydb_set_vers(policy->p, kernvers)) {
error = errno; error = errno;
ERR(policy, "Could not downgrade policy to version %d.", kernvers); ERR(policy, "Could not downgrade policy to version %d.", kernvers);