Update perl asm scripts include paths for perlasm.
[openssl.git] / crypto / asn1 / tasn_new.c
index 9216342fec945bb40b1180bfcec8622a9398862a..95e7de25aa040da730ac91681e4860af7f030d70 100644 (file)
@@ -68,7 +68,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
                                                                int combine);
 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
 static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
-void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
+static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
 
 ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it)
        {
@@ -146,7 +146,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
                case ASN1_ITYPE_CHOICE:
                if (asn1_cb)
                        {
-                       i = asn1_cb(ASN1_OP_NEW_PRE, pval, it);
+                       i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
                        if (!i)
                                goto auxerr;
                        if (i==2)
@@ -166,7 +166,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
                        memset(*pval, 0, it->size);
                        }
                asn1_set_choice_selector(pval, -1, it);
-               if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it))
+               if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
                                goto auxerr;
                break;
 
@@ -174,7 +174,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
                case ASN1_ITYPE_SEQUENCE:
                if (asn1_cb)
                        {
-                       i = asn1_cb(ASN1_OP_NEW_PRE, pval, it);
+                       i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
                        if (!i)
                                goto auxerr;
                        if (i==2)
@@ -201,7 +201,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
                        if (!ASN1_template_new(pseqval, tt))
                                goto memerr;
                        }
-               if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it))
+               if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
                                goto auxerr;
                break;
        }
@@ -326,11 +326,13 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
        {
        ASN1_TYPE *typ;
        int utype;
-       const ASN1_PRIMITIVE_FUNCS *pf;
-       pf = it->funcs;
 
-       if (pf && pf->prim_new)
-               return pf->prim_new(pval, it);
+       if (it && it->funcs)
+               {
+               const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
+               if (pf->prim_new)
+                       return pf->prim_new(pval, it);
+               }
 
        if (!it || (it->itype == ASN1_ITYPE_MSTRING))
                utype = -1;
@@ -343,10 +345,7 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
                return 1;
 
                case V_ASN1_BOOLEAN:
-               if (it)
-                       *(ASN1_BOOLEAN *)pval = it->size;
-               else
-                       *(ASN1_BOOLEAN *)pval = -1;
+               *(ASN1_BOOLEAN *)pval = it->size;
                return 1;
 
                case V_ASN1_NULL:
@@ -371,13 +370,12 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
        return 0;
        }
 
-void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
+static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
        {
        int utype;
-       const ASN1_PRIMITIVE_FUNCS *pf;
-       pf = it->funcs;
-       if (pf)
+       if (it && it->funcs)
                {
+               const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
                if (pf->prim_clear)
                        pf->prim_clear(pval, it);
                else