#include <stdbool.h>
#include <stddef.h>
+#include <stdint.h>
#include <string.h>
#include "dec.h"
}
(*off) += atom->off;
eoc = atom->typ == YACItemEOC;
- err = cb(NULL, 0, eoc ? 0 : (n + 1), cbState, atom, off, buf, len);
+ err = cb(NULL, 0, eoc ? -1 : (ptrdiff_t)n, cbState, atom, off, buf, len);
if (err != YACErrNo) {
return err;
}
}
(*off) += atom->off;
if (atom->typ == YACItemEOC) {
- err = cb(NULL, 0, 0, cbState, atom, off, buf, len);
+ err = cb(NULL, 0, -1, cbState, atom, off, buf, len);
if (err != YACErrNo) {
return err;
}
if (atom->typ == YACItemEOC) {
return YACErrMapNoVal;
}
- err = cb(key, keyLen, 0, cbState, atom, off, buf, len);
+ err = cb(key, keyLen, -1, cbState, atom, off, buf, len);
if (err != YACErrNo) {
return err;
}
}
if ((atom->len) > 0) {
atom->typ = YACItemChunk;
- err = cb(NULL, 0, n + 1, cbState, atom, off, buf, len);
+ err = cb(NULL, 0, (ptrdiff_t)n, cbState, atom, off, buf, len);
if (err != YACErrNo) {
return err;
}
}
}
atom->typ = YACItemEOC;
- err = cb(NULL, 0, 0, cbState, atom, off, buf, len);
+ err = cb(NULL, 0, -1, cbState, atom, off, buf, len);
if (err != YACErrNo) {
return err;
}