From a0b6480267adbd52062343d9b38ff86cce89b894 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 27 Aug 2020 11:45:30 -0400 Subject: [PATCH] bitfield.h.j2: prefix `CAST_PTR` with the uppercase identifier prefix Signed-off-by: Philippe Proulx --- barectf/templates/bitfield.h.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/barectf/templates/bitfield.h.j2 b/barectf/templates/bitfield.h.j2 index d19951d..8cb46ba 100644 --- a/barectf/templates/bitfield.h.j2 +++ b/barectf/templates/bitfield.h.j2 @@ -34,10 +34,10 @@ #include #ifdef __cplusplus -# define CAST_PTR(_type, _value) \ +# define {{ ucprefix }}CAST_PTR(_type, _value) \ static_cast<_type>(static_cast(_value)) #else -# define CAST_PTR(_type, _value) ((void *) (_value)) +# define {{ ucprefix }}CAST_PTR(_type, _value) ((void *) (_value)) #endif {% set def_bo = cfg.trace.type.default_byte_order %} @@ -78,7 +78,7 @@ do { \ #define _{{ prefix }}bt_bitfield_write_le(_ptr, type, _start, _length, _vtype, _v) \ do { \ _vtype __v = (_v); \ - type *__ptr = CAST_PTR(type *, _ptr); \ + type *__ptr = {{ ucprefix }}CAST_PTR(type *, _ptr); \ unsigned long __start = (_start), __length = (_length); \ type mask, cmask; \ unsigned long ts = sizeof(type) * CHAR_BIT; /* type size */ \ @@ -137,7 +137,7 @@ do { \ #define _{{ prefix }}bt_bitfield_write_be(_ptr, type, _start, _length, _vtype, _v) \ do { \ _vtype __v = (_v); \ - type *__ptr = CAST_PTR(type *, _ptr); \ + type *__ptr = {{ ucprefix }}CAST_PTR(type *, _ptr); \ unsigned long __start = (_start), __length = (_length); \ type mask, cmask; \ unsigned long ts = sizeof(type) * CHAR_BIT; /* type size */ \ -- 2.34.1