fix: convert signed integer types to unsigned in core and value modules to eliminate -Wsign-compare warnings

- Change `int` to `uint32_t` for iterator indices in `map_iterate` and `string_iterate` to match capacity/length types
- Update `String.length` field type from `int` to `uint32_t` in `wren_utils.h`
- Modify `wrenStringCodePointAt` parameter type from `int` to `uint32_t` and remove redundant negative index assertion
- Convert loop variable in `markMap` from `int` to `uint32_t` to match `map->capacity` type
- Add `-Wsign-compare`, `-Wtype-limits`, and `-Wuninitialized` compiler flags to catch future mismatches
This commit is contained in:
Bob Nystrom
2015-02-25 05:56:33 +00:00
parent fca963cb48
commit c9f0dcde66
5 changed files with 21 additions and 15 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ HEADERS := include/wren.h $(wildcard src/*.h)
SOURCES := $(wildcard src/*.c)
BUILD_DIR := build
CFLAGS := -Wall -Werror
CFLAGS := -Wall -Werror -Wsign-compare -Wtype-limits -Wuninitialized
# TODO: Add -Wextra.
# Mode configuration.