diff options
author | Wim Taymans <wtaymans@redhat.com> | 2018-02-08 10:49:08 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2018-02-08 10:49:08 +0100 |
commit | f049d3dc7f8cdc26c73b7f8bb56e5cc9c4f3eb9e (patch) | |
tree | ee9e36d1ab3fad043317d8b2de8cc2348ba7fb11 /spa | |
parent | 72e98dc74a8a56eae741b81ce660850e075306df (diff) |
Fix compiler issues with c++
Diffstat (limited to 'spa')
-rw-r--r-- | spa/include/spa/pod/builder.h | 8 | ||||
-rw-r--r-- | spa/include/spa/support/log.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/spa/include/spa/pod/builder.h b/spa/include/spa/pod/builder.h index 9992f527..6876d8d5 100644 --- a/spa/include/spa/pod/builder.h +++ b/spa/include/spa/pod/builder.h @@ -84,7 +84,7 @@ spa_pod_builder_deref(struct spa_pod_builder *builder, uint32_t ref) else if (ref + 8 <= builder->size) { struct spa_pod *pod = SPA_MEMBER(builder->data, ref, struct spa_pod); if (SPA_POD_SIZE(pod) <= builder->size) - return pod; + return (void *) pod; } return NULL; } @@ -115,7 +115,7 @@ spa_pod_builder_raw(struct spa_pod_builder *builder, const void *data, uint32_t if (ref + size > builder->size) ref = -1; else - memcpy(builder->data + ref, data, size); + memcpy(SPA_MEMBER(builder->data, ref, void), data, size); } builder->state.offset += size; @@ -148,7 +148,7 @@ static inline void *spa_pod_builder_pop(struct spa_pod_builder *builder) struct spa_pod *pod; frame = &builder->frame[--builder->state.depth]; - if ((pod = spa_pod_builder_deref(builder, frame->ref)) != NULL) + if ((pod = (struct spa_pod *) spa_pod_builder_deref(builder, frame->ref)) != NULL) *pod = frame->pod; top = builder->state.depth > 0 ? &builder->frame[builder->state.depth-1] : NULL; @@ -328,7 +328,7 @@ spa_pod_builder_array(struct spa_pod_builder *builder, uint32_t child_size, uint32_t child_type, uint32_t n_elems, const void *elems) { const struct spa_pod_array p = { - {sizeof(struct spa_pod_array_body) + n_elems * child_size, SPA_POD_TYPE_ARRAY}, + {(uint32_t)(sizeof(struct spa_pod_array_body) + n_elems * child_size), SPA_POD_TYPE_ARRAY}, {{child_size, child_type}} }; uint32_t ref = spa_pod_builder_raw(builder, &p, sizeof(p)); diff --git a/spa/include/spa/support/log.h b/spa/include/spa/support/log.h index 260f6339..dfce08c0 100644 --- a/spa/include/spa/support/log.h +++ b/spa/include/spa/support/log.h @@ -113,7 +113,7 @@ struct spa_log { #else #define SPA_LOG_FUNC(name,lev) \ -static inline void spa_log_##name (struct spa_log *l, const char *format, ...) \ +static inline void spa_log_##name (struct spa_log *l, const char *format, ...) \ { \ if (SPA_UNLIKELY (spa_log_level_enabled (l, lev))) { \ va_list varargs; \ |