Two call helper functions.
More...
Go to the source code of this file.
|
| #define | OXR_TWO_CALL_CHECK_ONLY(log, cnt_input, cnt_output, count, sval) |
| |
| #define | OXR_TWO_CALL_CHECK_GOTO(log, cnt_input, cnt_output, count, sval, goto_label) |
| |
| #define | OXR_TWO_CALL_HELPER(log, cnt_input, cnt_output, output, count, data, sval) |
| |
| #define | OXR_TWO_CALL_FILL_IN_HELPER(log, cnt_input, cnt_output, output_structs, count, fill_fn, source_structs, sval) |
| | Calls fill_fn(&output_struct[i], &source_struct[i]) to fill output_structs. More...
|
| |
| #define | OXR_TWO_CALL_FILL_IN_GOTO(log, cnt_input, cnt_output, output_structs, count, fill_macro, source_structs, sval, goto_label) |
| | Calls fill_fn(&output_struct[i], &source_struct[i]) to fill output_structs. More...
|
| |
◆ OXR_TWO_CALL_CHECK_GOTO
| #define OXR_TWO_CALL_CHECK_GOTO |
( |
|
log, |
|
|
|
cnt_input, |
|
|
|
cnt_output, |
|
|
|
count, |
|
|
|
sval, |
|
|
|
goto_label |
|
) |
| |
Value: do { \
if ((cnt_output) == NULL) { \
sval =
oxr_error(log, XR_ERROR_VALIDATION_FAILURE, #cnt_output); \
goto goto_label; \
} \
*(cnt_output) = (uint32_t)(count); \
\
if ((cnt_input) == 0) { \
goto goto_label; \
} \
if ((cnt_input) < (uint32_t)(count)) { \
sval =
oxr_error(log, XR_ERROR_SIZE_INSUFFICIENT, #cnt_input); \
goto goto_label; \
} \
} while (false)
XrResult oxr_error(struct oxr_logger *logger, XrResult result, const char *fmt,...)
Definition: oxr_logger.c:203
◆ OXR_TWO_CALL_CHECK_ONLY
| #define OXR_TWO_CALL_CHECK_ONLY |
( |
|
log, |
|
|
|
cnt_input, |
|
|
|
cnt_output, |
|
|
|
count, |
|
|
|
sval |
|
) |
| |
Value: do { \
if ((cnt_output) == NULL) { \
return
oxr_error(log, XR_ERROR_VALIDATION_FAILURE, #cnt_output); \
} \
*(cnt_output) = (uint32_t)(count); \
\
if ((cnt_input) == 0) { \
return sval; \
} \
if ((cnt_input) < (uint32_t)(count)) { \
return
oxr_error(log, XR_ERROR_SIZE_INSUFFICIENT, #cnt_input); \
} \
} while (false)
◆ OXR_TWO_CALL_FILL_IN_GOTO
| #define OXR_TWO_CALL_FILL_IN_GOTO |
( |
|
log, |
|
|
|
cnt_input, |
|
|
|
cnt_output, |
|
|
|
output_structs, |
|
|
|
count, |
|
|
|
fill_macro, |
|
|
|
source_structs, |
|
|
|
sval, |
|
|
|
goto_label |
|
) |
| |
Value: do { \
OXR_TWO_CALL_CHECK_GOTO(log, cnt_input, cnt_output, count, sval, goto_label); \
\
for (uint32_t i = 0; i < count; i++) { \
fill_macro(output_structs[i], source_structs[i]); \
} \
} while (false)
Calls fill_fn(&output_struct[i], &source_struct[i]) to fill output_structs.
◆ OXR_TWO_CALL_FILL_IN_HELPER
| #define OXR_TWO_CALL_FILL_IN_HELPER |
( |
|
log, |
|
|
|
cnt_input, |
|
|
|
cnt_output, |
|
|
|
output_structs, |
|
|
|
count, |
|
|
|
fill_fn, |
|
|
|
source_structs, |
|
|
|
sval |
|
) |
| |
Value: do { \
OXR_TWO_CALL_CHECK_ONLY(log, cnt_input, cnt_output, count, sval); \
\
for (uint32_t i = 0; i < count; i++) { \
fill_fn(&output_structs[i], &source_structs[i]); \
} \
return sval; \
} while (false)
Calls fill_fn(&output_struct[i], &source_struct[i]) to fill output_structs.
◆ OXR_TWO_CALL_HELPER
| #define OXR_TWO_CALL_HELPER |
( |
|
log, |
|
|
|
cnt_input, |
|
|
|
cnt_output, |
|
|
|
output, |
|
|
|
count, |
|
|
|
data, |
|
|
|
sval |
|
) |
| |
Value: do { \
OXR_TWO_CALL_CHECK_ONLY(log, cnt_input, cnt_output, count, sval); \
\
for (uint32_t i = 0; i < (count); i++) { \
(output)[i] = (data)[i]; \
} \
return (sval); \
} while (false)