changeset 36842:d8b2651bfeab

Remove unnecessary casts.
author ib
date Tue, 25 Feb 2014 16:12:33 +0000
parents c659d33157e3
children 1078b8dd7625
files gui/dialog/playlist.c gui/dialog/preferences.c gui/dialog/skinbrowser.c gui/interface.c gui/win32/gui.c gui/wm/ws.c
diffstat 6 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/gui/dialog/playlist.c	Tue Feb 25 15:19:22 2014 +0000
+++ b/gui/dialog/playlist.c	Tue Feb 25 16:12:33 2014 +0000
@@ -86,7 +86,7 @@
  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;
--- a/gui/dialog/preferences.c	Tue Feb 25 15:19:22 2014 +0000
+++ b/gui/dialog/preferences.c	Tue Feb 25 16:12:33 2014 +0000
@@ -1341,13 +1341,13 @@
  {
   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 @@
  {
   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 );
--- a/gui/dialog/skinbrowser.c	Tue Feb 25 15:19:22 2014 +0000
+++ b/gui/dialog/skinbrowser.c	Tue Feb 25 16:12:33 2014 +0000
@@ -169,7 +169,7 @@
 {
  gchar         * str[2];
  gchar         * tmp;
- int             i;
+ size_t          i;
  glob_t          gg;
  struct stat     fs;
 
@@ -181,7 +181,7 @@
  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 ) )
--- a/gui/interface.c	Tue Feb 25 15:19:22 2014 +0000
+++ b/gui/interface.c	Tue Feb 25 16:12:33 2014 +0000
@@ -985,7 +985,7 @@
 
     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 @@
 
     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 @@
 
     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:
--- a/gui/win32/gui.c	Tue Feb 25 15:19:22 2014 +0000
+++ b/gui/win32/gui.c	Tue Feb 25 16:12:33 2014 +0000
@@ -629,11 +629,11 @@
             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 @@
                     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 @@
                             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);
--- a/gui/wm/ws.c	Tue Feb 25 15:19:22 2014 +0000
+++ b/gui/wm/ws.c	Tue Feb 25 16:12:33 2014 +0000
@@ -1307,7 +1307,7 @@
             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);