diff options
author | Campbell Barton <campbell@blender.org> | 2022-11-04 10:37:25 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-11-05 05:47:01 +0300 |
commit | ae3073323e92a1773fb253bd1c5d6c92b826e1e0 (patch) | |
tree | 0c2c63d40bbb0b83c6604f8b4e40e8f46ab0047e /source/blender/editors/object | |
parent | 4a313b82529b95aa267086ca0c4f113e65bb79c8 (diff) |
Cleanup: use bool instead of short for job stop & do_update arguments
Since these values are only ever 0/1, use bool type.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_bake.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_bake_api.c | 10 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.cc | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_remesh.cc | 10 |
4 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 4b6ce69294f..91641de1605 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -461,7 +461,7 @@ static void init_multiresbake_job(bContext *C, MultiresBakeJob *bkj) CTX_DATA_END; } -static void multiresbake_startjob(void *bkv, short *stop, short *do_update, float *progress) +static void multiresbake_startjob(void *bkv, bool *stop, bool *do_update, float *progress) { MultiresBakerJobData *data; MultiresBakeJob *bkj = bkv; diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index d05badc8fee..260d65fc5dc 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -106,7 +106,7 @@ typedef struct BakeAPIRender { /* Progress Callbacks. */ float *progress; - short *do_update; + bool *do_update; /* Operator state. */ ReportList *reports; @@ -150,12 +150,12 @@ static int bake_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) * for exec() when there is no render job * NOTE: this won't check for the escape key being pressed, but doing so isn't thread-safe. */ -static int bake_break(void *UNUSED(rjv)) +static bool bake_break(void *UNUSED(rjv)) { if (G.is_break) { - return 1; + return true; } - return 0; + return false; } static void bake_update_image(ScrArea *area, Image *image) @@ -1854,7 +1854,7 @@ finally: return result; } -static void bake_startjob(void *bkv, short *UNUSED(stop), short *do_update, float *progress) +static void bake_startjob(void *bkv, bool *UNUSED(stop), bool *do_update, float *progress) { BakeAPIRender *bkr = (BakeAPIRender *)bkv; diff --git a/source/blender/editors/object/object_modifier.cc b/source/blender/editors/object/object_modifier.cc index 2838b5829bf..a87e52db129 100644 --- a/source/blender/editors/object/object_modifier.cc +++ b/source/blender/editors/object/object_modifier.cc @@ -3023,7 +3023,7 @@ static bool ocean_bake_poll(bContext *C) struct OceanBakeJob { /* from wmJob */ struct Object *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; int current_frame; struct OceanCache *och; @@ -3062,7 +3062,7 @@ static void oceanbake_update(void *customdata, float progress, int *cancel) *(oj->progress) = progress; } -static void oceanbake_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void oceanbake_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { OceanBakeJob *oj = static_cast<OceanBakeJob *>(customdata); @@ -3075,7 +3075,7 @@ static void oceanbake_startjob(void *customdata, short *stop, short *do_update, BKE_ocean_bake(oj->ocean, oj->och, oceanbake_update, (void *)oj); *do_update = true; - *stop = 0; + *stop = false; } static void oceanbake_endjob(void *customdata) diff --git a/source/blender/editors/object/object_remesh.cc b/source/blender/editors/object/object_remesh.cc index 69fa84aa260..a50fb28805e 100644 --- a/source/blender/editors/object/object_remesh.cc +++ b/source/blender/editors/object/object_remesh.cc @@ -654,7 +654,7 @@ enum eSymmetryAxes { struct QuadriFlowJob { /* from wmJob */ struct Object *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; const struct wmOperator *op; @@ -836,7 +836,7 @@ static Mesh *remesh_symmetry_mirror(Object *ob, Mesh *mesh, eSymmetryAxes symmet return mesh_mirror; } -static void quadriflow_start_job(void *customdata, short *stop, short *do_update, float *progress) +static void quadriflow_start_job(void *customdata, bool *stop, bool *do_update, float *progress) { QuadriFlowJob *qj = static_cast<QuadriFlowJob *>(customdata); @@ -884,7 +884,7 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update if (new_mesh == nullptr) { *do_update = true; - *stop = 0; + *stop = false; if (qj->success == 1) { /* This is not a user cancellation event. */ qj->success = 0; @@ -917,7 +917,7 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update BKE_mesh_batch_cache_dirty_tag(static_cast<Mesh *>(ob->data), BKE_MESH_BATCH_DIRTY_ALL); *do_update = true; - *stop = 0; + *stop = false; } static void quadriflow_end_job(void *customdata) @@ -992,7 +992,7 @@ static int quadriflow_remesh_exec(bContext *C, wmOperator *op) if (op->flag == 0) { /* This is called directly from the exec operator, this operation is now blocking */ job->is_nonblocking_job = false; - short stop = 0, do_update = true; + bool stop = false, do_update = true; float progress; quadriflow_start_job(job, &stop, &do_update, &progress); quadriflow_end_job(job); |