The FNV-1a hash initializer constant 2166136261 exceeds the maximum value
for a signed 32-bit integer, causing GCC to emit a constant unsigned error
when compiling as C++. Adding the 'u' suffix explicitly marks the literal
as unsigned, resolving the compilation issue without changing behavior.
The debug instruction printer was dereferencing string arrays directly instead of accessing their .buffer member, causing incorrect symbol name display for LOAD_GLOBAL, STORE_GLOBAL, CALL, SUPER, METHOD_INSTANCE, and METHOD_STATIC instructions. Updated all six printf calls to use vm->globalNames.data[global].buffer and vm->methodNames.data[symbol].buffer respectively.
Replace the `char*` buffer element type with a `String` struct that holds both the buffer pointer and its length. This eliminates O(n) `strlen()` calls in `wrenSymbolTableFind` and ensures length is always available without scanning for the null terminator. Update `wrenSymbolTableAdd` to populate the new `length` field, `wrenSymbolTableClear` to free via `symbol.buffer`, and all call sites (e.g., `methodNotFound` in `wren_vm.c`) to access `.buffer` explicitly.
Replace the single-bit FLAG_MARKED enum and ObjFlags bitfield with a direct bool 'marked' field on the Obj struct. This simplifies the garbage collector's mark-sweep logic by removing unnecessary bitwise operations (|, &, ~) and the associated enum definition, making the intent clearer and reducing cognitive overhead when reading GC-related code paths.
Remove the entire wren_math.c and wren_math.h implementation files, delete all math test scripts under test/math/, and strip the WREN_USE_LIB_MATH compile flag from wren_common.h. Also remove the wrenLoadMathLibrary call from wren_vm.c and delete the wren_math.c/h entries from both the MSVC project file and its filters file.
The diff reorders includes across multiple source files to place standard library headers before project headers, removes the `_CRT_SECURE_NO_WARNINGS` define from `wren_common.h`, and adds it as a preprocessor definition in both Debug and Release configurations of the MSVC 2013 project file.
Add wren_math.c and wren_math.h to the MSVC 2013 project files, including both the .vcxproj and .vcxproj.filters. Also fix the indentation of the WREN_COMPUTED_GOTO comment in wren_common.h and correct a conditional guard bug in wren_vm.c where wrenLoadMathLibrary was guarded by WREN_USE_LIB_IO instead of WREN_USE_LIB_MATH.
Implement the Math standard library module for Wren, including absolute value, ceiling, floor, integer/fractional decomposition, trigonometric functions (sin, cos, tan), degree/radian conversion, and a seeded xorshift random number generator. Add WREN_USE_LIB_MATH compile-time flag to wren_common.h and provide comprehensive test suite under test/math/.
Implement a new optional Math module for the Wren standard library, gated behind the WREN_USE_LIB_MATH flag (default on). The module provides double-precision math functions (abs, ceil, floor, int, frac, sin, cos, tan, deg, rad) and a xorshift-based pseudo-random number generator with srand/rand methods. Includes comprehensive test files for each function and an all_tests runner.
Disable optimization for wrenPinObj and wrenUnpinObj functions under Microsoft Visual Studio 2013 to prevent the compiler from incorrectly inlining them, which triggers a memory access violation. The pragma directives bracket only these two functions to minimize the impact on the rest of the compilation unit.
Add MSVC 2013 project scaffolding under project/msvc2013/ including wren.sln solution file, wren.vcxproj with Debug/Release Win32 configurations using v120 toolset, and wren.vcxproj.filters organizing source and header files from ../src/ into Visual Studio filter categories.
Enforce a consistent include ordering convention across the codebase: wren_common.h (as configuration header) first, followed by the module's own header, then other wren_*.h headers in lexicographic order, and finally standard library includes. Also add missing wren_common.h include to main.c and wren_io.c, and add _CRT_SECURE_NO_WARNINGS define for MSVC in wren_common.h.
The WREN_COMPUTED_GOTO macro is now conditionally set to 0 when
compiling with _MSC_VER, as Microsoft's compiler does not support
the computed-goto extension used by the VM dispatch loop.
In `src/wren_value.h`, change three flexible array members (`char value[]`, `Upvalue* upvalues[]`, `Value fields[]`) to explicit zero-sized arrays (`char value[0]`, `Upvalue* upvalues[0]`, `Value fields[0]`) to resolve compiler warnings about non-standard zero-sized array usage in structs `ObjString`, `ObjClosure`, and `ObjInstance`.