[MPlayer-cvslog] r36938 - in trunk/gui: dialog/playlist.c dialog/preferences.c dialog/skinbrowser.c interface.c win32/gui.c wm/ws.c

ib subversion at mplayerhq.hu
Tue Feb 25 17:12:33 CET 2014


Author: ib
Date: Tue Feb 25 17:12:33 2014
New Revision: 36938

Log:
Remove unnecessary casts.

Modified:
   trunk/gui/dialog/playlist.c
   trunk/gui/dialog/preferences.c
   trunk/gui/dialog/skinbrowser.c
   trunk/gui/interface.c
   trunk/gui/win32/gui.c
   trunk/gui/wm/ws.c

Modified: trunk/gui/dialog/playlist.c
==============================================================================
--- trunk/gui/dialog/playlist.c	Tue Feb 25 16:19:22 2014	(r36937)
+++ trunk/gui/dialog/playlist.c	Tue Feb 25 17:12:33 2014	(r36938)
@@ -86,7 +86,7 @@ static int compare_func(const void *a, c
  char * tmp;
  int    i;
  if ( !a || !b || !( (DirNodeType *)a )->path ) return -1;
- tmp=strdup( (char *)b ); tmp[strlen( tmp )-1]=0;
+ tmp=strdup( b ); tmp[strlen( tmp )-1]=0;
  i=strcmp( ( (DirNodeType *)a )->path,tmp );
  free( tmp );
  return i;

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Tue Feb 25 16:19:22 2014	(r36937)
+++ trunk/gui/dialog/preferences.c	Tue Feb 25 17:12:33 2014	(r36938)
@@ -1341,13 +1341,13 @@ void ShowPreferences( void )
  {
   int     i;
   GList * Items = NULL;
-  char  * name = NULL;
+  const char  * name = NULL;
 
   Items=g_list_append( Items,MSGTR_GUI__Default_ );
   for( i=0;mpcodecs_vd_drivers[i];i++ )
    {
     Items=g_list_append( Items,(char *)mpcodecs_vd_drivers[i]->info->name );
-    if ( video_fm_list && !gstrcmp( video_fm_list[0],mpcodecs_vd_drivers[i]->info->short_name ) ) name=(char *)mpcodecs_vd_drivers[i]->info->name;
+    if ( video_fm_list && !gstrcmp( video_fm_list[0],mpcodecs_vd_drivers[i]->info->short_name ) ) name=mpcodecs_vd_drivers[i]->info->name;
    }
   gtk_combo_set_popdown_strings( GTK_COMBO( CBVFM ),Items );
   g_list_free( Items );
@@ -1357,13 +1357,13 @@ void ShowPreferences( void )
  {
   int     i;
   GList * Items = NULL;
-  char  * name = NULL;
+  const char  * name = NULL;
 
   Items=g_list_append( Items,MSGTR_GUI__Default_ );
   for( i=0;mpcodecs_ad_drivers[i];i++ )
    {
     Items=g_list_append( Items,(char *)mpcodecs_ad_drivers[i]->info->name );
-    if ( audio_fm_list && !gstrcmp( audio_fm_list[0],mpcodecs_ad_drivers[i]->info->short_name ) ) name=(char *)mpcodecs_ad_drivers[i]->info->name;
+    if ( audio_fm_list && !gstrcmp( audio_fm_list[0],mpcodecs_ad_drivers[i]->info->short_name ) ) name=mpcodecs_ad_drivers[i]->info->name;
    }
   gtk_combo_set_popdown_strings( GTK_COMBO( CBAFM ),Items );
   g_list_free( Items );

Modified: trunk/gui/dialog/skinbrowser.c
==============================================================================
--- trunk/gui/dialog/skinbrowser.c	Tue Feb 25 16:19:22 2014	(r36937)
+++ trunk/gui/dialog/skinbrowser.c	Tue Feb 25 17:12:33 2014	(r36938)
@@ -169,7 +169,7 @@ int FillSkinList( gchar * mdir )
 {
  gchar         * str[2];
  gchar         * tmp;
- int             i;
+ size_t          i;
  glob_t          gg;
  struct stat     fs;
 
@@ -181,7 +181,7 @@ int FillSkinList( gchar * mdir )
  if ( gtkFindInCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
 
  glob( mdir,GLOB_NOSORT,NULL,&gg );
- for( i=0;i<(int)gg.gl_pathc;i++ )
+ for( i=0;i<gg.gl_pathc;i++ )
   {
    if ( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
    if ( ( stat( gg.gl_pathv[i],&fs ) == 0 ) && S_ISDIR( fs.st_mode ) )

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Tue Feb 25 16:19:22 2014	(r36937)
+++ trunk/gui/interface.c	Tue Feb 25 17:12:33 2014	(r36938)
@@ -985,7 +985,7 @@ void mplayer(int what, float value, void
 
     case MPLAYER_SET_FONT_ENCODING:
         nfree(subtitle_font_encoding);
-        subtitle_font_encoding = gstrdup((char *)data);
+        subtitle_font_encoding = gstrdup(data);
         mplayer(MPLAYER_LOAD_FONT, 0, 0);
         break;
 
@@ -1024,7 +1024,7 @@ void mplayer(int what, float value, void
 
     case MPLAYER_SET_SUB_ENCODING:
         nfree(sub_cp);
-        sub_cp = gstrdup((char *)data);
+        sub_cp = gstrdup(data);
         break;
 
     case MPLAYER_SET_EXTRA_STEREO:
@@ -1055,22 +1055,22 @@ void mplayer(int what, float value, void
 
     case MPLAYER_SET_CONTRAST:
         if (guiInfo.sh_video)
-            set_video_colors(guiInfo.sh_video, "contrast", (int)value);
+            set_video_colors(guiInfo.sh_video, "contrast", value);
         break;
 
     case MPLAYER_SET_BRIGHTNESS:
         if (guiInfo.sh_video)
-            set_video_colors(guiInfo.sh_video, "brightness", (int)value);
+            set_video_colors(guiInfo.sh_video, "brightness", value);
         break;
 
     case MPLAYER_SET_HUE:
         if (guiInfo.sh_video)
-            set_video_colors(guiInfo.sh_video, "hue", (int)value);
+            set_video_colors(guiInfo.sh_video, "hue", value);
         break;
 
     case MPLAYER_SET_SATURATION:
         if (guiInfo.sh_video)
-            set_video_colors(guiInfo.sh_video, "saturation", (int)value);
+            set_video_colors(guiInfo.sh_video, "saturation", value);
         break;
 
     case MPLAYER_SET_EQUALIZER:

Modified: trunk/gui/win32/gui.c
==============================================================================
--- trunk/gui/win32/gui.c	Tue Feb 25 16:19:22 2014	(r36937)
+++ trunk/gui/win32/gui.c	Tue Feb 25 17:12:33 2014	(r36938)
@@ -629,11 +629,11 @@ static LRESULT CALLBACK VideoProc(HWND h
             rect_height = rd.bottom - rd.top;
 
             /* maintain our aspect ratio */
-            tmpheight = ((float)rect_width/video_aspect);
+            tmpheight = rect_width/video_aspect;
             tmpheight += tmpheight % 2;
             if(tmpheight > rect_height)
             {
-                rect_width = ((float)rect_height*video_aspect);
+                rect_width = rect_height*video_aspect;
                 rect_width += rect_width % 2;
             }
             else rect_height = tmpheight;
@@ -927,12 +927,12 @@ static LRESULT CALLBACK EventProc(HWND h
                     if(item->type == tyHpotmeter)
                     {
                         item->x = GET_X_LPARAM(lParam) - gui->mousewx;
-                        item->value = (float)((float)((item->x - item->wx) * 100.0f) / (float)(item->wwidth - item->width));
+                        item->value = ((item->x - item->wx) * 100.0f) / (float)(item->wwidth - item->width);
                     }
                     if(item->type == tyPotmeter)
                     {
                         gui->mousewx = GET_X_LPARAM(lParam) - gui->activewidget->x;
-                        item->value = (float) (gui->mousewx * 100.0f) / (float) item->wwidth;
+                        item->value = (gui->mousewx * 100.0f) / (float) item->wwidth;
                     }
 
                     if((item->type == tyPotmeter) || (item->type == tyHpotmeter) || (item->type == tyVpotmeter))
@@ -944,15 +944,15 @@ static LRESULT CALLBACK EventProc(HWND h
                             item->value = 0.0f;
 
                         if(item->msg == evSetVolume)
-                            guiInfo.Volume = (float) item->value;
+                            guiInfo.Volume = item->value;
                         else if(item->msg == evSetMoviePosition)
-                            guiInfo.Position = (float) item->value;
+                            guiInfo.Position = item->value;
                         else if(item->msg == evSetBalance)
                         {
                             /* make the range for 50% a bit bigger, because the sliders for balance usually suck */
                             if((item->value - 50.0f < 1.5f) && (item->value - 50.0f > -1.5f))
                                 item->value = 50.0f;
-                            guiInfo.Balance = (float) item->value;
+                            guiInfo.Balance = item->value;
                         }
                         updatedisplay(gui, hWnd);
                         handlemsg(hWnd, item->msg);

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Tue Feb 25 16:19:22 2014	(r36937)
+++ trunk/gui/wm/ws.c	Tue Feb 25 17:12:33 2014	(r36938)
@@ -1307,7 +1307,7 @@ void wsImageCreate(wsWindow *win, int w,
             mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
         }
 
-        win->Shminfo.shmaddr = (char *)shmat(win->Shminfo.shmid, 0, 0);
+        win->Shminfo.shmaddr = shmat(win->Shminfo.shmid, 0, 0);
 
         if (win->Shminfo.shmaddr == ((char *)-1)) {
             XDestroyImage(win->xImage);


More information about the MPlayer-cvslog mailing list