Fix issues (normal contract where used for I/O whereas they could be used
with OA Dict)
This commit is contained in:
1 parent
faedca81d1
commit
8a4d013354
1 file changed
+4
-8
@@ -607,7 +607,6 @@
|
|||||||
M_C(name, _get_str)(string_t str, dict_t dict, const bool append) \
|
M_C(name, _get_str)(string_t str, dict_t dict, const bool append) \
|
||||||
{ \
|
{ \
|
||||||
STRINGI_CONTRACT (str); \
|
STRINGI_CONTRACT (str); \
|
||||||
DICTI_CONTRACT(name, dict); \
|
|
||||||
(append ? string_cat_str : string_set_str) (str, "{"); \
|
(append ? string_cat_str : string_set_str) (str, "{"); \
|
||||||
dict_it_t it; \
|
dict_it_t it; \
|
||||||
for (M_C(name, _it)(it, dict) ; \
|
for (M_C(name, _it)(it, dict) ; \
|
||||||
@@ -631,7 +630,6 @@
|
|||||||
M_C(name, _out_str)(FILE *file, const dict_t dict) \
|
M_C(name, _out_str)(FILE *file, const dict_t dict) \
|
||||||
{ \
|
{ \
|
||||||
assert (file != NULL); \
|
assert (file != NULL); \
|
||||||
DICTI_CONTRACT(name, dict); \
|
|
||||||
fputc ('{', file); \
|
fputc ('{', file); \
|
||||||
dict_it_t it; \
|
dict_it_t it; \
|
||||||
for (M_C(name, _it)(it, dict) ; \
|
for (M_C(name, _it)(it, dict) ; \
|
||||||
@@ -654,7 +652,6 @@
|
|||||||
M_C(name, _parse_str)(dict_t dict, const char str[], const char **endp) \
|
M_C(name, _parse_str)(dict_t dict, const char str[], const char **endp) \
|
||||||
{ \
|
{ \
|
||||||
assert (str != NULL); \
|
assert (str != NULL); \
|
||||||
DICTI_CONTRACT(name, dict); \
|
|
||||||
M_C(name, _clean)(dict); \
|
M_C(name, _clean)(dict); \
|
||||||
bool success = false; \
|
bool success = false; \
|
||||||
int c = *str++; \
|
int c = *str++; \
|
||||||
@@ -695,7 +692,6 @@
|
|||||||
M_C(name, _in_str)(dict_t dict, FILE *file) \
|
M_C(name, _in_str)(dict_t dict, FILE *file) \
|
||||||
{ \
|
{ \
|
||||||
assert (file != NULL); \
|
assert (file != NULL); \
|
||||||
DICTI_CONTRACT(name, dict); \
|
|
||||||
M_C(name, _clean)(dict); \
|
M_C(name, _clean)(dict); \
|
||||||
int c = fgetc(file); \
|
int c = fgetc(file); \
|
||||||
if (M_UNLIKELY (c != '{')) return false; \
|
if (M_UNLIKELY (c != '{')) return false; \
|
||||||
@@ -903,7 +899,7 @@ typedef enum {
|
|||||||
} dict_t[1]; \
|
} dict_t[1]; \
|
||||||
\
|
\
|
||||||
typedef struct M_C(name, _it_s) { \
|
typedef struct M_C(name, _it_s) { \
|
||||||
struct M_C(name,_s) *dict; \
|
const struct M_C(name,_s) *dict; \
|
||||||
size_t index; \
|
size_t index; \
|
||||||
} dict_it_t[1]; \
|
} dict_it_t[1]; \
|
||||||
\
|
\
|
||||||
@@ -1427,7 +1423,7 @@ typedef enum {
|
|||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline void \
|
static inline void \
|
||||||
M_C(name, _it)(dict_it_t it, dict_t d) \
|
M_C(name, _it)(dict_it_t it, const dict_t d) \
|
||||||
{ \
|
{ \
|
||||||
DICTI_OA_CONTRACT(d); \
|
DICTI_OA_CONTRACT(d); \
|
||||||
assert (it != NULL); \
|
assert (it != NULL); \
|
||||||
@@ -1452,7 +1448,7 @@ typedef enum {
|
|||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline void \
|
static inline void \
|
||||||
M_C(name, _it_last)(dict_it_t it, dict_t d) \
|
M_C(name, _it_last)(dict_it_t it, const dict_t d) \
|
||||||
{ \
|
{ \
|
||||||
DICTI_OA_CONTRACT(d); \
|
DICTI_OA_CONTRACT(d); \
|
||||||
assert (it != NULL); \
|
assert (it != NULL); \
|
||||||
@@ -1467,7 +1463,7 @@ typedef enum {
|
|||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline void \
|
static inline void \
|
||||||
M_C(name, _it_end)(dict_it_t it, dict_t d) \
|
M_C(name, _it_end)(dict_it_t it, const dict_t d) \
|
||||||
{ \
|
{ \
|
||||||
DICTI_OA_CONTRACT(d); \
|
DICTI_OA_CONTRACT(d); \
|
||||||
assert (it != NULL); \
|
assert (it != NULL); \
|
||||||
|
|||||||
Reference in new issue
Block a user