changeset 19061:86350b4b8203

drops casts from void * on malloc/calloc from the gui code
author reynaldo
date Thu, 13 Jul 2006 16:17:24 +0000
parents b508e7ef1ea8
children 83c3afeab35d
files Gui/bitmap.c Gui/interface.c Gui/mplayer/gtk/sb.c Gui/mplayer/pb.c Gui/mplayer/play.c Gui/win32/interface.c
diffstat 6 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/bitmap.c	Thu Jul 13 13:28:56 2006 +0000
+++ b/Gui/bitmap.c	Thu Jul 13 16:17:24 2006 +0000
@@ -38,7 +38,7 @@
  png_read_info( png,info );
  png_get_IHDR( png,info,&bf->Width,&bf->Height,&bf->BPP,&color,NULL,NULL,NULL );
 
- row_p=(png_bytep *)malloc( sizeof( png_bytep ) * bf->Height );
+ row_p=malloc( sizeof( png_bytep ) * bf->Height );
  if ( !row_p )
   {
    mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png]  not enough memory for row buffer\n" );
@@ -198,7 +198,7 @@
  out->BPP=1;
  out->ImageSize=(out->Width * out->Height + 7) / 8;
  mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize );
- out->Image=(char *)calloc( 1,out->ImageSize );
+ out->Image=calloc( 1,out->ImageSize );
  if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_NotEnoughMemoryC32To1 );
  {
   int i,b,c=0; unsigned int * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1;
@@ -221,7 +221,7 @@
  out->Height=in->Height;
  out->BPP=32;
  out->ImageSize=out->Width * out->Height * 4;
- out->Image=(char *)calloc( 1,out->ImageSize );
+ out->Image=calloc( 1,out->ImageSize );
  mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c1to32] imagesize: %d\n",out->ImageSize );
  if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_NotEnoughMemoryC1To32 );
  {
--- a/Gui/interface.c	Thu Jul 13 13:28:56 2006 +0000
+++ b/Gui/interface.c	Thu Jul 13 16:17:24 2006 +0000
@@ -241,7 +241,7 @@
    case -2: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinCfgReadError,skinName ); exit( 0 );
   }
 // --- initialize windows
