fprintf(stderr, "stdinread(): %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
- struct KEKSAtom atom;
- memset(&atom, 0, sizeof(struct KEKSAtom));
+ struct KEKSAtom atom = {0};
size_t off = 0;
size_t got = 0;
int indent = 0;
fprintf(stderr, "open: %s\n", strerror(errno));
return false;
}
- struct stat sb;
- memset(&sb, 0, sizeof(struct stat));
+ struct stat sb = {0};
if (fstat(fd, &sb) != 0) {
fprintf(stderr, "fstat: %s\n", strerror(errno));
return false;
OffDigits = NoOffsets ? -1 : (int)(1 + floor(log10((double)len)));
snprintf(OffFmt, sizeof OffFmt, "%%s%%0%dzd%%s ", OffDigits);
- struct KEKSItems items;
+ struct KEKSItems items = {0};
enum KEKSErr err = KEKSErrInvalid;
size_t off = 0;
- struct timespec started;
- struct timespec finished;
+ struct timespec started = {0};
+ struct timespec finished = {0};
ptrdiff_t parseCycles = 0;
while (off < len) {
err = KEKSItemsInit(&items, itemsInitialLen);
&Got, buf + Off, len - Off, (const unsigned char *)"dates", 5));
adder(KEKSAtomListEncode(&Got, buf + Off, len - Off)); // .dates
{
- struct timespec ts;
- ts.tv_sec = 1234567890;
- ts.tv_nsec = 0;
+ struct timespec ts = {.tv_sec = 1234567890, .tv_nsec = 0};
assert(KEKSTimespecToTAI(&ts));
unsigned char tai[12] = {0};
assert(KEKSTimespecToTAI64(tai, &ts));
case KEKSAtomNint: {
atom->typ = (tag == KEKSAtomPint) ? KEKSItemPint : KEKSItemNint;
size_t binGot = 0;
- struct KEKSAtom bin;
- memset(&bin, 0, sizeof(struct KEKSAtom));
+ struct KEKSAtom bin = {0};
if ((buf[1] & (unsigned char)KEKSAtomStrings) == 0) {
return KEKSErrIntNonBin;
}
case KEKSAtomFloat: {
atom->typ = KEKSItemFloat;
size_t mGot = 0;
- struct KEKSAtom m;
- memset(&m, 0, sizeof(struct KEKSAtom));
+ struct KEKSAtom m = {0};
enum KEKSErr err = KEKSAtomDecode(&mGot, &m, buf + 1, len - 1);
if (err != KEKSErrNo) {
return err;
}
size_t eGot = 0;
- struct KEKSAtom e;
- memset(&e, 0, sizeof(struct KEKSAtom));
+ struct KEKSAtom e = {0};
err = KEKSAtomDecode(&eGot, &e, buf + 1 + mGot, len - 1 - mGot);
if (err != KEKSErrNo) {
return err;
assert(schema != NULL);
assert(data != NULL);
size_t origIdxSchema = idxSchema;
- struct KEKSSchemaErr err;
+ struct KEKSSchemaErr err = {0};
size_t v = *taken;
Eached:
idxSchema = origIdxSchema;
err.msg = "non-TAI64 taken";
return err;
}
- struct timespec tv;
+ struct timespec tv = {0};
enum KEKSErr errConvert = KEKSTAI64ToTimespec(
&tv, data->list[v].atom.v.str.ptr, data->list[v].atom.v.str.len);
if (errConvert != KEKSErrNo) {