diff options
52 files changed, 207 insertions, 206 deletions
diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h index 109d3e6d977..431bc11b07f 100644 --- a/source/blender/blenkernel/BKE_dynamicpaint.h +++ b/source/blender/blenkernel/BKE_dynamicpaint.h @@ -119,7 +119,7 @@ struct DynamicPaintSurface *get_activeSurface(struct DynamicPaintCanvasSettings int dynamicPaint_createUVSurface(struct Scene *scene, struct DynamicPaintSurface *surface, float *progress, - short *do_update); + bool *do_update); /** * Calculate a single frame and included sub-frames for surface. */ diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 11c37a74a54..f0bb530e32b 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -170,7 +170,7 @@ int BKE_sound_scene_playing(struct Scene *scene); void BKE_sound_free_waveform(struct bSound *sound); -void BKE_sound_read_waveform(struct Main *bmain, struct bSound *sound, short *stop); +void BKE_sound_read_waveform(struct Main *bmain, struct bSound *sound, bool *stop); void BKE_sound_update_scene(struct Depsgraph *depsgraph, struct Scene *scene); diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h index 89f30ce8ef8..70c1049b5d7 100644 --- a/source/blender/blenkernel/BKE_tracking.h +++ b/source/blender/blenkernel/BKE_tracking.h @@ -657,8 +657,8 @@ void BKE_tracking_reconstruction_context_free(struct MovieReconstructContext *co * callback in libmv side and passing to an interface. */ void BKE_tracking_reconstruction_solve(struct MovieReconstructContext *context, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress, char *stats_message, int message_size); diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index b9cec17b6e0..e0ae3f42be6 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -2790,7 +2790,7 @@ static bool dynamicPaint_symmetrizeAdjData(PaintAdjData *ed, int active_points) int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, float *progress, - short *do_update) + bool *do_update) { /* Antialias jitter point relative coords */ const int aa_samples = (surface->flags & MOD_DPAINT_ANTIALIAS) ? 5 : 1; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 1aef42ef037..51a20cf1e35 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -1025,7 +1025,7 @@ void BKE_sound_free_waveform(bSound *sound) sound->tags &= ~SOUND_TAGS_WAVEFORM_NO_RELOAD; } -void BKE_sound_read_waveform(Main *bmain, bSound *sound, short *stop) +void BKE_sound_read_waveform(Main *bmain, bSound *sound, bool *stop) { bool need_close_audio_handles = false; if (sound->playback_handle == NULL) { @@ -1041,8 +1041,11 @@ void BKE_sound_read_waveform(Main *bmain, bSound *sound, short *stop) int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND; waveform->data = MEM_mallocN(sizeof(float[3]) * length, "SoundWaveform.samples"); + /* Ideally this would take a boolean argument. */ + short stop_i16 = *stop; waveform->length = AUD_readSound( - sound->playback_handle, waveform->data, length, SOUND_WAVE_SAMPLES_PER_SECOND, stop); + sound->playback_handle, waveform->data, length, SOUND_WAVE_SAMPLES_PER_SECOND, &stop_i16); + *stop = stop_i16 != 0; } else { /* Create an empty waveform here if the sound couldn't be @@ -1381,7 +1384,7 @@ int BKE_sound_scene_playing(Scene *UNUSED(scene)) void BKE_sound_read_waveform(Main *bmain, bSound *sound, /* NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop) + bool *stop) { UNUSED_VARS(sound, stop, bmain); } diff --git a/source/blender/blenkernel/intern/tracking_solver.c b/source/blender/blenkernel/intern/tracking_solver.c index 11041b4c0fd..e784c39ba08 100644 --- a/source/blender/blenkernel/intern/tracking_solver.c +++ b/source/blender/blenkernel/intern/tracking_solver.c @@ -56,8 +56,8 @@ typedef struct MovieReconstructContext { } MovieReconstructContext; typedef struct ReconstructProgressData { - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; char *stats_message; int message_size; @@ -465,8 +465,8 @@ static void reconstructionOptionsFromContext(libmv_ReconstructionOptions *recons } void BKE_tracking_reconstruction_solve(MovieReconstructContext *context, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress, char *stats_message, int message_size) diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 9bf0cce2af2..26a264c1716 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -142,7 +142,7 @@ typedef struct EEVEE_LightBake { struct GPUTexture *dummy_layer_color; int total, done; /* to compute progress */ - short *stop, *do_update; + bool *stop, *do_update; float *progress; /** For only handling the resources. */ @@ -778,7 +778,7 @@ wmJob *EEVEE_lightbake_job_create(struct wmWindowManager *wm, } if (old_lbake->stop != NULL) { - *old_lbake->stop = 1; + *old_lbake->stop = true; } BLI_mutex_unlock(old_lbake->mutex); } @@ -1359,13 +1359,13 @@ static bool lightbake_do_sample(EEVEE_LightBake *lbake, DRW_custom_pipeline(&draw_engine_eevee_type, depsgraph, render_callback, lbake); lbake->done += 1; *lbake->progress = lbake->done / (float)lbake->total; - *lbake->do_update = 1; + *lbake->do_update = true; eevee_lightbake_context_disable(lbake); return true; } -void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float *progress) +void EEVEE_lightbake_job(void *custom_data, bool *stop, bool *do_update, float *progress) { EEVEE_LightBake *lbake = (EEVEE_LightBake *)custom_data; Depsgraph *depsgraph = lbake->depsgraph; @@ -1394,8 +1394,8 @@ void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float /* Resource allocation can fail. Early exit in this case. */ if (lbake->lcache->flag & LIGHTCACHE_INVALID) { - *lbake->stop = 1; - *lbake->do_update = 1; + *lbake->stop = true; + *lbake->do_update = true; lbake->lcache->flag &= ~LIGHTCACHE_BAKING; eevee_lightbake_context_disable(lbake); eevee_lightbake_delete_resources(lbake); diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.h b/source/blender/draw/engines/eevee/eevee_lightcache.h index 4e94e1914a7..73961f1919d 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.h +++ b/source/blender/draw/engines/eevee/eevee_lightcache.h @@ -42,7 +42,7 @@ void *EEVEE_lightbake_job_data_alloc(struct Main *bmain, int frame); void EEVEE_lightbake_job_data_free(void *custom_data); void EEVEE_lightbake_update(void *custom_data); -void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float *progress); +void EEVEE_lightbake_job(void *custom_data, bool *stop, bool *do_update, float *progress); /** * This is to update the world irradiance and reflection contribution from diff --git a/source/blender/draw/intern/draw_manager_shader.c b/source/blender/draw/intern/draw_manager_shader.c index 40b05dff51f..85701a10f4b 100644 --- a/source/blender/draw/intern/draw_manager_shader.c +++ b/source/blender/draw/intern/draw_manager_shader.c @@ -64,8 +64,8 @@ static void drw_deferred_shader_compilation_exec( void *custom_data, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *UNUSED(do_update), + bool *stop, + bool *UNUSED(do_update), float *UNUSED(progress)) { GPU_render_begin(); diff --git a/source/blender/editors/gpencil/gpencil_trace_ops.c b/source/blender/editors/gpencil/gpencil_trace_ops.c index 36165c6b7c0..1a18e10412e 100644 --- a/source/blender/editors/gpencil/gpencil_trace_ops.c +++ b/source/blender/editors/gpencil/gpencil_trace_ops.c @@ -45,7 +45,7 @@ typedef struct TraceJob { /* from wmJob */ struct Object *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; bContext *C; @@ -198,7 +198,7 @@ static void trace_initialize_job_data(TraceJob *trace_job) } } -static void trace_start_job(void *customdata, short *stop, short *do_update, float *progress) +static void trace_start_job(void *customdata, bool *stop, bool *do_update, float *progress) { TraceJob *trace_job = customdata; @@ -257,7 +257,7 @@ static void trace_start_job(void *customdata, short *stop, short *do_update, flo trace_job->success = !trace_job->was_canceled; *do_update = true; - *stop = 0; + *stop = false; } static void trace_end_job(void *customdata) @@ -339,7 +339,7 @@ static int gpencil_trace_image_exec(bContext *C, wmOperator *op) ED_object_base_activate(job->C, job->base_active); if ((job->image->source == IMA_SRC_FILE) || (job->frame_num > 0)) { - short stop = 0, do_update = true; + bool stop = false, do_update = true; float progress; trace_start_job(job, &stop, &do_update, &progress); trace_end_job(job); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 9a4f98ebcd6..a5e2cd02f3b 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1309,8 +1309,8 @@ static void ui_id_preview_image_render_size( const bContext *C, Scene *scene, ID *id, PreviewImage *pi, int size, const bool use_job); static void ui_studiolight_icon_job_exec(void *customdata, - short *UNUSED(stop), - short *UNUSED(do_update), + bool *UNUSED(stop), + bool *UNUSED(do_update), float *UNUSED(progress)) { Icon **tmp = (Icon **)customdata; 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); diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c index 41238eb171b..1a3f0f0f2ac 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.c +++ b/source/blender/editors/physics/dynamicpaint_ops.c @@ -285,7 +285,7 @@ void DPAINT_OT_output_toggle(wmOperatorType *ot) typedef struct DynamicPaintBakeJob { /* from wmJob */ void *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; struct Main *bmain; @@ -429,7 +429,7 @@ static void dynamicPaint_bakeImageSequence(DynamicPaintBakeJob *job) ED_update_for_newframe(job->bmain, job->depsgraph); } -static void dpaint_bake_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void dpaint_bake_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { DynamicPaintBakeJob *job = customdata; @@ -450,7 +450,7 @@ static void dpaint_bake_startjob(void *customdata, short *stop, short *do_update dynamicPaint_bakeImageSequence(job); *do_update = true; - *stop = 0; + *stop = false; } /* diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 314796e96e4..d5e55c99444 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -61,7 +61,7 @@ typedef struct FluidJob { /* from wmJob */ void *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; const char *type; const char *name; @@ -349,7 +349,7 @@ static void fluid_bake_endjob(void *customdata) } } -static void fluid_bake_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void fluid_bake_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { FluidJob *job = customdata; FluidDomainSettings *fds = job->fmd->domain; @@ -428,7 +428,7 @@ static void fluid_bake_startjob(void *customdata, short *stop, short *do_update, *do_update = true; } if (stop) { - *stop = 0; + *stop = false; } } @@ -461,7 +461,7 @@ static void fluid_free_endjob(void *customdata) } } -static void fluid_free_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void fluid_free_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { FluidJob *job = customdata; FluidDomainSettings *fds = job->fmd->domain; @@ -504,7 +504,7 @@ static void fluid_free_startjob(void *customdata, short *stop, short *do_update, #endif *do_update = true; - *stop = 0; + *stop = false; /* Update scene so that viewport shows freed up scene */ ED_update_for_newframe(job->bmain, job->depsgraph); diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index 97cd0d1d149..9fac93187ee 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -86,7 +86,7 @@ static bool ptcache_add_remove_poll(bContext *C) typedef struct PointCacheJob { wmWindowManager *wm; void *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; PTCacheBaker *baker; @@ -126,7 +126,7 @@ static void ptcache_job_update(void *customdata, float progress, int *cancel) *(job->progress) = progress; } -static void ptcache_job_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void ptcache_job_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { PointCacheJob *job = customdata; @@ -144,7 +144,7 @@ static void ptcache_job_startjob(void *customdata, short *stop, short *do_update BKE_ptcache_bake(job->baker); *do_update = true; - *stop = 0; + *stop = false; } static void ptcache_job_endjob(void *customdata) diff --git a/source/blender/editors/render/render_internal.cc b/source/blender/editors/render/render_internal.cc index e66cabbc9f8..b05f430d198 100644 --- a/source/blender/editors/render/render_internal.cc +++ b/source/blender/editors/render/render_internal.cc @@ -69,7 +69,7 @@ #include "render_intern.hh" /* Render Callbacks */ -static int render_break(void *rjv); +static bool render_break(void *rjv); struct RenderJob { Main *main; @@ -87,8 +87,8 @@ struct RenderJob { Image *image; ImageUser iuser; bool image_outdated; - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; ReportList *reports; int orig_layer; @@ -637,7 +637,7 @@ static void current_scene_update(void *rjv, Scene *scene) rj->iuser.scene = scene; } -static void render_startjob(void *rjv, short *stop, short *do_update, float *progress) +static void render_startjob(void *rjv, bool *stop, bool *do_update, float *progress) { RenderJob *rj = static_cast<RenderJob *>(rjv); @@ -791,29 +791,29 @@ static void render_endjob(void *rjv) } /* called by render, check job 'stop' value or the global */ -static int render_breakjob(void *rjv) +static bool render_breakjob(void *rjv) { RenderJob *rj = static_cast<RenderJob *>(rjv); if (G.is_break) { - return 1; + return true; } if (rj->stop && *(rj->stop)) { - return 1; + return true; } - return 0; + return false; } /** * 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 render_break(void * /*rjv*/) +static bool render_break(void * /*rjv*/) { if (G.is_break) { - return 1; + return true; } - return 0; + return false; } /* runs in thread, no cursor setting here works. careful with notifiers too (malloc conflicts) */ diff --git a/source/blender/editors/render/render_preview.cc b/source/blender/editors/render/render_preview.cc index 5aae48b1138..3a25bb0de0c 100644 --- a/source/blender/editors/render/render_preview.cc +++ b/source/blender/editors/render/render_preview.cc @@ -104,7 +104,7 @@ static void icon_copy_rect(ImBuf *ibuf, uint w, uint h, uint *rect); struct ShaderPreview { /* from wmJob */ void *owner; - short *stop, *do_update; + bool *stop, *do_update; Scene *scene; ID *id, *id_copy; @@ -1047,7 +1047,7 @@ static void shader_preview_update(void *spv, RenderResult * /*rr*/, struct rcti } /* called by renderer, checks job value */ -static int shader_preview_break(void *spv) +static bool shader_preview_break(void *spv) { ShaderPreview *sp = static_cast<ShaderPreview *>(spv); @@ -1223,7 +1223,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs } /* runs inside thread for material and icons */ -static void shader_preview_startjob(void *customdata, short *stop, short *do_update) +static void shader_preview_startjob(void *customdata, bool *stop, bool *do_update) { ShaderPreview *sp = static_cast<ShaderPreview *>(customdata); @@ -1408,7 +1408,7 @@ static void set_alpha(char *cp, int sizex, int sizey, char alpha) } } -static void icon_preview_startjob(void *customdata, short *stop, short *do_update) +static void icon_preview_startjob(void *customdata, bool *stop, bool *do_update) { ShaderPreview *sp = static_cast<ShaderPreview *>(customdata); @@ -1488,8 +1488,8 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat * does not run two of them at the same time. */ static void common_preview_startjob(void *customdata, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float * /*progress*/) { ShaderPreview *sp = static_cast<ShaderPreview *>(customdata); @@ -1509,8 +1509,8 @@ static void common_preview_startjob(void *customdata, static void other_id_types_preview_render(IconPreview *ip, IconPreviewSize *cur_size, const ePreviewRenderMethod pr_method, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { ShaderPreview *sp = MEM_cnew<ShaderPreview>("Icon ShaderPreview"); @@ -1570,8 +1570,8 @@ static int icon_previewimg_size_index_get(const IconPreviewSize *icon_size, } static void icon_preview_startjob_all_sizes(void *customdata, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { IconPreview *ip = (IconPreview *)customdata; @@ -1735,7 +1735,7 @@ class PreviewLoadJob { void push_load_request(PreviewImage *preview, eIconSizes icon_size); private: - static void run_fn(void *customdata, short *stop, short *do_update, float *progress); + static void run_fn(void *customdata, bool *stop, bool *do_update, float *progress); static void update_fn(void *customdata); static void end_fn(void *customdata); static void free_fn(void *customdata); @@ -1776,7 +1776,7 @@ void PreviewLoadJob::load_jobless(PreviewImage *preview, const eIconSizes icon_s job_data.push_load_request(preview, icon_size); - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0; run_fn(&job_data, &stop, &do_update, &progress); update_fn(&job_data); @@ -1798,7 +1798,7 @@ void PreviewLoadJob::push_load_request(PreviewImage *preview, const eIconSizes i BLI_thread_queue_push(todo_queue_, &requested_previews_.back()); } -void PreviewLoadJob::run_fn(void *customdata, short *stop, short *do_update, float * /*progress*/) +void PreviewLoadJob::run_fn(void *customdata, bool *stop, bool *do_update, float * /*progress*/) { PreviewLoadJob *job_data = static_cast<PreviewLoadJob *>(customdata); @@ -1936,7 +1936,7 @@ void ED_preview_icon_render( } IconPreview ip = {nullptr}; - short stop = false, update = false; + bool stop = false, update = false; float progress = 0.0f; ED_preview_ensure_dbase(); diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index 83ce447e8cf..e5c2b9702e5 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -1398,7 +1398,7 @@ static int light_cache_bake_exec(bContext *C, wmOperator *op) light_cache_bake_tag_cache(scene, op); - short stop = 0, do_update; + bool stop = false, do_update; float progress; /* Not actually used. */ EEVEE_lightbake_job(rj, &stop, &do_update, &progress); EEVEE_lightbake_job_data_free(rj); diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 9a690f36aab..10a037a1c3c 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -676,8 +676,8 @@ typedef struct PrefetchQueue { SpinLock spin; - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; } PrefetchQueue; @@ -819,7 +819,7 @@ static uchar *prefetch_thread_next_frame(PrefetchQueue *queue, (queue->initial_frame - queue->current_frame); } - *queue->do_update = 1; + *queue->do_update = true; *queue->progress = (float)frames_processed / (queue->end_frame - queue->start_frame); } } @@ -868,7 +868,7 @@ static void prefetch_task_func(TaskPool *__restrict pool, void *task_data) if (!result) { /* no more space in the cache, stop reading frames */ - *queue->stop = 1; + *queue->stop = true; break; } } @@ -880,8 +880,8 @@ static void start_prefetch_threads(MovieClip *clip, int end_frame, short render_size, short render_flag, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { int tot_thread = BLI_task_scheduler_num_threads(); @@ -918,7 +918,7 @@ static bool prefetch_movie_frame(MovieClip *clip, int frame, short render_size, short render_flag, - short *stop) + bool *stop) { MovieClipUser user = *DNA_struct_default_get(MovieClipUser); @@ -940,14 +940,14 @@ static bool prefetch_movie_frame(MovieClip *clip, if (!result) { /* no more space in the cache, we could stop prefetching here */ - *stop = 1; + *stop = true; } IMB_freeImBuf(ibuf); } else { /* error reading frame, fair enough stop attempting further reading */ - *stop = 1; + *stop = true; } } @@ -961,8 +961,8 @@ static void do_prefetch_movie(MovieClip *clip, int end_frame, short render_size, short render_flag, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { int frame; @@ -976,7 +976,7 @@ static void do_prefetch_movie(MovieClip *clip, frames_processed++; - *do_update = 1; + *do_update = true; *progress = (float)frames_processed / (end_frame - start_frame); } @@ -988,12 +988,12 @@ static void do_prefetch_movie(MovieClip *clip, frames_processed++; - *do_update = 1; + *do_update = true; *progress = (float)frames_processed / (end_frame - start_frame); } } -static void prefetch_startjob(void *pjv, short *stop, short *do_update, float *progress) +static void prefetch_startjob(void *pjv, bool *stop, bool *do_update, float *progress) { PrefetchJob *pj = pjv; diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 486f9f9ccb0..2c0668625a0 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1219,8 +1219,8 @@ static void do_movie_proxy(void *pjv, int UNUSED(build_count), int *build_undistort_sizes, int build_undistort_count, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { ProxyJob *pj = pjv; @@ -1285,8 +1285,8 @@ typedef struct ProxyQueue { int efra; SpinLock spin; - const short *stop; - short *do_update; + const bool *stop; + bool *do_update; float *progress; } ProxyQueue; @@ -1343,7 +1343,7 @@ static uchar *proxy_thread_next_frame(ProxyQueue *queue, queue->cfra++; close(file); - *queue->do_update = 1; + *queue->do_update = true; *queue->progress = (float)(queue->cfra - queue->sfra) / (queue->efra - queue->sfra); } BLI_spin_unlock(&queue->spin); @@ -1392,8 +1392,8 @@ static void do_sequence_proxy(void *pjv, int build_undistort_count, /* Cannot be const, because it is assigned to a non-const variable. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { ProxyJob *pj = pjv; @@ -1452,7 +1452,7 @@ static void do_sequence_proxy(void *pjv, MEM_freeN(handles); } -static void proxy_startjob(void *pjv, short *stop, short *do_update, float *progress) +static void proxy_startjob(void *pjv, bool *stop, bool *do_update, float *progress) { ProxyJob *pj = pjv; MovieClip *clip = pj->clip; diff --git a/source/blender/editors/space_clip/tracking_ops_solve.c b/source/blender/editors/space_clip/tracking_ops_solve.c index bfa45053e96..ddfcaa282e3 100644 --- a/source/blender/editors/space_clip/tracking_ops_solve.c +++ b/source/blender/editors/space_clip/tracking_ops_solve.c @@ -87,7 +87,7 @@ static void solve_camera_updatejob(void *scv) BLI_strncpy(tracking->stats->message, scj->stats_message, sizeof(tracking->stats->message)); } -static void solve_camera_startjob(void *scv, short *stop, short *do_update, float *progress) +static void solve_camera_startjob(void *scv, bool *stop, bool *do_update, float *progress) { SolveCameraJob *scj = (SolveCameraJob *)scv; BKE_tracking_reconstruction_solve( diff --git a/source/blender/editors/space_clip/tracking_ops_track.c b/source/blender/editors/space_clip/tracking_ops_track.c index f6fd2980c19..2753af609e7 100644 --- a/source/blender/editors/space_clip/tracking_ops_track.c +++ b/source/blender/editors/space_clip/tracking_ops_track.c @@ -204,8 +204,8 @@ static void track_markers_startjob( void *tmv, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { TrackMarkersJob *tmj = (TrackMarkersJob *)tmv; @@ -353,7 +353,7 @@ static int track_markers(bContext *C, wmOperator *op, bool use_job) return OPERATOR_RUNNING_MODAL; } - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0.0f; track_markers_startjob(tmj, &stop, &do_update, &progress); track_markers_endjob(tmj); diff --git a/source/blender/editors/space_file/filelist.cc b/source/blender/editors/space_file/filelist.cc index 3870178f119..9ca5b1da7da 100644 --- a/source/blender/editors/space_file/filelist.cc +++ b/source/blender/editors/space_file/filelist.cc @@ -246,7 +246,7 @@ struct FileList { bool (*check_dir_fn)(struct FileList *, char *, const bool); /* Fill filelist (to be called by read job). */ - void (*read_job_fn)(struct FileListReadJob *, short *, short *, float *); + void (*read_job_fn)(struct FileListReadJob *, bool *, bool *, float *); /* Filter an entry of current filelist. */ bool (*filter_fn)(struct FileListInternEntry *, const char *, FileListFilter *); @@ -295,24 +295,24 @@ enum { static ImBuf *gSpecialFileImages[SPECIAL_IMG_MAX]; static void filelist_readjob_main(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); static void filelist_readjob_lib(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); static void filelist_readjob_dir(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); static void filelist_readjob_asset_library(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); static void filelist_readjob_main_assets(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); /* helper, could probably go in BKE actually? */ @@ -3401,7 +3401,7 @@ struct FileListReadJob { static void filelist_readjob_append_entries(FileListReadJob *job_params, ListBase *from_entries, int from_entries_num, - short *do_update) + bool *do_update) { BLI_assert(BLI_listbase_count(from_entries) == from_entries_num); if (from_entries_num <= 0) { @@ -3456,8 +3456,8 @@ static bool filelist_readjob_should_recurse_into_entry(const int max_recursion, static void filelist_readjob_recursive_dir_add_items(const bool do_lib, FileListReadJob *job_params, - const short *stop, - short *do_update, + const bool *stop, + bool *do_update, float *progress) { FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3594,8 +3594,8 @@ static void filelist_readjob_recursive_dir_add_items(const bool do_lib, static void filelist_readjob_do(const bool do_lib, FileListReadJob *job_params, - const short *stop, - short *do_update, + const bool *stop, + bool *do_update, float *progress) { FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3611,16 +3611,16 @@ static void filelist_readjob_do(const bool do_lib, } static void filelist_readjob_dir(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { filelist_readjob_do(false, job_params, stop, do_update, progress); } static void filelist_readjob_lib(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { filelist_readjob_do(true, job_params, stop, do_update, progress); @@ -3643,7 +3643,7 @@ static void filelist_asset_library_path(const FileListReadJob *job_params, /** * Load asset library data, which currently means loading the asset catalogs for the library. */ -static void filelist_readjob_load_asset_library_data(FileListReadJob *job_params, short *do_update) +static void filelist_readjob_load_asset_library_data(FileListReadJob *job_params, bool *do_update) { FileList *tmp_filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3667,8 +3667,8 @@ static void filelist_readjob_load_asset_library_data(FileListReadJob *job_params } static void filelist_readjob_main_assets_add_items(FileListReadJob *job_params, - short * /*stop*/, - short *do_update, + bool * /*stop*/, + bool *do_update, float * /*progress*/) { FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3729,8 +3729,8 @@ static bool filelist_contains_main(const FileList *filelist, const Main *bmain) } static void filelist_readjob_asset_library(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3753,8 +3753,8 @@ static void filelist_readjob_asset_library(FileListReadJob *job_params, } static void filelist_readjob_main(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { /* TODO! */ @@ -3762,8 +3762,8 @@ static void filelist_readjob_main(FileListReadJob *job_params, } static void filelist_readjob_main_assets(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3791,7 +3791,7 @@ static bool filelist_readjob_is_partial_read(const FileListReadJob *read_job) * some current entries are kept and we just call the readjob to update the main files (see * #FileListReadJob.only_main_data). */ -static void filelist_readjob_startjob(void *flrjv, short *stop, short *do_update, float *progress) +static void filelist_readjob_startjob(void *flrjv, bool *stop, bool *do_update, float *progress) { FileListReadJob *flrj = static_cast<FileListReadJob *>(flrjv); @@ -3939,8 +3939,8 @@ void filelist_readjob_start(FileList *filelist, const int space_notifier, const const bool no_threads = (filelist->tags & FILELIST_TAGS_NO_THREADS) || flrj->only_main_data; if (no_threads) { - short dummy_stop = false; - short dummy_do_update = false; + bool dummy_stop = false; + bool dummy_do_update = false; float dummy_progress = 0.0f; /* Single threaded execution. Just directly call the callbacks. */ diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index cea53908d4f..959f8b01ec8 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -1147,8 +1147,8 @@ static void fsmenu_bookmark_validate_job_startjob( void *fsmenuv, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *UNUSED(progress)) { FSMenu *fsmenu = fsmenuv; diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 48b3d711bdf..e6eba45d45e 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -89,8 +89,8 @@ struct CompoJob { Depsgraph *compositor_depsgraph; bNodeTree *localtree; /* Jon system integration. */ - const short *stop; - short *do_update; + const bool *stop; + bool *do_update; float *progress; }; @@ -166,7 +166,7 @@ static int compo_get_recalc_flags(const bContext *C) } /* called by compo, only to check job 'stop' value */ -static int compo_breakjob(void *cjv) +static bool compo_breakjob(void *cjv) { CompoJob *cj = (CompoJob *)cjv; @@ -250,8 +250,8 @@ static void compo_progressjob(void *cjv, float progress) static void compo_startjob(void *cjv, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { CompoJob *cj = (CompoJob *)cjv; diff --git a/source/blender/editors/space_sequencer/sequencer_drag_drop.c b/source/blender/editors/space_sequencer/sequencer_drag_drop.c index c892e7d7e55..d43ce26d2a1 100644 --- a/source/blender/editors/space_sequencer/sequencer_drag_drop.c +++ b/source/blender/editors/space_sequencer/sequencer_drag_drop.c @@ -505,8 +505,8 @@ typedef struct DropJobData { } DropJobData; static void prefetch_data_fn(void *custom_data, - short *UNUSED(stop), - short *UNUSED(do_update), + bool *UNUSED(stop), + bool *UNUSED(do_update), float *UNUSED(progress)) { DropJobData *job_data = (DropJobData *)custom_data; diff --git a/source/blender/editors/space_sequencer/sequencer_preview.c b/source/blender/editors/space_sequencer/sequencer_preview.c index 2820edc95aa..2410055d76d 100644 --- a/source/blender/editors/space_sequencer/sequencer_preview.c +++ b/source/blender/editors/space_sequencer/sequencer_preview.c @@ -51,7 +51,7 @@ static void free_preview_job(void *data) } /* Only this runs inside thread. */ -static void preview_startjob(void *data, short *stop, short *do_update, float *progress) +static void preview_startjob(void *data, bool *stop, bool *do_update, float *progress) { PreviewJob *pj = data; PreviewJobAudio *previewjb; diff --git a/source/blender/editors/space_sequencer/sequencer_proxy.c b/source/blender/editors/space_sequencer/sequencer_proxy.c index c851d3a29d4..30817771015 100644 --- a/source/blender/editors/space_sequencer/sequencer_proxy.c +++ b/source/blender/editors/space_sequencer/sequencer_proxy.c @@ -118,7 +118,7 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) if (seq->flag & SELECT) { ListBase queue = {NULL, NULL}; LinkData *link; - short stop = 0, do_update; + bool stop = false, do_update; float progress; SEQ_proxy_rebuild_context(bmain, depsgraph, scene, seq, file_list, &queue, false); @@ -126,7 +126,7 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) for (link = queue.first; link; link = link->next) { struct SeqIndexBuildContext *context = link->data; SEQ_proxy_rebuild(context, &stop, &do_update, &progress); - SEQ_proxy_rebuild_finish(context, 0); + SEQ_proxy_rebuild_finish(context, false); } SEQ_relations_free_imbuf(scene, &ed->seqbase, false); } diff --git a/source/blender/editors/space_sequencer/sequencer_thumbnails.c b/source/blender/editors/space_sequencer/sequencer_thumbnails.c index 460054f3b44..d1606b14152 100644 --- a/source/blender/editors/space_sequencer/sequencer_thumbnails.c +++ b/source/blender/editors/space_sequencer/sequencer_thumbnails.c @@ -132,8 +132,8 @@ static void seq_get_thumb_image_dimensions(Sequence *seq, } static void thumbnail_start_job(void *data, - short *stop, - short *UNUSED(do_update), + bool *stop, + bool *UNUSED(do_update), float *UNUSED(progress)) { ThumbnailDrawJob *tj = data; diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c index 80517979f30..6f44cc68a19 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c @@ -154,7 +154,7 @@ static bool bake_strokes(Object *ob, typedef struct LineartBakeJob { wmWindowManager *wm; void *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; /* C or ob must have one != NULL. */ @@ -218,8 +218,8 @@ static void lineart_gpencil_guard_modifiers(LineartBakeJob *bj) } static void lineart_gpencil_bake_startjob(void *customdata, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { LineartBakeJob *bj = (LineartBakeJob *)customdata; @@ -337,7 +337,7 @@ static int lineart_gpencil_bake_common(bContext *C, } float pseduo_progress; - short pseduo_do_update; + bool pseduo_do_update; lineart_gpencil_bake_startjob(bj, NULL, &pseduo_do_update, &pseduo_progress); BLI_linklist_free(bj->objects, NULL); diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 5c76dfe52df..a05bc51fcea 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -358,14 +358,14 @@ struct IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, * Will rebuild all used indices and proxies at once. */ void IMB_anim_index_rebuild(struct IndexBuildContext *context, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); /** * Finish rebuilding proxies/time-codes and free temporary contexts used. */ -void IMB_anim_index_rebuild_finish(struct IndexBuildContext *context, short stop); +void IMB_anim_index_rebuild_finish(struct IndexBuildContext *context, bool stop); /** * Return the length (in frames) of the given \a anim. diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 63836690ee4..d824b87f493 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -931,7 +931,7 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, return (IndexBuildContext *)context; } -static void index_rebuild_ffmpeg_finish(FFmpegIndexBuilderContext *context, int stop) +static void index_rebuild_ffmpeg_finish(FFmpegIndexBuilderContext *context, const bool stop) { int i; @@ -1012,8 +1012,8 @@ static void index_rebuild_ffmpeg_proc_decoded_frame(FFmpegIndexBuilderContext *c } static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context, - const short *stop, - short *do_update, + const bool *stop, + bool *do_update, float *progress) { AVFrame *in_frame = av_frame_alloc(); @@ -1303,7 +1303,7 @@ static IndexBuildContext *index_fallback_create_context(struct anim *anim, return (IndexBuildContext *)context; } -static void index_rebuild_fallback_finish(FallbackIndexBuilderContext *context, int stop) +static void index_rebuild_fallback_finish(FallbackIndexBuilderContext *context, const bool stop) { struct anim *anim = context->anim; char filepath[FILE_MAX]; @@ -1330,8 +1330,8 @@ static void index_rebuild_fallback_finish(FallbackIndexBuilderContext *context, } static void index_rebuild_fallback(FallbackIndexBuilderContext *context, - const short *stop, - short *do_update, + const bool *stop, + bool *do_update, float *progress) { int count = IMB_anim_get_duration(context->anim, IMB_TC_NONE); @@ -1470,9 +1470,9 @@ IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, void IMB_anim_index_rebuild(struct IndexBuildContext *context, /* NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, + bool *stop, /* NOLINTNEXTLINE: readability-non-const-parameter. */ - short *do_update, + bool *do_update, /* NOLINTNEXTLINE: readability-non-const-parameter. */ float *progress) { @@ -1494,7 +1494,7 @@ void IMB_anim_index_rebuild(struct IndexBuildContext *context, UNUSED_VARS(stop, do_update, progress); } -void IMB_anim_index_rebuild_finish(IndexBuildContext *context, short stop) +void IMB_anim_index_rebuild_finish(IndexBuildContext *context, const bool stop) { switch (context->anim_type) { #ifdef WITH_FFMPEG diff --git a/source/blender/io/alembic/exporter/abc_export_capi.cc b/source/blender/io/alembic/exporter/abc_export_capi.cc index 546bc9d49cc..1ac4eacc997 100644 --- a/source/blender/io/alembic/exporter/abc_export_capi.cc +++ b/source/blender/io/alembic/exporter/abc_export_capi.cc @@ -72,8 +72,8 @@ static void report_job_duration(const ExportJobData *data) static void export_startjob(void *customdata, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { ExportJobData *data = static_cast<ExportJobData *>(customdata); @@ -230,7 +230,7 @@ bool ABC_export(Scene *scene, } else { /* Fake a job context, so that we don't need NULL pointer checks while exporting. */ - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0.0f; blender::io::alembic::export_startjob(job, &stop, &do_update, &progress); diff --git a/source/blender/io/alembic/intern/alembic_capi.cc b/source/blender/io/alembic/intern/alembic_capi.cc index b92ce5b4cfb..f6c11f6a684 100644 --- a/source/blender/io/alembic/intern/alembic_capi.cc +++ b/source/blender/io/alembic/intern/alembic_capi.cc @@ -427,8 +427,8 @@ struct ImportJobData { ArchiveReader *archive; std::vector<AbcObjectReader *> readers; - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; char error_code; @@ -446,7 +446,7 @@ static void report_job_duration(const ImportJobData *data) std::cout << '\n'; } -static void import_startjob(void *user_data, short *stop, short *do_update, float *progress) +static void import_startjob(void *user_data, bool *stop, bool *do_update, float *progress) { SCOPE_TIMER("Alembic import, objects reading and creation"); @@ -715,7 +715,7 @@ bool ABC_import(bContext *C, } else { /* Fake a job context, so that we don't need NULL pointer checks while importing. */ - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0.0f; import_startjob(job, &stop, &do_update, &progress); diff --git a/source/blender/io/usd/intern/usd_capi_export.cc b/source/blender/io/usd/intern/usd_capi_export.cc index 3977daaca4a..bf25c03fb7a 100644 --- a/source/blender/io/usd/intern/usd_capi_export.cc +++ b/source/blender/io/usd/intern/usd_capi_export.cc @@ -57,8 +57,8 @@ static void report_job_duration(const ExportJobData *data) static void export_startjob(void *customdata, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { ExportJobData *data = static_cast<ExportJobData *>(customdata); @@ -205,7 +205,7 @@ bool USD_export(bContext *C, } else { /* Fake a job context, so that we don't need NULL pointer checks while exporting. */ - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0.0f; blender::io::usd::export_startjob(job, &stop, &do_update, &progress); diff --git a/source/blender/io/usd/intern/usd_capi_import.cc b/source/blender/io/usd/intern/usd_capi_import.cc index b8cc43beeb9..680e9c758d3 100644 --- a/source/blender/io/usd/intern/usd_capi_import.cc +++ b/source/blender/io/usd/intern/usd_capi_import.cc @@ -126,8 +126,8 @@ struct ImportJobData { USDStageReader *archive; - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; char error_code; @@ -144,7 +144,7 @@ static void report_job_duration(const ImportJobData *data) std::cout << '\n'; } -static void import_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void import_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { ImportJobData *data = static_cast<ImportJobData *>(customdata); @@ -430,7 +430,7 @@ bool USD_import(struct bContext *C, } else { /* Fake a job context, so that we don't need NULL pointer checks while importing. */ - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0.0f; import_startjob(job, &stop, &do_update, &progress); diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 0b7c17d44bb..3161238dc2e 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -613,7 +613,7 @@ typedef struct bNodeTree { void (*progress)(void *, float progress); /** \warning may be called by different threads */ void (*stats_draw)(void *, const char *str); - int (*test_break)(void *); + bool (*test_break)(void *); void (*update_draw)(void *); void *tbh, *prh, *sdh, *udh; diff --git a/source/blender/render/RE_multires_bake.h b/source/blender/render/RE_multires_bake.h index a478f124892..70ce46bc195 100644 --- a/source/blender/render/RE_multires_bake.h +++ b/source/blender/render/RE_multires_bake.h @@ -43,8 +43,8 @@ typedef struct MultiresBakeRender { float user_scale; /* User scale used to scale displacement when baking derivative map. */ - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; } MultiresBakeRender; diff --git a/source/blender/render/RE_pipeline.h b/source/blender/render/RE_pipeline.h index e9a90096dab..d12162c0b9a 100644 --- a/source/blender/render/RE_pipeline.h +++ b/source/blender/render/RE_pipeline.h @@ -398,7 +398,7 @@ void RE_display_update_cb(struct Render *re, void RE_stats_draw_cb(struct Render *re, void *handle, void (*f)(void *handle, RenderStats *rs)); void RE_progress_cb(struct Render *re, void *handle, void (*f)(void *handle, float)); void RE_draw_lock_cb(struct Render *re, void *handle, void (*f)(void *handle, bool lock)); -void RE_test_break_cb(struct Render *re, void *handle, int (*f)(void *handle)); +void RE_test_break_cb(struct Render *re, void *handle, bool (*f)(void *handle)); void RE_current_scene_update_cb(struct Render *re, void *handle, void (*f)(void *handle, struct Scene *scene)); diff --git a/source/blender/render/intern/multires_bake.c b/source/blender/render/intern/multires_bake.c index f701d9a987a..cfb91e86ad9 100644 --- a/source/blender/render/intern/multires_bake.c +++ b/source/blender/render/intern/multires_bake.c @@ -89,7 +89,7 @@ typedef struct { char *texels; const MResolvePixelData *data; MFlushPixel flush_pixel; - short *do_update; + bool *do_update; } MBakeRast; typedef struct { @@ -134,7 +134,7 @@ static void init_bake_rast(MBakeRast *bake_rast, const ImBuf *ibuf, const MResolvePixelData *data, MFlushPixel flush_pixel, - short *do_update) + bool *do_update) { BakeImBufuserData *userdata = (BakeImBufuserData *)ibuf->userdata; diff --git a/source/blender/render/intern/pipeline.cc b/source/blender/render/intern/pipeline.cc index 79a1237a360..17cf3b7ff74 100644 --- a/source/blender/render/intern/pipeline.cc +++ b/source/blender/render/intern/pipeline.cc @@ -177,7 +177,7 @@ static void stats_nothing(void * /*arg*/, RenderStats * /*rs*/) static void float_nothing(void * /*arg*/, float /*val*/) { } -static int default_break(void * /*arg*/) +static bool default_break(void * /*arg*/) { return G.is_break == true; } @@ -847,7 +847,7 @@ void RE_draw_lock_cb(Render *re, void *handle, void (*f)(void *handle, bool lock re->dlh = handle; } -void RE_test_break_cb(Render *re, void *handle, int (*f)(void *handle)) +void RE_test_break_cb(Render *re, void *handle, bool (*f)(void *handle)) { re->test_break = f; re->tbh = handle; diff --git a/source/blender/render/intern/render_types.h b/source/blender/render/intern/render_types.h index b38f9cacdff..418acbca3b1 100644 --- a/source/blender/render/intern/render_types.h +++ b/source/blender/render/intern/render_types.h @@ -108,7 +108,7 @@ struct Render { void (*draw_lock)(void *handle, bool lock); void *dlh; - int (*test_break)(void *handle); + bool (*test_break)(void *handle); void *tbh; RenderStats i; diff --git a/source/blender/sequencer/SEQ_proxy.h b/source/blender/sequencer/SEQ_proxy.h index 00747f4b9cf..caf123afbcf 100644 --- a/source/blender/sequencer/SEQ_proxy.h +++ b/source/blender/sequencer/SEQ_proxy.h @@ -29,8 +29,8 @@ bool SEQ_proxy_rebuild_context(struct Main *bmain, struct ListBase *queue, bool build_only_on_bad_performance); void SEQ_proxy_rebuild(struct SeqIndexBuildContext *context, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); void SEQ_proxy_rebuild_finish(struct SeqIndexBuildContext *context, bool stop); void SEQ_proxy_set(struct Sequence *seq, bool value); diff --git a/source/blender/sequencer/SEQ_render.h b/source/blender/sequencer/SEQ_render.h index f95497b32b8..e2672eef8b9 100644 --- a/source/blender/sequencer/SEQ_render.h +++ b/source/blender/sequencer/SEQ_render.h @@ -67,7 +67,7 @@ void SEQ_render_thumbnails(const struct SeqRenderData *context, struct Sequence *seq_orig, float frame_step, const struct rctf *view_area, - const short *stop); + const bool *stop); /** * Get cached thumbnails. */ @@ -103,7 +103,7 @@ void SEQ_render_thumbnails_base_set(const struct SeqRenderData *context, struct Sequence *seq, struct Sequence *seq_orig, const struct rctf *view_area, - const short *stop); + const bool *stop); void SEQ_render_init_colorspace(struct Sequence *seq); void SEQ_render_new_render_data(struct Main *bmain, diff --git a/source/blender/sequencer/intern/proxy.c b/source/blender/sequencer/intern/proxy.c index fc1df4dc3ac..eaea310f423 100644 --- a/source/blender/sequencer/intern/proxy.c +++ b/source/blender/sequencer/intern/proxy.c @@ -479,10 +479,7 @@ bool SEQ_proxy_rebuild_context(Main *bmain, return true; } -void SEQ_proxy_rebuild(SeqIndexBuildContext *context, - short *stop, - short *do_update, - float *progress) +void SEQ_proxy_rebuild(SeqIndexBuildContext *context, bool *stop, bool *do_update, float *progress) { const bool overwrite = context->overwrite; SeqRenderData render_context; diff --git a/source/blender/sequencer/intern/proxy_job.c b/source/blender/sequencer/intern/proxy_job.c index 8520c06f9a2..d7dfe0130d8 100644 --- a/source/blender/sequencer/intern/proxy_job.c +++ b/source/blender/sequencer/intern/proxy_job.c @@ -41,7 +41,7 @@ static void proxy_freejob(void *pjv) } /* Only this runs inside thread. */ -static void proxy_startjob(void *pjv, short *stop, short *do_update, float *progress) +static void proxy_startjob(void *pjv, bool *stop, bool *do_update, float *progress) { ProxyJob *pj = pjv; LinkData *link; @@ -52,7 +52,7 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog SEQ_proxy_rebuild(context, stop, do_update, progress); if (*stop) { - pj->stop = 1; + pj->stop = true; fprintf(stderr, "Canceling proxy rebuild on users request...\n"); break; } diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c index 3cb15e092c8..5c6a59a5943 100644 --- a/source/blender/sequencer/intern/render.c +++ b/source/blender/sequencer/intern/render.c @@ -2103,7 +2103,7 @@ void SEQ_render_thumbnails(const SeqRenderData *context, Sequence *seq_orig, float frame_step, const rctf *view_area, - const short *stop) + const bool *stop) { SeqRenderState state; seq_render_state_init(&state); @@ -2164,7 +2164,7 @@ void SEQ_render_thumbnails_base_set(const SeqRenderData *context, Sequence *seq, Sequence *seq_orig, const rctf *view_area, - const short *stop) + const bool *stop) { SeqRenderState state; seq_render_state_init(&state); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 1f9de8040f6..37068c13993 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -1432,8 +1432,8 @@ void WM_jobs_timer(struct wmJob *, double timestep, unsigned int note, unsigned void WM_jobs_delay_start(struct wmJob *, double delay_time); typedef void (*wm_jobs_start_callback)(void *custom_data, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); void WM_jobs_callbacks(struct wmJob *, wm_jobs_start_callback startjob, @@ -1463,7 +1463,7 @@ void WM_jobs_stop(struct wmWindowManager *wm, const void *owner, void *startjob) */ void WM_jobs_kill(struct wmWindowManager *wm, void *owner, - void (*)(void *, short int *, short int *, float *)); + void (*)(void *, bool *, bool *, float *)); /** * Wait until every job ended. */ diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index 5360f327a0a..5d540c9c251 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -109,7 +109,8 @@ struct wmJob { /* internal */ const void *owner; int flag; - short suspended, running, ready, do_update, stop, job_type; + short suspended, running, ready, job_type; + bool do_update, stop; float progress; /** For display in header, identification */ @@ -593,7 +594,7 @@ void WM_jobs_stop(wmWindowManager *wm, const void *owner, void *startjob) void WM_jobs_kill(wmWindowManager *wm, void *owner, - void (*startjob)(void *, short int *, short int *, float *)) + void (*startjob)(void *, bool *, bool *, float *)) { LISTBASE_FOREACH_MUTABLE (wmJob *, wm_job, &wm->jobs) { if (wm_job->owner == owner || wm_job->startjob == startjob) { |