-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document and improve abstract reader/writer interface #208
base: dev
Are you sure you want to change the base?
Commits on Jun 21, 2024
-
CI: add dependabot configuration
Dependabot can provide automatic pull requests for things in the repository that should be updated. Example PR from dependabot against a repo owned by the github organization: github/opensource.guide#2248 Documentation: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates
Configuration menu - View commit details
-
Copy full SHA for 0ff814d - Browse repository at this point
Copy the full SHA 0ff814dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2265e82 - Browse repository at this point
Copy the full SHA 2265e82View commit details -
facilitate replacement of malloc/free functions open_memstream functions are left out of this change as they require other functions from stdlib.
Configuration menu - View commit details
-
Copy full SHA for ad60cea - Browse repository at this point
Copy the full SHA ad60ceaView commit details -
We don't support this any more. ``` ../../src/cbor.h:255:69: error: '_Bool' is a C99 extension [-Werror,-Wc99-extensions] CBOR_INLINE_API CborError cbor_encode_boolean(CborEncoder *encoder, bool value) ^ ``` Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 8907f20 - Browse repository at this point
Copy the full SHA 8907f20View commit details -
CI: Get Homebrew to use a bottle (precompiled) Qt
Homebrew no longer carries precompiled versions of Qt for macos-11, so switch to macos-13, the last on x86 CPUs (so we can still run Valgrind). It's also going away after the end of June. Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 89723e2 - Browse repository at this point
Copy the full SHA 89723e2View commit details -
CI: remove Valgrind on macOS: it doesn't work
``` ==21147== Valgrind: debuginfo reader: ensure_valid failed: ==21147== Valgrind: during call to ML_(img_get) ==21147== Valgrind: request for range [18446744069408125024, +16) exceeds ==21147== Valgrind: valid image size of 140733057859584 for image: ==21147== Valgrind: "/usr/local/Cellar/icu4c/74.2/lib/libicudata.74.2.dylib" ``` Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Configuration menu - View commit details
-
Copy full SHA for f9fd089 - Browse repository at this point
Copy the full SHA f9fd089View commit details -
I don't think we need to worry about Qt 4 any more. Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Configuration menu - View commit details
-
Copy full SHA for e9963de - Browse repository at this point
Copy the full SHA e9963deView commit details -
CI: unbreak macOS: need to have CXX set
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 6550f66 - Browse repository at this point
Copy the full SHA 6550f66View commit details -
CI: Run the configure step in verbose mode and print the config output
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Configuration menu - View commit details
-
Copy full SHA for a38a520 - Browse repository at this point
Copy the full SHA a38a520View commit details -
Makefile: disable cJSON support when building without math support
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 5d167a0 - Browse repository at this point
Copy the full SHA 5d167a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 722318d - Browse repository at this point
Copy the full SHA 722318dView commit details -
CI: add 'permissions' token to the GitHub actions file
Intel says this is needed Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Configuration menu - View commit details
-
Copy full SHA for b4e1cc7 - Browse repository at this point
Copy the full SHA b4e1cc7View commit details -
cborparser: Move parser initialisation to common routine.
`cbor_parser_init` and `cbor_parser_init_reader` are substantially similar, however the latter misses clearing out `it->flags`, leaving it uninitialised so possibly unsafe. Rather than copying & pasting that from `cbor_parser_init`, lets just use one routine that does the "common" part, then each routine can focus on the specifics needed.
Configuration menu - View commit details
-
Copy full SHA for f994144 - Browse repository at this point
Copy the full SHA f994144View commit details -
cborparser: Document
cbor_parser_init_reader
.Describe the input parameters for the function and how they are used as best we understand from on-paper analysis of the C code.
Configuration menu - View commit details
-
Copy full SHA for 167eef6 - Browse repository at this point
Copy the full SHA 167eef6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 286d132 - Browse repository at this point
Copy the full SHA 286d132View commit details -
cborparser: Pass CborValue to operation routines.
The `token` parameter is not sufficient since it is effectively shared by all `CborValue` instances. Since `tinycbor` often uses a temporary `CborValue` context to perform some operation, we need to store our context inside that `CborValue` so that we don't pollute the global state of the reader.
Configuration menu - View commit details
-
Copy full SHA for 3394f51 - Browse repository at this point
Copy the full SHA 3394f51View commit details -
cborparser: Move
ops
outside ofunion
In its place, put an arbitrary `void *` pointer for reader context. The reader needs to store some context information which is specific to the `CborParser` instance it is serving. Right now, `CborValue::source::token` serves this purpose, but the problem is that we also need a per-`CborValue` context and have nowhere to put it. Better to spend an extra pointer (4 bytes on 32-bit platforms) in the `CborParser` (which there'll be just one of), then to do it in the `CborValue` (which there may be several of) or to use a `CborReader` object that itself carries two pointers (`ops` and the context, thus we'd need an extra 3 pointers).
Configuration menu - View commit details
-
Copy full SHA for b7287ff - Browse repository at this point
Copy the full SHA b7287ffView commit details -
Configuration menu - View commit details
-
Copy full SHA for da482b2 - Browse repository at this point
Copy the full SHA da482b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 72d59f1 - Browse repository at this point
Copy the full SHA 72d59f1View commit details -
reader unit tests: Simplify the example reader
We simplify this reader in two ways: 1. we remove the `consumed` member of `struct Input`, and instead use the `CborValue`'s `source.token` member, which we treat as an unsigned integer offset into our `QByteArray`. 2. we replace the reader-specific `struct Input` with the `QByteArray` it was wrapping, since that's the only thing now contained in our `struct Input`. If a `CborValue` gets cloned, the pointer referred to by `source.token` similarly gets cloned, thus when we advance the pointer on the clone, it leaves the original alone, so computing the length of unknown-length entities in the CBOR document can be done safely.
Configuration menu - View commit details
-
Copy full SHA for 1ef9a05 - Browse repository at this point
Copy the full SHA 1ef9a05View commit details -
cborencoder: Document the write callback function.
What is not known, is what the significance is of `CborEncoderAppendType`. It basically tells the writer the nature of the data being written, but the default implementation ignores this and just blindly appends it no matter what. That raises the question of why it's important enough that the writer function needs to know about it.
Configuration menu - View commit details
-
Copy full SHA for b4b41d3 - Browse repository at this point
Copy the full SHA b4b41d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 914bee9 - Browse repository at this point
Copy the full SHA 914bee9View commit details -
examples: Add buffered reader example
This reads a CBOR file piece-wise, seeking backward and forward through the file if needed. Some seeking can be avoided by tuning the block size used in reads so that the read window shifts by smaller amounts.
Configuration menu - View commit details
-
Copy full SHA for 34e931e - Browse repository at this point
Copy the full SHA 34e931eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c17e0f - Browse repository at this point
Copy the full SHA 0c17e0fView commit details -
cbor.h, cborparser.c: Migrate parser documentation.
Not 100% sure of the syntax for documenting struct-members outside of the struct as I'm too used to doing it inline, hopefully this works as expected. :-)
Configuration menu - View commit details
-
Copy full SHA for a4a6364 - Browse repository at this point
Copy the full SHA a4a6364View commit details -
Configuration menu - View commit details
-
Copy full SHA for 427e009 - Browse repository at this point
Copy the full SHA 427e009View commit details