module-avb: fix types

This commit is contained in:
Nils Tonnaett 2026-05-18 12:47:02 -07:00 committed by Wim Taymans
parent 3bde62bc1d
commit 2dd60fdbc6
4 changed files with 9 additions and 9 deletions

View file

@ -156,7 +156,7 @@ int handle_cmd_set_name_common(struct aecp *aecp, int64_t now,
const struct avb_packet_aecp_aem_setget_name *cmd;
struct descriptor *desc;
uint16_t desc_type, desc_id, name_index;
char *name_ptr;
unsigned char *name_ptr;
int rc;
cmd = (const struct avb_packet_aecp_aem_setget_name *)p->payload;
@ -169,7 +169,7 @@ int handle_cmd_set_name_common(struct aecp *aecp, int64_t now,
return reply_status(aecp,
AVB_AECP_AEM_STATUS_NO_SUCH_DESCRIPTOR, m, len);
name_ptr = get_name_ptr(desc_type, descriptor_body(desc), name_index);
name_ptr = (unsigned char *)get_name_ptr(desc_type, descriptor_body(desc), name_index);
if (name_ptr == NULL)
return reply_status(aecp,
AVB_AECP_AEM_STATUS_BAD_ARGUMENTS, m, len);

View file

@ -250,7 +250,7 @@ struct avb_packet_aecp_aem_setget_name {
uint16_t descriptor_index;
uint16_t name_index;
uint16_t configuration_index;
char name[64];
unsigned char name[64];
} __attribute__ ((__packed__));
struct avb_packet_aecp_aem_setget_association_id {

View file

@ -16,11 +16,11 @@ typedef enum {
ST_ERROR,
} UTF8_STATE;
int validate_utf8 (uint8_t *str, size_t len)
int validate_utf8 (const unsigned char *str, size_t len)
{
UTF8_STATE state = ST_START;
for (int i = 0; i < len; ++i)
for (unsigned int i = 0; i < len; ++i)
{
switch (state)
{
@ -103,7 +103,7 @@ int validate_utf8 (uint8_t *str, size_t len)
}
}
int check_zero_padding (uint8_t const *str, size_t len)
int check_zero_padding (const unsigned char *str, size_t len)
{
size_t str_len = strnlen ((char *)str, len);
/* String doesn't need to be null-terminated. Return success if there is no
@ -113,7 +113,7 @@ int check_zero_padding (uint8_t const *str, size_t len)
return 0;
}
for (int i = str_len; i < len; ++i)
for (unsigned int i = str_len; i < len; ++i)
{
if (str[i] != 0x00)
{

View file

@ -8,7 +8,7 @@
#include <stdint.h>
#include <string.h>
int validate_utf8(uint8_t *str, size_t len);
int check_zero_padding(uint8_t *str, size_t len);
int check_zero_padding(const unsigned char *str, size_t len);
int validate_utf8(const unsigned char *str, size_t len);
#endif /* AVB_STRINGS_H */