[MPlayer-cvslog] r32937 - trunk/gui/skin/skin.c

ib subversion at mplayerhq.hu
Sat Feb 19 23:39:17 CET 2011


Author: ib
Date: Sat Feb 19 23:39:17 2011
New Revision: 32937

Log:
Make setname() directly return the string created instead of writing it
into some variable.

(The variable isn't used anywhere else, so it's easier to read this way.)

Modified:
   trunk/gui/skin/skin.c

Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c	Sat Feb 19 23:26:10 2011	(r32936)
+++ trunk/gui/skin/skin.c	Sat Feb 19 23:39:17 2011	(r32937)
@@ -39,7 +39,7 @@ listItems     * skinAppMPlayer = &appMPl
 
 static int             linenumber;
 
-static unsigned char   path[512],fn[512];
+static unsigned char   path[512];
 
 static listItems     * defList = NULL;
 static unsigned char   window_name[32] = "";
@@ -656,26 +656,31 @@ char * trim( char * in )
 
 FILE * skinFile;
 
-static void setname( char * item1, char * item2 )
+static char *setname( char * item1, char * item2 )
 {
+  static char fn[512];
+
   av_strlcpy(fn, item1, sizeof( fn ));
   av_strlcat(fn, "/", sizeof( fn )); av_strlcat(fn, item2, sizeof( fn ));
   av_strlcpy(path, fn, sizeof( path )); av_strlcat(path, "/", sizeof( path ));
   av_strlcat(fn, "/skin", sizeof( fn ));
+
+  return fn;
 }
 
 int skinRead( char * dname )
 {
+ char          * fn;
  unsigned char   tmp[256];
  unsigned char * ptmp;
  unsigned char   command[32];
  unsigned char   param[256];
  int             i;
 
- setname( skinDirInHome,dname );
+ fn = setname( skinDirInHome,dname );
  if ( ( skinFile = fopen( fn,"rt" ) ) == NULL )
   {
-   setname( skinMPlayerDir,dname );
+   fn = setname( skinMPlayerDir,dname );
    if ( ( skinFile = fopen( fn,"rt" ) ) == NULL )
     {
      mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_SKIN_SkinFileNotFound,fn );


More information about the MPlayer-cvslog mailing list