From 9ff74bcd219739b2ad684d6c7547a1cd8869ebd6 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 1 Apr 2021 01:06:57 -0500 Subject: [PATCH] asn1: Fix check/print type confusion --- lib/asn1/asn1_print.c | 2 +- lib/asn1/check-common.c | 4 ++-- lib/asn1/check-common.h | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/asn1/asn1_print.c b/lib/asn1/asn1_print.c index 0f3279393..7072f693e 100644 --- a/lib/asn1/asn1_print.c +++ b/lib/asn1/asn1_print.c @@ -72,7 +72,7 @@ static unsigned long indefinite_form_loop; static unsigned long indefinite_form_loop_max = 10000; typedef size_t (*lengther)(void *); -typedef size_t (*copyer)(const void *, void *); +typedef int (*copyer)(const void *, void *); typedef int (*encoder)(unsigned char *, size_t, void *, size_t *); typedef int (*decoder)(const unsigned char *, size_t, void *, size_t *); typedef char *(*printer)(const void *, int); diff --git a/lib/asn1/check-common.c b/lib/asn1/check-common.c index 95999709b..8a6b5dacd 100644 --- a/lib/asn1/check-common.c +++ b/lib/asn1/check-common.c @@ -197,9 +197,9 @@ generic_test (const struct test_case *tests, unsigned ntests, size_t data_size, int (ASN1CALL *encode)(unsigned char *, size_t, void *, size_t *), - int (ASN1CALL *length)(void *), + size_t (ASN1CALL *length)(void *), int (ASN1CALL *decode)(unsigned char *, size_t, void *, size_t *), - int (ASN1CALL *free_data)(void *), + void (ASN1CALL *free_data)(void *), int (*cmp)(void *a, void *b), int (ASN1CALL *copy)(const void *from, void *to)) { diff --git a/lib/asn1/check-common.h b/lib/asn1/check-common.h index c10fec28c..97d118997 100644 --- a/lib/asn1/check-common.h +++ b/lib/asn1/check-common.h @@ -58,9 +58,9 @@ struct test_case { }; typedef int (ASN1CALL *generic_encode)(unsigned char *, size_t, void *, size_t *); -typedef int (ASN1CALL *generic_length)(void *); +typedef size_t (ASN1CALL *generic_length)(void *); typedef int (ASN1CALL *generic_decode)(unsigned char *, size_t, void *, size_t *); -typedef int (ASN1CALL *generic_free)(void *); +typedef void (ASN1CALL *generic_free)(void *); typedef int (ASN1CALL *generic_copy)(const void *, void *); int @@ -68,9 +68,9 @@ generic_test (const struct test_case *tests, unsigned ntests, size_t data_size, int (ASN1CALL *encode)(unsigned char *, size_t, void *, size_t *), - int (ASN1CALL *length)(void *), + size_t (ASN1CALL *length)(void *), int (ASN1CALL *decode)(unsigned char *, size_t, void *, size_t *), - int (ASN1CALL *free_data)(void *), + void (ASN1CALL *free_data)(void *), int (*cmp)(void *a, void *b), int (ASN1CALL *copy)(const void *a, void *b)); -- 2.11.4.GIT