Codechange: Use null pointer literal instead of the NULL macro
This commit is contained in:
committed by
Michael Lutz
parent
3b4f224c0b
commit
7c8e7c6b6e
@@ -414,7 +414,7 @@ void Blitter_32bppAnim::CopyToBuffer(const void *video, void *dst, int width, in
|
||||
uint32 *udst = (uint32 *)dst;
|
||||
const uint32 *src = (const uint32 *)video;
|
||||
|
||||
if (this->anim_buf == NULL) return;
|
||||
if (this->anim_buf == nullptr) return;
|
||||
|
||||
const uint16 *anim_line = this->ScreenToAnimOffset((const uint32 *)video) + this->anim_buf;
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ protected:
|
||||
|
||||
public:
|
||||
Blitter_32bppAnim() :
|
||||
anim_buf(NULL),
|
||||
anim_alloc(NULL),
|
||||
anim_buf(nullptr),
|
||||
anim_alloc(nullptr),
|
||||
anim_buf_width(0),
|
||||
anim_buf_height(0),
|
||||
anim_buf_pitch(0)
|
||||
|
||||
@@ -167,7 +167,7 @@ Sprite *Blitter_8bppOptimized::Encode(const SpriteLoader::Sprite *sprite, Alloca
|
||||
uint trans = 0;
|
||||
uint pixels = 0;
|
||||
uint last_colour = 0;
|
||||
byte *count_dst = NULL;
|
||||
byte *count_dst = nullptr;
|
||||
|
||||
/* Store the scaled image */
|
||||
const SpriteLoader::CommonPixel *src = &sprite[i].data[y * sprite[i].width];
|
||||
@@ -176,11 +176,11 @@ Sprite *Blitter_8bppOptimized::Encode(const SpriteLoader::Sprite *sprite, Alloca
|
||||
uint colour = src++->m;
|
||||
|
||||
if (last_colour == 0 || colour == 0 || pixels == 255) {
|
||||
if (count_dst != NULL) {
|
||||
if (count_dst != nullptr) {
|
||||
/* Write how many non-transparent bytes we get */
|
||||
*count_dst = pixels;
|
||||
pixels = 0;
|
||||
count_dst = NULL;
|
||||
count_dst = nullptr;
|
||||
}
|
||||
/* As long as we find transparency bytes, keep counting */
|
||||
if (colour == 0 && trans != 255) {
|
||||
@@ -206,7 +206,7 @@ Sprite *Blitter_8bppOptimized::Encode(const SpriteLoader::Sprite *sprite, Alloca
|
||||
}
|
||||
}
|
||||
|
||||
if (count_dst != NULL) *count_dst = pixels;
|
||||
if (count_dst != nullptr) *count_dst = pixels;
|
||||
|
||||
/* Write line-ending */
|
||||
*dst = 0; dst++;
|
||||
|
||||
@@ -48,7 +48,7 @@ private:
|
||||
*/
|
||||
static Blitter **GetActiveBlitter()
|
||||
{
|
||||
static Blitter *s_blitter = NULL;
|
||||
static Blitter *s_blitter = nullptr;
|
||||
return &s_blitter;
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ protected:
|
||||
* @param name The name of the blitter.
|
||||
* @param description A longer description for the blitter.
|
||||
* @param usable Whether the blitter is usable (on the current computer). For example for disabling SSE blitters when the CPU can't handle them.
|
||||
* @pre name != NULL.
|
||||
* @pre description != NULL.
|
||||
* @pre name != nullptr.
|
||||
* @pre description != nullptr.
|
||||
* @pre There is no blitter registered with this name.
|
||||
*/
|
||||
BlitterFactory(const char *name, const char *description, bool usable = true) :
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
static Blitter *SelectBlitter(const char *name)
|
||||
{
|
||||
BlitterFactory *b = GetBlitterFactory(name);
|
||||
if (b == NULL) return NULL;
|
||||
if (b == nullptr) return nullptr;
|
||||
|
||||
Blitter *newb = b->CreateInstance();
|
||||
delete *GetActiveBlitter();
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
/**
|
||||
* Get the blitter factory with the given name.
|
||||
* @param name the blitter factory to select.
|
||||
* @return The blitter factory, or NULL when there isn't one with the wanted name.
|
||||
* @return The blitter factory, or nullptr when there isn't one with the wanted name.
|
||||
*/
|
||||
static BlitterFactory *GetBlitterFactory(const char *name)
|
||||
{
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
}
|
||||
#endif /* defined(WITH_COCOA) */
|
||||
#endif /* defined(DEDICATED) */
|
||||
if (GetBlitters().size() == 0) return NULL;
|
||||
if (GetBlitters().size() == 0) return nullptr;
|
||||
const char *bname = (StrEmpty(name)) ? default_blitter : name;
|
||||
|
||||
Blitters::iterator it = GetBlitters().begin();
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override {};
|
||||
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override {};
|
||||
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
|
||||
void *MoveTo(void *video, int x, int y) override { return NULL; };
|
||||
void *MoveTo(void *video, int x, int y) override { return nullptr; };
|
||||
void SetPixel(void *video, int x, int y, uint8 colour) override {};
|
||||
void DrawRect(void *video, int width, int height, uint8 colour) override {};
|
||||
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override {};
|
||||
|
||||
Reference in New Issue
Block a user