[MPlayer-dev-eng] [patch] make some functions static

Stefan Huehner stefan at huehner.org
Sat Aug 5 14:05:40 CEST 2006


Hi,

attached patch marks several functions static, which aren't used outside
their declaring file and have no corresponding prototype.

Regards,
Stefan

-------------- next part --------------
diff -u mplayer.c mplayer.c
--- mplayer.c	(working copy)
+++ mplayer.c	(working copy)
@@ -680,7 +680,7 @@
 }
 }
 
-void load_per_file_config (m_config_t* conf, const char *const file)
+static void load_per_file_config (m_config_t* conf, const char *const file)
 {
     char *confpath;
     char cfg[strlen(file)+10];
@@ -742,7 +742,7 @@
 #define mp_basename2(s) (strrchr(s,'/')==NULL?(char*)s:(strrchr(s,'/')+1))
 #define mp_basename(s) (strrchr(s,'\\')==NULL?(mp_basename2(s)):(strrchr(s,'\\')+1))
 
-int playtree_add_playlist(play_tree_t* entry)
+static int playtree_add_playlist(play_tree_t* entry)
 {
   play_tree_add_bpf(entry,filename);
 
@@ -779,7 +779,7 @@
   return PT_NEXT_SRC;
 }
 
-int sub_source(void)
+static int sub_source(void)
 {
     int source = -1;
     int top = -1;
@@ -799,7 +799,7 @@
 sub_data* subdata = NULL;
 static subtitle* vo_sub_last = NULL;
 
-void add_subtitles(char *filename, float fps, int silent)
+static void add_subtitles(char *filename, float fps, int silent)
 {
     sub_data *subd;
 #ifdef USE_ASS
@@ -1243,7 +1243,7 @@
  *
  */
 
-void set_osd_bar(int type,const char* name,double min,double max,double val) {
+static void set_osd_bar(int type,const char* name,double min,double max,double val) {
     
     if(osd_level < 1) return;
     
diff -u libmpdemux/aviheader.c libmpdemux/aviheader.c
--- libmpdemux/aviheader.c	(working copy)
+++ libmpdemux/aviheader.c	(working copy)
@@ -45,7 +45,7 @@
     return 0;
 }
 
-int avi_idx_cmp(const void *elem1,const void *elem2) {
+static int avi_idx_cmp(const void *elem1,const void *elem2) {
   register off_t a = AVI_IDX_OFFSET((AVIINDEXENTRY *)elem1);
   register off_t b = AVI_IDX_OFFSET((AVIINDEXENTRY *)elem2);
   return (a > b) - (b > a);
--- stream/cache2.c	(revision 19341)
+++ stream/cache2.c	(working copy)
@@ -60,13 +60,13 @@
 
 int cache_fill_status=0;
 
-void cache_stats(cache_vars_t* s){
+static void cache_stats(cache_vars_t* s){
   int newb=s->max_filepos-s->read_filepos; // new bytes in the buffer
   mp_msg(MSGT_CACHE,MSGL_INFO,"0x%06X  [0x%06X]  0x%06X   ",(int)s->min_filepos,(int)s->read_filepos,(int)s->max_filepos);
   mp_msg(MSGT_CACHE,MSGL_INFO,"%3d %%  (%3d%%)\n",100*newb/s->buffer_size,100*min_fill/s->buffer_size);
 }
 
-int cache_read(cache_vars_t* s,unsigned char* buf,int size){
+static int cache_read(cache_vars_t* s,unsigned char* buf,int size){
   int total=0;
   while(size>0){
     int pos,newb,len;
@@ -112,7 +112,7 @@
   return total;
 }
 
-int cache_fill(cache_vars_t* s){
+static int cache_fill(cache_vars_t* s){
   int back,back2,newb,space,len,pos;
   off_t read=s->read_filepos;
   
@@ -188,7 +188,7 @@
   
 }
 
-cache_vars_t* cache_init(int size,int sector){
+static cache_vars_t* cache_init(int size,int sector){
   int num;
 #ifndef WIN32
   cache_vars_t* s=shmem_alloc(sizeof(cache_vars_t));
--- stream/stream.c	(revision 19341)
+++ stream/stream.c	(working copy)
@@ -139,7 +139,7 @@
   NULL
 };
 
-stream_t* open_stream_plugin(stream_info_t* sinfo,char* filename,int mode,
+static stream_t* open_stream_plugin(stream_info_t* sinfo,char* filename,int mode,
 			     char** options, int* file_format, int* ret) {
   void* arg = NULL;
   stream_t* s;
--- libmpdemux/parse_mp4.c	(revision 19341)
+++ libmpdemux/parse_mp4.c	(working copy)
@@ -20,7 +20,7 @@
 #define MP4_DL MSGL_V
 #define freereturn(a,b) free(a); return b
 
-int mp4_read_descr_len(stream_t *s) {
+static int mp4_read_descr_len(stream_t *s) {
   uint8_t b;
   uint8_t numBytes = 0;
   uint32_t length = 0;
--- libmpdemux/asfheader.c	(revision 19341)
+++ libmpdemux/asfheader.c	(working copy)
@@ -62,7 +62,7 @@
 
 
 // the variable string is modify in this function
-void pack_asf_string(char* string, int length) {
+static void pack_asf_string(char* string, int length) {
   int i,j;
   if( string==NULL ) return;
   for( i=0, j=0; i<length && string[i]!='\0'; i+=2, j++) {
@@ -72,7 +72,7 @@
 }
 
 // the variable string is modify in this function
-void print_asf_string(const char* name, char* string, int length) {
+static void print_asf_string(const char* name, char* string, int length) {
   pack_asf_string(string, length);
   mp_msg(MSGT_HEADER,MSGL_V,"%s%s\n", name, string);
 }
--- libmpdemux/demux_avi.c	(revision 19341)
+++ libmpdemux/demux_avi.c	(working copy)
@@ -24,7 +24,7 @@
 int pts_from_bps=1;
 
 // Select ds from ID
-demux_stream_t* demux_avi_select_stream(demuxer_t *demux,unsigned int id){
+static demux_stream_t* demux_avi_select_stream(demuxer_t *demux,unsigned int id){
   int stream_id=avi_stream_id(id);
 
 //  printf("demux_avi_select_stream(%d)  {a:%d/v:%d}\n",stream_id,


More information about the MPlayer-dev-eng mailing list