Skip to content

docs: fix resize and swap examples in README - #95

Merged
eteran merged 1 commit into
eteran:masterfrom
Lxc097:patch-1
Sep 21, 2026
Merged

eteran merged 1 commit into
eteran:masterfrom
Lxc097:patch-1

Conversation

@Lxc097

@Lxc097 Lxc097 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

The README API table shows two-argument calls to cvector_resize and cvector_swap, but both macros require three arguments. Copying either call currently produces a macro argument-count error.

Update the resize comparison to v.resize(count, value) / cvector_resize(v, count, value), and use cvector_swap(v, other, int) for the table's integer vectors. Briefly explain the fill-value and element-type arguments.

Validation on Windows with MinGW-w64 GCC 16.2.0:

  • Reproduced the argument-count errors by compiling the calls extracted from the original README.
  • Compiled the corrected calls with -std=c89 -pedantic-errors -Wall -Wextra -Werror and ran assertions for initialization and swapping.
  • Built and ran the existing unit-tests.c (18 tests passed) and test.c using -std=gnu90 -Wall -Wextra -Werror.
  • git diff --check passed.

CMake/CTest was not run: the local CMake executable exits with Windows status 0xC0000135. The existing test programs were compiled and run directly with GCC.

Include the required fill value for cvector_resize and the element type for cvector_swap. Match the C++ resize comparison and explain both arguments.
@eteran
eteran merged commit d096d9b into eteran:master Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants