MisraScope
Description
Reserved identifier used by Scope-aware public macros to find the “current” allocator. The Scope and ScopeWith macros introduce this name into the enclosing block; tier-1 public macros (VecInit, …) expand to references to it. Outside any Scope/ScopeWith block the name is undeclared and the call site is a compile error.
Do not declare a local variable with this name in user code.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
KvConfig.h:48:
///
#define KvConfigInit(...) MISRA_OVERLOAD(KvConfigInit, __VA_ARGS__)
#define KvConfigInit_0() KvConfigInit_1(MisraScope)
#define KvConfigInit_1(allocator_ptr) \
MapInitFull_9( \- In
File.h:59:
#define ReadCompleteFile(...) MISRA_OVERLOAD(ReadCompleteFile, __VA_ARGS__)
#define ReadCompleteFile_4(filename, data, file_size, capacity) \
read_complete_file((filename), (data), (file_size), (capacity), MisraScope)
#define ReadCompleteFile_5(filename, data, file_size, capacity, allocator) \
read_complete_file((filename), (data), (file_size), (capacity), (allocator))- In
Allocator.h:242:
_scope_loop_##name = NULL) \
for (Allocator *name = &_scope_user_##name.base, \
*MisraScope = &_scope_internal_##name.base, \
*_scope_done_##name = name; \
_scope_done_##name; \
- In
Allocator.h:265:
///
#define ScopeWith(alloc_ptr) \
for (Allocator *MisraScope = (alloc_ptr), *_scope_with_done = MisraScope; _scope_with_done; _scope_with_done = NULL)
///
- In
Init.h:41:
///
#define BitVecInit(...) MISRA_OVERLOAD(BitVecInit, __VA_ARGS__)
#define BitVecInit_0() BitVecInit_1(MisraScope)
#ifdef __cplusplus
# define BitVecInit_1(allocator_ptr) \- In
Init.h:27:
///
#define FloatInit(...) MISRA_OVERLOAD(FloatInit, __VA_ARGS__)
#define FloatInit_0() ((Float) {.negative = false, .significand = IntInit_1(MisraScope), .exponent = 0})
#define FloatInit_1(allocator_ptr) ((Float) {.negative = false, .significand = IntInit_1(allocator_ptr), .exponent = 0})- In
Init.h:47:
#define MapInitFull(...) MISRA_OVERLOAD(MapInitFull, __VA_ARGS__)
#define MapInitFull_8(hash_fn, compare_fn, vcmp, kci, kcd, vci, vcd, policy_value) \
MapInitFull_9(hash_fn, compare_fn, vcmp, kci, kcd, vci, vcd, policy_value, MisraScope)
///
- In
Init.h:55:
///
#define MapInit(...) MISRA_OVERLOAD(MapInit, __VA_ARGS__)
#define MapInit_2(hash_fn, compare_fn) MapInit_3(hash_fn, compare_fn, MisraScope)
#define MapInit_3(hash_fn, compare_fn, typed_alloc_ptr) \
MapInitFull_9((hash_fn), (compare_fn), NULL, NULL, NULL, NULL, NULL, MisraMapPolicyLinear, typed_alloc_ptr)- In
Init.h:64:
#define MapInitWithValueCompare(...) MISRA_OVERLOAD(MapInitWithValueCompare, __VA_ARGS__)
#define MapInitWithValueCompare_3(hash_fn, compare_fn, value_compare_fn) \
MapInitWithValueCompare_4(hash_fn, compare_fn, value_compare_fn, MisraScope)
#define MapInitWithValueCompare_4(hash_fn, compare_fn, value_compare_fn, typed_alloc_ptr) \
MapInitFull_9( \- In
Init.h:83:
#define MapInitWithPolicy(...) MISRA_OVERLOAD(MapInitWithPolicy, __VA_ARGS__)
#define MapInitWithPolicy_3(hash_fn, compare_fn, policy_value) \
MapInitWithPolicy_4(hash_fn, compare_fn, policy_value, MisraScope)
#define MapInitWithPolicy_4(hash_fn, compare_fn, policy_value, typed_alloc_ptr) \
MapInitFull_9((hash_fn), (compare_fn), NULL, NULL, NULL, NULL, NULL, (policy_value), typed_alloc_ptr)- In
Init.h:92:
#define MapInitWithValueCompareAndPolicy(...) MISRA_OVERLOAD(MapInitWithValueCompareAndPolicy, __VA_ARGS__)
#define MapInitWithValueCompareAndPolicy_4(hash_fn, compare_fn, value_compare_fn, policy_value) \
MapInitWithValueCompareAndPolicy_5(hash_fn, compare_fn, value_compare_fn, policy_value, MisraScope)
#define MapInitWithValueCompareAndPolicy_5(hash_fn, compare_fn, value_compare_fn, policy_value, typed_alloc_ptr) \
MapInitFull_9((hash_fn), (compare_fn), (value_compare_fn), NULL, NULL, NULL, NULL, (policy_value), typed_alloc_ptr)- In
Init.h:101:
#define MapInitWithDeepCopy(...) MISRA_OVERLOAD(MapInitWithDeepCopy, __VA_ARGS__)
#define MapInitWithDeepCopy_6(hash_fn, compare_fn, key_ci, key_cd, value_ci, value_cd) \
MapInitWithDeepCopy_7(hash_fn, compare_fn, key_ci, key_cd, value_ci, value_cd, MisraScope)
#define MapInitWithDeepCopy_7(hash_fn, compare_fn, key_ci, key_cd, value_ci, value_cd, typed_alloc_ptr) \
MapInitFull_9( \- In
Init.h:117:
#define MapInitT(m, ...) MISRA_OVERLOAD(MapInitT, m, __VA_ARGS__)
#ifdef __cplusplus
# define MapInitT_3(m, hash_fn, compare_fn) (TYPE_OF(m) MapInit_3((hash_fn), (compare_fn), MisraScope))
# define MapInitT_4(m, hash_fn, compare_fn, typed_alloc_ptr) \
(TYPE_OF(m) MapInit_3((hash_fn), (compare_fn), typed_alloc_ptr))- In
Init.h:121:
(TYPE_OF(m) MapInit_3((hash_fn), (compare_fn), typed_alloc_ptr))
#else
# define MapInitT_3(m, hash_fn, compare_fn) ((TYPE_OF(m))MapInit_3((hash_fn), (compare_fn), MisraScope))
# define MapInitT_4(m, hash_fn, compare_fn, typed_alloc_ptr) \
((TYPE_OF(m))MapInit_3((hash_fn), (compare_fn), typed_alloc_ptr))- In
Init.h:130:
# define MapInitWithDeepCopyT_7(m, hash_fn, compare_fn, key_ci, key_cd, value_ci, value_cd) \
(TYPE_OF(m) \
MapInitWithDeepCopy_7((hash_fn), (compare_fn), (key_ci), (key_cd), (value_ci), (value_cd), MisraScope))
# define MapInitWithDeepCopyT_8(m, hash_fn, compare_fn, key_ci, key_cd, value_ci, value_cd, typed_alloc_ptr) \
(TYPE_OF( \- In
Init.h:138:
# define MapInitWithDeepCopyT_7(m, hash_fn, compare_fn, key_ci, key_cd, value_ci, value_cd) \
((TYPE_OF(m)) \
MapInitWithDeepCopy_7((hash_fn), (compare_fn), (key_ci), (key_cd), (value_ci), (value_cd), MisraScope))
# define MapInitWithDeepCopyT_8(m, hash_fn, compare_fn, key_ci, key_cd, value_ci, value_cd, typed_alloc_ptr) \
(( \- In
Init.h:17:
///
#define ListInit(...) MISRA_OVERLOAD(ListInit, __VA_ARGS__)
#define ListInit_0() ListInitWithDeepCopy_3(NULL, NULL, MisraScope)
#define ListInit_1(typed_alloc_ptr) ListInitWithDeepCopy_3(NULL, NULL, typed_alloc_ptr)- In
Init.h:24:
///
#define ListInitT(l, ...) MISRA_OVERLOAD(ListInitT, l, __VA_ARGS__)
#define ListInitT_1(l) ListInitWithDeepCopyT_4(l, NULL, NULL, MisraScope)
#define ListInitT_2(l, typed_alloc_ptr) ListInitWithDeepCopyT_4(l, NULL, NULL, typed_alloc_ptr)- In
Init.h:32:
///
#define ListInitWithDeepCopy(...) MISRA_OVERLOAD(ListInitWithDeepCopy, __VA_ARGS__)
#define ListInitWithDeepCopy_2(ci, cd) ListInitWithDeepCopy_3(ci, cd, MisraScope)
#define ListInitWithDeepCopy_3(ci, cd, typed_alloc_ptr) \
{.head = NULL, \- In
Init.h:44:
#define ListInitWithDeepCopyT(l, ...) MISRA_OVERLOAD(ListInitWithDeepCopyT, l, __VA_ARGS__)
#ifdef __cplusplus
# define ListInitWithDeepCopyT_3(l, ci, cd) (TYPE_OF(l) ListInitWithDeepCopy_3(ci, cd, MisraScope))
# define ListInitWithDeepCopyT_4(l, ci, cd, typed_alloc_ptr) \
(TYPE_OF(l) ListInitWithDeepCopy_3(ci, cd, typed_alloc_ptr))- In
Init.h:48:
(TYPE_OF(l) ListInitWithDeepCopy_3(ci, cd, typed_alloc_ptr))
#else
# define ListInitWithDeepCopyT_3(l, ci, cd) ((TYPE_OF(l))ListInitWithDeepCopy_3(ci, cd, MisraScope))
# define ListInitWithDeepCopyT_4(l, ci, cd, typed_alloc_ptr) \
((TYPE_OF(l))ListInitWithDeepCopy_3(ci, cd, typed_alloc_ptr))- In
Init.h:25:
#define StrInitFromCstr(...) MISRA_OVERLOAD(StrInitFromCstr, __VA_ARGS__)
#define StrInitFromCstr_2(cstr, len) str_init_from_cstr((cstr), (len), MisraScope)
#define StrInitFromCstr_3(cstr, len, alloc) str_init_from_cstr((cstr), (len), ALLOCATOR_OF(alloc))- In
Init.h:53:
#define StrInit(...) MISRA_OVERLOAD(StrInit, __VA_ARGS__)
#ifdef __cplusplus
# define StrInit_0() (Str VecInit_1(MisraScope))
# define StrInit_1(alloc_ptr) (Str VecInit_1(alloc_ptr))
#else- In
Init.h:56:
# define StrInit_1(alloc_ptr) (Str VecInit_1(alloc_ptr))
#else
# define StrInit_0() ((Str)VecInit_1(MisraScope))
# define StrInit_1(alloc_ptr) ((Str)VecInit_1(alloc_ptr))
#endif- In
Init.h:27:
///
#define IntInit(...) MISRA_OVERLOAD(IntInit, __VA_ARGS__)
#define IntInit_0() ((Int) {.bits = BitVecInit_1(MisraScope)})
#define IntInit_1(allocator_ptr) ((Int) {.bits = BitVecInit_1(allocator_ptr)})- In
Init.h:37:
///
#define VecInit(...) MISRA_OVERLOAD(VecInit, __VA_ARGS__)
#define VecInit_0() VecInit_1(MisraScope)
#define VecInit_1(allocator_ptr) \
{.length = 0, \- In
Init.h:56:
#define VecInitT(v, ...) MISRA_OVERLOAD(VecInitT, v, __VA_ARGS__)
#ifdef __cplusplus
# define VecInitT_1(v) (TYPE_OF(v) VecInit_1(MisraScope))
# define VecInitT_2(v, alloc_ptr) (TYPE_OF(v) VecInit_1(alloc_ptr))
#else- In
Init.h:59:
# define VecInitT_2(v, alloc_ptr) (TYPE_OF(v) VecInit_1(alloc_ptr))
#else
# define VecInitT_1(v) ((TYPE_OF(v))VecInit_1(MisraScope))
# define VecInitT_2(v, alloc_ptr) ((TYPE_OF(v))VecInit_1(alloc_ptr))
#endif- In
Init.h:69:
///
#define VecInitWithDeepCopy(...) MISRA_OVERLOAD(VecInitWithDeepCopy, __VA_ARGS__)
#define VecInitWithDeepCopy_2(ci, cd) VecInitWithDeepCopy_3(ci, cd, MisraScope)
#define VecInitWithDeepCopy_3(ci, cd, allocator_ptr) \
{.length = 0, \- In
Init.h:81:
#define VecInitWithDeepCopyT(v, ...) MISRA_OVERLOAD(VecInitWithDeepCopyT, v, __VA_ARGS__)
#ifdef __cplusplus
# define VecInitWithDeepCopyT_3(v, ci, cd) (TYPE_OF(v) VecInitWithDeepCopy_3(ci, cd, MisraScope))
# define VecInitWithDeepCopyT_4(v, ci, cd, alloc_ptr) (TYPE_OF(v) VecInitWithDeepCopy_3(ci, cd, alloc_ptr))
#else- In
Init.h:84:
# define VecInitWithDeepCopyT_4(v, ci, cd, alloc_ptr) (TYPE_OF(v) VecInitWithDeepCopy_3(ci, cd, alloc_ptr))
#else
# define VecInitWithDeepCopyT_3(v, ci, cd) ((TYPE_OF(v))VecInitWithDeepCopy_3(ci, cd, MisraScope))
# define VecInitWithDeepCopyT_4(v, ci, cd, alloc_ptr) ((TYPE_OF(v))VecInitWithDeepCopy_3(ci, cd, alloc_ptr))
#endif- In
Init.h:14:
#define GraphInit(...) MISRA_OVERLOAD(GraphInit, __VA_ARGS__)
#define GraphInit_0() GraphInitWithDeepCopy_3(NULL, NULL, MisraScope)
#define GraphInit_1(typed_alloc_ptr) GraphInitWithDeepCopy_3(NULL, NULL, typed_alloc_ptr)- In
Init.h:18:
#define GraphInitT(g, ...) MISRA_OVERLOAD(GraphInitT, g, __VA_ARGS__)
#define GraphInitT_1(g) GraphInitWithDeepCopyT_4((g), NULL, NULL, MisraScope)
#define GraphInitT_2(g, typed_alloc_ptr) GraphInitWithDeepCopyT_4((g), NULL, NULL, typed_alloc_ptr)- In
Init.h:22:
#define GraphInitWithDeepCopy(...) MISRA_OVERLOAD(GraphInitWithDeepCopy, __VA_ARGS__)
#define GraphInitWithDeepCopy_2(ci, cd) GRAPH_INIT_WITH_DEEP_COPY_VALUE((ci), (cd), MisraScope)
#define GraphInitWithDeepCopy_3(ci, cd, typed_alloc_ptr) GRAPH_INIT_WITH_DEEP_COPY_VALUE((ci), (cd), typed_alloc_ptr)- In
Init.h:27:
#define GraphInitWithDeepCopyT(g, ...) MISRA_OVERLOAD(GraphInitWithDeepCopyT, g, __VA_ARGS__)
#ifdef __cplusplus
# define GraphInitWithDeepCopyT_3(g, ci, cd) (TYPE_OF(g) GRAPH_INIT_WITH_DEEP_COPY_VALUE((ci), (cd), MisraScope))
# define GraphInitWithDeepCopyT_4(g, ci, cd, typed_alloc_ptr) \
(TYPE_OF(g) GRAPH_INIT_WITH_DEEP_COPY_VALUE((ci), (cd), typed_alloc_ptr))- In
Init.h:31:
(TYPE_OF(g) GRAPH_INIT_WITH_DEEP_COPY_VALUE((ci), (cd), typed_alloc_ptr))
#else
# define GraphInitWithDeepCopyT_3(g, ci, cd) ((TYPE_OF(g))GRAPH_INIT_WITH_DEEP_COPY_VALUE((ci), (cd), MisraScope))
# define GraphInitWithDeepCopyT_4(g, ci, cd, typed_alloc_ptr) \
((TYPE_OF(g))GRAPH_INIT_WITH_DEEP_COPY_VALUE((ci), (cd), typed_alloc_ptr))
Last updated on