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
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
SCsub
allocators.h
array.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
array.h
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.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
color.h
color_names.inc Add missing map.h include in color defs 2017-01-15 12:51:47 +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
core_string_names.cpp -begin of export work, not done yet 2017-02-15 08:30:32 -03:00
core_string_names.h
dictionary.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
dictionary.h
dvector.cpp
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
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
event_queue.cpp
event_queue.h
func_ref.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
func_ref.h
global_constants.cpp Match ERROR_QUERY_FAILED enum with others 2017-02-02 21:15:47 +09:00
global_constants.h
globals.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
globals.h
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
hq2x.h
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
list.h
make_binders.py
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
method_bind.cpp MethodBind: Make sure header order is kept 2017-01-14 22:07:28 +01:00
method_bind.h
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
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
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
print_string.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
print_string.h
ref_ptr.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
ref_ptr.h
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
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
rid.h
ring_buffer.h
safe_refcount.cpp Enable WebGL2 in web export, start fixing build 2017-02-01 10:21:04 +01:00
safe_refcount.h
script_debugger_local.cpp Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
script_debugger_local.h
script_debugger_remote.cpp Style: Cleanups, added headers, renamed files 2017-01-16 08:04:23 +01:00
script_debugger_remote.h
script_language.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
script_language.h
self_list.h
set.h Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
simple_type.h
sort.h
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
undo_redo.cpp Rename the _MD macro to D_METHOD 2017-02-13 12:50:02 +01:00
undo_redo.h
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.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
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
vector.h Enable WebGL2 in web export, start fixing build 2017-02-01 10:21:04 +01:00
vmap.h
vset.h