- if ( ( mplDrawBuffer = (unsigned char *)malloc( appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
+ if ( ( mplDrawBuffer = malloc( appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
   {
    fprintf( stderr,MSGTR_NEMDB );
    exit( 0 );
@@ -1151,7 +1151,7 @@
    case gtkSetPanscan:
         {
 	 mp_cmd_t * mp_cmd;
-         mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
+         mp_cmd=calloc( 1,sizeof( *mp_cmd ) );
          mp_cmd->id=MP_CMD_PANSCAN;    mp_cmd->name=strdup( "panscan" );
 	 mp_cmd->args[0].v.f=fparam;   mp_cmd->args[1].v.i=1;
 	 mp_input_queue_cmd( mp_cmd );
--- a/Gui/mplayer/gtk/sb.c	Thu Jul 13 13:28:56 2006 +0000
+++ b/Gui/mplayer/gtk/sb.c	Thu Jul 13 16:17:24 2006 +0000
@@ -179,13 +179,13 @@
  gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)1 );
  gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)0 );
 
- if ( ( sbMPlayerDirInHome_obsolete=(char *)calloc( 1,strlen( skinDirInHome_obsolete ) + 4 ) ) != NULL )
+ if ( ( sbMPlayerDirInHome_obsolete=calloc( 1,strlen( skinDirInHome_obsolete ) + 4 ) ) != NULL )
   { strcpy( sbMPlayerDirInHome_obsolete,skinDirInHome_obsolete ); strcat( sbMPlayerDirInHome_obsolete,"/*" ); }
- if ( ( sbMPlayerDirInHome=(char *)calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL )
+ if ( ( sbMPlayerDirInHome=calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL )
   { strcpy( sbMPlayerDirInHome,skinDirInHome ); strcat( sbMPlayerDirInHome,"/*" ); }
- if ( ( sbMPlayerPrefixDir_obsolete=(char *)calloc( 1,strlen( skinMPlayerDir ) + 4 ) ) != NULL )
+ if ( ( sbMPlayerPrefixDir_obsolete=calloc( 1,strlen( skinMPlayerDir ) + 4 ) ) != NULL )
   { strcpy( sbMPlayerPrefixDir_obsolete,skinMPlayerDir ); strcat( sbMPlayerPrefixDir_obsolete,"/*" ); }
- if ( ( sbMPlayerPrefixDir=(char *)calloc( 1,strlen( skinMPlayerDir ) + 4 ) ) != NULL )
+ if ( ( sbMPlayerPrefixDir=calloc( 1,strlen( skinMPlayerDir ) + 4 ) ) != NULL )
   { strcpy( sbMPlayerPrefixDir,skinMPlayerDir ); strcat( sbMPlayerPrefixDir,"/*" ); }
 
  gtk_window_add_accel_group( GTK_WINDOW( SkinBrowser ),accel_group );
--- a/Gui/mplayer/pb.c	Thu Jul 13 13:28:56 2006 +0000
+++ b/Gui/mplayer/pb.c	Thu Jul 13 16:17:24 2006 +0000
@@ -226,7 +226,7 @@
 
  gfree( (void**)&mplPBDrawBuffer );
 
- if ( ( mplPBDrawBuffer = (unsigned char *)malloc( appMPlayer.bar.Bitmap.ImageSize ) ) == NULL )
+ if ( ( mplPBDrawBuffer = malloc( appMPlayer.bar.Bitmap.ImageSize ) ) == NULL )
   {
    mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_NEMDB );
    exit( 0 );
--- a/Gui/mplayer/play.c	Thu Jul 13 13:28:56 2006 +0000
+++ b/Gui/mplayer/play.c	Thu Jul 13 16:17:24 2006 +0000
@@ -127,7 +127,7 @@
  if ( !guiIntfStruct.Playing ) return;
  if ( guiIntfStruct.Playing == 1 )
   {
-   mp_cmd_t * cmd = (mp_cmd_t *)calloc( 1,sizeof( *cmd ) );
+   mp_cmd_t * cmd = calloc( 1,sizeof( *cmd ) );
    cmd->id=MP_CMD_PAUSE;
    cmd->name=strdup("pause");
    mp_input_queue_cmd(cmd);
@@ -194,7 +194,7 @@
  if ( prev && appMPlayer.menuIsPresent )
   {
    if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer );
-   if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
+   if ( ( mplMenuDrawBuffer = calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
     { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
    wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
    wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
@@ -224,7 +224,7 @@
 
 // --- reload main window
  if ( mplDrawBuffer ) free( mplDrawBuffer );
- if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
+ if ( ( mplDrawBuffer = calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
   { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
 
  wsDestroyWindow( &appMPlayer.mainWindow );
--- a/Gui/win32/interface.c	Thu Jul 13 13:28:56 2006 +0000
+++ b/Gui/win32/interface.c	Thu Jul 13 16:17:24 2006 +0000
@@ -266,7 +266,7 @@
         }
         case evMute:
         {
-            mp_cmd_t * cmd = (mp_cmd_t *)calloc(1, sizeof(*cmd));
+            mp_cmd_t * cmd = calloc(1, sizeof(*cmd));
             cmd->id=MP_CMD_MUTE;
             cmd->name=strdup("mute");
             mp_input_queue_cmd(cmd);
@@ -311,7 +311,7 @@
 
    if(guiIntfStruct.Playing == 1)
    {
-       mp_cmd_t * cmd = (mp_cmd_t *)calloc(1, sizeof(*cmd));
+       mp_cmd_t * cmd = calloc(1, sizeof(*cmd));
        cmd->id=MP_CMD_PAUSE;
        cmd->name=strdup("pause");
        mp_input_queue_cmd(cmd);