Commit 2ea3b5fc authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Don't re-invent uint8_t - remove byte_t

Also sizeof(byte_t)^Wsizeof(uint8_t) can only ever be 1, if it is
defined. It's not defined, if char is more than 8 bits, and uint8_t is
not provided, but then VLC will not compile in the first place.
parent 7676e68d
......@@ -137,7 +137,7 @@ typedef int32_t vlc_fixed_t;
/** audio output buffer */
struct aout_buffer_t
{
byte_t * p_buffer;
uint8_t * p_buffer;
int i_alloc_type;
/* i_size is the real size of the buffer (used for debug ONLY), i_nb_bytes
* is the number of significative bytes in it. */
......@@ -269,7 +269,7 @@ struct aout_input_t
aout_fifo_t fifo;
/* Mixer information */
byte_t * p_first_byte_to_mix;
uint8_t * p_first_byte_to_mix;
audio_replay_gain_t replay_gain;
float f_multiplier;
......
......@@ -91,8 +91,6 @@
typedef int32_t intptr_t;
#endif
typedef uint8_t byte_t;
/* Systems that don't have stdint.h may not define INT64_MIN and
INT64_MAX */
#ifndef INT64_MIN
......
......@@ -292,7 +292,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
{
HANDLE hEvent;
struct SRB_ExecSCSICmd ssc;
byte_t p_tocheader[ 4 ];
uint8_t p_tocheader[ 4 ];
/* Create the transfer completion event */
hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
......@@ -348,7 +348,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
if( pp_sectors )
{
int i, i_toclength;
byte_t *p_fulltoc;
uint8_t *p_fulltoc;
i_toclength = 4 /* header */ + p_tocheader[0] +
((unsigned int)p_tocheader[1] << 8);
......@@ -551,9 +551,9 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
* ioctl_ReadSector: Read VCD or CDDA sectors
****************************************************************************/
int ioctl_ReadSectors( vlc_object_t *p_this, const vcddev_t *p_vcddev,
int i_sector, byte_t * p_buffer, int i_nb, int i_type )
int i_sector, uint8_t *p_buffer, int i_nb, int i_type )
{
byte_t *p_block;
uint8_t *p_block;
int i;
if( i_type == VCD_TYPE ) p_block = malloc( VCD_SECTOR_SIZE * i_nb );
......
......@@ -94,4 +94,4 @@ vcddev_t *ioctl_Open ( vlc_object_t *, const char * );
void ioctl_Close ( vlc_object_t *, vcddev_t * );
int ioctl_GetTracksMap ( vlc_object_t *, const vcddev_t *, int ** );
int ioctl_ReadSectors ( vlc_object_t *, const vcddev_t *,
int, byte_t *, int, int );
int, uint8_t *, int, int );
......@@ -116,7 +116,7 @@ struct atomic_operation_t
struct aout_filter_sys_t
{
size_t i_overflow_buffer_size;/* in bytes */
byte_t * p_overflow_buffer;
uint8_t * p_overflow_buffer;
unsigned int i_nb_atomic_operations;
struct atomic_operation_t * p_atomic_operations;
};
......@@ -124,7 +124,7 @@ struct aout_filter_sys_t
struct filter_sys_t
{
size_t i_overflow_buffer_size;/* in bytes */
byte_t * p_overflow_buffer;
uint8_t * p_overflow_buffer;
unsigned int i_nb_atomic_operations;
struct atomic_operation_t * p_atomic_operations;
};
......@@ -466,9 +466,9 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
int i_output_nb = aout_FormatNbChannels( &p_filter->output );
float * p_in = (float*) p_in_buf->p_buffer;
byte_t * p_out;
byte_t * p_overflow;
byte_t * p_slide;
uint8_t * p_out;
uint8_t * p_overflow;
uint8_t * p_slide;
size_t i_overflow_size; /* in bytes */
size_t i_out_size; /* in bytes */
......
......@@ -80,7 +80,7 @@ struct filter_sys_t
int i_bitspersample;
size_t i_overflow_buffer_size;/* in bytes */
byte_t * p_overflow_buffer;
uint8_t * p_overflow_buffer;
unsigned int i_nb_atomic_operations;
struct atomic_operation_t * p_atomic_operations;
};
......@@ -555,9 +555,9 @@ static void stereo2mono_downmix( aout_filter_t * p_filter,
int i_output_nb = aout_FormatNbChannels( &p_filter->output );
int16_t * p_in = (int16_t*) p_in_buf->p_buffer;
byte_t * p_out;
byte_t * p_overflow;
byte_t * p_slide;
uint8_t * p_out;
uint8_t * p_overflow;
uint8_t * p_slide;
size_t i_overflow_size; /* in bytes */
size_t i_out_size; /* in bytes */
......
......@@ -90,12 +90,12 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
static const uint8_t p_sync_le[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
static const uint8_t p_sync_be[6] = { 0xF8, 0x72, 0x4E, 0x1F, 0x00, 0x01 };
#ifndef HAVE_SWAB
byte_t * p_tmp;
uint8_t * p_tmp;
uint16_t i;
#endif
uint16_t i_frame_size = p_in_buf->i_nb_bytes / 2;
byte_t * p_in = p_in_buf->p_buffer;
byte_t * p_out = p_out_buf->p_buffer;
uint8_t * p_in = p_in_buf->p_buffer;
uint8_t * p_out = p_out_buf->p_buffer;
/* Copy the S/PDIF headers. */
if( p_filter->output.i_format == VLC_FOURCC('s','p','d','b') )
......
......@@ -161,8 +161,8 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
for( i_frame = 0; i_frame < 3; i_frame++ )
{
uint16_t i_length_padded = i_length;
byte_t * p_out = p_out_buf->p_buffer + (i_frame * i_fz);
byte_t * p_in = p_filter->p_sys->p_buf + (i_frame * i_length);
uint8_t * p_out = p_out_buf->p_buffer + (i_frame * i_fz);
uint8_t * p_in = p_filter->p_sys->p_buf + (i_frame * i_length);
switch( p_in_buf->i_nb_samples )
{
......@@ -197,7 +197,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
swab( p_in, p_out + 8, i_length );
#else
uint16_t i;
byte_t * p_tmp, tmp;
uint8_t * p_tmp, tmp;
p_tmp = p_out + 8;
for( i = i_length / 2 ; i-- ; )
{
......
......@@ -527,15 +527,15 @@ static void Do_S16ToFL32_SW( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_in = p_swabbed + i - 1;
#else
byte_t p_tmp[2];
uint8_t p_tmp[2];
p_in = (int16_t *)p_in_buf->p_buffer + i - 1;
#endif
while( i-- )
{
#ifndef HAVE_SWAB
p_tmp[0] = ((byte_t *)p_in)[1];
p_tmp[1] = ((byte_t *)p_in)[0];
p_tmp[0] = ((uint8_t *)p_in)[1];
p_tmp[1] = ((uint8_t *)p_in)[0];
*p_out = (float)( *(int16_t *)p_tmp ) / 32768.0;
#else
*p_out = (float)*p_in / 32768.0;
......@@ -563,7 +563,7 @@ static void Do_S16ToFL24_SW( aout_instance_t * p_aout, aout_filter_t * p_filter,
uint8_t * p_in = (uint8_t *)p_in_buf->p_buffer + (i - 1) * 3;
float * p_out = (float *)p_out_buf->p_buffer + i - 1;
byte_t p_tmp[3];
uint8_t p_tmp[3];
while( i-- )
{
......
......@@ -79,8 +79,8 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
int i_nb_channels = aout_FormatNbChannels( &p_aout->mixer.mixer );
int i_nb_bytes = p_buffer->i_nb_samples * sizeof(int32_t)
* i_nb_channels;
byte_t * p_in;
byte_t * p_out;
uint8_t * p_in;
uint8_t * p_out;
while ( p_input->b_error )
{
......
......@@ -233,7 +233,7 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************
* This function writes a buffer of i_length bytes in the socket
*****************************************************************************/
static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void Play( aout_thread_t *p_aout, uint8_t *buffer, int i_size )
{
int i_amount;
......
......@@ -594,7 +594,7 @@ static int OSSThread( aout_instance_t * p_aout )
{
aout_buffer_t * p_buffer = NULL;
int i_tmp, i_size;
byte_t * p_bytes;
uint8_t * p_bytes;
if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
{
......
......@@ -58,7 +58,7 @@ struct aout_sys_t
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void Play ( aout_instance_t * );
static void SDLCallback ( void *, byte_t *, int );
static void SDLCallback ( void *, uint8_t *, int );
/*****************************************************************************
* Module descriptor
......@@ -246,7 +246,7 @@ static void Close ( vlc_object_t *p_this )
/*****************************************************************************
* SDLCallback: what to do once SDL has played sound samples
*****************************************************************************/
static void SDLCallback( void * _p_aout, byte_t * p_stream, int i_len )
static void SDLCallback( void * _p_aout, uint8_t * p_stream, int i_len )
{
aout_instance_t * p_aout = (aout_instance_t *)_p_aout;
aout_buffer_t * p_buffer;
......
......@@ -207,7 +207,7 @@ struct aout_sys_t
int i_buffer_size;
byte_t *p_silence_buffer; /* buffer we use to play silence */
uint8_t *p_silence_buffer; /* buffer we use to play silence */
bool b_chan_reorder; /* do we need channel reordering */
int pi_chan_table[AOUT_CHAN_MAX];
......
......@@ -83,7 +83,7 @@ static int OpenPacketizer( vlc_object_t * );
static void CloseDecoder ( vlc_object_t * );
static void *DecodeBlock ( decoder_t *, block_t ** );
static int SyncInfo ( const byte_t *, unsigned int *, unsigned int *,
static int SyncInfo ( const uint8_t *, unsigned int *, unsigned int *,
unsigned int *, int * );
static uint8_t *GetOutBuffer ( decoder_t *, void ** );
......@@ -429,7 +429,7 @@ static block_t *GetSoutBuffer( decoder_t *p_dec )
* since we don't want to oblige S/PDIF people to use liba52 just to get
* their SyncInfo...
*****************************************************************************/
static int SyncInfo( const byte_t * p_buf,
static int SyncInfo( const uint8_t * p_buf,
unsigned int * pi_channels,
unsigned int * pi_channels_conf,
unsigned int * pi_sample_rate, int * pi_bit_rate )
......
......@@ -83,7 +83,7 @@ static int Open( vlc_object_t * p_this )
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
const byte_t*p_peek;
const uint8_t *p_peek;
int i_peek = 0;
bool b_big_endian = 0; /* Arbitrary initialisation */
......@@ -197,7 +197,7 @@ static int Demux( demux_t *p_demux )
#else
int i;
byte_t *p_tmp, tmp;
uint8_t *p_tmp, tmp;
p_tmp = p_block_in->p_buffer;
for( i = p_block_in->i_buffer / 2 ; i-- ; )
{
......
......@@ -35,7 +35,7 @@
#define __EVEN( x ) ( (x)&0x01 ? (x)+1 : (x) )
static vlc_fourcc_t GetFOURCC( const byte_t *p_buff )
static vlc_fourcc_t GetFOURCC( const uint8_t *p_buff )
{
return VLC_FOURCC( p_buff[0], p_buff[1], p_buff[2], p_buff[3] );
}
......
......@@ -77,7 +77,7 @@ static int Open( vlc_object_t * p_this )
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
const byte_t *p_peek;
const uint8_t *p_peek;
int i_peek = 0;
/* Check if we are dealing with a WAV file */
......
......@@ -99,7 +99,7 @@ static int Open( vlc_object_t * p_this )
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
const byte_t *p_peek;
const uint8_t *p_peek;
uint8_t *p_streaminfo;
int i_streaminfo;
......
......@@ -268,7 +268,7 @@ static char *nscdec( vlc_object_t *p_demux, char* p_encoded )
static int DemuxOpen( vlc_object_t * p_this )
{
demux_t *p_demux = (demux_t *)p_this;
const byte_t *p_peek;
const uint8_t *p_peek;
int i_size;
/* Lets check the content to see if this is a NSC file */
......
......@@ -78,7 +78,7 @@ int E_(Import_GVP)( vlc_object_t *p_this )
{
demux_t *p_demux = (demux_t *)p_this;
int i_peek, i, b_found = false;
const byte_t *p_peek;
const uint8_t *p_peek;
i_peek = stream_Peek( p_demux->s, &p_peek, MAX_LINE );
......
......@@ -58,7 +58,7 @@ int E_(Import_IFO)( vlc_object_t *p_this )
&& !strcasecmp( psz_file + strlen( "VTS_00_0" ) , ".IFO" ) ) ) )
{
int i_peek;
const byte_t *p_peek;
const uint8_t *p_peek;
i_peek = stream_Peek( p_demux->s, &p_peek, 8 );
if( i_peek != 8 || memcmp( p_peek, "DVDVIDEO", 8 ) )
......
......@@ -138,7 +138,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args );
int E_(Import_SGIMB)( vlc_object_t * p_this )
{
demux_t *p_demux = (demux_t *)p_this;
const byte_t *p_peek;
const uint8_t *p_peek;
int i_size;
/* Lets check the content to see if this is a sgi mediabase file */
......
......@@ -133,7 +133,7 @@ static int Open( vlc_object_t * p_this )
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
const byte_t *p_peek, *p_peek_backup;
const uint8_t *p_peek, *p_peek_backup;
uint32_t i_dword;
dv_header_t dv_header;
......
......@@ -47,7 +47,7 @@ struct aout_sys_t
int i_card;
int i_device;
byte_t * p_silent_buffer;
uint8_t * p_silent_buffer;
};
#define DEFAULT_FRAME_SIZE 2048
......@@ -269,7 +269,7 @@ static int QNXaoutThread( aout_instance_t * p_aout )
{
aout_buffer_t * p_buffer;
int i_tmp, i_size;
byte_t * p_bytes;
uint8_t * p_bytes;
if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
{
......
......@@ -74,7 +74,7 @@ static int vlclua_demux_peek( lua_State *L )
static int vlclua_demux_read( lua_State *L )
{
demux_t *p_demux = (demux_t *)vlclua_get_this( L );
byte_t *p_read;
uint8_t *p_read;
int n = luaL_checkint( L, 1 );
int i_read = stream_Read( p_demux->s, &p_read, n );
lua_pushlstring( L, (const char *)p_read, i_read );
......
......@@ -254,7 +254,7 @@ int vlclua_stream_read( lua_State *L )
{
stream_t * p_stream;
int n;
byte_t *p_read;
uint8_t *p_read;
int i_read;
p_stream = (stream_t *)luaL_checklightuserdata( L, 1 );
n = luaL_checkint( L, 2 );
......
......@@ -325,7 +325,7 @@ static block_t *PacketizeRawBlock( decoder_t *p_dec, block_t **pp_block )
/****************************************************************************
* ADTS helpers
****************************************************************************/
static int ADTSSyncInfo( decoder_t * p_dec, const byte_t * p_buf,
static int ADTSSyncInfo( decoder_t * p_dec, const uint8_t * p_buf,
unsigned int * pi_channels,
unsigned int * pi_sample_rate,
unsigned int * pi_frame_length,
......
......@@ -58,7 +58,7 @@ struct vout_sys_t
int i_width;
int i_height;
byte_t* p_pixels;
uint8_t* p_pixels;
};
/*****************************************************************************
......@@ -120,7 +120,7 @@ static int Init( vout_thread_t *p_vout )
{
vout_sys_t *p_sys = p_vout->p_sys;
IDirectFBSurface *p_primary = (IDirectFBSurface *) p_vout->p_sys->p_primary;
byte_t* p_pixels = NULL;
uint8_t* p_pixels = NULL;
picture_t *p_pic = NULL;
int i_rlength, i_glength, i_blength;
int i_roffset, i_goffset, i_boffset;
......@@ -220,7 +220,7 @@ static int Init( vout_thread_t *p_vout )
/* allocate p_pixels */
i_size = i_line_pitch * p_sys->i_height;
p_sys->p_pixels = malloc( sizeof(byte_t) * i_size );
p_sys->p_pixels = malloc( i_size );
if( p_sys->p_pixels == NULL )
{
p_primary->Unlock(p_primary);
......@@ -277,7 +277,7 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
vout_sys_t *p_sys = p_vout->p_sys;
IDirectFBSurface *p_primary = (IDirectFBSurface *) p_sys->p_primary;
byte_t* p_pixels = NULL;
uint8_t* p_pixels = NULL;
int i_size;
int i_line_pitch;
......
......@@ -157,13 +157,13 @@ struct vout_sys_t
vlc_fourcc_t i_chroma;
/* Video memory */
byte_t * p_video; /* base adress */
uint8_t * p_video; /* base adress */
size_t i_page_size; /* page size */
};
struct picture_sys_t
{
byte_t * p_data; /* base adress */
uint8_t * p_data; /* base adress */
};
/*****************************************************************************
......
......@@ -114,7 +114,7 @@ struct vout_sys_t
{
mga_vid_config_t mga;
int i_fd;
byte_t * p_video;
uint8_t * p_video;
};
struct picture_sys_t
......
......@@ -2931,7 +2931,7 @@ static IMAGE_TYPE * CreateImage( vout_thread_t *p_vout,
Display *p_display, EXTRA_ARGS,
int i_width, int i_height )
{
byte_t * p_data; /* image data storage zone */
uint8_t * p_data; /* image data storage zone */
IMAGE_TYPE *p_image;
#ifdef MODULE_NAME_IS_x11
int i_quantum; /* XImage quantum (see below) */
......@@ -2945,10 +2945,10 @@ static IMAGE_TYPE * CreateImage( vout_thread_t *p_vout,
i_height = ( i_height + 15 ) >> 4 << 4;
i_width = ( i_width + 15 ) >> 4 << 4;
p_data = (byte_t *) malloc( i_width * i_height * i_bits_per_pixel / 8 );
p_data = malloc( i_width * i_height * i_bits_per_pixel / 8 );
#elif defined(MODULE_NAME_IS_x11)
i_bytes_per_line = i_width * i_bytes_per_pixel;
p_data = (byte_t *) malloc( i_bytes_per_line * i_height );
p_data = malloc( i_bytes_per_line * i_height );
#endif
if( !p_data )
{
......
......@@ -64,9 +64,9 @@
{ \
(p_new_buffer)->i_alloc_type = i_alloc_type; \
(p_new_buffer)->i_size = i_alloc_size; \
(p_new_buffer)->p_buffer = (byte_t *)(p_new_buffer) \
(p_new_buffer)->p_buffer = (uint8_t *)(p_new_buffer) \
+ sizeof(aout_buffer_t); \
(p_new_buffer)->b_discontinuity = false; \
(p_new_buffer)->b_discontinuity = false; \
if ( (p_previous_buffer) != NULL ) \
{ \
(p_new_buffer)->start_date = \
......
......@@ -456,7 +456,7 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
if( p_input->b_restart )
{
aout_fifo_t fifo, dummy_fifo;
byte_t *p_first_byte_to_mix;
uint8_t *p_first_byte_to_mix;
vlc_mutex_lock( &p_aout->mixer_lock );
......
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