[xiph-commits] r13571 - in trunk/vorbis: include/vorbis lib

erikd at svn.xiph.org erikd at svn.xiph.org
Sun Aug 19 02:36:24 PDT 2007


Author: erikd
Date: 2007-08-19 02:36:24 -0700 (Sun, 19 Aug 2007)
New Revision: 13571

Modified:
   trunk/vorbis/include/vorbis/codec.h
   trunk/vorbis/lib/info.c
Log:
Make vorbis comment functions const correct.

Modified: trunk/vorbis/include/vorbis/codec.h
===================================================================
--- trunk/vorbis/include/vorbis/codec.h	2007-08-19 03:35:32 UTC (rev 13570)
+++ trunk/vorbis/include/vorbis/codec.h	2007-08-19 09:36:24 UTC (rev 13571)
@@ -166,11 +166,11 @@
 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);

Modified: trunk/vorbis/lib/info.c
===================================================================
--- trunk/vorbis/lib/info.c	2007-08-19 03:35:32 UTC (rev 13570)
+++ trunk/vorbis/lib/info.c	2007-08-19 09:36:24 UTC (rev 13571)
@@ -59,7 +59,7 @@
   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 @@
   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 @@
   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 @@
   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);



More information about the commits mailing list