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.h:204:
#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:439:
/// Used in following macros
///
#define IOFMT_LVAL_APPEND_COMMA(x) IOFMT(LVAL(x)),
#define IOFMT_APPEND_COMMA(x) IOFMT(x),- 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:667:
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:670:
}
if (start2 + len > bv2->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector2 length {}", start2, LVAL(start2 + len - 1), bv2->length);
}- In
BitVec.c:737:
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:740:
}
if (start2 + len > bv2->length) {
LOG_FATAL("Range [{}:{}] exceeds bitvector2 length {}", start2, LVAL(start2 + len - 1), bv2->length);
}- In
JSON.c:400:
if (!StrLen(&ns)) {
LOG_ERROR("Failed to parse number. '{.8}'", LVAL(StrIterDataAt(&saved_si, StrIterIndex(&saved_si))));
StrDeinit(&ns);
DefaultAllocatorDeinit(&scratch);- In
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
Complex.c:7:
#include <Misra/Std/Memory.h>
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
- In
Init.c:5:
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
- In
Insert.c:5:
#include <Misra/Std/Container/Vec.h>
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
- In
Insert.c:417:
// Test R-value insert operations
VecPushBackR(&vec, LVAL(42));
// Check that the element was added
- In
Insert.c:430:
// Test R-value insert at index
VecInsertR(&vec, LVAL(50), 1);
// Check that the element was inserted
- In
Insert.c:450:
// Test R-value fast insert
VecInsertFastR(&vec, LVAL(60), 1);
// Check that the element was inserted
- In
Remove.c:5:
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities for deadend testing
- In
Foreach.c:5:
#include <Misra/Std/Log.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
- In
Write.c:684:
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
Write.c:700:
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
Write.c:707:
// 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
Write.c:4119:
StrAppendFmt(&s, "AAAAAAAA");
size before = StrLen(&s);
ok = ok && StrPatchFmt(&s, 2, "{}", LVAL(1234));
ok = ok && (StrLen(&s) == before);
ok = ok && StrBegin(&s)[2] == '1' && StrBegin(&s)[5] == '4';- In
Write.c:4994:
bool ok = FileIsOpen(&f);
if (ok) {
ok = ok && FWriteFmtLn(&f, "n={}", LVAL((i32)42));
FileClose(&f);
File r = FileOpen(StrBegin(&path), "r");- In
Foreach.c:6:
#include <Misra/Std/Log.h>
#include <Misra/Std/Io.h>
#include <Misra/Types.h> // For LVAL macro
// Include test utilities
Last updated on