godot/core
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
..
bind Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
helper ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant. 2017-01-02 23:03:46 -03:00
io Many fixes to make exported scenes work better, still buggy. 2017-02-15 08:34:02 -03:00
math Correct hash behavior for floating point numbers 2017-02-16 18:44:29 +01:00
os Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
allocators.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
array.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
array.h Both Array and Dictionary are always in shared mode (removed copy on write). 2017-01-11 08:54:17 -03:00
class_db.cpp Correct hash behavior for floating point numbers 2017-02-16 18:44:29 +01:00
class_db.h Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
color_names.inc Add missing map.h include in color defs 2017-01-15 12:51:47 +01:00
color.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
color.h Merge pull request #7093 from bojidar-bg/named-colors 2017-01-11 10:36:15 +01:00
command_queue_mt.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
command_queue_mt.h Style: Cosmetic fixes to play nice with clang-format 2017-01-15 16:42:17 +01:00
compressed_translation.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
compressed_translation.h Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector 2017-01-07 18:26:38 -03:00
core_string_names.cpp -begin of export work, not done yet 2017-02-15 08:30:32 -03:00
core_string_names.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
dictionary.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
dictionary.h Both Array and Dictionary are always in shared mode (removed copy on write). 2017-01-11 08:54:17 -03:00
dvector.cpp Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector 2017-01-07 18:26:38 -03:00
dvector.h Lot of work in new importer, importing textures now works. 2017-02-01 09:46:36 -03:00
engine.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
engine.h Replace Engine version API by preexisting OS one 2017-01-13 18:25:49 +01:00
error_list.h Match ERROR_QUERY_FAILED enum with others 2017-02-02 21:15:47 +09:00
error_macros.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
error_macros.h Merge remote-tracking branch 'origin/gles3' into gles3-on-master 2017-01-02 21:52:26 +01:00
event_queue.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
event_queue.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
func_ref.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
func_ref.h ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant. 2017-01-02 23:03:46 -03:00
global_constants.cpp Match ERROR_QUERY_FAILED enum with others 2017-02-02 21:15:47 +09:00
global_constants.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
globals.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
globals.h -Changed most project settings in the engine, so they have major and minor categories. 2017-01-05 09:16:00 -03:00
hash_map.h Correct hash behavior for floating point numbers 2017-02-16 18:44:29 +01:00
hashfuncs.h Correct hash behavior for floating point numbers 2017-02-16 18:44:29 +01:00
hq2x.cpp Fixed HQ2x compiler warnings 2016-07-05 16:52:31 +02:00
hq2x.h Finalized DynamicFont implementation 2016-05-29 11:37:52 -03:00
image.cpp Several bugfixes, improving the import workflow 2017-02-06 00:38:39 -03:00
image.h Several bugfixes, improving the import workflow 2017-02-06 00:38:39 -03:00
input_map.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
input_map.h Keyboard Input modifiers do not block actions. 2017-01-25 21:21:19 +01:00
int_types.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
list.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
make_binders.py ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant. 2017-01-02 23:03:46 -03:00
map.h Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
message_queue.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
message_queue.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
method_bind.cpp MethodBind: Make sure header order is kept 2017-01-14 22:07:28 +01:00
method_bind.h ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant. 2017-01-02 23:03:46 -03:00
method_ptrcall.h updated method_ptrcall.h to use 3.0 naming 2017-01-17 11:36:17 +01:00
object.cpp -begin of export work, not done yet 2017-02-15 08:30:32 -03:00
object.h Correct hash behavior for floating point numbers 2017-02-16 18:44:29 +01:00
packed_data_container.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
packed_data_container.h Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector 2017-01-07 18:26:38 -03:00
pair.h Lot of work in new importer, importing textures now works. 2017-02-01 09:46:36 -03:00
path_db.cpp Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
path_db.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
path_remap.cpp Removed import/export system, will start new one from scratch. 2017-01-25 21:57:08 -03:00
path_remap.h Removed import/export system, will start new one from scratch. 2017-01-25 21:57:08 -03:00
pool_allocator.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
pool_allocator.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
print_string.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
print_string.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
ref_ptr.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
ref_ptr.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
reference.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
reference.h Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
register_core_types.cpp Lot of work in new importer, importing textures now works. 2017-02-01 09:46:36 -03:00
register_core_types.h -Changed most project settings in the engine, so they have major and minor categories. 2017-01-05 09:16:00 -03:00
resource.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
resource.h Lot of work in new importer, importing textures now works. 2017-02-01 09:46:36 -03:00
rid.cpp Merge remote-tracking branch 'origin/gles3' into gles3-on-master 2017-01-02 21:52:26 +01:00
rid.h Few small fixes so tools=no and target=release compiles 2017-01-10 21:42:14 +11:00
ring_buffer.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
safe_refcount.cpp Enable WebGL2 in web export, start fixing build 2017-02-01 10:21:04 +01:00
safe_refcount.h Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector 2017-01-07 18:26:38 -03:00
script_debugger_local.cpp Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
script_debugger_local.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
script_debugger_remote.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
script_debugger_remote.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
script_language.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
script_language.h Type renames: 2017-01-11 00:52:51 -03:00
SCsub Move tests again from core to main 2017-01-08 21:33:37 +01:00
self_list.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
set.h Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
simple_type.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
sort.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
string_db.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
string_db.h Remove use of _SCS from ADD_METHOD 2017-02-13 10:37:47 +01:00
translation.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
translation.h CSV translation import plugin 2017-02-01 20:41:05 -03:00
typedefs.h Style: Various fixes to play nice with clang-format 2017-01-16 08:49:52 +01:00
ucaps.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
undo_redo.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
undo_redo.h -Changed most project settings in the engine, so they have major and minor categories. 2017-01-05 09:16:00 -03:00
ustring.cpp Merge pull request #7002 from RandomShaper/vcs-friendliness 2017-01-25 14:52:40 -03:00
ustring.h Merge pull request #7002 from RandomShaper/vcs-friendliness 2017-01-25 14:52:40 -03:00
variant_call.cpp Remove use of _SCS from ADD_METHOD 2017-02-13 10:37:47 +01:00
variant_construct_string.cpp Style: Various fixes to play nice with clang-format 2017-01-16 08:49:52 +01:00
variant_op.cpp Revert "Make nan==nan true for GDScript" 2017-02-14 17:05:16 -03:00
variant_parser.cpp Renamed engine.cfg to godot.cfg, to forcefully break compatibility with 2.x 2017-02-04 20:53:55 -03:00
variant_parser.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
variant.cpp Correct hash behavior for floating point numbers 2017-02-16 18:44:29 +01:00
variant.h Correct hash behavior for floating point numbers 2017-02-16 18:44:29 +01:00
vector.h Enable WebGL2 in web export, start fixing build 2017-02-01 10:21:04 +01:00
vmap.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
vset.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00