checkpolicy: dis* fixed signed vs unsigned errors

A number of places we used unsigned variables and compared them against
signed variables.  This patch makes everything unsigned.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Eric Paris 2011-11-03 16:30:13 -04:00
parent 14e4b70b93
commit 44d8a2fed9
2 changed files with 13 additions and 13 deletions

View File

@ -115,7 +115,7 @@ static void display_id(policydb_t * p, FILE * fp, uint32_t symbol_type,
int display_type_set(type_set_t * set, uint32_t flags, policydb_t * policy,
FILE * fp)
{
int i, num_types;
unsigned int i, num_types;
if (set->flags & TYPE_STAR) {
fprintf(fp, " * ");
@ -178,7 +178,7 @@ int display_type_set(type_set_t * set, uint32_t flags, policydb_t * policy,
int display_mod_role_set(role_set_t * roles, policydb_t * p, FILE * fp)
{
int i, num = 0;
unsigned int i, num = 0;
if (roles->flags & ROLE_STAR) {
fprintf(fp, " * ");
@ -299,7 +299,7 @@ int display_type_callback(hashtab_key_t key, hashtab_datum_t datum, void *data)
{
type_datum_t *type;
FILE *fp;
int i, first_attrib = 1;
unsigned int i, first_attrib = 1;
type = (type_datum_t *) datum;
fp = (FILE *) data;
@ -346,7 +346,7 @@ int display_types(policydb_t * p, FILE * fp)
int display_users(policydb_t * p, FILE * fp)
{
int i, j;
unsigned int i, j;
ebitmap_t *bitmap;
for (i = 0; i < p->p_users.nprim; i++) {
display_id(p, fp, SYM_USERS, i, "");
@ -365,7 +365,7 @@ int display_users(policydb_t * p, FILE * fp)
int display_bools(policydb_t * p, FILE * fp)
{
int i;
unsigned int i;
for (i = 0; i < p->p_bools.nprim; i++) {
display_id(p, fp, SYM_BOOLS, i, "");
@ -462,7 +462,7 @@ void display_initial_sids(policydb_t * p, FILE * fp)
void display_class_set(ebitmap_t *classes, policydb_t *p, FILE *fp)
{
int i, num = 0;
unsigned int i, num = 0;
for (i = ebitmap_startbit(classes); i < ebitmap_length(classes); i++) {
if (!ebitmap_get_bit(classes, i))
@ -538,9 +538,9 @@ int role_display_callback(hashtab_key_t key, hashtab_datum_t datum, void *data)
static int display_scope_index(scope_index_t * indices, policydb_t * p,
FILE * out_fp)
{
int i;
unsigned int i;
for (i = 0; i < SYM_NUM; i++) {
int any_found = 0, j;
unsigned int any_found = 0, j;
fprintf(out_fp, "%s:", symbol_labels[i]);
for (j = ebitmap_startbit(&indices->scope[i]);
j < ebitmap_length(&indices->scope[i]); j++) {
@ -820,7 +820,7 @@ static void display_policycaps(policydb_t * p, FILE * fp)
ebitmap_node_t *node;
const char *capname;
char buf[64];
int i;
unsigned int i;
fprintf(fp, "policy capabilities:\n");
ebitmap_for_each_bit(&p->policycaps, node, i) {

View File

@ -157,7 +157,7 @@ int render_av_rule(avtab_key_t * key, avtab_datum_t * datum, uint32_t what,
int display_avtab(avtab_t * a, uint32_t what, policydb_t * p, FILE * fp)
{
int i;
unsigned int i;
avtab_ptr_t cur;
avtab_t expa;
@ -184,7 +184,7 @@ int display_avtab(avtab_t * a, uint32_t what, policydb_t * p, FILE * fp)
int display_bools(policydb_t * p, FILE * fp)
{
int i;
unsigned int i;
for (i = 0; i < p->p_bools.nprim; i++) {
fprintf(fp, "%s : %d\n", p->p_bool_val_to_name[i],
@ -304,7 +304,7 @@ static void display_policycaps(policydb_t * p, FILE * fp)
ebitmap_node_t *node;
const char *capname;
char buf[64];
int i;
unsigned int i;
fprintf(fp, "policy capabilities:\n");
ebitmap_for_each_bit(&p->policycaps, node, i) {
@ -329,7 +329,7 @@ static void display_id(policydb_t *p, FILE *fp, uint32_t symbol_type,
static void display_permissive(policydb_t *p, FILE *fp)
{
ebitmap_node_t *node;
int i;
unsigned int i;
fprintf(fp, "permissive sids:\n");
ebitmap_for_each_bit(&p->permissive_map, node, i) {