@@ -190,7 +190,7 @@ static char *yaml_utf16_to_str(UTF16_CHAR *data, size_t len) {
190190 }
191191
192192 for (size_t i = 0 ; i < len ; ++ i , tmp += ret ) {
193- ret = c16rtomb (tmp , le16toh (data [i ].c ), & st );
193+ ret = c16rtomb (tmp , ( int ) le16toh (data [i ].c ), & st );
194194 if (ret < 0 ) {
195195 LOG_ERR ("c16rtomb failed: %s" , strerror (errno ));
196196 free (mbstr );
@@ -279,7 +279,7 @@ static bool yaml_uefi_hcrtm(const TCG_EVENT2* const event) {
279279#ifdef HAVE_EFIVAR_EFIVAR_H
280280char * yaml_devicepath (BYTE * dp , UINT64 dp_len ) {
281281 int ret ;
282- ret = efidp_format_device_path (NULL , 0 , (const_efidp )dp , dp_len );
282+ ret = ( int ) efidp_format_device_path (NULL , 0 , (const_efidp )dp , ( ssize_t ) dp_len );
283283 if (ret < 0 ) {
284284 LOG_ERR ("failed to allocate memory: %s\n" , strerror (errno ));
285285 return NULL ;
@@ -295,8 +295,8 @@ char *yaml_devicepath(BYTE* dp, UINT64 dp_len) {
295295 }
296296
297297 /* The void* cast is a hack to support efivar versions < 38 */
298- ret = efidp_format_device_path ((void * )text_path ,
299- text_path_len , (const_efidp )dp , dp_len );
298+ ret = ( int ) efidp_format_device_path ((void * )text_path ,
299+ text_path_len , (const_efidp )dp , ( ssize_t ) dp_len );
300300 if (ret < 0 ) {
301301 free (text_path );
302302 LOG_ERR ("cannot parse device path\n" );
@@ -351,7 +351,7 @@ char **yaml_split_escape_string(UINT8 const *description, size_t size)
351351 len = size - i ;
352352 }
353353
354- tmp = realloc (lines , sizeof (char * ) * (nlines + 2 ));
354+ tmp = ( char * * ) realloc (lines , sizeof (char * ) * (nlines + 2 ));
355355 if (!tmp ) {
356356 LOG_ERR ("failed to allocate memory for description lines: %s\n" ,
357357 strerror (errno ));
@@ -422,7 +422,7 @@ char **yaml_split_escape_string(UINT8 const *description, size_t size)
422422 }
423423
424424 if (escape == NULL ) {
425- lines [nlines ][k ++ ] = description [j ];
425+ lines [nlines ][k ++ ] = ( char ) description [j ];
426426 } else {
427427 while (* escape ) {
428428 lines [nlines ][k ++ ] = * escape ;
@@ -440,7 +440,7 @@ char **yaml_split_escape_string(UINT8 const *description, size_t size)
440440 for (i = 0 ; lines != NULL && lines [i ] != NULL ; i ++ ) {
441441 free (lines [i ]);
442442 }
443- free (lines );
443+ free (( char * * ) lines );
444444 return NULL ;
445445}
446446
@@ -575,7 +575,7 @@ static bool yaml_uefi_var(UEFI_VARIABLE_DATA *data, size_t size, UINT32 type,
575575
576576 uint8_t * signature = (uint8_t * )slist +
577577 sizeof (* slist ) + le32toh (slist -> SignatureHeaderSize );
578- int signatures = signature_size / le32toh (slist -> SignatureSize );
578+ int signatures = ( int )( signature_size / le32toh (slist -> SignatureSize ) );
579579 /* iterate through each EFI_SIGNATURE on the list */
580580 int i ;
581581 for (i = 0 ; i < signatures ; i ++ ) {
0 commit comments