Constness.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1882 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user