clean up const warnings

This commit is contained in:
David Lawrence
2000-11-15 22:38:51 +00:00
parent 61632c1973
commit 5ed0ffc1f7
4 changed files with 13 additions and 5 deletions

View File

@@ -275,8 +275,16 @@ void ASN1_OBJECT_free(ASN1_OBJECT *a)
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS)
{
#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause memory leaks */
if (a->sn != NULL) Free((void *)a->sn);
if (a->ln != NULL) Free((void *)a->ln);
union { const void *k; void *v; } u;
if (a->sn != NULL) {
u.k = a->sn;
Free(u.v);
}
if (a->ln != NULL) {
u.k = a->ln;
Free(u.v);
}
#endif
a->sn=a->ln=NULL;
}

View File

@@ -95,7 +95,7 @@ void sk_##type##_free(STACK_OF(type) *sk) \
int sk_##type##_num(const STACK_OF(type) *sk) \
{ return M_sk_num((const STACK *)sk); } \
type *sk_##type##_value(const STACK_OF(type) *sk,int n) \
{ return (type *)sk_value((STACK *)sk,n); } \
{ return (type *)sk_value((const STACK *)sk,n); } \
type *sk_##type##_set(STACK_OF(type) *sk,int n,type *v) \
{ return (type *)(sk_set((STACK *)sk,n,(char *)v)); } \
void sk_##type##_zero(STACK_OF(type) *sk) \

View File

@@ -80,7 +80,7 @@ typedef struct stack_st
#define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL)
int sk_num(STACK *);
char *sk_value(STACK *, int);
char *sk_value(const STACK *, int);
char *sk_set(STACK *, int, char *);

View File

@@ -289,7 +289,7 @@ int sk_num(STACK *st)
return st->num;
}
char *sk_value(STACK *st, int i)
char *sk_value(const STACK *st, int i)
{
if(st == NULL) return NULL;
return st->data[i];