Replace NULL with nullptr

Moderator: GZDoom Developers

Post Reply
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Replace NULL with nullptr

Post by The Zombie Killer »

Blzut3
 
 
Posts: 3213
Joined: Wed Nov 24, 2004 12:59 pm
Operating System Version (Optional): Kubuntu
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Replace NULL with nullptr

Post by Blzut3 »

I see absolutely no reason to make a sweeping change like this just because it can be done. Yes there are advantages to using nullptr going forwards, but it's not something that can't be slowly rolled out as code is touched.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Replace NULL with nullptr

Post by Graf Zahl »

Agreed. That's how I was handling it - when I'm touching code that has NULL's I am replacing them. Changing such stuff just because can later cause problems to find when things were changed.
I'd also like to replace ZDoom's homegrown sized integers with the official stdint.h types but only if there is some consensus that it is a good idea and also gradually.
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: Replace NULL with nullptr

Post by _mental_ »

Graf Zahl wrote:I'd also like to replace ZDoom's homegrown sized integers with the official stdint.h types but only if there is some consensus that it is a good idea and also gradually.
Sure it's a very good idea, especially for type names like DWORD or BYTE. And no more USE_WINDOWS_DWORD workaround.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Replace NULL with nullptr

Post by Graf Zahl »

Last time it got blocked because of the _t suffix. I'd still prefer the official types, though, than redefining them again for some questionable convenience. But of course this can only be done if everybody agrees and if it's done gradually, not all at once.
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: Replace NULL with nullptr

Post by _mental_ »

As C++11 (or in fact C++14) compiler is now required, all supported build environment must have <cstdint> header. I doubt that redefining is really needed.
Or did you mean typedef's them without _t suffix? But in this case they may conflict with third party libraries or with platform specific types. You know that there is at least one system with a bunch on huge frameworks and with pretty much everything included in their header files.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Replace NULL with nullptr

Post by Graf Zahl »

That's precisely why I'd prefer to use compiler-native types. They are most likely guaranteed not to conflict with anything, except for some badly behaved old libraries, which ZDoom does not use.
But the entire typedef madness that's going on is not something I consider ok.

I'd still prefer stdint.h, the C++ namespacing is something I'd rather avoid here.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”