diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2017-09-01 22:33:39 +0200 |
---|---|---|
committer | Hein-Pieter van Braam <hp@tmm.cx> | 2017-09-02 01:59:26 +0200 |
commit | 9c63ab99f0a505b0f60079bb30cc453b4415fddc (patch) | |
tree | 7014cb6e8c2e71a0583656f76d3d37d719a74fb0 /core/vmap.h | |
parent | dac150108ab3c1f41d5fd86cc6853f883064caaf (diff) |
Fix use of unitialized variables
The second in my quest to make Godot 3.x compile with -Werror on GCC7
Diffstat (limited to 'core/vmap.h')
-rw-r--r-- | core/vmap.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/vmap.h b/core/vmap.h index f0977341ec..8165a919b6 100644 --- a/core/vmap.h +++ b/core/vmap.h @@ -60,9 +60,13 @@ class VMap { int low = 0; int high = _data.size() - 1; - int middle; const _Pair *a = &_data[0]; + int middle = 0; +#if DEBUG_ENABLED + if (low > high) + ERR_PRINT("low > high, this may be a bug"); +#endif while (low <= high) { middle = (low + high) / 2; |