From 415cbbf252ca1a0d130e06322455884df2685986 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Tue, 10 Jun 1997 12:53:28 +0000 Subject: [PATCH] Constness. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1882 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/asn1/der.h | 4 ++-- lib/asn1/der_copy.c | 4 ++-- lib/asn1/gen_copy.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/asn1/der.h b/lib/asn1/der.h index f861449a6..dfa534d41 100644 --- a/lib/asn1/der.h +++ b/lib/asn1/der.h @@ -71,8 +71,8 @@ size_t length_general_string (general_string *data); size_t length_octet_string (octet_string *k); size_t length_generalized_time (time_t *t); -void copy_general_string (general_string *from, general_string *to); -void copy_octet_string (octet_string *from, octet_string *to); +void copy_general_string (const general_string *from, general_string *to); +void copy_octet_string (const octet_string *from, octet_string *to); int fix_dce(int reallen, int *len); diff --git a/lib/asn1/der_copy.c b/lib/asn1/der_copy.c index a4265a225..5dfe87002 100644 --- a/lib/asn1/der_copy.c +++ b/lib/asn1/der_copy.c @@ -3,14 +3,14 @@ RCSID("$Id$"); void -copy_general_string (general_string *from, general_string *to) +copy_general_string (const general_string *from, general_string *to) { *to = malloc(strlen(*from) + 1); strcpy(*to, *from); } void -copy_octet_string (octet_string *from, octet_string *to) +copy_octet_string (const octet_string *from, octet_string *to) { to->length = from->length; to->data = malloc(to->length); diff --git a/lib/asn1/gen_copy.c b/lib/asn1/gen_copy.c index 8ee9065cd..7ce72884b 100644 --- a/lib/asn1/gen_copy.c +++ b/lib/asn1/gen_copy.c @@ -91,11 +91,11 @@ void generate_type_copy (Symbol *s) { fprintf (headerfile, - "void copy_%s(%s *, %s *);\n", + "void copy_%s(const %s *, %s *);\n", s->gen_name, s->gen_name, s->gen_name); fprintf (codefile, "void\n" - "copy_%s(%s *from, %s *to)\n" + "copy_%s(const %s *from, %s *to)\n" "{\n", s->gen_name, s->gen_name, s->gen_name);