modules: assume sizeof(uint8_t) is 1

From C11 7.20.1.1:
The typedef name uintN_t designates an unsigned integer type with width N and no padding bits.
This commit is contained in:
Steve Lhomme 2023-07-11 08:42:31 +02:00
parent 722a680e37
commit a76147639a
10 changed files with 14 additions and 16 deletions

View File

@ -371,7 +371,7 @@ static int CryptSetup( sout_access_out_t *p_access, char *key_file )
}
if( p_sys->b_generate_iv )
vlc_rand_bytes( p_sys->aes_ivs, sizeof(uint8_t)*16);
vlc_rand_bytes( p_sys->aes_ivs, 16);
return VLC_SUCCESS;
}
@ -451,7 +451,7 @@ static int CryptKey( sout_access_out_t *p_access, uint32_t i_segment )
if( !p_sys->b_generate_iv )
{
/* Use segment number as IV if randomIV isn't selected*/
memset( p_sys->aes_ivs, 0, 16 * sizeof(uint8_t));
memset( p_sys->aes_ivs, 0, 16);
p_sys->aes_ivs[15] = i_segment & 0xff;
p_sys->aes_ivs[14] = (i_segment >> 8 ) & 0xff;
p_sys->aes_ivs[13] = (i_segment >> 16 ) & 0xff;
@ -888,7 +888,7 @@ static ssize_t openNextFile( sout_access_out_t *p_access, sout_access_out_sys_t
segment->psz_key_uri = strdup( p_sys->key_uri );
CryptKey( p_access, i_newseg );
if( p_sys->b_generate_iv )
memcpy( segment->aes_ivs, p_sys->aes_ivs, sizeof(uint8_t)*16 );
memcpy( segment->aes_ivs, p_sys->aes_ivs, 16 );
}
msg_Dbg( p_access, "Successfully opened livehttp file: %s (%"PRIu32")" , segment->psz_filename, i_newseg );

View File

@ -282,7 +282,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( p_sys->p_info->user_data_len > 2 )
{
free( p_sys->p_gop_user_data );
p_sys->p_gop_user_data = calloc( p_sys->p_info->user_data_len, sizeof(uint8_t) );
p_sys->p_gop_user_data = calloc( p_sys->p_info->user_data_len, 1 );
if( p_sys->p_gop_user_data )
{
p_sys->i_gop_user_data = p_sys->p_info->user_data_len;

View File

@ -155,7 +155,7 @@ static void ParsePayloadExtensions( asf_packet_sys_t *p_packetsys,
if ( guidcmp( &p_ext->i_extension_id, &mfasf_sampleextension_outputcleanpoint_guid ) )
{
if ( i_payload_extensions_size != sizeof(uint8_t) ) goto sizeerror;
if ( i_payload_extensions_size != 1 ) goto sizeerror;
*b_keyframe |= *p_data;
}
else if ( guidcmp( &p_ext->i_extension_id, &asf_dvr_sampleextension_videoframe_guid ) )

View File

@ -384,7 +384,7 @@ static uint8_t *vlclua_todata( lua_State *L, int narg, int *pi_data )
{
size_t i_data;
const char *psz_data = lua_tolstring( L, narg, &i_data );
uint8_t *p_data = vlc_alloc( i_data, sizeof(uint8_t) );
uint8_t *p_data = malloc( i_data );
*pi_data = (int)i_data;
if( !p_data )
{

View File

@ -712,7 +712,7 @@ static block_t *OggStreamPageOut( sout_mux_t *p_mux,
static void OggGetSkeletonIndex( uint8_t **pp_buffer, long *pi_size, ogg_stream_t *p_stream )
{
uint8_t *p_buffer = calloc( INDEX_BASE_SIZE + p_stream->skeleton.i_index_size, sizeof(uint8_t) );
uint8_t *p_buffer = calloc( INDEX_BASE_SIZE + p_stream->skeleton.i_index_size, 1 );
if ( !p_buffer ) return;
*pp_buffer = p_buffer;
@ -814,7 +814,7 @@ static void OggGetSkeletonFisbone( uint8_t **pp_buffer, long *pi_size,
}
}
*pp_buffer = calloc( FISBONE_BASE_SIZE + headers.i_size, sizeof(uint8_t) );
*pp_buffer = calloc( FISBONE_BASE_SIZE + headers.i_size, 1 );
if ( !*pp_buffer ) return;
p_buffer = *pp_buffer;
@ -1475,7 +1475,7 @@ static bool AllocateIndex( sout_mux_t *p_mux, sout_input_t *p_input )
}
i_size *= ( 8.0 / 7 ); /* 7bits encoding overhead */
msg_Dbg( p_mux, "allocating %zu bytes for index", i_size );
p_stream->skeleton.p_index = calloc( i_size, sizeof(uint8_t) );
p_stream->skeleton.p_index = calloc( i_size, 1 );
if ( !p_stream->skeleton.p_index ) return false;
p_stream->skeleton.i_index_size = i_size;
p_stream->skeleton.i_index_payload = 0;

View File

@ -236,7 +236,7 @@ static int Activate( filter_t *p_filter )
switch( p_filter->fmt_out.video.i_chroma )
{
case VLC_CODEC_RGB8:
i_tables_size = sizeof( uint8_t ) * PALETTE_TABLE_SIZE;
i_tables_size = PALETTE_TABLE_SIZE;
break;
case VLC_CODEC_RGB15:
case VLC_CODEC_RGB16:

View File

@ -183,8 +183,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
return NULL;
}
p_sys->p_at = xrealloc( p_sys->p_at,
i_lines * i_pitch * sizeof( uint8_t ) );
p_sys->p_at = xrealloc( p_sys->p_at, i_lines * i_pitch );
p_at = p_sys->p_at;
vlc_mutex_lock( &p_sys->lock );

View File

@ -470,8 +470,7 @@ static void FilterEdge( filter_t *p_filter, picture_t *p_inpic,
p_grad = p_sys->p_buf32_bis;
if( !p_sys->p_buf8 )
p_sys->p_buf8 =
vlc_alloc( i_num_lines * i_src_visible, sizeof(uint8_t));
p_sys->p_buf8 = vlc_alloc( i_num_lines * i_src_visible, 1);
p_theta = p_sys->p_buf8;
if( !p_smooth || !p_grad || !p_theta ) return;

View File

@ -482,7 +482,7 @@ static int oldmovie_sliding_offset_apply( filter_t *p_filter, picture_t *p_pic_o
for ( size_t i_p = 0; i_p < i_planes; i_p++ ) {
/* first allocate temporary buffer for swap operation */
uint8_t *p_temp_buf = calloc( p_pic_out->p[i_p].i_lines * p_pic_out->p[i_p].i_pitch,
sizeof(uint8_t) );
1 );
if ( unlikely( !p_temp_buf ) )
return VLC_ENOMEM;
memcpy( p_temp_buf,p_pic_out->p[i_p].p_pixels,

View File

@ -488,7 +488,7 @@ static int vhs_sliding_effect_apply( filter_t *p_filter, picture_t *p_pic_out )
uint8_t *p_temp_buf;
if ( !p_sys->i_sliding_type_duplicate ) {
p_temp_buf= calloc( p_pic_out->p[i_p].i_lines
* p_pic_out->p[i_p].i_pitch, sizeof(uint8_t) );
* p_pic_out->p[i_p].i_pitch, 1 );
if ( unlikely( !p_temp_buf ) )
return VLC_ENOMEM;
memcpy( p_temp_buf, p_pic_out->p[i_p].p_pixels,