[MPlayer-cvslog] r19066 - in trunk/Gui: bitmap.c interface.c mplayer/gtk/sb.c mplayer/pb.c mplayer/play.c win32/interface.c
reynaldo
subversion at mplayerhq.hu
Thu Jul 13 18:17:30 CEST 2006
Author: reynaldo
Date: Thu Jul 13 18:17:24 2006
New Revision: 19066
Modified:
trunk/Gui/bitmap.c
trunk/Gui/interface.c
trunk/Gui/mplayer/gtk/sb.c
trunk/Gui/mplayer/pb.c
trunk/Gui/mplayer/play.c
trunk/Gui/win32/interface.c
Log:
drops casts from void * on malloc/calloc from the gui code
Modified: trunk/Gui/bitmap.c
==============================================================================
--- trunk/Gui/bitmap.c (original)
+++ trunk/Gui/bitmap.c Thu Jul 13 18:17:24 2006
@@ -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 );
{
Modified: trunk/Gui/interface.c
==============================================================================
--- trunk/Gui/interface.c (original)
+++ trunk/Gui/interface.c Thu Jul 13 18:17:24 2006
@@ -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 );
Modified: trunk/Gui/mplayer/gtk/sb.c
==============================================================================
--- trunk/Gui/mplayer/gtk/sb.c (original)
+++ trunk/Gui/mplayer/gtk/sb.c Thu Jul 13 18:17:24 2006
@@ -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 );
Modified: trunk/Gui/mplayer/pb.c
==============================================================================
--- trunk/Gui/mplayer/pb.c (original)
+++ trunk/Gui/mplayer/pb.c Thu Jul 13 18:17:24 2006
@@ -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 );
Modified: trunk/Gui/mplayer/play.c
==============================================================================
--- trunk/Gui/mplayer/play.c (original)
+++ trunk/Gui/mplayer/play.c Thu Jul 13 18:17:24 2006
@@ -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 );
Modified: trunk/Gui/win32/interface.c
==============================================================================
--- trunk/Gui/win32/interface.c (original)
+++ trunk/Gui/win32/interface.c Thu Jul 13 18:17:24 2006
@@ -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);
More information about the MPlayer-cvslog
mailing list