diff options
author | Nils Larsch <nils@openssl.org> | 2005-04-05 10:29:43 +0000 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2005-04-05 10:29:43 +0000 |
commit | 70f34a58411014e76dd03ed6ac0b1bdb95b53b16 (patch) | |
tree | f8c42b1de09721ac83f07abd04c44f05a43465d1 /crypto/objects | |
parent | c2e40d0f9a417bb5bb4d7c53ffb7d07229caffb8 (diff) | |
download | openssl-70f34a58411014e76dd03ed6ac0b1bdb95b53b16.tar.gz |
some const fixes and cleanup
Diffstat (limited to 'crypto/objects')
-rw-r--r-- | crypto/objects/o_names.c | 6 | ||||
-rw-r--r-- | crypto/objects/obj_dat.c | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c index 28c9370ca3..adb5731f76 100644 --- a/crypto/objects/o_names.c +++ b/crypto/objects/o_names.c @@ -111,8 +111,8 @@ int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *), static int obj_name_cmp(const void *a_void, const void *b_void) { int ret; - OBJ_NAME *a = (OBJ_NAME *)a_void; - OBJ_NAME *b = (OBJ_NAME *)b_void; + const OBJ_NAME *a = (const OBJ_NAME *)a_void; + const OBJ_NAME *b = (const OBJ_NAME *)b_void; ret=a->type-b->type; if (ret == 0) @@ -133,7 +133,7 @@ static int obj_name_cmp(const void *a_void, const void *b_void) static unsigned long obj_name_hash(const void *a_void) { unsigned long ret; - OBJ_NAME *a = (OBJ_NAME *)a_void; + const OBJ_NAME *a = (const OBJ_NAME *)a_void; if ((name_funcs_stack != NULL) && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) { diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index 15f813a489..700a0b6d3c 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -115,7 +115,7 @@ static unsigned long add_hash(const void *ca_void) int i; unsigned long ret=0; unsigned char *p; - ADDED_OBJ *ca = (ADDED_OBJ *)ca_void; + const ADDED_OBJ *ca = (const ADDED_OBJ *)ca_void; a=ca->obj; switch (ca->type) @@ -149,8 +149,8 @@ static int add_cmp(const void *ca_void, const void *cb_void) { ASN1_OBJECT *a,*b; int i; - ADDED_OBJ *ca = (ADDED_OBJ *)ca_void; - ADDED_OBJ *cb = (ADDED_OBJ *)cb_void; + const ADDED_OBJ *ca = (const ADDED_OBJ *)ca_void; + const ADDED_OBJ *cb = (const ADDED_OBJ *)cb_void; i=ca->type-cb->type; if (i) return(i); @@ -161,7 +161,7 @@ static int add_cmp(const void *ca_void, const void *cb_void) case ADDED_DATA: i=(a->length - b->length); if (i) return(i); - return(memcmp(a->data,b->data,a->length)); + return(memcmp(a->data,b->data,(size_t)a->length)); case ADDED_SNAME: if (a->sn == NULL) return(-1); else if (b->sn == NULL) return(1); @@ -382,8 +382,8 @@ int OBJ_obj2nid(const ASN1_OBJECT *a) adp=(ADDED_OBJ *)lh_retrieve(added,&ad); if (adp != NULL) return (adp->obj->nid); } - op=(ASN1_OBJECT **)OBJ_bsearch((char *)&a,(char *)obj_objs,NUM_OBJ, - sizeof(ASN1_OBJECT *),obj_cmp); + op=(ASN1_OBJECT **)OBJ_bsearch((const char *)&a,(const char *)obj_objs, + NUM_OBJ, sizeof(ASN1_OBJECT *),obj_cmp); if (op == NULL) return(NID_undef); return((*op)->nid); @@ -521,7 +521,7 @@ int OBJ_ln2nid(const char *s) adp=(ADDED_OBJ *)lh_retrieve(added,&ad); if (adp != NULL) return (adp->obj->nid); } - op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)ln_objs,NUM_LN, + op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)ln_objs, NUM_LN, sizeof(ASN1_OBJECT *),ln_cmp); if (op == NULL) return(NID_undef); return((*op)->nid); @@ -549,8 +549,8 @@ int OBJ_sn2nid(const char *s) static int obj_cmp(const void *ap, const void *bp) { int j; - ASN1_OBJECT *a= *(ASN1_OBJECT **)ap; - ASN1_OBJECT *b= *(ASN1_OBJECT **)bp; + const ASN1_OBJECT *a= *(ASN1_OBJECT * const *)ap; + const ASN1_OBJECT *b= *(ASN1_OBJECT * const *)bp; j=(a->length - b->length); if (j) return(j); |