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/render/render_preview.cc | |
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/render/render_preview.cc')
-rw-r--r-- | source/blender/editors/render/render_preview.cc | 28 |
1 files changed, 14 insertions, 14 deletions
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(); |