[4.10]Maps store floats instead of doubles

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Major Cooke
Posts: 8109
Joined: Sun Jan 28, 2007 3:55 pm

[4.10]Maps store floats instead of doubles

Post by Major Cooke »

Code: Select all

2>C:\Games\doom 2\GZSource\src\common\scripting\core\maps.cpp(165,23): warning C4244: 'argument': conversion from 'double' to 'VT', possible loss of data
2>        with
2>        [
2>            VT=float
2>        ]
2>C:\Games\doom 2\GZSource\src\common\scripting\core\maps.cpp(470): message : see reference to function template instantiation 'void MapInsert<FMap_I32_F32>(M *,unsigned int,double)' being compiled
2>        with
2>        [
2>            M=FMap_I32_F32
2>        ]
2>C:\Games\doom 2\GZSource\src\common\scripting\core\maps.cpp(249,11): warning C4244: '=': conversion from 'double' to 'VT', possible loss of data
2>        with
2>        [
2>            VT=float
2>        ]
2>C:\Games\doom 2\GZSource\src\common\scripting\core\maps.cpp(470): message : see reference to function template instantiation 'void MapIteratorSetValue<FMapIterator_I32_F32>(I *,double)' being compiled
2>        with
2>        [
2>            I=FMapIterator_I32_F32
2>        ]
I'm concerned that if it's used to store doubles, the result will not be precise if that's what's needed.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48514
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [4.10]Maps store floats instead of doubles

Post by Graf Zahl »

There's also a map type using doubles.
Last edited by Graf Zahl on Sun Dec 04, 2022 1:58 pm, edited 1 time in total.
User avatar
RicardoLuis0
 
 
Posts: 52
Joined: Tue Aug 21, 2018 9:31 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Location: Brazil

Re: [4.10]Maps store floats instead of doubles

Post by RicardoLuis0 »

That's not the case, there's a Map<X,float> for type 32-bit float types, and Map<X, double> for 64-bit float types (you can see that this is for the 32-bit type because the type is XXXX_F32 and not XXXX_F64)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48514
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [4.10]Maps store floats instead of doubles

Post by Graf Zahl »

Yes, I noticed while checking this out. Seems someone did not look deeply enough. Thank god it's a false alert.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48514
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [4.10]Maps store floats instead of doubles

Post by Graf Zahl »

Still needs the warnings fixed, though, but that's of lesser concern.
User avatar
Major Cooke
Posts: 8109
Joined: Sun Jan 28, 2007 3:55 pm

Re: [4.10]Maps store floats instead of doubles

Post by Major Cooke »

Ah okay, glad to hear, was worried about that. I don't know how to read that code very well.

Return to “Closed Bugs [GZDoom]”