diff options
author | Jacques Lucke <jacques@blender.org> | 2020-09-09 11:44:46 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-09-09 11:44:46 +0300 |
commit | 916497627ce07318bb9bc82aabcb42af9561c560 (patch) | |
tree | b9fe6b958087d04c870881a85c33bf7081e02235 /source/blender/blenkernel/intern | |
parent | 095142eae65820c8daf246def0866ac6accc9c87 (diff) |
Cleanup: use bool instead of int
Diffstat (limited to 'source/blender/blenkernel/intern')
4 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_inline.h b/source/blender/blenkernel/intern/CCGSubSurf_inline.h index 8aa1fede57d..91a7129b433 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf_inline.h +++ b/source/blender/blenkernel/intern/CCGSubSurf_inline.h @@ -213,15 +213,15 @@ BLI_INLINE void Normalize(float no[3]) /* Data layers mathematics. */ -BLI_INLINE int VertDataEqual(const float a[], const float b[], const CCGSubSurf *ss) +BLI_INLINE bool VertDataEqual(const float a[], const float b[], const CCGSubSurf *ss) { int i; for (i = 0; i < ss->meshIFC.numLayers; i++) { if (a[i] != b[i]) { - return 0; + return false; } } - return 1; + return true; } BLI_INLINE void VertDataZero(float v[], const CCGSubSurf *ss) diff --git a/source/blender/blenkernel/intern/CCGSubSurf_legacy.c b/source/blender/blenkernel/intern/CCGSubSurf_legacy.c index 8fc9afd58f1..b723d39ca08 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf_legacy.c +++ b/source/blender/blenkernel/intern/CCGSubSurf_legacy.c @@ -47,15 +47,15 @@ static int _edge_isBoundary(const CCGEdge *e) return e->numFaces < 2; } -static int _vert_isBoundary(const CCGVert *v) +static bool _vert_isBoundary(const CCGVert *v) { int i; for (i = 0; i < v->numEdges; i++) { if (_edge_isBoundary(v->edges[i])) { - return 1; + return true; } } - return 0; + return false; } static CCGVert *_edge_getOtherVert(CCGEdge *e, CCGVert *vQ) diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 3b73702cf0f..a653087f961 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -565,7 +565,7 @@ void BKE_armature_refresh_layer_used(struct Depsgraph *depsgraph, struct bArmatu * unique names afterwards) strip_number: removes number extensions (TODO: not used) * axis: the axis to name on * head/tail: the head/tail co-ordinate of the bone on the specified axis */ -int bone_autoside_name( +bool bone_autoside_name( char name[MAXBONENAME], int UNUSED(strip_number), short axis, float head, float tail) { unsigned int len; @@ -574,7 +574,7 @@ int bone_autoside_name( len = strlen(name); if (len == 0) { - return 0; + return false; } BLI_strncpy(basename, name, sizeof(basename)); @@ -689,9 +689,9 @@ int bone_autoside_name( BLI_snprintf(name, MAXBONENAME, "%s.%s", basename, extension); - return 1; + return true; } - return 0; + return false; } /** \} */ diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index ee60bf79611..4ea8ae555e3 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -413,7 +413,7 @@ static void setup_app_blend_file_data(bContext *C, } } -static int handle_subversion_warning(Main *main, ReportList *reports) +static bool handle_subversion_warning(Main *main, ReportList *reports) { if (main->minversionfile > BLENDER_FILE_VERSION || (main->minversionfile == BLENDER_FILE_VERSION && @@ -425,7 +425,7 @@ static int handle_subversion_warning(Main *main, ReportList *reports) main->minsubversionfile); } - return 1; + return true; } int BKE_blendfile_read(bContext *C, @@ -443,7 +443,7 @@ int BKE_blendfile_read(bContext *C, bfd = BLO_read_from_file(filepath, params->skip_flags, reports); if (bfd) { - if (0 == handle_subversion_warning(bfd->main, reports)) { + if (!handle_subversion_warning(bfd->main, reports)) { BKE_main_free(bfd->main); MEM_freeN(bfd); bfd = NULL; |