From 84d0675ac85bfe509c59809a2a89bc8a20033327 Mon Sep 17 00:00:00 2001 From: erikd Date: Sun, 19 Aug 2007 09:36:24 +0000 Subject: [PATCH] Make vorbis comment functions const correct. svn path=/trunk/vorbis/; revision=13571 --- include/vorbis/codec.h | 8 ++++---- lib/info.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/vorbis/codec.h b/include/vorbis/codec.h index 5a954dd..7b37e96 100644 --- a/include/vorbis/codec.h +++ b/include/vorbis/codec.h @@ -166,11 +166,11 @@ extern void vorbis_info_init(vorbis_info *vi); extern void vorbis_info_clear(vorbis_info *vi); extern int vorbis_info_blocksize(vorbis_info *vi,int zo); extern void vorbis_comment_init(vorbis_comment *vc); -extern void vorbis_comment_add(vorbis_comment *vc, char *comment); +extern void vorbis_comment_add(vorbis_comment *vc, const char *comment); extern void vorbis_comment_add_tag(vorbis_comment *vc, - char *tag, char *contents); -extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count); -extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag); + const char *tag, const char *contents); +extern char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count); +extern int vorbis_comment_query_count(vorbis_comment *vc, const char *tag); extern void vorbis_comment_clear(vorbis_comment *vc); extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb); diff --git a/lib/info.c b/lib/info.c index 7e1df89..8bbeb28 100644 --- a/lib/info.c +++ b/lib/info.c @@ -59,7 +59,7 @@ void vorbis_comment_init(vorbis_comment *vc){ memset(vc,0,sizeof(*vc)); } -void vorbis_comment_add(vorbis_comment *vc,char *comment){ +void vorbis_comment_add(vorbis_comment *vc,const char *comment){ vc->user_comments=_ogg_realloc(vc->user_comments, (vc->comments+2)*sizeof(*vc->user_comments)); vc->comment_lengths=_ogg_realloc(vc->comment_lengths, @@ -71,7 +71,7 @@ void vorbis_comment_add(vorbis_comment *vc,char *comment){ vc->user_comments[vc->comments]=NULL; } -void vorbis_comment_add_tag(vorbis_comment *vc, char *tag, char *contents){ +void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, const char *contents){ char *comment=alloca(strlen(tag)+strlen(contents)+2); /* +2 for = and \0 */ strcpy(comment, tag); strcat(comment, "="); @@ -91,7 +91,7 @@ static int tagcompare(const char *s1, const char *s2, int n){ return 0; } -char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count){ +char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count){ long i; int found = 0; int taglen = strlen(tag)+1; /* +1 for the = we append */ @@ -112,7 +112,7 @@ char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count){ return NULL; /* didn't find anything */ } -int vorbis_comment_query_count(vorbis_comment *vc, char *tag){ +int vorbis_comment_query_count(vorbis_comment *vc, const char *tag){ int i,count=0; int taglen = strlen(tag)+1; /* +1 for the = we append */ char *fulltag = alloca(taglen+1); -- 2.7.4