Fix calling convention for asn1 tests
authorAsanka Herath <asanka@secure-endpoints.com>
Mon, 23 Aug 2010 17:34:40 +0000 (13:34 -0400)
committerAsanka C. Herath <asanka@secure-endpoints.com>
Tue, 14 Sep 2010 12:03:27 +0000 (08:03 -0400)
lib/asn1/check-common.c
lib/asn1/check-common.h

index 886be89e3a5f5e0a4b6431af24b48845aa7d5982..1848e4dbd2450fc92eba809f5058f8b5ed3985b7 100644 (file)
@@ -44,6 +44,7 @@
 #include <err.h>
 #include <roken.h>
 
+#include "asn1-common.h"
 #include "check-common.h"
 
 RCSID("$Id$");
@@ -195,12 +196,12 @@ int
 generic_test (const struct test_case *tests,
              unsigned ntests,
              size_t data_size,
-             int (*encode)(unsigned char *, size_t, void *, size_t *),
-             int (*length)(void *),
-             int (*decode)(unsigned char *, size_t, void *, size_t *),
-             int (*free_data)(void *),
+             int (ASN1CALL *encode)(unsigned char *, size_t, void *, size_t *),
+             int (ASN1CALL *length)(void *),
+             int (ASN1CALL *decode)(unsigned char *, size_t, void *, size_t *),
+             int (ASN1CALL *free_data)(void *),
              int (*cmp)(void *a, void *b),
-             int (*copy)(const void *from, void *to))
+             int (ASN1CALL *copy)(const void *from, void *to))
 {
     unsigned char *buf, *buf2;
     int i;
@@ -353,7 +354,7 @@ int
 generic_decode_fail (const struct test_case *tests,
                     unsigned ntests,
                     size_t data_size,
-                    int (*decode)(unsigned char *, size_t, void *, size_t *))
+                    int (ASN1CALL *decode)(unsigned char *, size_t, void *, size_t *))
 {
     unsigned char *buf;
     int i;
index 9a36dbcc1015c5b527af975adc26bbbd60404b29..9ecbdbc35ded26688e33546593b23dc3c17e717c 100644 (file)
@@ -40,28 +40,28 @@ struct test_case {
     char *name;
 };
 
-typedef int (*generic_encode)(unsigned char *, size_t, void *, size_t *);
-typedef int (*generic_length)(void *);
-typedef int (*generic_decode)(unsigned char *, size_t, void *, size_t *);
-typedef int (*generic_free)(void *);
-typedef int (*generic_copy)(const void *, void *);
+typedef int (ASN1CALL *generic_encode)(unsigned char *, size_t, void *, size_t *);
+typedef int (ASN1CALL *generic_length)(void *);
+typedef int (ASN1CALL *generic_decode)(unsigned char *, size_t, void *, size_t *);
+typedef int (ASN1CALL *generic_free)(void *);
+typedef int (ASN1CALL *generic_copy)(const void *, void *);
 
 int
 generic_test (const struct test_case *tests,
              unsigned ntests,
              size_t data_size,
-             int (*encode)(unsigned char *, size_t, void *, size_t *),
-             int (*length)(void *),
-             int (*decode)(unsigned char *, size_t, void *, size_t *),
-             int (*free_data)(void *),
+             int (ASN1CALL *encode)(unsigned char *, size_t, void *, size_t *),
+             int (ASN1CALL *length)(void *),
+             int (ASN1CALL *decode)(unsigned char *, size_t, void *, size_t *),
+             int (ASN1CALL *free_data)(void *),
              int (*cmp)(void *a, void *b),
-             int (*copy)(const void *a, void *b));
+             int (ASN1CALL *copy)(const void *a, void *b));
 
 int
 generic_decode_fail(const struct test_case *tests,
                    unsigned ntests,
                    size_t data_size,
-                   int (*decode)(unsigned char *, size_t, void *, size_t *));
+                   int (ASN1CALL *decode)(unsigned char *, size_t, void *, size_t *));
 
 
 struct map_page;