LVAL
Description
Creates a temporary, addressable l-value from a given expression x.
Parameters
| Name | Direction | Description |
|---|---|---|
x |
in | The expression whose value needs to be addressable. |
Success
Returns addressable version of x as first element of temporary array.
Failure
Function cannot fail - creates temporary storage unconditionally.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:775:
if (!next || next == in) {
LOG_ERROR("Failed to read value for placeholder {}", LVAL(arg_index - 1));
return NULL;
}- In
Io.c:784:
LOG_ERROR(
"Input '{.8}' does not match format string '{.8}'",
LVAL(in ? in : "(null)"),
LVAL(p ? p : "(null)")
);- In
Io.c:785:
"Input '{.8}' does not match format string '{.8}'",
LVAL(in ? in : "(null)"),
LVAL(p ? p : "(null)")
);
return NULL;- In
BitVec.c:612:
if (start1 + len > bv1->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector1 length {}", start1, LVAL(start1 + len - 1), bv1->length);
}
if (start2 + len > bv2->length) {- In
BitVec.c:615:
}
if (start2 + len > bv2->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector2 length {}", start2, LVAL(start2 + len - 1), bv2->length);
}- In
BitVec.c:682:
if (start1 + len > bv1->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector1 length {}", start1, LVAL(start1 + len - 1), bv1->length);
}
if (start2 + len > bv2->length) {- In
BitVec.c:685:
}
if (start2 + len > bv2->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector2 length {}", start2, LVAL(start2 + len - 1), bv2->length);
}- In
JSON.c:275:
LOG_ERROR(
"No unicode support '{.6}'. Unicode sequence will be skipped.",
LVAL(StrIterDataAt(&si, StrIterIndex(&si) - 1))
);
StrIterMustMove(&si, 5);- In
JSON.c:403:
if (!StrLen(&ns)) {
LOG_ERROR("Failed to parse number. '{.8}'", LVAL(StrIterDataAt(&saved_si, StrIterIndex(&saved_si))));
StrDeinit(&ns);
DefaultAllocatorDeinit(&scratch);- In
Vec.Ops.c:4:
#include <Misra/Std/Container/Vec.h>
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
- In
Vec.Foreach.c:5:
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
- In
Io.Write.c:677:
Str s = StrInit(&alloc);
StrAppendFmt(&s, "old prefix ");
StrWriteFmt(&s, "fresh {}", LVAL(42));
bool ok = (StrLen(&s) == 8) && (StrBegin(&s)[0] == 'f') && (StrBegin(&s)[StrLen(&s) - 1] == '2');
StrDeinit(&s);- In
Io.Write.c:693:
StrAppendFmt(&s, "AAAAAAAA");
size before_length = StrLen(&s);
bool ok = StrPatchFmt(&s, 2, "{}", LVAL(1234));
ok = ok && StrLen(&s) == before_length;
ok = ok && StrBegin(&s)[0] == 'A' && StrBegin(&s)[1] == 'A';- In
Io.Write.c:700:
// Patch that would extend past the end must fail.
ok = ok && !StrPatchFmt(&s, 6, "{}", LVAL(9999));
ok = ok && StrLen(&s) == before_length;
ok = ok && StrBegin(&s)[6] == 'A' && StrBegin(&s)[7] == 'A';- In
Vec.Init.c:5:
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
- In
Vec.Remove.c:5:
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities for deadend testing
- In
Vec.Complex.c:7:
#include <Misra/Std/Memory.h>
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
- In
Vec.Insert.c:4:
#include <Misra/Std/Container/Vec.h>
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
- In
Vec.Insert.c:364:
// Test R-value insert operations
VecPushBackR(&vec, LVAL(42));
// Check that the element was added
- In
Vec.Insert.c:377:
// Test R-value insert at index
VecInsertR(&vec, LVAL(50), 1);
// Check that the element was inserted
- In
Vec.Insert.c:397:
// Test R-value fast insert
VecInsertFastR(&vec, LVAL(60), 1);
// Check that the element was inserted
- In
Str.Foreach.c:6:
#include <Misra/Std/Log.h>
#include <Misra/Std/Io.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
- In
Io.h:203:
#ifdef __cplusplus
# define ZstrIO(zstr, alloc_ptr) \
TO_TYPE_SPECIFIC_IO(ZstrAlloc, &LVAL(((ZstrIOArg) {.value = (void *)&(zstr), .allocator = (alloc_ptr)})))
#else
# define ZstrIO(zstr, alloc_ptr) \- In
Io.h:434:
/// Used in following macros
///
#define IOFMT_LVAL_APPEND_COMMA(x) IOFMT(LVAL(x)),
#define IOFMT_APPEND_COMMA(x) IOFMT(x),
Last updated on