diff --git a/spa/include/spa/graph/graph-scheduler1.h b/spa/include/spa/graph/graph-scheduler1.h index 8f3f62174..72c2e7049 100644 --- a/spa/include/spa/graph/graph-scheduler1.h +++ b/spa/include/spa/graph/graph-scheduler1.h @@ -134,28 +134,28 @@ static inline bool spa_graph_data_iterate(struct spa_graph_data *data) static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *node) { - struct spa_graph_data *d = data; + struct spa_graph_data *d = (struct spa_graph_data *) data; spa_debug("node %p start pull", node); node->state = SPA_GRAPH_STATE_CHECK_IN; d->node = node; if (node->ready_link.next == NULL) spa_list_append(&d->ready, &node->ready_link); - while(spa_graph_data_iterate(data)); + while(spa_graph_data_iterate(d)); return 0; } static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *node) { - struct spa_graph_data *d = data; + struct spa_graph_data *d = (struct spa_graph_data *) data; spa_debug("node %p start push", node); node->state = SPA_GRAPH_STATE_OUT; d->node = node; if (node->ready_link.next == NULL) spa_list_append(&d->ready, &node->ready_link); - while(spa_graph_data_iterate(data)); + while(spa_graph_data_iterate(d)); return 0; } diff --git a/spa/include/spa/pod/parser.h b/spa/include/spa/pod/parser.h index b88f80da2..7550ec128 100644 --- a/spa/include/spa/pod/parser.h +++ b/spa/include/spa/pod/parser.h @@ -116,13 +116,14 @@ do { \ case 's': \ *va_arg(args, char**) = \ (pod == NULL || (SPA_POD_TYPE(pod) == SPA_POD_TYPE_NONE) \ - ? NULL : SPA_POD_CONTENTS(struct spa_pod_string, pod)); \ + ? NULL \ + : (char *)SPA_POD_CONTENTS(struct spa_pod_string, pod)); \ break; \ case 'S': \ { \ char *dest = va_arg(args, char*); \ uint32_t maxlen = va_arg(args, uint32_t); \ - strncpy(dest, SPA_POD_CONTENTS(struct spa_pod_string, pod), maxlen-1); \ + strncpy(dest, (char *)SPA_POD_CONTENTS(struct spa_pod_string, pod), maxlen-1); \ break; \ } \ case 'z': \ @@ -139,11 +140,12 @@ do { \ break; \ case 'B': \ *va_arg(args, uint32_t **) = \ - SPA_POD_CONTENTS(struct spa_pod_bitmap, pod); \ + (uint32_t *) SPA_POD_CONTENTS(struct spa_pod_bitmap, pod); \ break; \ case 'p': \ { \ - struct spa_pod_pointer_body *b = SPA_POD_BODY(pod); \ + struct spa_pod_pointer_body *b = \ + (struct spa_pod_pointer_body *) SPA_POD_BODY(pod); \ *(va_arg(args, void **)) = b->value; \ break; \ } \ @@ -247,7 +249,7 @@ static inline int spa_pod_parser_getv(struct spa_pod_parser *parser, case ':': { uint32_t key = va_arg(args, uint32_t); - const struct spa_pod *obj = parser->iter[parser->depth].data; + const struct spa_pod *obj = (const struct spa_pod *) parser->iter[parser->depth].data; prop = spa_pod_find_prop(obj, key); if (prop != NULL && (prop->body.flags & SPA_POD_PROP_FLAG_UNSET) == 0) diff --git a/spa/include/spa/support/log-impl.h b/spa/include/spa/support/log-impl.h index c69224e2e..df63f74b4 100644 --- a/spa/include/spa/support/log-impl.h +++ b/spa/include/spa/support/log-impl.h @@ -24,6 +24,8 @@ extern "C" { #endif +#include + #include static inline void spa_log_impl_logv(struct spa_log *log, diff --git a/spa/include/spa/support/type-map-impl.h b/spa/include/spa/support/type-map-impl.h index b6e0aad9c..d5416a37f 100644 --- a/spa/include/spa/support/type-map-impl.h +++ b/spa/include/spa/support/type-map-impl.h @@ -26,10 +26,16 @@ extern "C" { #include +struct spa_type_map_impl_data { + struct spa_type_map map; + unsigned int n_types; + char **types; +}; + static inline uint32_t spa_type_map_impl_get_id (struct spa_type_map *map, const char *type) { - struct { struct spa_type_map map; uint32_t n_types; char *types[1]; } *impl = (void*) map; + struct spa_type_map_impl_data *impl = (struct spa_type_map_impl_data *) map; uint32_t i = 0; for (i = 1; i <= impl->n_types; i++) { @@ -44,7 +50,7 @@ spa_type_map_impl_get_id (struct spa_type_map *map, const char *type) static inline const char * spa_type_map_impl_get_type (const struct spa_type_map *map, uint32_t id) { - struct { struct spa_type_map map; uint32_t n_types; char *types[1]; } *impl = (void*) map; + struct spa_type_map_impl_data *impl = (struct spa_type_map_impl_data *) map; if (id <= impl->n_types) return impl->types[id]; return NULL; @@ -52,7 +58,7 @@ spa_type_map_impl_get_type (const struct spa_type_map *map, uint32_t id) static inline size_t spa_type_map_impl_get_size (const struct spa_type_map *map) { - struct { struct spa_type_map map; uint32_t n_types; char *types[1]; } *impl = (void*) map; + struct spa_type_map_impl_data *impl = (struct spa_type_map_impl_data *) map; return impl->n_types; } diff --git a/spa/include/spa/utils/ringbuffer.h b/spa/include/spa/utils/ringbuffer.h index 36df4f231..ade6a7e2a 100644 --- a/spa/include/spa/utils/ringbuffer.h +++ b/spa/include/spa/utils/ringbuffer.h @@ -97,9 +97,9 @@ spa_ringbuffer_read_data(struct spa_ringbuffer *rbuf, uint32_t offset, void *data, uint32_t len) { uint32_t l0 = SPA_MIN(len, size - offset), l1 = len - l0; - memcpy(data, buffer + offset, l0); + memcpy(data, SPA_MEMBER(buffer, offset, void), l0); if (SPA_UNLIKELY(l1 > 0)) - memcpy(data + l0, buffer, l1); + memcpy(SPA_MEMBER(data, l0, void), buffer, l1); } /** @@ -147,9 +147,9 @@ spa_ringbuffer_write_data(struct spa_ringbuffer *rbuf, uint32_t offset, const void *data, uint32_t len) { uint32_t l0 = SPA_MIN(len, size - offset), l1 = len - l0; - memcpy(buffer + offset, data, l0); + memcpy(SPA_MEMBER(buffer, offset, void), data, l0); if (SPA_UNLIKELY(l1 > 0)) - memcpy(buffer, data + l0, l1); + memcpy(buffer, SPA_MEMBER(data, l0, void), l1); } /**