scummvm/graphics
D G Turner ac4087856f ALL: Remove optimization unstable code on checking for null after new.
These issues were identified by the STACK tool.

By default, the C++ new operator will throw an exception on allocation
failure, rather than returning a null pointer.

The result is that testing the returned pointer for null is redundant
and _may_ be removed by the compiler. This is thus optimization
unstable and may result in incorrect behaviour at runtime.

However, we do not use exceptions as they are not supported by all
compilers and may be disabled.

To make this stable without removing the null check, you could qualify
the new operator call with std::nothrow to indicate that this should
return a null, rather than throwing an exception.

However, using (std::nothrow) was not desirable due to the Symbian
toolchain lacking a <new> header.
A global solution to this was also not easy by redefining "new" as "new
(std::nothrow)" due to custom constructors in NDS toolchain and various
common classes.

Also, this would then need explicit checks for OOM adding to all new
usages as per C malloc which is untidy.

For now to remove this optimisation unstable code is best as it is
likely to not be present anyway, and OOM will cause a system library
exception instead, even without exceptions enabled in the application
code.
2014-01-15 02:36:19 +00:00
..
decoders GRAPHICS: Set PNG alpha bits to 0 if there's no alpha present. 2013-11-12 10:57:25 +01:00
fonts GRAPHICS: Document loadTTFFont a bit. 2013-12-08 20:11:59 +01:00
scaler GRAPHICS: Fix incorrect parameter order for getBasePtr. 2013-08-08 06:55:17 +02:00
colormasks.h GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
conversion.cpp GRAPHICS: Fix compilation of conversion.cpp on motomagx. 2012-10-09 23:32:51 +02:00
conversion.h GRAPHICS: Allow in-place conversion with any color formats in crossBlit. 2012-08-28 02:27:48 +02:00
cursor.h GRAPHICS: Add cursor palette start/count functions 2011-08-16 00:19:29 -04:00
cursorman.cpp GRAPHICS: Fix uninitialized cursor visibility variable. CID 1002283. 2013-09-30 04:47:11 +01:00
cursorman.h RECORDER: Implement Events Recorder 2013-05-17 00:18:09 +03:00
font.cpp GRAPHICS: Allow Font to accept U32String as strings. 2013-11-23 21:34:54 +01:00
font.h GRAPHICS: Allow Font to accept U32String as strings. 2013-11-23 21:34:54 +01:00
fontman.cpp GRAPHICS: Take ownership of fonts passed to FontManager. 2012-03-28 19:17:13 +02:00
fontman.h GRAPHICS: Take ownership of fonts passed to FontManager. 2012-03-28 19:17:13 +02:00
maccursor.cpp GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
maccursor.h GRAPHICS: Add cursor palette start/count functions 2011-08-16 00:19:29 -04:00
module.mk GRAPHICS: Delete iff.cpp and iff.h since all ILBM and PBM decoding is handled by IFFDecoder now 2013-01-06 20:04:50 +01:00
palette.h ALL: behaviour -> behavior 2011-05-25 10:50:46 -04:00
pixelformat.h GRAPHICS: Fix colorToARGB's alpha value when no alpha channel is present 2012-06-15 23:11:28 -04:00
primitives.cpp JANITORIAL: Enforce "} // End of namespace" with a single space after }. 2013-01-26 19:38:02 +01:00
primitives.h JANITORIAL: Enforce "} // End of namespace" with a single space after }. 2013-01-26 19:38:02 +01:00
scaler.cpp JANITORIAL: Fix ){ -> ) { 2013-01-24 20:15:13 +01:00
scaler.h GRAPHICS: Allow arbitrary input sizes for thumbnail scaling. 2013-07-13 01:57:23 +02:00
sjis.cpp ALL: Remove optimization unstable code on checking for null after new. 2014-01-15 02:36:19 +00:00
sjis.h JANITORIAL: Remove trailing whitespaces. 2012-09-26 04:17:55 +02:00
surface.cpp GRAPHICS: Remove variable shadowing 2013-09-22 15:54:06 -05:00
surface.h GRAPHICS: Fix SharedPtrSurfaceDeleter for nullptr inputs. 2013-11-27 19:44:54 +01:00
thumbnail.cpp GRAPHICS: Be more robust with broken/unsupported thumbnail headers. 2013-07-12 22:54:53 +02:00
thumbnail.h RECORDER: Implement Events Recorder 2013-05-17 00:18:09 +03:00
VectorRenderer.cpp JANITORIAL: Remove trailing whitespaces. 2012-09-26 04:17:55 +02:00
VectorRenderer.h GRAPHICS: Add support for Soft Shadows with rounded squares 2013-08-16 20:54:08 +02:00
VectorRendererSpec.cpp GRAPHICS: Fix dest alpha formula in blendPixelPtr 2014-01-10 20:04:10 +01:00
VectorRendererSpec.h GRAPHICS: Gradient blending on borders of rounded squares 2013-08-16 20:54:10 +02:00
wincursor.cpp GRAPHICS: Hide the WinCursor implementation 2012-05-14 09:56:56 -04:00
wincursor.h GRAPHICS: Hide the WinCursor implementation 2012-05-14 09:56:56 -04:00
yuv_to_rgb.cpp GRAPHICS: Take advantage of Surface::getPixels. 2013-08-03 04:02:49 +02:00
yuv_to_rgb.h GRAPHICS: Cleanup the YUV to RGB usage documentation 2013-06-30 17:56:36 -04:00