From ec18d735e1a879a188411e1027e4dd6f8412d19d Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 11 Jun 2004 01:08:23 +0000 Subject: [PATCH] * asn1_encode.c (asn1_encode_generaltime): Fix memcpy argument to actually be a pointer. (asn1_encode_enumerated): Drop "const" from scalar argument type. * asn1_encode.h (asn1_encode_integer, asn1_encode_enumerated, asn1_encode_unsigned_integer, asn1_encode_octetstring, asn1_encode_charstring, asn1_encode_printablestring, asn1_encode_ia5string, asn1_encode_generaltime, asn1_encode_generalstring): Drop "const" from scalar argument types. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16431 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/ChangeLog | 12 ++++++++++++ src/lib/krb5/asn.1/asn1_encode.c | 4 ++-- src/lib/krb5/asn.1/asn1_encode.h | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index f788a2f51..ce20ff65c 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,3 +1,15 @@ +2004-06-10 Ken Raeburn + + * asn1_encode.c (asn1_encode_generaltime): Fix memcpy argument to + actually be a pointer. + (asn1_encode_enumerated): Drop "const" from scalar argument type. + * asn1_encode.h (asn1_encode_integer, asn1_encode_enumerated, + asn1_encode_unsigned_integer, asn1_encode_octetstring, + asn1_encode_charstring, asn1_encode_printablestring, + asn1_encode_ia5string, asn1_encode_generaltime, + asn1_encode_generalstring): Drop "const" from scalar argument + types. + 2004-06-04 Ken Raeburn * asn1_encode.c (asn1_encode_generaltime): Use gmtime_r if diff --git a/src/lib/krb5/asn.1/asn1_encode.c b/src/lib/krb5/asn.1/asn1_encode.c index 9d2912800..4f9e6949b 100644 --- a/src/lib/krb5/asn.1/asn1_encode.c +++ b/src/lib/krb5/asn.1/asn1_encode.c @@ -80,7 +80,7 @@ asn1_error_code asn1_encode_integer(asn1buf * buf, long val, } asn1_error_code -asn1_encode_enumerated(asn1buf * buf, const long val, +asn1_encode_enumerated(asn1buf * buf, long val, unsigned int *retlen) { asn1_error_code retval; @@ -248,7 +248,7 @@ asn1_error_code asn1_encode_generaltime(asn1buf *buf, time_t val, gtime = gmtime(&gmt_time); if (gtime == NULL) return ASN1_BAD_GMTIME; - memcpy(gtimebuf, gtime, sizeof(gtimebuf)); + memcpy(>imebuf, gtime, sizeof(gtimebuf)); #endif gtime = >imebuf; diff --git a/src/lib/krb5/asn.1/asn1_encode.h b/src/lib/krb5/asn.1/asn1_encode.h index 2acabc294..79eee48d5 100644 --- a/src/lib/krb5/asn.1/asn1_encode.h +++ b/src/lib/krb5/asn.1/asn1_encode.h @@ -50,7 +50,7 @@ */ asn1_error_code asn1_encode_integer - (asn1buf *buf, const long val, unsigned int *retlen); + (asn1buf *buf, long val, unsigned int *retlen); /* requires *buf is allocated modifies *buf, *retlen effects Inserts the encoding of val into *buf and returns @@ -59,10 +59,10 @@ asn1_error_code asn1_encode_integer to expand the buffer. */ asn1_error_code asn1_encode_enumerated -(asn1buf *buf, const long val, unsigned int *retlen); +(asn1buf *buf, long val, unsigned int *retlen); asn1_error_code asn1_encode_unsigned_integer - (asn1buf *buf, const unsigned long val, + (asn1buf *buf, unsigned long val, unsigned int *retlen); /* requires *buf is allocated modifies *buf, *retlen @@ -73,7 +73,7 @@ asn1_error_code asn1_encode_unsigned_integer asn1_error_code asn1_encode_octetstring (asn1buf *buf, - const unsigned int len, const asn1_octet *val, + unsigned int len, const asn1_octet *val, unsigned int *retlen); /* requires *buf is allocated modifies *buf, *retlen @@ -84,7 +84,7 @@ asn1_error_code asn1_encode_octetstring asn1_error_code asn1_encode_oid (asn1buf *buf, - const unsigned int len, const asn1_octet *val, + unsigned int len, const asn1_octet *val, unsigned int *retlen); /* requires *buf is allocated modifies *buf, *retlen @@ -95,7 +95,7 @@ asn1_error_code asn1_encode_oid asn1_error_code asn1_encode_charstring (asn1buf *buf, - const unsigned int len, const char *val, + unsigned int len, const char *val, unsigned int *retlen); /* requires *buf is allocated modifies *buf, *retlen @@ -115,7 +115,7 @@ asn1_error_code asn1_encode_null asn1_error_code asn1_encode_printablestring (asn1buf *buf, - const unsigned int len, const char *val, + unsigned int len, const char *val, int *retlen); /* requires *buf is allocated modifies *buf, *retlen @@ -126,7 +126,7 @@ asn1_error_code asn1_encode_printablestring asn1_error_code asn1_encode_ia5string (asn1buf *buf, - const unsigned int len, const char *val, + unsigned int len, const char *val, int *retlen); /* requires *buf is allocated modifies *buf, *retlen @@ -136,7 +136,7 @@ asn1_error_code asn1_encode_ia5string to expand the buffer. */ asn1_error_code asn1_encode_generaltime - (asn1buf *buf, const time_t val, unsigned int *retlen); + (asn1buf *buf, time_t val, unsigned int *retlen); /* requires *buf is allocated modifies *buf, *retlen effects Inserts the encoding of val into *buf and returns @@ -147,7 +147,7 @@ asn1_error_code asn1_encode_generaltime asn1_error_code asn1_encode_generalstring (asn1buf *buf, - const unsigned int len, const char *val, + unsigned int len, const char *val, unsigned int *retlen); /* requires *buf is allocated, val has a length of len characters modifies *buf, *retlen -- 2.26.2