mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-27 21:37:37 -04:00
module-avb: fix types
This commit is contained in:
parent
3bde62bc1d
commit
2dd60fdbc6
4 changed files with 9 additions and 9 deletions
|
|
@ -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;
|
const struct avb_packet_aecp_aem_setget_name *cmd;
|
||||||
struct descriptor *desc;
|
struct descriptor *desc;
|
||||||
uint16_t desc_type, desc_id, name_index;
|
uint16_t desc_type, desc_id, name_index;
|
||||||
char *name_ptr;
|
unsigned char *name_ptr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
cmd = (const struct avb_packet_aecp_aem_setget_name *)p->payload;
|
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,
|
return reply_status(aecp,
|
||||||
AVB_AECP_AEM_STATUS_NO_SUCH_DESCRIPTOR, m, len);
|
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)
|
if (name_ptr == NULL)
|
||||||
return reply_status(aecp,
|
return reply_status(aecp,
|
||||||
AVB_AECP_AEM_STATUS_BAD_ARGUMENTS, m, len);
|
AVB_AECP_AEM_STATUS_BAD_ARGUMENTS, m, len);
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ struct avb_packet_aecp_aem_setget_name {
|
||||||
uint16_t descriptor_index;
|
uint16_t descriptor_index;
|
||||||
uint16_t name_index;
|
uint16_t name_index;
|
||||||
uint16_t configuration_index;
|
uint16_t configuration_index;
|
||||||
char name[64];
|
unsigned char name[64];
|
||||||
} __attribute__ ((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
|
|
||||||
struct avb_packet_aecp_aem_setget_association_id {
|
struct avb_packet_aecp_aem_setget_association_id {
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@ typedef enum {
|
||||||
ST_ERROR,
|
ST_ERROR,
|
||||||
} UTF8_STATE;
|
} 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;
|
UTF8_STATE state = ST_START;
|
||||||
|
|
||||||
for (int i = 0; i < len; ++i)
|
for (unsigned int i = 0; i < len; ++i)
|
||||||
{
|
{
|
||||||
switch (state)
|
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);
|
size_t str_len = strnlen ((char *)str, len);
|
||||||
/* String doesn't need to be null-terminated. Return success if there is no
|
/* 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = str_len; i < len; ++i)
|
for (unsigned int i = str_len; i < len; ++i)
|
||||||
{
|
{
|
||||||
if (str[i] != 0x00)
|
if (str[i] != 0x00)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int validate_utf8(uint8_t *str, size_t len);
|
int check_zero_padding(const unsigned char *str, size_t len);
|
||||||
int check_zero_padding(uint8_t *str, size_t len);
|
int validate_utf8(const unsigned char *str, size_t len);
|
||||||
|
|
||||||
#endif /* AVB_STRINGS_H */
|
#endif /* AVB_STRINGS_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue