git/reftable
Patrick Steinhardt 66f892bb07 reftable: cast away constness when assigning constants to records
The reftable records are used in multiple ways throughout the reftable
library. In many of those cases they merely act as input to a function
without getting modified by it at all. Most importantly, this happens
when writing records and when querying for records.

We rely on this in our tests and thus assign string constants to those
fields, which is about to generate warnings as those fields are of type
`char *`. While we could go through the process and instead allocate
those strings in all of our tests, this feels quite unnecessary.

Instead, add casts to `char *` for all of those strings. As this is part
of our tests, this also nicely serves as a demonstration that nothing
writes or frees those string constants, which would otherwise lead to
segfaults.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-06-07 10:30:49 -07:00
..
LICENSE
basics.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
basics.h global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
basics_test.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
block.c Merge branch 'ps/reftable-write-optim' 2024-05-08 10:18:43 -07:00
block.h Merge branch 'ps/reftable-write-optim' 2024-05-08 10:18:43 -07:00
block_test.c reftable: cast away constness when assigning constants to records 2024-06-07 10:30:49 -07:00
blocksource.c reftable: introduce macros to allocate arrays 2024-02-06 12:10:08 -08:00
blocksource.h
constants.h
dump.c
error.c Merge branch 'ps/reftable-write-optim' 2024-05-08 10:18:43 -07:00
generic.c
generic.h
iter.c reftable/block: rename `block_reader_start()` 2024-04-15 10:36:09 -07:00
iter.h reftable/merged: remove unnecessary null check for subiters 2024-03-04 10:19:39 -08:00
merged.c reftable/merged: avoid duplicate pqueue emptiness check 2024-03-04 10:19:40 -08:00
merged.h reftable/merged: make `merged_iter` structure private 2024-03-04 10:19:30 -08:00
merged_test.c reftable: cast away constness when assigning constants to records 2024-06-07 10:30:49 -07:00
pq.c reftable: allow inlining of a few functions 2024-03-04 10:19:49 -08:00
pq.h reftable: allow inlining of a few functions 2024-03-04 10:19:49 -08:00
pq_test.c reftable/merged: make subiters own their records 2024-03-04 10:19:39 -08:00
publicbasics.c reftable: introduce macros to allocate arrays 2024-02-06 12:10:08 -08:00
reader.c reftable/block: reuse `zstream` state on inflation 2024-04-15 10:36:09 -07:00
reader.h
readwrite_test.c reftable: cast away constness when assigning constants to records 2024-06-07 10:30:49 -07:00
record.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
record.h reftable/record: extract function to decode key lengths 2024-04-03 09:16:50 -07:00
record_test.c reftable/record: use scratch buffer when decoding records 2024-03-05 09:10:06 -08:00
reftable-blocksource.h
reftable-error.h Merge branch 'ps/reftable-write-optim' 2024-05-08 10:18:43 -07:00
reftable-generic.h
reftable-iterator.h
reftable-malloc.h
reftable-merged.h reftable/stack: use `size_t` to track stack length 2024-02-06 12:10:08 -08:00
reftable-reader.h
reftable-record.h reftable/record: reuse message when decoding log records 2024-03-05 09:10:06 -08:00
reftable-stack.h
reftable-tests.h reftable: remove name checks 2024-04-08 17:01:41 -07:00
reftable-writer.h Merge branch 'ps/reftable-write-optim' 2024-05-08 10:18:43 -07:00
stack.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
stack.h reftable/stack: use geometric table compaction 2024-04-08 12:11:10 -07:00
stack_test.c reftable: cast away constness when assigning constants to records 2024-06-07 10:30:49 -07:00
system.h reftable/stack: register lockfiles during compaction 2024-03-07 12:34:13 -08:00
test_framework.c
test_framework.h
tree.c reftable: introduce macros to allocate arrays 2024-02-06 12:10:08 -08:00
tree.h
tree_test.c
writer.c reftable/writer: reset `last_key` instead of releasing it 2024-04-08 17:01:41 -07:00
writer.h