mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
spa: debug: SPA_TYPE_Id is unsigned
The underlying type of `SPA_TYPE_Id` is `uint32_t`, so access and print it as such.
This commit is contained in:
parent
49d9d5e618
commit
331bb2f1ed
2 changed files with 7 additions and 4 deletions
|
|
@ -5,6 +5,8 @@
|
||||||
#ifndef SPA_DEBUG_FORMAT_H
|
#ifndef SPA_DEBUG_FORMAT_H
|
||||||
#define SPA_DEBUG_FORMAT_H
|
#define SPA_DEBUG_FORMAT_H
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include <spa/pod/parser.h>
|
#include <spa/pod/parser.h>
|
||||||
#include <spa/utils/string.h>
|
#include <spa/utils/string.h>
|
||||||
#include <spa/debug/context.h>
|
#include <spa/debug/context.h>
|
||||||
|
|
@ -41,10 +43,11 @@ spa_debug_strbuf_format_value(struct spa_strbuf *buffer, const struct spa_type_i
|
||||||
break;
|
break;
|
||||||
case SPA_TYPE_Id:
|
case SPA_TYPE_Id:
|
||||||
{
|
{
|
||||||
const char *str = spa_debug_type_find_short_name(info, *(int32_t *) body);
|
uint32_t value = *(uint32_t *) body;
|
||||||
|
const char *str = spa_debug_type_find_short_name(info, value);
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
if (str == NULL) {
|
if (str == NULL) {
|
||||||
snprintf(tmp, sizeof(tmp), "%d", *(int32_t*)body);
|
snprintf(tmp, sizeof(tmp), "%" PRIu32, value);
|
||||||
str = tmp;
|
str = tmp;
|
||||||
}
|
}
|
||||||
spa_strbuf_append(buffer, "%s", str);
|
spa_strbuf_append(buffer, "%s", str);
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ spa_debugc_pod_value(struct spa_debug_context *ctx, int indent, const struct spa
|
||||||
spa_debugc(ctx, "%*s" "Bool %s", indent, "", (*(int32_t *) body) ? "true" : "false");
|
spa_debugc(ctx, "%*s" "Bool %s", indent, "", (*(int32_t *) body) ? "true" : "false");
|
||||||
break;
|
break;
|
||||||
case SPA_TYPE_Id:
|
case SPA_TYPE_Id:
|
||||||
spa_debugc(ctx, "%*s" "Id %-8" PRId32 " (%s)", indent, "", *(int32_t *) body,
|
spa_debugc(ctx, "%*s" "Id %-8" PRIu32 " (%s)", indent, "", *(uint32_t *) body,
|
||||||
spa_debug_type_find_name(info, *(int32_t *) body));
|
spa_debug_type_find_name(info, *(uint32_t *) body));
|
||||||
break;
|
break;
|
||||||
case SPA_TYPE_Int:
|
case SPA_TYPE_Int:
|
||||||
spa_debugc(ctx, "%*s" "Int %" PRId32, indent, "", *(int32_t *) body);
|
spa_debugc(ctx, "%*s" "Int %" PRId32, indent, "", *(int32_t *) body);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue