spa: prefix SPA_*_LAST enum values with an underscore

These are not part of the ABI, prefixing them makes this a bit more obvious
that they shouldn't be used.
This commit is contained in:
Peter Hutterer 2021-05-06 10:55:40 +10:00
parent 2ff7a8fba7
commit 0504ebffeb
7 changed files with 15 additions and 15 deletions

View file

@ -45,7 +45,7 @@ enum spa_data_type {
SPA_DATA_DmaBuf, /**< fd to dmabuf memory */
SPA_DATA_MemId, /**< memory is identified with an id */
SPA_DATA_LAST, /**< not part of ABI */
_SPA_DATA_LAST, /**< not part of ABI */
};
/** Chunk of memory, can change for each buffer */

View file

@ -47,7 +47,7 @@ enum spa_meta_type {
* associated with the data */
SPA_META_Busy, /**< don't write to buffer when count > 0 */
SPA_META_LAST, /**< not part of ABI/API */
_SPA_META_LAST, /**< not part of ABI/API */
};
/**

View file

@ -43,7 +43,7 @@ enum spa_control_type {
SPA_CONTROL_Midi, /**< data contains a spa_pod_bytes with raw midi data */
SPA_CONTROL_OSC, /**< data contains a spa_pod_bytes with an OSC packet */
SPA_CONTROL_LAST, /**< not part of ABI */
_SPA_CONTROL_LAST, /**< not part of ABI */
};
#ifdef __cplusplus

View file

@ -149,7 +149,7 @@ static inline int spa_debug_format(int indent,
size = val->size;
vals = SPA_POD_BODY(val);
if (type < SPA_TYPE_None || type >= SPA_TYPE_LAST)
if (type < SPA_TYPE_None || type >= _SPA_TYPE_LAST)
continue;
ti = spa_debug_type_find(info, prop->key);

View file

@ -54,26 +54,26 @@ enum {
SPA_TYPE_Fd,
SPA_TYPE_Choice,
SPA_TYPE_Pod,
SPA_TYPE_LAST, /**< not part of ABI */
_SPA_TYPE_LAST, /**< not part of ABI */
/* Pointers */
SPA_TYPE_POINTER_START = 0x10000,
SPA_TYPE_POINTER_Buffer,
SPA_TYPE_POINTER_Meta,
SPA_TYPE_POINTER_Dict,
SPA_TYPE_POINTER_LAST, /**< not part of ABI */
_SPA_TYPE_POINTER_LAST, /**< not part of ABI */
/* Events */
SPA_TYPE_EVENT_START = 0x20000,
SPA_TYPE_EVENT_Device,
SPA_TYPE_EVENT_Node,
SPA_TYPE_EVENT_LAST, /**< not part of ABI */
_SPA_TYPE_EVENT_LAST, /**< not part of ABI */
/* Commands */
SPA_TYPE_COMMAND_START = 0x30000,
SPA_TYPE_COMMAND_Device,
SPA_TYPE_COMMAND_Node,
SPA_TYPE_COMMAND_LAST, /**< not part of ABI */
_SPA_TYPE_COMMAND_LAST, /**< not part of ABI */
/* Objects */
SPA_TYPE_OBJECT_START = 0x40000,
@ -87,7 +87,7 @@ enum {
SPA_TYPE_OBJECT_ParamPortConfig,
SPA_TYPE_OBJECT_ParamRoute,
SPA_TYPE_OBJECT_Profiler,
SPA_TYPE_OBJECT_LAST, /**< not part of ABI */
_SPA_TYPE_OBJECT_LAST, /**< not part of ABI */
/* vendor extensions */
SPA_TYPE_VENDOR_PipeWire = 0x02000000,

View file

@ -34,7 +34,7 @@ static void test_abi(void)
spa_assert(SPA_DATA_MemFd == 2);
spa_assert(SPA_DATA_DmaBuf == 3);
spa_assert(SPA_DATA_MemId == 4);
spa_assert(SPA_DATA_LAST == 5);
spa_assert(_SPA_DATA_LAST == 5);
#if defined(__x86_64__) && defined(__LP64__)
spa_assert(sizeof(struct spa_chunk) == 16);
@ -55,7 +55,7 @@ static void test_abi(void)
spa_assert(SPA_META_Cursor == 5);
spa_assert(SPA_META_Control == 6);
spa_assert(SPA_META_Busy == 7);
spa_assert(SPA_META_LAST == 8);
spa_assert(_SPA_META_LAST == 8);
#if defined(__x86_64__) && defined(__LP64__)
spa_assert(sizeof(struct spa_meta) == 16);

View file

@ -102,17 +102,17 @@ static void test_abi(void)
spa_assert(SPA_TYPE_Fd == 18);
spa_assert(SPA_TYPE_Choice == 19);
spa_assert(SPA_TYPE_Pod == 20);
spa_assert(SPA_TYPE_LAST == 21);
spa_assert(_SPA_TYPE_LAST == 21);
spa_assert(SPA_TYPE_EVENT_START == 0x20000);
spa_assert(SPA_TYPE_EVENT_Device == 0x20001);
spa_assert(SPA_TYPE_EVENT_Node == 0x20002);
spa_assert(SPA_TYPE_EVENT_LAST == 0x20003);
spa_assert(_SPA_TYPE_EVENT_LAST == 0x20003);
spa_assert(SPA_TYPE_COMMAND_START == 0x30000);
spa_assert(SPA_TYPE_COMMAND_Device == 0x30001);
spa_assert(SPA_TYPE_COMMAND_Node == 0x30002);
spa_assert(SPA_TYPE_COMMAND_LAST == 0x30003);
spa_assert(_SPA_TYPE_COMMAND_LAST == 0x30003);
spa_assert(SPA_TYPE_OBJECT_START == 0x40000);
spa_assert(SPA_TYPE_OBJECT_PropInfo == 0x40001);
@ -125,7 +125,7 @@ static void test_abi(void)
spa_assert(SPA_TYPE_OBJECT_ParamPortConfig == 0x40008);
spa_assert(SPA_TYPE_OBJECT_ParamRoute == 0x40009);
spa_assert(SPA_TYPE_OBJECT_Profiler == 0x4000a);
spa_assert(SPA_TYPE_OBJECT_LAST == 0x4000b);
spa_assert(_SPA_TYPE_OBJECT_LAST == 0x4000b);
spa_assert(SPA_TYPE_VENDOR_PipeWire == 0x02000000);
spa_assert(SPA_TYPE_VENDOR_Other == 0x7f000000);