godot/modules/gdscript
Hein-Pieter van Braam b696beea65 Correct hash behavior for floating point numbers
This fixes HashMap where a key or part of a key is a floating point
number. To fix this the following has been done:

* HashMap now takes an extra template argument Comparator. This class
gets used to compare keys. The default Comperator now works correctly
for common types and floating point numbets.

* Variant implements ::hash_compare() now. This function implements
nan-safe comparison for all types with components that contain floating
point numbers.

* Variant now has a VariantComparator which uses Variant::hash_compare()
safely compare floating point components of variant's types.

* The hash functions for floating point numbers will now normalize NaN
values so that all floating point numbers that are NaN hash to the same
value.

C++ module writers that want to use HashMap internally in their modules
can now also safeguard against this crash by defining their on
Comperator class that safely compares their types.

GDScript users, or writers of modules that don't use HashMap internally
in their modules don't need to do anything.

This fixes #7354 and fixes #6947.
2017-02-16 18:44:29 +01:00
..
config.py style: Fix PEP8 blank lines issues in Python files 2016-11-01 00:35:16 +01:00
gd_compiler.cpp Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
gd_compiler.h Correct hash behavior for floating point numbers 2017-02-16 18:44:29 +01:00
gd_editor.cpp Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
gd_function.cpp Remove bounds check when resuming from yield. 2017-02-13 21:59:05 +01:00
gd_function.h -GDScript support for accessing properties directly 2017-01-04 17:37:45 -03:00
gd_functions.cpp Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. 2017-01-16 13:36:33 -06:00
gd_functions.h Merge pull request #7093 from bojidar-bg/named-colors 2017-01-11 10:36:15 +01:00
gd_parser.cpp -begin of export work, not done yet 2017-02-15 08:30:32 -03:00
gd_parser.h Merge pull request #6845 from karroffel/master 2017-01-14 17:08:10 -03:00
gd_script.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
gd_script.h Style: Fix whole-line commented code 2017-01-14 14:52:23 +01:00
gd_tokenizer.cpp Correct hash behavior for floating point numbers 2017-02-16 18:44:29 +01:00
gd_tokenizer.h made _ a special token in GDScript 2017-01-20 09:26:55 +01:00
register_types.cpp Removed import/export system, will start new one from scratch. 2017-01-25 21:57:08 -03:00
register_types.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
SCsub SCsub: Add python shebang as a hint for syntax highlighting 2016-10-17 20:10:46 +02:00