From bcc42f3a013b420e926af948c25c94986eaaf51a Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 8 Nov 2022 20:17:31 +0100 Subject: [PATCH] Compare against pointers --- src/BRSRC13/CORE/V1DB/prepmesh.c | 4 ++-- src/DETHRACE/common/loading.c | 2 +- src/DETHRACE/common/utility.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BRSRC13/CORE/V1DB/prepmesh.c b/src/BRSRC13/CORE/V1DB/prepmesh.c index ddd68c39..948b048a 100644 --- a/src/BRSRC13/CORE/V1DB/prepmesh.c +++ b/src/BRSRC13/CORE/V1DB/prepmesh.c @@ -604,8 +604,8 @@ void BrModelUpdate(br_model* model, br_uint_16 flags) { if (model->flags & BR_MODF_PREPREPARED) { return; } - if (!model->faces || !model->vertices) { - BrFailure("BrModelUpdate: model has no faces or vertices (%s)", model->identifier ? model->identifier : ""); + if (model->faces == NULL || model->vertices == NULL) { + BrFailure("BrModelUpdate: model has no faces or vertices (%s)", model->identifier != NULL ? model->identifier : ""); } if (flags & BR_MODU_UNKNOWN) { flags |= BR_MODU_NORMALS; diff --git a/src/DETHRACE/common/loading.c b/src/DETHRACE/common/loading.c index c0907ad4..52d40416 100644 --- a/src/DETHRACE/common/loading.c +++ b/src/DETHRACE/common/loading.c @@ -1687,7 +1687,7 @@ void MungeWindscreen(br_model* pModel) { void SetModelFlags(br_model* pModel, int pOwner) { LOG_TRACE("(%p, %d)", pModel, pOwner); - if (pModel && pModel->nfaces) { + if (pModel != NULL&& pModel->nfaces != 0) { #if defined(DETHRACE_FIX_BUGS) /* Show Squad Car in the wreck gallery. */ if (gAusterity_mode) { #else diff --git a/src/DETHRACE/common/utility.c b/src/DETHRACE/common/utility.c index 9446fff7..864fecd3 100644 --- a/src/DETHRACE/common/utility.c +++ b/src/DETHRACE/common/utility.c @@ -368,7 +368,7 @@ br_pixelmap* DRPixelmapAllocate(br_uint_8 pType, br_uint_16 pW, br_uint_16 pH, v br_pixelmap* the_map; the_map = BrPixelmapAllocate(pType, pW, pH, pPixels, pFlags); - if (the_map) { + if (the_map != NULL) { the_map->origin_y = 0; the_map->origin_x = 0; }