Commit d1c0b836 authored by Sam Hocevar's avatar Sam Hocevar

* include/vlc_common.h:

    + Introduced intptr_t and uintptr_t.
  * Fixed compilation warnings here and there.
parent caa12e0a
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.93 2003/12/03 21:50:49 sigmunau Exp $
* $Id: vlc_common.h,v 1.94 2003/12/04 16:02:54 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -93,6 +93,8 @@
typedef unsigned long long uint64_t;
typedef signed long long int64_t;
# endif
typedef uint32_t uintptr_t;
typedef int32_t intptr_t;
#endif
typedef uint8_t byte_t;
......
......@@ -2,7 +2,7 @@
* float32tos16.c : converter from float32 to signed 16 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32tos16.c,v 1.13 2003/10/25 00:49:13 sam Exp $
* $Id: float32tos16.c,v 1.14 2003/12/04 16:02:54 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -94,7 +94,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
/* This is walken's trick based on IEEE float format. */
float f_in = *p_in + 384.0;
int32_t i_in;
i_in = *(int32_t *)&f_in;
i_in = *(int32_t *)(intptr_t)&f_in;
if ( i_in > 0x43c07fff ) *p_out = 32767;
else if ( i_in < 0x43bf8000 ) *p_out = -32768;
else *p_out = i_in - 0x43c00000;
......
......@@ -2,7 +2,7 @@
* s16tofloat32.c : converter from signed 16 bits integer to float32
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: s16tofloat32.c,v 1.6 2003/10/25 00:49:13 sam Exp $
* $Id: s16tofloat32.c,v 1.7 2003/12/04 16:02:54 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -96,7 +96,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
* this takes 16 seconds to perform one billion conversions, instead
* of 19 seconds for the above division. */
int32_t i_out = *p_in + 0x43c00000;
float f_out = *(float *)&i_out;
float f_out = *(float *)(intptr_t)&i_out;
*p_out = f_out - 384.0;
#endif
......
......@@ -2,7 +2,7 @@
* mkv.cpp : matroska demuxer
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mkv.cpp,v 1.48 2003/12/02 01:54:30 rocky Exp $
* $Id: mkv.cpp,v 1.49 2003/12/04 16:02:54 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -2171,9 +2171,9 @@ static void InformationsCreate( input_thread_t *p_input )
p_cat = input_InfoCategory( p_input, "Matroska" );
if( p_sys->f_duration > 1000.1 )
{
char psz_buffer[MSTRTIME_MAX_SIZE];
input_AddInfo( p_cat, _("Duration"),
msecstotimestr( psz_buffer, p_sys->f_duration ) );
char psz_buffer[MSTRTIME_MAX_SIZE];
input_AddInfo( p_cat, _("Duration"),
msecstotimestr( psz_buffer, (int)p_sys->f_duration ) );
}
if( p_sys->psz_title )
......
......@@ -2,7 +2,7 @@
* kde.cpp : KDE plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: kde.cpp,v 1.12 2003/08/21 16:59:35 hartman Exp $
* $Id: kde.cpp,v 1.13 2003/12/04 16:02:54 sam Exp $
*
* Authors: Andres Krapf <dae@chez.com> Sun Mar 25 2001
*
......@@ -50,7 +50,7 @@ static void run(intf_thread_t *p_intf);
* Module descriptor
*****************************************************************************/
vlc_module_begin();
int i = getenv( "DISPLAY" ) == NULL ? 8 : 85;
/* int i = getenv( "DISPLAY" ) == NULL ? 8 : 85; */
add_category_hint( "kde", NULL, VLC_TRUE );
add_file( "kde-uirc", DATA_PATH "/ui.rc", NULL, N_( "path to ui.rc file" ), NULL, VLC_TRUE );
set_description( _("KDE interface") );
......
......@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.c,v 1.38 2003/10/29 01:33:27 gbazin Exp $
* $Id: xcommon.c,v 1.39 2003/12/04 16:02:54 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -2087,7 +2087,7 @@ static void TestNetWMSupport( vout_thread_t *p_vout )
0, 16384, False, AnyPropertyType,
&net_wm_supported,
&i_format, &i_items, &i_bytesafter,
(unsigned char **)&p_args );
(unsigned char **)(intptr_t)&p_args );
if( i_ret != Success || i_items == 0 ) return;
......
......@@ -2,7 +2,7 @@
* effects.c : Effects for the visualization system
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: effects.c,v 1.9 2003/10/24 17:43:51 sam Exp $
* $Id: effects.c,v 1.10 2003/12/04 16:02:54 sam Exp $
*
* Authors: Clment Stenac <zorglub@via.ecp.fr>
*
......@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -148,7 +148,7 @@ int spectrum_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
{
float f_in = *p_buffl + 384.0;
int32_t i_in;
i_in = *(int32_t *)&f_in;
i_in = *(int32_t *)(intptr_t)&f_in;
if(i_in > 0x43c07fff ) * p_buffs = 32767;
else if ( i_in < 0x43bf8000 ) *p_buffs = -32768;
else *p_buffs = i_in - 0x43c00000;
......@@ -248,20 +248,20 @@ int spectrum_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
(p_picture->p[2].i_lines - i_line /2 - 1 -k/2 ) *
p_picture->p[2].i_pitch +
( ( i_band_width * i + j ) /2 ) )
= 0xff;
= 0xff;
}
else
{
*(p_picture->p[2].p_pixels +
(p_picture->p[2].i_lines - i_line /2 - 1 -k/2 ) *
p_picture->p[2].i_pitch +
( ( i_band_width * i + j ) /2 ) )
p_picture->p[2].i_pitch +
( ( i_band_width * i + j ) /2 ) )
= 0x10 ;
}
}
}
}
}
if(height[i] * i_amp > p_effect->i_height)
height[i] = floor(p_effect->i_height / i_amp );
......@@ -278,50 +278,49 @@ int spectrum_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
p_picture->p[1].i_pitch +
( ( i_band_width * i + j ) /2 ) ) = 0x00;
if( 0x04 * i_line - 0x0f > 0 )
{
if( 0x04 * i_line - 0x0f < 0xff )
*(p_picture->p[2].p_pixels +
(p_picture->p[2].i_lines - i_line /2 - 1) *
p_picture->p[2].i_pitch +
( ( i_band_width * i + j ) /2 ) ) =
p_picture->p[2].i_pitch +
( ( i_band_width * i + j ) /2 ) ) =
( 0x04 * i_line) -0x0f ;
else
*(p_picture->p[2].p_pixels +
(p_picture->p[2].i_lines - i_line /2 - 1) *
p_picture->p[2].i_pitch +
( ( i_band_width * i + j ) /2 ) ) =
p_picture->p[2].i_pitch +
( ( i_band_width * i + j ) /2 ) ) =
0xff;
}
else
{
*(p_picture->p[2].p_pixels +
(p_picture->p[2].i_lines - i_line /2 - 1) *
p_picture->p[2].i_pitch +
( ( i_band_width * i + j ) /2 ) ) =
p_picture->p[2].i_pitch +
( ( i_band_width * i + j ) /2 ) ) =
0x10 ;
}
}
}
}
fft_close( p_state );
if( p_s16_buff != NULL )
if( p_s16_buff != NULL )
{
free( p_s16_buff );
p_s16_buff = NULL;
}
if(height) free(height);
if(psz_parse) free(psz_parse);
return 0;
}
/*****************************************************************************
* scope_Run: scope effect
*****************************************************************************/
......@@ -415,23 +414,23 @@ int random_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
/*****************************************************************************
* blur_Run: blur effect
*****************************************************************************/
#if 0
#if 0
/* This code is totally crappy */
int blur_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
aout_buffer_t * p_buffer , picture_t * p_picture)
{
uint8_t * p_pictures;
int i,j;
int i,j;
int i_size; /* Total size of one image */
i_size = (p_picture->p[0].i_pitch * p_picture->p[0].i_lines +
p_picture->p[1].i_pitch * p_picture->p[1].i_lines +
p_picture->p[2].i_pitch * p_picture->p[2].i_lines );
if( !p_effect->p_data )
{
p_effect->p_data=(void *)malloc( 5 * i_size *sizeof(uint8_t));
if( !p_effect->p_data)
{
msg_Err(p_aout,"Out of memory");
......@@ -447,17 +446,17 @@ int blur_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
for( i = 0 ; i < 5 ; i++)
{
for ( j = 0 ; j< p_picture->p[0].i_pitch * p_picture->p[0].i_lines; i++)
p_picture->p[0].p_pixels[j] =
p_picture->p[0].p_pixels[j] =
p_pictures[i * i_size + j] * (100 - 20 * i) /100 ;
for ( j = 0 ; j< p_picture->p[1].i_pitch * p_picture->p[1].i_lines; i++)
p_picture->p[1].p_pixels[j] =
p_picture->p[1].p_pixels[j] =
p_pictures[i * i_size +
p_picture->p[0].i_pitch * p_picture->p[0].i_lines + j ];
for ( j = 0 ; j< p_picture->p[2].i_pitch * p_picture->p[2].i_lines; i++)
p_picture->p[2].p_pixels[j] =
p_picture->p[2].p_pixels[j] =
p_pictures[i * i_size +
p_picture->p[0].i_pitch * p_picture->p[0].i_lines +
p_picture->p[1].i_pitch * p_picture->p[1].i_lines
p_picture->p[1].i_pitch * p_picture->p[1].i_lines
+ j ];
}
......
......@@ -2,7 +2,7 @@
* item.c : Playlist item functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: item.c,v 1.5 2003/11/27 21:24:57 fenrir Exp $
* $Id: item.c,v 1.6 2003/12/04 16:02:54 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -27,6 +27,7 @@
#include <vlc/vlc.h>
#include <vlc/vout.h>
#include <vlc/sout.h>
#include <vlc/input.h>
#include "vlc_playlist.h"
......
......@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.67 2003/12/02 12:57:36 gbazin Exp $
* $Id: playlist.c,v 1.68 2003/12/04 16:02:54 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -27,6 +27,7 @@
#include <vlc/vlc.h>
#include <vlc/vout.h>
#include <vlc/sout.h>
#include <vlc/input.h>
#include "stream_control.h"
#include "input_ext-intf.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment