diff --git a/libkc3/buf_inspect.c b/libkc3/buf_inspect.c
index 9df8365..e2626c8 100644
--- a/libkc3/buf_inspect.c
+++ b/libkc3/buf_inspect.c
@@ -19,6 +19,8 @@
#include "array.h"
#include "buf.h"
#include "buf_inspect.h"
+#include "buf_inspect_s32_decimal.h"
+#include "buf_inspect_s64_decimal.h"
#include "buf_save.h"
#include "character.h"
#include "cow.h"
@@ -32,6 +34,8 @@
#include "str.h"
#include "tag.h"
+const s_sym *g_buf_inspect_type = NULL;
+
sw buf_inspect_array_data (s_buf *buf, const s_array *array);
sw buf_inspect_array_data_rec (s_buf *buf, const s_array *array,
const u8 **data, const s_tag **tag,
@@ -45,6 +49,7 @@ sw buf_inspect_tag_type (s_buf *buf, e_tag_type type);
sw buf_inspect_array (s_buf *buf, const s_array *array)
{
+ const s_sym *buf_inspect_type;
sw r;
sw result = 0;
assert(buf);
@@ -63,11 +68,14 @@ sw buf_inspect_array (s_buf *buf, const s_array *array)
r = result;
goto clean;
}
+ buf_inspect_type = g_buf_inspect_type;
+ g_buf_inspect_type = sym_array_type(array->array_type);
if ((r = buf_inspect_array_data(buf, array)) < 0) {
err_puts("buf_inspect_array: buf_inspect_array_data");
goto clean;
}
result += r;
+ g_buf_inspect_type = buf_inspect_type;
r = result;
clean:
return r;
@@ -146,6 +154,7 @@ sw buf_inspect_array_data_rec (s_buf *buf, const s_array *array,
sw buf_inspect_array_data_size (const s_array *array)
{
uw *address;
+ const s_sym *buf_inspect_type;
u8 *data = NULL;
s_tag *tag = NULL;
sw r;
@@ -157,9 +166,12 @@ sw buf_inspect_array_data_size (const s_array *array)
address = alloc(array->dimension * sizeof(uw));
if (! address)
return -1;
+ buf_inspect_type = g_buf_inspect_type;
+ g_buf_inspect_type = sym_array_type(array->array_type);
r = buf_inspect_array_data_size_rec(array, (const u8 **) &data,
(const s_tag **) &tag,
address, 0);
+ g_buf_inspect_type = buf_inspect_type;
free(address);
return r;
}
@@ -1080,7 +1092,7 @@ sw buf_inspect_f32 (s_buf *buf, const f32 *f)
return r;
result += r;
}
- if ((r = buf_inspect_s32(buf, &exp)) <= 0)
+ if ((r = buf_inspect_s32_decimal(buf, &exp)) <= 0)
return r;
result += r;
}
@@ -1158,7 +1170,7 @@ sw buf_inspect_f64 (s_buf *buf, const f64 *f)
return r;
result += r;
}
- if ((r = buf_inspect_s64(buf, &exp)) <= 0)
+ if ((r = buf_inspect_s64_decimal(buf, &exp)) <= 0)
return r;
result += r;
}
@@ -1793,6 +1805,7 @@ sw buf_inspect_list_tag_size (const s_tag *tag)
sw buf_inspect_map (s_buf *buf, const s_map *map)
{
+ const s_sym *buf_inspect_type;
uw i = 0;
s_tag *k;
sw r;
@@ -1825,9 +1838,17 @@ sw buf_inspect_map (s_buf *buf, const s_map *map)
return r;
result += r;
}
- if ((r = buf_inspect_tag(buf, map->value + i)) < 0)
+ buf_inspect_type = g_buf_inspect_type;
+ if (! tag_type(map->value + i, &g_buf_inspect_type)) {
+ g_buf_inspect_type = buf_inspect_type;
+ return -1;
+ }
+ if ((r = buf_inspect_tag(buf, map->value + i)) < 0) {
+ g_buf_inspect_type = buf_inspect_type;
return r;
+ }
result += r;
+ g_buf_inspect_type = buf_inspect_type;
i++;
if (i < map->count) {
if ((r = buf_write_1(buf, ", ")) < 0)
diff --git a/libkc3/buf_inspect.h b/libkc3/buf_inspect.h
index e20d0c8..eea0b54 100644
--- a/libkc3/buf_inspect.h
+++ b/libkc3/buf_inspect.h
@@ -21,6 +21,8 @@
#include "types.h"
+extern const s_sym *g_buf_inspect_type;
+
#define BUF_INSPECT_S_BASE_PROTOTYPES(bits, base) \
sw buf_inspect_s ## bits ## _ ## base (s_buf *buf, \
const s ## bits *s); \
diff --git a/libkc3/buf_inspect_s.c.in b/libkc3/buf_inspect_s.c.in
index 775079e..5429fb2 100644
--- a/libkc3/buf_inspect_s.c.in
+++ b/libkc3/buf_inspect_s.c.in
@@ -15,6 +15,7 @@
#include "buf.h"
#include "buf_inspect.h"
#include "buf_inspect_u_bits$.h"
+#include "buf_inspect_u_bits$_decimal.h"
#include "sym.h"
sw buf_inspect_s_bits$ (s_buf *buf, const s_bits$ *s)
@@ -22,12 +23,14 @@ sw buf_inspect_s_bits$ (s_buf *buf, const s_bits$ *s)
sw r;
sw result = 0;
u_bits$ u;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_S_bits$)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_S_bits$) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_S_bits$)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
u = *s;
if (*s < 0) {
if ((r = buf_write_1(buf, "-")) < 0)
@@ -35,7 +38,7 @@ sw buf_inspect_s_bits$ (s_buf *buf, const s_bits$ *s)
result += r;
u = -*s;
}
- if ((r = buf_inspect_u_bits$(buf, &u)) < 0)
+ if ((r = buf_inspect_u_bits$_decimal(buf, &u)) < 0)
return r;
result += r;
return result;
@@ -46,15 +49,17 @@ sw buf_inspect_s_bits$_size (const s_bits$ *s)
sw r;
sw result = 0;
u_bits$ u;
- if ((r = buf_inspect_paren_sym_size(&g_sym_S_bits$)) < 0)
- return r;
- result += r;
- result += strlen(" ");
+ if (g_buf_inspect_type != &g_sym_S_bits$) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_S_bits$)) < 0)
+ return r;
+ result += r;
+ result += strlen(" ");
+ }
u = *s;
if (*s < 0) {
result += strlen("-");
u = -*s;
}
- result += buf_inspect_u_bits$_size(&u);
+ result += buf_inspect_u_bits$_decimal_size(&u);
return result;
}
diff --git a/libkc3/buf_inspect_s16.c b/libkc3/buf_inspect_s16.c
index 8bd9fa7..ab1450a 100644
--- a/libkc3/buf_inspect_s16.c
+++ b/libkc3/buf_inspect_s16.c
@@ -15,6 +15,7 @@
#include "buf.h"
#include "buf_inspect.h"
#include "buf_inspect_u16.h"
+#include "buf_inspect_u16_decimal.h"
#include "sym.h"
sw buf_inspect_s16 (s_buf *buf, const s16 *s)
@@ -22,12 +23,14 @@ sw buf_inspect_s16 (s_buf *buf, const s16 *s)
sw r;
sw result = 0;
u16 u;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_S16)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_S16) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_S16)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
u = *s;
if (*s < 0) {
if ((r = buf_write_1(buf, "-")) < 0)
@@ -35,7 +38,7 @@ sw buf_inspect_s16 (s_buf *buf, const s16 *s)
result += r;
u = -*s;
}
- if ((r = buf_inspect_u16(buf, &u)) < 0)
+ if ((r = buf_inspect_u16_decimal(buf, &u)) < 0)
return r;
result += r;
return result;
@@ -46,15 +49,17 @@ sw buf_inspect_s16_size (const s16 *s)
sw r;
sw result = 0;
u16 u;
- if ((r = buf_inspect_paren_sym_size(&g_sym_S16)) < 0)
- return r;
- result += r;
- result += strlen(" ");
+ if (g_buf_inspect_type != &g_sym_S16) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_S16)) < 0)
+ return r;
+ result += r;
+ result += strlen(" ");
+ }
u = *s;
if (*s < 0) {
result += strlen("-");
u = -*s;
}
- result += buf_inspect_u16_size(&u);
+ result += buf_inspect_u16_decimal_size(&u);
return result;
}
diff --git a/libkc3/buf_inspect_s32.c b/libkc3/buf_inspect_s32.c
index 4855de1..353460c 100644
--- a/libkc3/buf_inspect_s32.c
+++ b/libkc3/buf_inspect_s32.c
@@ -15,6 +15,7 @@
#include "buf.h"
#include "buf_inspect.h"
#include "buf_inspect_u32.h"
+#include "buf_inspect_u32_decimal.h"
#include "sym.h"
sw buf_inspect_s32 (s_buf *buf, const s32 *s)
@@ -22,12 +23,14 @@ sw buf_inspect_s32 (s_buf *buf, const s32 *s)
sw r;
sw result = 0;
u32 u;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_S32)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_S32) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_S32)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
u = *s;
if (*s < 0) {
if ((r = buf_write_1(buf, "-")) < 0)
@@ -35,7 +38,7 @@ sw buf_inspect_s32 (s_buf *buf, const s32 *s)
result += r;
u = -*s;
}
- if ((r = buf_inspect_u32(buf, &u)) < 0)
+ if ((r = buf_inspect_u32_decimal(buf, &u)) < 0)
return r;
result += r;
return result;
@@ -46,15 +49,17 @@ sw buf_inspect_s32_size (const s32 *s)
sw r;
sw result = 0;
u32 u;
- if ((r = buf_inspect_paren_sym_size(&g_sym_S32)) < 0)
- return r;
- result += r;
- result += strlen(" ");
+ if (g_buf_inspect_type != &g_sym_S32) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_S32)) < 0)
+ return r;
+ result += r;
+ result += strlen(" ");
+ }
u = *s;
if (*s < 0) {
result += strlen("-");
u = -*s;
}
- result += buf_inspect_u32_size(&u);
+ result += buf_inspect_u32_decimal_size(&u);
return result;
}
diff --git a/libkc3/buf_inspect_s64.c b/libkc3/buf_inspect_s64.c
index 2c1d07f..38c7968 100644
--- a/libkc3/buf_inspect_s64.c
+++ b/libkc3/buf_inspect_s64.c
@@ -15,6 +15,7 @@
#include "buf.h"
#include "buf_inspect.h"
#include "buf_inspect_u64.h"
+#include "buf_inspect_u64_decimal.h"
#include "sym.h"
sw buf_inspect_s64 (s_buf *buf, const s64 *s)
@@ -22,12 +23,14 @@ sw buf_inspect_s64 (s_buf *buf, const s64 *s)
sw r;
sw result = 0;
u64 u;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_S64)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_S64) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_S64)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
u = *s;
if (*s < 0) {
if ((r = buf_write_1(buf, "-")) < 0)
@@ -35,7 +38,7 @@ sw buf_inspect_s64 (s_buf *buf, const s64 *s)
result += r;
u = -*s;
}
- if ((r = buf_inspect_u64(buf, &u)) < 0)
+ if ((r = buf_inspect_u64_decimal(buf, &u)) < 0)
return r;
result += r;
return result;
@@ -46,15 +49,17 @@ sw buf_inspect_s64_size (const s64 *s)
sw r;
sw result = 0;
u64 u;
- if ((r = buf_inspect_paren_sym_size(&g_sym_S64)) < 0)
- return r;
- result += r;
- result += strlen(" ");
+ if (g_buf_inspect_type != &g_sym_S64) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_S64)) < 0)
+ return r;
+ result += r;
+ result += strlen(" ");
+ }
u = *s;
if (*s < 0) {
result += strlen("-");
u = -*s;
}
- result += buf_inspect_u64_size(&u);
+ result += buf_inspect_u64_decimal_size(&u);
return result;
}
diff --git a/libkc3/buf_inspect_s8.c b/libkc3/buf_inspect_s8.c
index 53c823e..21917ab 100644
--- a/libkc3/buf_inspect_s8.c
+++ b/libkc3/buf_inspect_s8.c
@@ -15,6 +15,7 @@
#include "buf.h"
#include "buf_inspect.h"
#include "buf_inspect_u8.h"
+#include "buf_inspect_u8_decimal.h"
#include "sym.h"
sw buf_inspect_s8 (s_buf *buf, const s8 *s)
@@ -22,12 +23,14 @@ sw buf_inspect_s8 (s_buf *buf, const s8 *s)
sw r;
sw result = 0;
u8 u;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_S8)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_S8) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_S8)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
u = *s;
if (*s < 0) {
if ((r = buf_write_1(buf, "-")) < 0)
@@ -35,7 +38,7 @@ sw buf_inspect_s8 (s_buf *buf, const s8 *s)
result += r;
u = -*s;
}
- if ((r = buf_inspect_u8(buf, &u)) < 0)
+ if ((r = buf_inspect_u8_decimal(buf, &u)) < 0)
return r;
result += r;
return result;
@@ -46,15 +49,17 @@ sw buf_inspect_s8_size (const s8 *s)
sw r;
sw result = 0;
u8 u;
- if ((r = buf_inspect_paren_sym_size(&g_sym_S8)) < 0)
- return r;
- result += r;
- result += strlen(" ");
+ if (g_buf_inspect_type != &g_sym_S8) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_S8)) < 0)
+ return r;
+ result += r;
+ result += strlen(" ");
+ }
u = *s;
if (*s < 0) {
result += strlen("-");
u = -*s;
}
- result += buf_inspect_u8_size(&u);
+ result += buf_inspect_u8_decimal_size(&u);
return result;
}
diff --git a/libkc3/buf_inspect_sw.c b/libkc3/buf_inspect_sw.c
index bba1a4d..06d65ca 100644
--- a/libkc3/buf_inspect_sw.c
+++ b/libkc3/buf_inspect_sw.c
@@ -15,6 +15,7 @@
#include "buf.h"
#include "buf_inspect.h"
#include "buf_inspect_uw.h"
+#include "buf_inspect_uw_decimal.h"
#include "sym.h"
sw buf_inspect_sw (s_buf *buf, const sw *s)
@@ -22,12 +23,14 @@ sw buf_inspect_sw (s_buf *buf, const sw *s)
sw r;
sw result = 0;
uw u;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_Sw)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_Sw) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_Sw)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
u = *s;
if (*s < 0) {
if ((r = buf_write_1(buf, "-")) < 0)
@@ -35,7 +38,7 @@ sw buf_inspect_sw (s_buf *buf, const sw *s)
result += r;
u = -*s;
}
- if ((r = buf_inspect_uw(buf, &u)) < 0)
+ if ((r = buf_inspect_uw_decimal(buf, &u)) < 0)
return r;
result += r;
return result;
@@ -46,15 +49,17 @@ sw buf_inspect_sw_size (const sw *s)
sw r;
sw result = 0;
uw u;
- if ((r = buf_inspect_paren_sym_size(&g_sym_Sw)) < 0)
- return r;
- result += r;
- result += strlen(" ");
+ if (g_buf_inspect_type != &g_sym_Sw) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_Sw)) < 0)
+ return r;
+ result += r;
+ result += strlen(" ");
+ }
u = *s;
if (*s < 0) {
result += strlen("-");
u = -*s;
}
- result += buf_inspect_uw_size(&u);
+ result += buf_inspect_uw_decimal_size(&u);
return result;
}
diff --git a/libkc3/buf_inspect_u.c.in b/libkc3/buf_inspect_u.c.in
index 3c7eaa0..91f0652 100644
--- a/libkc3/buf_inspect_u.c.in
+++ b/libkc3/buf_inspect_u.c.in
@@ -23,12 +23,14 @@ sw buf_inspect_u_bits$ (s_buf *buf, const u_bits$ *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_U_bits$)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_U_bits$) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_U_bits$)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
if ((r = buf_inspect_u_bits$_base(buf, &g_kc3_base_decimal, u)) < 0)
return r;
result += r;
@@ -127,10 +129,12 @@ sw buf_inspect_u_bits$_size (const u_bits$ *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym_size(&g_sym_U_bits$)) < 0)
- return r;
- result += r;
- result++;
+ if (g_buf_inspect_type != &g_sym_U_bits$) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_U_bits$)) < 0)
+ return r;
+ result += r;
+ result++;
+ }
if ((r = buf_inspect_u_bits$_base_size(&g_kc3_base_decimal, u)) < 0)
return r;
result += r;
diff --git a/libkc3/buf_inspect_u16.c b/libkc3/buf_inspect_u16.c
index 0a3beb1..cbe4e77 100644
--- a/libkc3/buf_inspect_u16.c
+++ b/libkc3/buf_inspect_u16.c
@@ -23,12 +23,14 @@ sw buf_inspect_u16 (s_buf *buf, const u16 *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_U16)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_U16) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_U16)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
if ((r = buf_inspect_u16_base(buf, &g_kc3_base_decimal, u)) < 0)
return r;
result += r;
@@ -127,10 +129,12 @@ sw buf_inspect_u16_size (const u16 *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym_size(&g_sym_U16)) < 0)
- return r;
- result += r;
- result++;
+ if (g_buf_inspect_type != &g_sym_U16) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_U16)) < 0)
+ return r;
+ result += r;
+ result++;
+ }
if ((r = buf_inspect_u16_base_size(&g_kc3_base_decimal, u)) < 0)
return r;
result += r;
diff --git a/libkc3/buf_inspect_u32.c b/libkc3/buf_inspect_u32.c
index 5d7285a..84b41b3 100644
--- a/libkc3/buf_inspect_u32.c
+++ b/libkc3/buf_inspect_u32.c
@@ -23,12 +23,14 @@ sw buf_inspect_u32 (s_buf *buf, const u32 *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_U32)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_U32) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_U32)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
if ((r = buf_inspect_u32_base(buf, &g_kc3_base_decimal, u)) < 0)
return r;
result += r;
@@ -127,10 +129,12 @@ sw buf_inspect_u32_size (const u32 *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym_size(&g_sym_U32)) < 0)
- return r;
- result += r;
- result++;
+ if (g_buf_inspect_type != &g_sym_U32) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_U32)) < 0)
+ return r;
+ result += r;
+ result++;
+ }
if ((r = buf_inspect_u32_base_size(&g_kc3_base_decimal, u)) < 0)
return r;
result += r;
diff --git a/libkc3/buf_inspect_u64.c b/libkc3/buf_inspect_u64.c
index 98f6352..4349dc4 100644
--- a/libkc3/buf_inspect_u64.c
+++ b/libkc3/buf_inspect_u64.c
@@ -23,12 +23,14 @@ sw buf_inspect_u64 (s_buf *buf, const u64 *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_U64)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_U64) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_U64)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
if ((r = buf_inspect_u64_base(buf, &g_kc3_base_decimal, u)) < 0)
return r;
result += r;
@@ -127,10 +129,12 @@ sw buf_inspect_u64_size (const u64 *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym_size(&g_sym_U64)) < 0)
- return r;
- result += r;
- result++;
+ if (g_buf_inspect_type != &g_sym_U64) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_U64)) < 0)
+ return r;
+ result += r;
+ result++;
+ }
if ((r = buf_inspect_u64_base_size(&g_kc3_base_decimal, u)) < 0)
return r;
result += r;
diff --git a/libkc3/buf_inspect_u8.c b/libkc3/buf_inspect_u8.c
index 570f7d5..11ad801 100644
--- a/libkc3/buf_inspect_u8.c
+++ b/libkc3/buf_inspect_u8.c
@@ -23,12 +23,14 @@ sw buf_inspect_u8 (s_buf *buf, const u8 *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_U8)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_U8) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_U8)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
if ((r = buf_inspect_u8_base(buf, &g_kc3_base_decimal, u)) < 0)
return r;
result += r;
@@ -127,10 +129,12 @@ sw buf_inspect_u8_size (const u8 *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym_size(&g_sym_U8)) < 0)
- return r;
- result += r;
- result++;
+ if (g_buf_inspect_type != &g_sym_U8) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_U8)) < 0)
+ return r;
+ result += r;
+ result++;
+ }
if ((r = buf_inspect_u8_base_size(&g_kc3_base_decimal, u)) < 0)
return r;
result += r;
diff --git a/libkc3/buf_inspect_uw.c b/libkc3/buf_inspect_uw.c
index 67fd7b5..34bb0ea 100644
--- a/libkc3/buf_inspect_uw.c
+++ b/libkc3/buf_inspect_uw.c
@@ -23,12 +23,14 @@ sw buf_inspect_uw (s_buf *buf, const uw *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym(buf, &g_sym_Uw)) < 0)
- return r;
- result += r;
- if ((r = buf_write_1(buf, " ")) < 0)
- return r;
- result += r;
+ if (g_buf_inspect_type != &g_sym_Uw) {
+ if ((r = buf_inspect_paren_sym(buf, &g_sym_Uw)) < 0)
+ return r;
+ result += r;
+ if ((r = buf_write_1(buf, " ")) < 0)
+ return r;
+ result += r;
+ }
if ((r = buf_inspect_uw_base(buf, &g_kc3_base_decimal, u)) < 0)
return r;
result += r;
@@ -127,10 +129,12 @@ sw buf_inspect_uw_size (const uw *u)
{
sw r;
sw result = 0;
- if ((r = buf_inspect_paren_sym_size(&g_sym_Uw)) < 0)
- return r;
- result += r;
- result++;
+ if (g_buf_inspect_type != &g_sym_Uw) {
+ if ((r = buf_inspect_paren_sym_size(&g_sym_Uw)) < 0)
+ return r;
+ result += r;
+ result++;
+ }
if ((r = buf_inspect_uw_base_size(&g_kc3_base_decimal, u)) < 0)
return r;
result += r;