diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/hashfuncs.h | 5 | ||||
-rw-r--r-- | core/variant_parser.cpp | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/core/hashfuncs.h b/core/hashfuncs.h index a917ee5edb..6c029a3458 100644 --- a/core/hashfuncs.h +++ b/core/hashfuncs.h @@ -74,7 +74,10 @@ static inline uint32_t hash_djb2_one_float(float p_in,uint32_t p_prev=5381) { float f; uint32_t i; } u; - u.f=p_in; + + // handle -0 case + if (p_in==0.0f) u.f=0.0f; + else u.f=p_in; return ((p_prev<<5)+p_prev)+u.i; } diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 6b3828a572..5ed2415e36 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -1177,16 +1177,16 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in } else if (id=="IntArray") { - Vector<int32_t> args; - Error err = _parse_construct<int32_t>(p_stream,args,line,r_err_str); + Vector<int> args; + Error err = _parse_construct<int>(p_stream,args,line,r_err_str); if (err) return err; - DVector<int32_t> arr; + DVector<int> arr; { int len=args.size(); arr.resize(len); - DVector<int32_t>::Write w = arr.write(); + DVector<int>::Write w = arr.write(); for(int i=0;i<len;i++) { w[i]=int(args[i]); } |