case KEKSItemRaw:
default:
return (struct KEKSSchemaErr){
- .offSchema = schema->offsets[idxSchema],
- .offData = data->offsets[idxData],
+ .offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema],
+ .offData = (data->offsets == NULL) ? 0 : data->offsets[idxData],
.code = KEKSSchemaErrUnexpectedState,
.msg = "unsupported len type",
};
case KEKSItemRaw:
default:
return (struct KEKSSchemaErr){
- .offSchema = schema->offsets[idxSchema],
- .offData = data->offsets[idxData],
+ .offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema],
+ .offData = (data->offsets == NULL) ? 0 : data->offsets[idxData],
.code = KEKSSchemaErrUnexpectedState,
.msg = "unsupported len type",
};
size_t v = *taken;
Eached:
idxSchema = origIdxSchema;
- err.offSchema = schema->offsets[idxSchema];
- err.offData = data->offsets[idxData];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
+ err.offData = (data->offsets == NULL) ? 0 : data->offsets[idxData];
err.code = KEKSSchemaErrInvalid;
if (schema->list[idxSchema].atom.v.list.len == 0) {
err.code = KEKSSchemaErrInvalidSchema;
err.msg = "wrong number of args";
return err;
}
- err.offSchema = schema->offsets[idxSchema];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
switch (schema->list[idxSchema].atom.typ) {
case KEKSItemNIL:
(*taken) = idxData;
err.msg = "wrong number of args";
return err;
}
- err.offSchema = schema->offsets[idxSchema];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
if (schema->list[idxSchema].atom.typ != KEKSItemBin) {
err.code = KEKSSchemaErrInvalidSchema;
err.msg = "non-bin EQ";
return err;
}
while (idxSchema != 0) {
- err.offSchema = schema->offsets[idxSchema];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
if (schema->list[idxSchema].atom.typ != KEKSItemStr) {
err.code = KEKSSchemaErrInvalidSchema;
err.msg = "non-str TYPE";
err.msg = "wrong number of args";
return err;
}
- err.offSchema = schema->offsets[idxSchema];
- err.offData = data->offsets[v];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
+ err.offData = (data->offsets == NULL) ? 0 : data->offsets[v];
int64_t our = 0;
int64_t their = 0;
struct KEKSSchemaErr errLens =
err.msg = "wrong number of args";
return err;
}
- err.offSchema = schema->offsets[idxSchema];
- err.offData = data->offsets[v];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
+ err.offData = (data->offsets == NULL) ? 0 : data->offsets[v];
int64_t our = 0;
int64_t their = 0;
struct KEKSSchemaErr errLens =
err.msg = "wrong number of args";
return err;
}
- err.offSchema = schema->offsets[idxSchema];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
if (schema->list[idxSchema].atom.typ != KEKSItemStr) {
err.code = KEKSSchemaErrInvalidSchema;
err.msg = "non-str SCHEMA";
err.msg = "unknown SCHEMA";
return err;
}
- err.offSchema = schema->offsets[idxSchema];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
err.msg = "SCHEMA";
if (v == SIZE_MAX) {
err.code = KEKSSchemaErrNo;
err.msg = "wrong number of args";
return err;
}
- err.offSchema = schema->offsets[idxSchema];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
if (schema->list[idxSchema].atom.typ != KEKSItemPint) {
err.code = KEKSSchemaErrInvalidSchema;
err.msg = "non-int PREC";
assert(schema != NULL);
assert(data != NULL);
struct KEKSSchemaErr err = (struct KEKSSchemaErr){
- .offSchema = schema->offsets[idxSchema],
- .offData = data->offsets[idxData],
+ .offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema],
+ .offData = (data->offsets == NULL) ? 0 : data->offsets[idxData],
.code = KEKSSchemaErrInvalid,
};
if (schema->list[idxSchema].atom.typ != KEKSItemList) {
return err;
}
idxSchema = schema->list[idxSchema].atom.v.list.head;
- err.offSchema = schema->offsets[idxSchema];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
struct keksSchemaValidationState state = {
.nonExamined = 0,
.eachInList = false,
return errCmd;
}
idxSchema = schema->list[idxSchema].next;
- err.offSchema = schema->offsets[idxSchema];
+ err.offSchema = (schema->offsets == NULL) ? 0 : schema->offsets[idxSchema];
}
if (state.nonExaminedCheck && state.nonExamined > 0) {
err.code = KEKSSchemaErrInvalidData;