[MPlayer-cvslog] r19113 - in trunk: libaf/af_format.h libaf/format.c libmpcodecs/img_format.c libmpcodecs/img_format.h libmpdemux/asfheader.c libmpdemux/librtsp/rtsp.c libmpdemux/librtsp/rtsp.h libmpdemux/network.c libmpdemux/tvi_v4l2.c libvo/video_out.h

reynaldo subversion at mplayerhq.hu
Sun Jul 16 03:20:36 CEST 2006


Author: reynaldo
Date: Sun Jul 16 03:20:30 2006
New Revision: 19113

Modified:
   trunk/libaf/af_format.h
   trunk/libaf/format.c
   trunk/libmpcodecs/img_format.c
   trunk/libmpcodecs/img_format.h
   trunk/libmpdemux/asfheader.c
   trunk/libmpdemux/librtsp/rtsp.c
   trunk/libmpdemux/librtsp/rtsp.h
   trunk/libmpdemux/network.c
   trunk/libmpdemux/tvi_v4l2.c
   trunk/libvo/video_out.h

Log:
marks several read-only string parameters and function return-values which can only be used read-only  as const. Patch by Stefan Huehner, stefan _AT huener-org

Modified: trunk/libaf/af_format.h
==============================================================================
--- trunk/libaf/af_format.h	(original)
+++ trunk/libaf/af_format.h	Sun Jul 16 03:20:30 2006
@@ -84,11 +84,11 @@
 #define AF_FORMAT_FLOAT_NE AF_FORMAT_FLOAT_LE
 #endif
 
-extern int af_str2fmt(char *str);
-extern int af_str2fmt_short(char *str);
+extern int af_str2fmt(const char *str);
+extern int af_str2fmt_short(const char *str);
 extern int af_fmt2bits(int format);
 extern int af_bits2fmt(int bits);
 extern char* af_fmt2str(int format, char* str, int size);
-extern char* af_fmt2str_short(int format);
+extern const char* af_fmt2str_short(int format);
 
 #endif /* __af_format_h__ */

Modified: trunk/libaf/format.c
==============================================================================
--- trunk/libaf/format.c	(original)
+++ trunk/libaf/format.c	Sun Jul 16 03:20:30 2006
@@ -19,7 +19,7 @@
 #include "help_mp.h"
 
 // Convert from string to format
-int af_str2fmt(char* str)
+int af_str2fmt(const char* str)
 {
   int format=0;
   // Scan for endianess
@@ -178,7 +178,7 @@
     { NULL, 0 }
 };
 
-char *af_fmt2str_short(int format)
+const char *af_fmt2str_short(int format)
 {
     int i;
 
@@ -189,7 +189,7 @@
     return "??";
 }
 
-int af_str2fmt_short(char* str)
+int af_str2fmt_short(const char* str)
 {
     int i;
 

Modified: trunk/libmpcodecs/img_format.c
==============================================================================
--- trunk/libmpcodecs/img_format.c	(original)
+++ trunk/libmpcodecs/img_format.c	Sun Jul 16 03:20:30 2006
@@ -1,7 +1,7 @@
 #include "config.h"
 #include "img_format.h"
 
-char *vo_format_name(int format)
+const char *vo_format_name(int format)
 {
     switch(format)
     {

Modified: trunk/libmpcodecs/img_format.h
==============================================================================
--- trunk/libmpcodecs/img_format.h	(original)
+++ trunk/libmpcodecs/img_format.h	Sun Jul 16 03:20:30 2006
@@ -114,6 +114,6 @@
     int timestamp; // pts, 90000 Hz counter based
 } vo_mpegpes_t;
 
-char *vo_format_name(int format);
+const char *vo_format_name(int format);
 
 #endif

Modified: trunk/libmpdemux/asfheader.c
==============================================================================
--- trunk/libmpdemux/asfheader.c	(original)
+++ trunk/libmpdemux/asfheader.c	Sun Jul 16 03:20:30 2006
@@ -77,7 +77,7 @@
   mp_msg(MSGT_HEADER,MSGL_V,"%s%s\n", name, string);
 }
 
-static char* asf_chunk_type(unsigned char* guid) {
+static const char* asf_chunk_type(unsigned char* guid) {
   static char tmp[60];
   char *p;
   int i;

Modified: trunk/libmpdemux/librtsp/rtsp.c
==============================================================================
--- trunk/libmpdemux/librtsp/rtsp.c	(original)
+++ trunk/libmpdemux/librtsp/rtsp.c	Sun Jul 16 03:20:30 2006
@@ -705,7 +705,7 @@
 
 }
 
-char *rtsp_get_param(rtsp_t *s, char *p) {
+char *rtsp_get_param(rtsp_t *s, const char *p) {
   int len;
   char *param;
   if (!s->param)

Modified: trunk/libmpdemux/librtsp/rtsp.h
==============================================================================
--- trunk/libmpdemux/librtsp/rtsp.h	(original)
+++ trunk/libmpdemux/librtsp/rtsp.h	Sun Jul 16 03:20:30 2006
@@ -72,7 +72,7 @@
 char *rtsp_get_session(rtsp_t *s);
 
 char *rtsp_get_mrl(rtsp_t *s);
-char *rtsp_get_param(rtsp_t *s, char *param);
+char *rtsp_get_param(rtsp_t *s, const char *param);
 
 /*int      rtsp_peek_header (rtsp_t *this, char *data); */
 

Modified: trunk/libmpdemux/network.c
==============================================================================
--- trunk/libmpdemux/network.c	(original)
+++ trunk/libmpdemux/network.c	Sun Jul 16 03:20:30 2006
@@ -117,7 +117,7 @@
 
 // Converts an address family constant to a string
 
-char *af2String(int af) {
+const char *af2String(int af) {
 	switch (af) {
 		case AF_INET:	return "AF_INET";
 		

Modified: trunk/libmpdemux/tvi_v4l2.c
==============================================================================
--- trunk/libmpdemux/tvi_v4l2.c	(original)
+++ trunk/libmpdemux/tvi_v4l2.c	Sun Jul 16 03:20:30 2006
@@ -213,7 +213,7 @@
 ** Translate a video4linux2 fourcc aka pixel format
 ** to a human readable string.
 */
-static char *pixfmt2name(int pixfmt)
+static const char *pixfmt2name(int pixfmt)
 {
     static char unknown[24];
 

Modified: trunk/libvo/video_out.h
==============================================================================
--- trunk/libvo/video_out.h	(original)
+++ trunk/libvo/video_out.h	Sun Jul 16 03:20:30 2006
@@ -166,7 +166,7 @@
 
 } vo_functions_t;
 
-char *vo_format_name(int format);
+const char *vo_format_name(int format);
 int vo_init(void);
 
 vo_functions_t* init_best_video_out(char** vo_list);



More information about the MPlayer-cvslog mailing list