diff options
170 files changed, 527 insertions, 511 deletions
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 14e9f27ee39..68ef209371d 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -345,7 +345,7 @@ SceneParams BlenderSync::get_scene_params(BL::Scene b_scene, bool background) BL::RenderSettings r = b_scene.render(); SceneParams params; PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); - int shadingsystem = RNA_boolean_get(&cscene, "shading_system"); + const bool shadingsystem = RNA_boolean_get(&cscene, "shading_system"); if(shadingsystem == 0) params.shadingsystem = SceneParams::SVM; @@ -494,7 +494,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use params.progressive = true; /* shading system - scene level needs full refresh */ - int shadingsystem = RNA_boolean_get(&cscene, "shading_system"); + const bool shadingsystem = RNA_boolean_get(&cscene, "shading_system"); if(shadingsystem == 0) params.shadingsystem = SessionParams::SVM; diff --git a/source/blender/avi/AVI_avi.h b/source/blender/avi/AVI_avi.h index cfa314bba04..44ffaad1f48 100644 --- a/source/blender/avi/AVI_avi.h +++ b/source/blender/avi/AVI_avi.h @@ -235,7 +235,7 @@ typedef enum { /** * Test whether this is an avi-format. */ -int AVI_is_avi(const char *name); +bool AVI_is_avi(const char *name); /** diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c index f7e94c4937b..7bfe84ebfa7 100644 --- a/source/blender/avi/intern/avi.c +++ b/source/blender/avi/intern/avi.c @@ -206,7 +206,7 @@ void AVI_set_debug(int mode) AVI_DEBUG = mode; } -int AVI_is_avi(char *name) +bool AVI_is_avi(char *name) { FILE *fp; int ret; @@ -230,7 +230,7 @@ int AVI_is_avi(char *name) } #endif -int AVI_is_avi(const char *name) +bool AVI_is_avi(const char *name) { int temp, fcca, j; AviMovie movie = {NULL}; diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 6ffa126713d..353b1c5d597 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -147,7 +147,7 @@ typedef int (*DMSetMaterial)(int mat_nr, void *attribs); typedef int (*DMCompareDrawOptions)(void *userData, int cur_index, int next_index); typedef void (*DMSetDrawInterpOptions)(void *userData, int index, float t); typedef DMDrawOption (*DMSetDrawOptions)(void *userData, int index); -typedef DMDrawOption (*DMSetDrawOptionsTex)(struct MTFace *tface, int has_vcol, int matnr); +typedef DMDrawOption (*DMSetDrawOptionsTex)(struct MTFace *tface, const bool has_vcol, int matnr); typedef enum DMDrawFlag { DM_DRAW_USE_COLORS = 1, @@ -673,7 +673,7 @@ DerivedMesh *editbmesh_get_derived_cage_and_final(struct Scene *scene, struct Ob struct BMEditMesh *em, DerivedMesh **final_r, CustomDataMask dataMask); float (*editbmesh_get_vertex_cos(struct BMEditMesh *em, int *numVerts_r))[3]; -int editbmesh_modifier_is_enabled(struct Scene *scene, struct ModifierData *md, DerivedMesh *dm); +bool editbmesh_modifier_is_enabled(struct Scene *scene, struct ModifierData *md, DerivedMesh *dm); void makeDerivedMesh(struct Scene *scene, struct Object *ob, struct BMEditMesh *em, CustomDataMask dataMask, int build_shapekey_layers); diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index 9068be970b5..517c0f7d58b 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -103,7 +103,7 @@ short action_get_item_transforms(struct bAction *act, struct Object *ob, struct void calc_action_range(const struct bAction *act, float *start, float *end, short incl_modifiers); /* Does action have any motion data at all? */ -short action_has_motion(const struct bAction *act); +bool action_has_motion(const struct bAction *act); /* Action Groups API ----------------- */ diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h index afa053012da..850c387cd45 100644 --- a/source/blender/blenkernel/BKE_curve.h +++ b/source/blender/blenkernel/BKE_curve.h @@ -82,7 +82,7 @@ void BKE_curve_texspace_get(struct Curve *cu, float r_loc[3], float r_rot[3], fl bool BKE_curve_minmax(struct Curve *cu, bool use_radius, float min[3], float max[3]); bool BKE_curve_center_median(struct Curve *cu, float cent[3]); bool BKE_curve_center_bounds(struct Curve *cu, float cent[3]); -void BKE_curve_translate(struct Curve *cu, float offset[3], int do_keys); +void BKE_curve_translate(struct Curve *cu, float offset[3], const bool do_keys); void BKE_curve_material_index_remove(struct Curve *cu, int index); void BKE_curve_material_index_clear(struct Curve *cu); diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h index df7e9561c46..8a0f9f3fa67 100644 --- a/source/blender/blenkernel/BKE_depsgraph.h +++ b/source/blender/blenkernel/BKE_depsgraph.h @@ -106,8 +106,8 @@ void DAG_scene_free(struct Scene *sce); * not cause any updates but is used by external render engines to detect if for * example a datablock was removed. */ -void DAG_scene_update_flags(struct Main *bmain, struct Scene *sce, unsigned int lay, const short do_time); -void DAG_on_visible_update(struct Main *bmain, const short do_time); +void DAG_scene_update_flags(struct Main *bmain, struct Scene *sce, unsigned int lay, const bool do_time); +void DAG_on_visible_update(struct Main *bmain, const bool do_time); void DAG_id_tag_update(struct ID *id, short flag); void DAG_id_tag_update_ex(struct Main *bmain, struct ID *id, short flag); diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 06598a26b30..13eca506d9e 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -228,16 +228,16 @@ int binarysearch_bezt_index(struct BezTriple array[], float frame, int arraylen, /* get the time extents for F-Curve */ bool calc_fcurve_range(struct FCurve *fcu, float *min, float *max, - const short do_sel_only, const short do_min_length); + const bool do_sel_only, const bool do_min_length); /* get the bounding-box extents for F-Curve */ -short calc_fcurve_bounds(struct FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax, - const short do_sel_only, const short include_handles); +bool calc_fcurve_bounds(struct FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax, + const bool do_sel_only, const bool include_handles); /* .............. */ /* Are keyframes on F-Curve of any use (to final result, and to show in editors)? */ -short fcurve_are_keyframes_usable(struct FCurve *fcu); +bool fcurve_are_keyframes_usable(struct FCurve *fcu); /* Can keyframes be added to F-Curve? */ bool fcurve_is_keyframable(struct FCurve *fcu); diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 3742b45c6c0..61f70d7f7e7 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -73,7 +73,7 @@ typedef struct Global { short winpos, displaymode; /* used to be in Render */ /* to indicate render is busy, prevent renderwindow events etc */ - short is_rendering; + bool is_rendering; /* debug value, can be set from the UI and python, used for testing nonstandard features */ short debug_value; diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index a44a9e0c7a9..e36d4bab566 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -140,7 +140,7 @@ enum { #define IMA_CHAN_FLAG_ALPHA 4 /* checks whether there's an image buffer for given image and user */ -int BKE_image_has_ibuf(struct Image *ima, struct ImageUser *iuser); +bool BKE_image_has_ibuf(struct Image *ima, struct ImageUser *iuser); /* same as above, but can be used to retrieve images being rendered in * a thread safe way, always call both acquire and release */ @@ -181,7 +181,7 @@ void BKE_image_assign_ibuf(struct Image *ima, struct ImBuf *ibuf); /* called on frame change or before render */ void BKE_image_user_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr); void BKE_image_user_check_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr); -int BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr, short *r_is_in_range); +int BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr, bool *r_is_in_range); void BKE_image_user_file_path(struct ImageUser *iuser, struct Image *ima, char *path); void BKE_image_update_frame(const struct Main *bmain, int cfra); @@ -216,10 +216,10 @@ struct Image *BKE_image_copy(struct Main *bmain, struct Image *ima); void BKE_image_merge(struct Image *dest, struct Image *source); /* scale the image */ -int BKE_image_scale(struct Image *image, int width, int height); +bool BKE_image_scale(struct Image *image, int width, int height); /* check if texture has alpha (depth=32) */ -int BKE_image_has_alpha(struct Image *image); +bool BKE_image_has_alpha(struct Image *image); void BKE_image_get_size(struct Image *image, struct ImageUser *iuser, int *width, int *height); void BKE_image_get_size_fl(struct Image *image, struct ImageUser *iuser, float size[2]); diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h index 19264feaf48..6183df8666d 100644 --- a/source/blender/blenkernel/BKE_key.h +++ b/source/blender/blenkernel/BKE_key.h @@ -69,7 +69,7 @@ struct KeyBlock *BKE_keyblock_from_object(struct Object *ob); struct KeyBlock *BKE_keyblock_from_object_reference(struct Object *ob); struct KeyBlock *BKE_keyblock_add(struct Key *key, const char *name); -struct KeyBlock *BKE_keyblock_add_ctime(struct Key *key, const char *name, const short do_force); +struct KeyBlock *BKE_keyblock_add_ctime(struct Key *key, const char *name, const bool do_force); struct KeyBlock *BKE_keyblock_from_key(struct Key *key, int index); struct KeyBlock *BKE_keyblock_find_name(struct Key *key, const char name[]); void BKE_keyblock_copy_settings(struct KeyBlock *kb_dst, const struct KeyBlock *kb_src); diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h index b57fa360441..ba45df73590 100644 --- a/source/blender/blenkernel/BKE_lattice.h +++ b/source/blender/blenkernel/BKE_lattice.h @@ -85,7 +85,7 @@ struct BPoint *BKE_lattice_active_point_get(struct Lattice *lt); void BKE_lattice_minmax(struct Lattice *lt, float min[3], float max[3]); void BKE_lattice_center_median(struct Lattice *lt, float cent[3]); void BKE_lattice_center_bounds(struct Lattice *lt, float cent[3]); -void BKE_lattice_translate(struct Lattice *lt, float offset[3], int do_keys); +void BKE_lattice_translate(struct Lattice *lt, float offset[3], bool do_keys); int BKE_lattice_index_from_uvw(struct Lattice *lt, const int u, const int v, const int w); void BKE_lattice_index_to_uvw(struct Lattice *lt, const int index, int *r_u, int *r_v, int *r_w); diff --git a/source/blender/blenkernel/BKE_mask.h b/source/blender/blenkernel/BKE_mask.h index de262f98d39..691afaf8f16 100644 --- a/source/blender/blenkernel/BKE_mask.h +++ b/source/blender/blenkernel/BKE_mask.h @@ -87,7 +87,7 @@ float BKE_mask_spline_project_co(struct MaskSpline *spline, struct MaskSplinePoi float start_u, const float co[2], const eMaskSign sign); /* point */ -int BKE_mask_point_has_handle(struct MaskSplinePoint *point); +bool BKE_mask_point_has_handle(struct MaskSplinePoint *point); void BKE_mask_point_handle(struct MaskSplinePoint *point, float handle[2]); void BKE_mask_point_set_handle(struct MaskSplinePoint *point, float loc[2], bool keep_direction, float orig_handle[2], float orig_vec[3][3]); @@ -100,8 +100,8 @@ float BKE_mask_point_weight(struct MaskSpline *spline, struct MaskSplinePoint *p struct MaskSplinePointUW *BKE_mask_point_sort_uw(struct MaskSplinePoint *point, struct MaskSplinePointUW *uw); void BKE_mask_point_add_uw(struct MaskSplinePoint *point, float u, float w); -void BKE_mask_point_select_set(struct MaskSplinePoint *point, const short do_select); -void BKE_mask_point_select_set_handle(struct MaskSplinePoint *point, const short do_select); +void BKE_mask_point_select_set(struct MaskSplinePoint *point, const bool do_select); +void BKE_mask_point_select_set_handle(struct MaskSplinePoint *point, const bool do_select); /* general */ struct Mask *BKE_mask_new(struct Main *bmain, const char *name); @@ -131,7 +131,7 @@ void BKE_mask_calc_handle_adjacent_interp(struct MaskSpline *spline, struct Mask void BKE_mask_calc_tangent_polyline(struct MaskSpline *spline, struct MaskSplinePoint *point, float t[2]); void BKE_mask_calc_handle_point(struct MaskSpline *spline, struct MaskSplinePoint *point); void BKE_mask_calc_handle_point_auto(struct MaskSpline *spline, struct MaskSplinePoint *point, - const short do_recalc_length); + const bool do_recalc_length); void BKE_mask_get_handle_point_adjacent(struct MaskSpline *spline, struct MaskSplinePoint *point, struct MaskSplinePoint **r_point_prev, struct MaskSplinePoint **r_point_next); void BKE_mask_layer_calc_handles(struct MaskLayer *masklay); @@ -199,7 +199,7 @@ float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline, void BKE_mask_spline_feather_collapse_inner_loops(struct MaskSpline *spline, float (*feather_points)[2], const unsigned int tot_feather_point); float (*BKE_mask_spline_differentiate(struct MaskSpline *spline, int width, int height, unsigned int *tot_diff_point))[2]; float (*BKE_mask_spline_feather_differentiated_points_with_resolution(struct MaskSpline *spline, unsigned int *tot_feather_point, - const unsigned int resol, const int do_feather_isect))[2]; + const unsigned int resol, const bool do_feather_isect))[2]; /* *** mask point functions which involve evaluation *** */ float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2]; @@ -220,8 +220,8 @@ MaskRasterHandle *BKE_maskrasterize_handle_new(void); void BKE_maskrasterize_handle_free(MaskRasterHandle *mr_handle); void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mask, const int width, const int height, - const short do_aspect_correct, const short do_mask_aa, - const short do_feather); + const bool do_aspect_correct, const bool do_mask_aa, + const bool do_feather); float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float xy[2]); void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle, diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h index 4828df2fbec..341105cfdf7 100644 --- a/source/blender/blenkernel/BKE_movieclip.h +++ b/source/blender/blenkernel/BKE_movieclip.h @@ -55,7 +55,7 @@ void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, void BKE_movieclip_get_size_fl(struct MovieClip *clip, struct MovieClipUser *user, float size[2]); int BKE_movieclip_get_duration(struct MovieClip *clip); void BKE_movieclip_get_aspect(struct MovieClip *clip, float *aspx, float *aspy); -int BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user); +bool BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user); void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr); void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *user, struct MovieClipScopes *scopes); @@ -63,10 +63,10 @@ void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *u void BKE_movieclip_get_cache_segments(struct MovieClip *clip, struct MovieClipUser *user, int *totseg_r, int **points_r); void BKE_movieclip_build_proxy_frame(struct MovieClip *clip, int clip_flag, struct MovieDistortion *distortion, - int cfra, int *build_sizes, int build_count, int undistorted); + int cfra, int *build_sizes, int build_count, bool undistorted); void BKE_movieclip_build_proxy_frame_for_ibuf(struct MovieClip *clip, struct ImBuf *ibuf, struct MovieDistortion *distortion, - int cfra, int *build_sizes, int build_count, int undistorted); + int cfra, int *build_sizes, int build_count, bool undistorted); float BKE_movieclip_remap_scene_to_clip_frame(struct MovieClip *clip, float framenr); float BKE_movieclip_remap_clip_to_scene_frame(struct MovieClip *clip, float framenr); @@ -74,8 +74,8 @@ float BKE_movieclip_remap_clip_to_scene_frame(struct MovieClip *clip, float fram void BKE_movieclip_filename_for_frame(struct MovieClip *clip, struct MovieClipUser *user, char *name); struct ImBuf *BKE_movieclip_anim_ibuf_for_frame(struct MovieClip *clip, struct MovieClipUser *user); -int BKE_movieclip_has_cached_frame(struct MovieClip *clip, struct MovieClipUser *user); -int BKE_movieclip_put_frame_if_possible(struct MovieClip *clip, struct MovieClipUser *user, struct ImBuf *ibuf); +bool BKE_movieclip_has_cached_frame(struct MovieClip *clip, struct MovieClipUser *user); +bool BKE_movieclip_put_frame_if_possible(struct MovieClip *clip, struct MovieClipUser *user, struct ImBuf *ibuf); /* cacheing flags */ #define MOVIECLIP_CACHE_SKIP (1 << 0) diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 5b41dc481c9..344797dd15a 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -59,7 +59,7 @@ struct NlaStrip *add_nla_soundstrip(struct Scene *scene, struct Speaker *spk); /* ----------------------------- */ /* API */ -short BKE_nlastrips_has_space(ListBase *strips, float start, float end); +bool BKE_nlastrips_has_space(ListBase *strips, float start, float end); void BKE_nlastrips_sort_strips(ListBase *strips); short BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip); @@ -78,7 +78,7 @@ void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt); void BKE_nlatrack_solo_toggle(struct AnimData *adt, struct NlaTrack *nlt); -short BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end); +bool BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end); void BKE_nlatrack_sort_strips(struct NlaTrack *nlt); short BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip); diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 664c1a6b051..3a111724d18 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -554,7 +554,7 @@ void BKE_node_preview_clear_tree(struct bNodeTree *ntree); void BKE_node_preview_sync_tree(struct bNodeTree *to_ntree, struct bNodeTree *from_ntree); void BKE_node_preview_merge_tree(struct bNodeTree *to_ntree, struct bNodeTree *from_ntree, bool remove_old); -void BKE_node_preview_set_pixel(struct bNodePreview *preview, const float col[4], int x, int y, int do_manage); +void BKE_node_preview_set_pixel(struct bNodePreview *preview, const float col[4], int x, int y, bool do_manage); /* ************** NODE TYPE ACCESS *************** */ diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 38055dd1ec5..f9a3f19df96 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -174,7 +174,7 @@ int BKE_object_obdata_texspace_get(struct Object *ob, short **r_texflag, float * int BKE_object_insert_ptcache(struct Object *ob); // void object_delete_ptcache(struct Object *ob, int index); -struct KeyBlock *BKE_object_insert_shape_key(struct Scene *scene, struct Object *ob, const char *name, int from_mix); +struct KeyBlock *BKE_object_insert_shape_key(struct Scene *scene, struct Object *ob, const char *name, const bool from_mix); bool BKE_object_is_child_recursive(struct Object *ob_parent, struct Object *ob_child); bool BKE_object_is_animated(struct Scene *scene, struct Object *ob); diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 60cb4792da0..2f166dd2dac 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -140,7 +140,7 @@ typedef struct SculptSession { /* PBVH acceleration structure */ struct PBVH *pbvh; - int show_diffuse_color; + bool show_diffuse_color; /* Paiting on deformed mesh */ int modifiers_active; /* object is deformed with some modifiers */ diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h index 9f825cf439f..1a2d6469a29 100644 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@ -53,7 +53,7 @@ typedef struct { /* Callbacks */ /* returns 1 if the search should continue from this node, 0 otherwise */ -typedef int (*BKE_pbvh_SearchCallback)(PBVHNode *node, void *data); +typedef bool (*BKE_pbvh_SearchCallback)(PBVHNode *node, void *data); typedef void (*BKE_pbvh_HitCallback)(PBVHNode *node, void *data); typedef void (*BKE_pbvh_HitOccludedCallback)(PBVHNode *node, void *data, float *tmin); @@ -174,9 +174,9 @@ void BKE_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max float BKE_pbvh_node_get_tmin(PBVHNode *node); /* test if AABB is at least partially inside the planes' volume */ -int BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data); +bool BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data); /* test if AABB is at least partially outside the planes' volume */ -int BKE_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data); +bool BKE_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data); struct GSet *BKE_pbvh_bmesh_node_unique_verts(PBVHNode *node); struct GSet *BKE_pbvh_bmesh_node_other_verts(PBVHNode *node); @@ -203,7 +203,7 @@ void BKE_pbvh_node_layer_disp_free(PBVHNode *node); /* vertex deformer */ float (*BKE_pbvh_get_vertCos(struct PBVH *pbvh))[3]; void BKE_pbvh_apply_vertCos(struct PBVH *pbvh, float (*vertCos)[3]); -int BKE_pbvh_isDeformed(struct PBVH *pbvh); +bool BKE_pbvh_isDeformed(struct PBVH *pbvh); /* Vertex Iterator */ @@ -330,6 +330,6 @@ void BKE_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***nodes, int *totnode); //void BKE_pbvh_node_BB_reset(PBVHNode *node); //void BKE_pbvh_node_BB_expand(PBVHNode *node, float co[3]); -void pbvh_show_diffuse_color_set(PBVH *bvh, int show_diffuse_color); +void pbvh_show_diffuse_color_set(PBVH *bvh, bool show_diffuse_color); #endif /* __BKE_PBVH_H__ */ diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index d19c281afb8..52042649dc4 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -119,7 +119,7 @@ void BKE_scene_update_tagged(struct EvaluationContext *eval_ctx, struct Main *bm void BKE_scene_update_for_newframe(struct EvaluationContext *eval_ctx, struct Main *bmain, struct Scene *sce, unsigned int lay); struct SceneRenderLayer *BKE_scene_add_render_layer(struct Scene *sce, const char *name); -int BKE_scene_remove_render_layer(struct Main *main, struct Scene *scene, struct SceneRenderLayer *srl); +bool BKE_scene_remove_render_layer(struct Main *main, struct Scene *scene, struct SceneRenderLayer *srl); /* render profile */ int get_render_subsurf_level(struct RenderData *r, int level); @@ -127,11 +127,11 @@ int get_render_child_particle_number(struct RenderData *r, int num); int get_render_shadow_samples(struct RenderData *r, int samples); float get_render_aosss_error(struct RenderData *r, float error); -int BKE_scene_use_new_shading_nodes(struct Scene *scene); +bool BKE_scene_use_new_shading_nodes(struct Scene *scene); void BKE_scene_disable_color_management(struct Scene *scene); -int BKE_scene_check_color_management_enabled(const struct Scene *scene); -int BKE_scene_check_rigidbody_active(const struct Scene *scene); +bool BKE_scene_check_color_management_enabled(const struct Scene *scene); +bool BKE_scene_check_rigidbody_active(const struct Scene *scene); int BKE_scene_num_threads(const struct Scene *scene); int BKE_render_num_threads(const struct RenderData *r); diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 3ac04a32f38..0cbb9215868 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -220,7 +220,7 @@ void BKE_sequence_free(struct Scene *scene, struct Sequence *seq); const char *BKE_sequence_give_name(struct Sequence *seq); void BKE_sequence_calc(struct Scene *scene, struct Sequence *seq); void BKE_sequence_calc_disp(struct Scene *scene, struct Sequence *seq); -void BKE_sequence_reload_new_file(struct Scene *scene, struct Sequence *seq, int lock_range); +void BKE_sequence_reload_new_file(struct Scene *scene, struct Sequence *seq, const bool lock_range); int BKE_sequencer_evaluate_frame(struct Scene *scene, int cfra); struct StripElem *BKE_sequencer_give_stripelem(struct Sequence *seq, int cfra); diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h index eb89216d360..7d7fad1c58d 100644 --- a/source/blender/blenkernel/BKE_text.h +++ b/source/blender/blenkernel/BKE_text.h @@ -62,7 +62,7 @@ char *txt_to_buf (struct Text *text); void txt_clean_text (struct Text *text); void txt_order_cursors (struct Text *text, const bool reverse); int txt_find_string (struct Text *text, const char *findstr, int wrap, int match_case); -int txt_has_sel (struct Text *text); +bool txt_has_sel (struct Text *text); int txt_get_span (struct TextLine *from, struct TextLine *to); int txt_utf8_offset_to_index(const char *str, int offset); int txt_utf8_index_to_offset(const char *str, int index); @@ -112,13 +112,13 @@ void txt_print_undo (struct Text *text); #endif /* utility functions, could be moved somewhere more generic but are python/text related */ -int text_check_bracket(const char ch); -int text_check_delim(const char ch); -int text_check_digit(const char ch); -int text_check_identifier(const char ch); -int text_check_identifier_nodigit(const char ch); -int text_check_whitespace(const char ch); -int text_find_identifier_start(const char *str, int i); +int text_check_bracket(const char ch); +bool text_check_delim(const char ch); +bool text_check_digit(const char ch); +bool text_check_identifier(const char ch); +bool text_check_identifier_nodigit(const char ch); +bool text_check_whitespace(const char ch); +int text_find_identifier_start(const char *str, int i); /* defined in bpy_interface.c */ extern int text_check_identifier_unicode(const unsigned int ch); diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index cf192234906..6a5b5626b50 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -64,7 +64,7 @@ void BKE_texture_free(struct Tex *t); void init_colorband(struct ColorBand *coba, bool rangetype); struct ColorBand *add_colorband(bool rangetype); -int do_colorband(const struct ColorBand *coba, float in, float out[4]); +bool do_colorband(const struct ColorBand *coba, float in, float out[4]); void colorband_table_RGBA(struct ColorBand *coba, float **array, int *size); struct CBData *colorband_element_add(struct ColorBand *coba, float position); int colorband_element_remove(struct ColorBand *coba, int index); diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h index 081547f94f0..4d41640527f 100644 --- a/source/blender/blenkernel/BKE_tracking.h +++ b/source/blender/blenkernel/BKE_tracking.h @@ -209,7 +209,7 @@ void BKE_tracking_disable_channels(struct ImBuf *ibuf, bool disable_red, bool di /* **** 2D tracking **** */ struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user, - short backwards, short sequence); + const bool backwards, const bool sequence); void BKE_tracking_context_free(struct MovieTrackingContext *context); void BKE_tracking_context_sync(struct MovieTrackingContext *context); void BKE_tracking_context_sync_user(const struct MovieTrackingContext *context, struct MovieClipUser *user); diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h index 8bccf3511d8..07aeceda474 100644 --- a/source/blender/blenkernel/BKE_unit.h +++ b/source/blender/blenkernel/BKE_unit.h @@ -34,7 +34,7 @@ extern "C" { /* in all cases the value is assumed to be scaled by the user preference */ /* humanly readable representation of a value in units (used for button drawing) */ -size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, bool pad); +size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, bool split, bool pad); /* replace units with values, used before python button evaluation */ int bUnit_ReplaceString(char *str, int len_max, const char *str_prev, double scale_pref, int system, int type); diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h index 347c8b60532..0610c23a6b2 100644 --- a/source/blender/blenkernel/BKE_writeffmpeg.h +++ b/source/blender/blenkernel/BKE_writeffmpeg.h @@ -78,7 +78,7 @@ void BKE_ffmpeg_filepath_get(char *string, struct RenderData *rd); void BKE_ffmpeg_preset_set(struct RenderData *rd, int preset); void BKE_ffmpeg_image_type_verify(struct RenderData *rd, struct ImageFormatData *imf); void BKE_ffmpeg_codec_settings_verify(struct RenderData *rd); -int BKE_ffmpeg_alpha_channel_is_supported(struct RenderData *rd); +bool BKE_ffmpeg_alpha_channel_is_supported(struct RenderData *rd); struct IDProperty *BKE_ffmpeg_property_add(struct RenderData *Rd, const char *type, int opt_index, int parent_index); int BKE_ffmpeg_property_add_string(struct RenderData *rd, const char *type, const char *str); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 83e0d99bc6b..c59044d1fce 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1444,9 +1444,9 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos const bool do_final_wmcol = (scene->toolsettings->weights_preview == WP_WPREVIEW_FINAL) && do_wmcol; #endif const bool do_final_wmcol = FALSE; - int do_init_wmcol = ((dataMask & CD_MASK_PREVIEW_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT) && !do_final_wmcol); + const bool do_init_wmcol = ((dataMask & CD_MASK_PREVIEW_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT) && !do_final_wmcol); /* XXX Same as above... For now, only weights preview in WPaint mode. */ - const int do_mod_wmcol = do_init_wmcol; + const bool do_mod_wmcol = do_init_wmcol; VirtualModifierData virtualModifierData; @@ -1938,7 +1938,7 @@ float (*editbmesh_get_vertex_cos(BMEditMesh *em, int *numVerts_r))[3] return cos; } -int editbmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedMesh *dm) +bool editbmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedMesh *dm) { ModifierTypeInfo *mti = modifierType_getInfo(md->type); int required_mode = eModifierMode_Realtime | eModifierMode_Editmode; @@ -1965,9 +1965,9 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D int required_mode = eModifierMode_Realtime | eModifierMode_Editmode; int draw_flag = dm_drawflag_calc(scene->toolsettings); - // const int do_mod_mcol = true; // (ob->mode == OB_MODE_OBJECT); + // const bool do_mod_mcol = true; // (ob->mode == OB_MODE_OBJECT); #if 0 /* XXX Will re-enable this when we have global mod stack options. */ - const int do_final_wmcol = (scene->toolsettings->weights_preview == WP_WPREVIEW_FINAL) && do_wmcol; + const bool do_final_wmcol = (scene->toolsettings->weights_preview == WP_WPREVIEW_FINAL) && do_wmcol; #endif const bool do_final_wmcol = FALSE; const bool do_init_wmcol = ((((Mesh *)ob->data)->drawflag & ME_DRAWEIGHT) && !do_final_wmcol); @@ -2697,7 +2697,8 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) { float *verts[4], *tex_coords[4]; const int nr_verts = mface[f].v4 != 0 ? 4 : 3; - int i, is_degenerate; + bool is_degenerate; + int i; verts[0] = mvert[mface[f].v1].co; verts[1] = mvert[mface[f].v2].co; verts[2] = mvert[mface[f].v3].co; tex_coords[0] = mtface[f].uv[0]; tex_coords[1] = mtface[f].uv[1]; tex_coords[2] = mtface[f].uv[2]; @@ -2725,7 +2726,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) /* verify the winding is consistent */ if (is_degenerate == 0) { float prev_edge[2]; - int is_signed = 0; + bool is_signed = 0; sub_v2_v2v2(prev_edge, tex_coords[0], tex_coords[3]); i = 0; diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index aea915b9ec4..8967df14b24 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1007,7 +1007,7 @@ void BKE_pose_remove_group(Object *ob) /* ************** F-Curve Utilities for Actions ****************** */ /* Check if the given action has any keyframes */ -short action_has_motion(const bAction *act) +bool action_has_motion(const bAction *act) { FCurve *fcu; diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index c2ce779f03f..76f610c0d79 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -1020,7 +1020,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings * int savedlines, saveline; float rgba[4], ycc[3], luma; int ycc_mode = -1; - const short is_float = (ibuf->rect_float != NULL); + const bool is_float = (ibuf->rect_float != NULL); void *cache_handle = NULL; struct ColormanageProcessor *cm_processor = NULL; diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index cba4b7e1ea2..c5979686afb 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2524,7 +2524,7 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render) struct BevelSort *sortdata, *sd, *sd1; int a, b, nr, poly, resolu = 0, len = 0; int do_tilt, do_radius, do_weight; - int is_editmode = 0; + bool is_editmode = false; ListBase *bev; /* this function needs an object, because of tflag and upflag */ @@ -4092,7 +4092,7 @@ bool BKE_curve_center_bounds(Curve *cu, float cent[3]) return false; } -void BKE_curve_translate(Curve *cu, float offset[3], int do_keys) +void BKE_curve_translate(Curve *cu, float offset[3], const bool do_keys) { ListBase *nurb_lb = BKE_curve_nurbs_get(cu); Nurb *nu; diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 8aeacda8100..6ff27e50bf8 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -557,7 +557,7 @@ void defgroup_unique_name(bDeformGroup *dg, Object *ob) BLI_uniquename_cb(defgroup_unique_check, &data, DATA_("Group"), '.', dg->name, sizeof(dg->name)); } -static int is_char_sep(const char c) +static bool is_char_sep(const char c) { return ELEM4(c, '.', ' ', '-', '_'); } diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 0e3a15b114e..e60505a2245 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -1988,7 +1988,7 @@ static void dag_object_time_update_flags(Main *bmain, Scene *scene, Object *ob) } /* recursively update objects in groups, each group is done at most once */ -static void dag_group_update_flags(Main *bmain, Scene *scene, Group *group, const short do_time) +static void dag_group_update_flags(Main *bmain, Scene *scene, Group *group, const bool do_time) { GroupObject *go; @@ -2007,7 +2007,7 @@ static void dag_group_update_flags(Main *bmain, Scene *scene, Group *group, cons /* flag all objects that need recalc, for changes in time for example */ /* do_time: make this optional because undo resets objects to their animated locations without this */ -void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const short do_time) +void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const bool do_time) { Base *base; Object *ob; @@ -2160,7 +2160,7 @@ static void dag_group_on_visible_update(Group *group) } } -void DAG_on_visible_update(Main *bmain, const short do_time) +void DAG_on_visible_update(Main *bmain, const bool do_time) { ListBase listbase; DagSceneLayer *dsl; @@ -2228,7 +2228,7 @@ void DAG_on_visible_update(Main *bmain, const short do_time) static void dag_id_flush_update__isDependentTexture(void *userData, Object *UNUSED(ob), ID **idpoin) { - struct { ID *id; int is_dependent; } *data = userData; + struct { ID *id; bool is_dependent; } *data = userData; if (*idpoin && GS((*idpoin)->name) == ID_TE) { if (data->id == (*idpoin)) @@ -2286,7 +2286,7 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id) /* set flags based on textures - can influence depgraph via modifiers */ if (idtype == ID_TE) { for (obt = bmain->object.first; obt; obt = obt->id.next) { - struct { ID *id; int is_dependent; } data; + struct { ID *id; bool is_dependent; } data; data.id = id; data.is_dependent = 0; diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index ef4d199dbb2..98cac2f4721 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -1461,7 +1461,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf PaintPoint *pPoint = (PaintPoint *)sData->type_data; DerivedMesh *dm = surface->canvas->dm; int i; - bool scene_color_manage = BKE_scene_check_color_management_enabled(scene); + const bool scene_color_manage = BKE_scene_check_color_management_enabled(scene); if (surface->type != MOD_DPAINT_SURFACE_T_PAINT) return; diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 04765a74b77..c93181bd903 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -433,7 +433,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, bool * /* helper for calc_fcurve_* functions -> find first and last BezTriple to be used */ static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple **last, - const short do_sel_only) + const bool do_sel_only) { short found = FALSE; @@ -482,12 +482,12 @@ static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple /* Calculate the extents of F-Curve's data */ -short calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax, - const short do_sel_only, const short include_handles) +bool calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax, + const bool do_sel_only, const bool include_handles) { float xminv = 999999999.0f, xmaxv = -999999999.0f; float yminv = 999999999.0f, ymaxv = -999999999.0f; - short foundvert = FALSE; + bool foundvert = false; unsigned int i; if (fcu->totvert) { @@ -578,7 +578,7 @@ short calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, flo /* Calculate the extents of F-Curve's keyframes */ bool calc_fcurve_range(FCurve *fcu, float *start, float *end, - const short do_sel_only, const short do_min_length) + const bool do_sel_only, const bool do_min_length) { float min = 999999999.0f, max = -999999999.0f; short foundvert = FALSE; @@ -631,7 +631,7 @@ bool calc_fcurve_range(FCurve *fcu, float *start, float *end, * Usability of keyframes refers to whether they should be displayed, * and also whether they will have any influence on the final result. */ -short fcurve_are_keyframes_usable(FCurve *fcu) +bool fcurve_are_keyframes_usable(FCurve *fcu) { /* F-Curve must exist */ if (fcu == NULL) diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 2f543dcbe09..c60c1ea2b5f 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -211,7 +211,7 @@ VFont *BKE_vfont_load(Main *bmain, const char *name) VFont *vfont = NULL; PackedFile *pf; PackedFile *temp_pf = NULL; - int is_builtin; + bool is_builtin; if (STREQ(name, FO_BUILTIN_NAME)) { BLI_strncpy(filename, name, sizeof(filename)); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 322f09f48d5..55699bc0aae 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -561,7 +561,7 @@ void BKE_image_merge(Image *dest, Image *source) } /* note, we could be clever and scale all imbuf's but since some are mipmaps its not so simple */ -int BKE_image_scale(Image *image, int width, int height) +bool BKE_image_scale(Image *image, int width, int height) { ImBuf *ibuf; void *lock; @@ -1264,7 +1264,7 @@ char BKE_imtype_from_arg(const char *imtype_arg) else return R_IMF_IMTYPE_INVALID; } -static int do_add_image_extension(char *string, const char imtype, const ImageFormatData *im_format) +static bool do_add_image_extension(char *string, const char imtype, const ImageFormatData *im_format) { const char *extension = NULL; const char *extension_test; @@ -3149,7 +3149,7 @@ void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock) } /* checks whether there's an image buffer for given image and user */ -int BKE_image_has_ibuf(Image *ima, ImageUser *iuser) +bool BKE_image_has_ibuf(Image *ima, ImageUser *iuser) { ImBuf *ibuf; @@ -3284,7 +3284,7 @@ void BKE_image_pool_release_ibuf(Image *ima, ImBuf *ibuf, ImagePool *pool) } } -int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, short *r_is_in_range) +int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, bool *r_is_in_range) { const int len = (iuser->fie_ima * iuser->frames) / 2; @@ -3346,7 +3346,7 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, shor void BKE_image_user_frame_calc(ImageUser *iuser, int cfra, int fieldnr) { if (iuser) { - short is_in_range; + bool is_in_range; const int framenr = BKE_image_user_frame_get(iuser, cfra, fieldnr, &is_in_range); if (is_in_range) { @@ -3404,7 +3404,7 @@ void BKE_image_user_file_path(ImageUser *iuser, Image *ima, char *filepath) BLI_path_abs(filepath, ID_BLEND_PATH(G.main, &ima->id)); } -int BKE_image_has_alpha(struct Image *image) +bool BKE_image_has_alpha(struct Image *image) { ImBuf *ibuf; void *lock; diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index e01993d64d9..d2080b4922c 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -1558,7 +1558,7 @@ KeyBlock *BKE_keyblock_add(Key *key, const char *name) * \param name Optional name for the new keyblock. * \param do_force always use ctime even for relative keys. */ -KeyBlock *BKE_keyblock_add_ctime(Key *key, const char *name, const short do_force) +KeyBlock *BKE_keyblock_add_ctime(Key *key, const char *name, const bool do_force) { KeyBlock *kb = BKE_keyblock_add(key, name); diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 525f9107a12..8b509c77155 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -620,7 +620,7 @@ static int calc_curve_deform(Object *par, float co[3], Curve *cu = par->data; float fac, loc[4], dir[3], new_quat[4], radius; short index; - const int is_neg_axis = (axis > 2); + const bool is_neg_axis = (axis > 2); /* to be sure, mostly after file load */ if (par->curve_cache->path == NULL) { @@ -711,7 +711,7 @@ void curve_deform_verts(Object *cuOb, Object *target, DerivedMesh *dm, float (*v int a; CurveDeform cd; int use_vgroups; - const int is_neg_axis = (defaxis > 2); + const bool is_neg_axis = (defaxis > 2); if (cuOb->type != OB_CURVE) return; @@ -1147,7 +1147,7 @@ void BKE_lattice_center_bounds(Lattice *lt, float cent[3]) mid_v3_v3v3(cent, min, max); } -void BKE_lattice_translate(Lattice *lt, float offset[3], int do_keys) +void BKE_lattice_translate(Lattice *lt, float offset[3], bool do_keys) { int i, numVerts; diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index 131e383a8a2..33e758ed754 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -434,7 +434,7 @@ float BKE_mask_spline_project_co(MaskSpline *spline, MaskSplinePoint *point, /* point */ -int BKE_mask_point_has_handle(MaskSplinePoint *point) +bool BKE_mask_point_has_handle(MaskSplinePoint *point) { BezTriple *bezt = &point->bezt; @@ -671,7 +671,7 @@ void BKE_mask_point_add_uw(MaskSplinePoint *point, float u, float w) BKE_mask_point_sort_uw(point, &point->uw[point->tot_uw - 1]); } -void BKE_mask_point_select_set(MaskSplinePoint *point, const short do_select) +void BKE_mask_point_select_set(MaskSplinePoint *point, const bool do_select) { int i; @@ -692,7 +692,7 @@ void BKE_mask_point_select_set(MaskSplinePoint *point, const short do_select) } } -void BKE_mask_point_select_set_handle(MaskSplinePoint *point, const short do_select) +void BKE_mask_point_select_set_handle(MaskSplinePoint *point, const bool do_select) { if (do_select) { MASKPOINT_SEL_HANDLE(point); @@ -1298,7 +1298,7 @@ void BKE_mask_calc_handle_adjacent_interp(MaskSpline *spline, MaskSplinePoint *p * Useful for giving sane defaults. */ void BKE_mask_calc_handle_point_auto(MaskSpline *spline, MaskSplinePoint *point, - const short do_recalc_length) + const bool do_recalc_length) { MaskSplinePoint *point_prev, *point_next; const char h_back[2] = {point->bezt.h1, point->bezt.h2}; diff --git a/source/blender/blenkernel/intern/mask_evaluate.c b/source/blender/blenkernel/intern/mask_evaluate.c index f63d027d9f4..c6cc4a412b8 100644 --- a/source/blender/blenkernel/intern/mask_evaluate.c +++ b/source/blender/blenkernel/intern/mask_evaluate.c @@ -505,7 +505,7 @@ void BKE_mask_spline_feather_collapse_inner_loops(MaskSpline *spline, float (*fe static float (*mask_spline_feather_differentiated_points_with_resolution__even(MaskSpline *spline, unsigned int *tot_feather_point, const unsigned int resol, - const int do_feather_isect + const bool do_feather_isect ))[2] { MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); @@ -578,7 +578,7 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__even(M static float (*mask_spline_feather_differentiated_points_with_resolution__double(MaskSpline *spline, unsigned int *tot_feather_point, const unsigned int resol, - const int do_feather_isect + const bool do_feather_isect ))[2] { MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); @@ -715,7 +715,7 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__double float (*BKE_mask_spline_feather_differentiated_points_with_resolution(MaskSpline *spline, unsigned int *tot_feather_point, const unsigned int resol, - const int do_feather_isect + const bool do_feather_isect ))[2] { switch (spline->offset_mode) { diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c index 3ecca00e31b..6c46b9c7c5b 100644 --- a/source/blender/blenkernel/intern/mask_rasterize.c +++ b/source/blender/blenkernel/intern/mask_rasterize.c @@ -192,7 +192,7 @@ typedef struct MaskRasterSplineInfo { unsigned int vertex_total_cap_head; unsigned int vertex_total_cap_tail; - unsigned int is_cyclic; + bool is_cyclic; } MaskRasterSplineInfo; /** @@ -256,7 +256,7 @@ void BKE_maskrasterize_handle_free(MaskRasterHandle *mr_handle) static void maskrasterize_spline_differentiate_point_outset(float (*diff_feather_points)[2], float (*diff_points)[2], const unsigned int tot_diff_point, const float ofs, - const short do_test) + const bool do_test) { unsigned int k_prev = tot_diff_point - 2; unsigned int k_curr = tot_diff_point - 1; @@ -558,8 +558,8 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size) void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mask, const int width, const int height, - const short do_aspect_correct, const short do_mask_aa, - const short do_feather) + const bool do_aspect_correct, const bool do_mask_aa, + const bool do_feather) { const rctf default_bounds = {0.0f, 1.0f, 0.0f, 1.0f}; const float pixel_size = 1.0f / (float)min_ii(width, height); @@ -613,8 +613,8 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas BLI_scanfill_begin_arena(&sf_ctx, sf_arena); for (spline = masklay->splines.first; spline; spline = spline->next) { - const unsigned int is_cyclic = (spline->flag & MASK_SPLINE_CYCLIC) != 0; - const unsigned int is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0; + const bool is_cyclic = (spline->flag & MASK_SPLINE_CYCLIC) != 0; + const bool is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0; float (*diff_points)[2]; unsigned int tot_diff_point; diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index dfa0d30f536..4ea98650551 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -176,7 +176,7 @@ static void get_sequence_fname(MovieClip *clip, int framenr, char *name) } /* supposed to work with sequences only */ -static void get_proxy_fname(MovieClip *clip, int proxy_render_size, int undistorted, int framenr, char *name) +static void get_proxy_fname(MovieClip *clip, int proxy_render_size, bool undistorted, int framenr, char *name) { int size = rendersize_to_number(proxy_render_size); char dir[FILE_MAX], clipdir[FILE_MAX], clipfile[FILE_MAX]; @@ -482,7 +482,7 @@ static ImBuf *get_imbuf_cache(MovieClip *clip, MovieClipUser *user, int flag) return NULL; } -static int has_imbuf_cache(MovieClip *clip, MovieClipUser *user, int flag) +static bool has_imbuf_cache(MovieClip *clip, MovieClipUser *user, int flag) { if (clip->cache) { MovieClipImBufCacheKey key; @@ -1046,7 +1046,7 @@ ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float } -int BKE_movieclip_has_frame(MovieClip *clip, MovieClipUser *user) +bool BKE_movieclip_has_frame(MovieClip *clip, MovieClipUser *user) { ImBuf *ibuf = BKE_movieclip_get_ibuf(clip, user); @@ -1290,7 +1290,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip scopes->ok = TRUE; } -static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, int proxy_render_size, int undistorted, bool threaded) +static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, int proxy_render_size, bool undistorted, bool threaded) { char name[FILE_MAX]; int quality, rectx, recty; @@ -1335,7 +1335,7 @@ static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, i * (meaning scaling shall be threaded) */ void BKE_movieclip_build_proxy_frame(MovieClip *clip, int clip_flag, struct MovieDistortion *distortion, - int cfra, int *build_sizes, int build_count, int undistorted) + int cfra, int *build_sizes, int build_count, bool undistorted) { ImBuf *ibuf; MovieClipUser user; @@ -1370,7 +1370,7 @@ void BKE_movieclip_build_proxy_frame(MovieClip *clip, int clip_flag, struct Movi * (different threads handles different frames, no threading within frame is needed) */ void BKE_movieclip_build_proxy_frame_for_ibuf(MovieClip *clip, ImBuf *ibuf, struct MovieDistortion *distortion, - int cfra, int *build_sizes, int build_count, int undistorted) + int cfra, int *build_sizes, int build_count, bool undistorted) { if (!build_count) return; @@ -1508,9 +1508,9 @@ ImBuf *BKE_movieclip_anim_ibuf_for_frame(MovieClip *clip, MovieClipUser *user) return ibuf; } -int BKE_movieclip_has_cached_frame(MovieClip *clip, MovieClipUser *user) +bool BKE_movieclip_has_cached_frame(MovieClip *clip, MovieClipUser *user) { - int has_frame = FALSE; + bool has_frame = false; BLI_lock_thread(LOCK_MOVIECLIP); has_frame = has_imbuf_cache(clip, user, clip->flag); @@ -1519,7 +1519,7 @@ int BKE_movieclip_has_cached_frame(MovieClip *clip, MovieClipUser *user) return has_frame; } -int BKE_movieclip_put_frame_if_possible(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf) +bool BKE_movieclip_put_frame_if_possible(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf) { bool result; diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 2189fbd2f55..cba905ad487 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -899,7 +899,7 @@ static void multires_subdivide(MultiresModifierData *mmd, Object *ob, int totlvl CCGKey highGridKey, lowGridKey; CCGSubSurf *ss; int i, numGrids, highGridSize; - int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK); + const bool has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK); /* create subsurf DM from original mesh at high level */ cddm = CDDM_from_mesh(me); @@ -1170,7 +1170,7 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm) CCGKey highGridKey, lowGridKey; CCGSubSurf *ss; int i, j, numGrids, highGridSize, lowGridSize; - int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK); + const bool has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK); /* create subsurf DM from original mesh at high level */ if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform); @@ -1233,7 +1233,7 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm) } else { DerivedMesh *cddm, *subdm; - int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK); + const bool has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK); if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform); else cddm = CDDM_from_mesh(me); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 1fbc2432595..b2b20f82757 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -548,7 +548,7 @@ float BKE_nla_tweakedit_remap(AnimData *adt, float cframe, short mode) /* (these functions are used for NLA-Tracks and also for nested/meta-strips) */ /* Check if there is any space in the given list to add the given strip */ -short BKE_nlastrips_has_space(ListBase *strips, float start, float end) +bool BKE_nlastrips_has_space(ListBase *strips, float start, float end) { NlaStrip *strip; @@ -967,7 +967,7 @@ void BKE_nlatrack_set_active(ListBase *tracks, NlaTrack *nlt_a) } /* Check if there is any space in the given track to add a strip of the given length */ -short BKE_nlatrack_has_space(NlaTrack *nlt, float start, float end) +bool BKE_nlatrack_has_space(NlaTrack *nlt, float start, float end) { /* sanity checks * - track must exist diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 02751e0cbb3..f058bbc5f78 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1478,7 +1478,7 @@ void BKE_node_preview_merge_tree(bNodeTree *to_ntree, bNodeTree *from_ntree, boo /* hack warning! this function is only used for shader previews, and * since it gets called multiple times per pixel for Ztransp we only * add the color once. Preview gets cleared before it starts render though */ -void BKE_node_preview_set_pixel(bNodePreview *preview, const float col[4], int x, int y, int do_manage) +void BKE_node_preview_set_pixel(bNodePreview *preview, const float col[4], int x, int y, bool do_manage) { if (preview) { if (x >= 0 && y >= 0) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index b8d4ef8167c..53eb24bb23f 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -3224,7 +3224,7 @@ void object_delete_ptcache(Object *ob, int index) /* shape key utility function */ /************************* Mesh ************************/ -static KeyBlock *insert_meshkey(Scene *scene, Object *ob, const char *name, int from_mix) +static KeyBlock *insert_meshkey(Scene *scene, Object *ob, const char *name, const bool from_mix) { Mesh *me = ob->data; Key *key = me->key; @@ -3256,7 +3256,7 @@ static KeyBlock *insert_meshkey(Scene *scene, Object *ob, const char *name, int return kb; } /************************* Lattice ************************/ -static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, int from_mix) +static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, const bool from_mix) { Lattice *lt = ob->data; Key *key = lt->key; @@ -3294,7 +3294,7 @@ static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, int return kb; } /************************* Curve ************************/ -static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, int from_mix) +static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, const bool from_mix) { Curve *cu = ob->data; Key *key = cu->key; @@ -3334,7 +3334,7 @@ static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, int return kb; } -KeyBlock *BKE_object_insert_shape_key(Scene *scene, Object *ob, const char *name, int from_mix) +KeyBlock *BKE_object_insert_shape_key(Scene *scene, Object *ob, const char *name, const bool from_mix) { switch (ob->type) { case OB_MESH: diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index 0874d34b25d..dd9f1a268b2 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -838,7 +838,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem float (*obmat)[4]; int a, b, hair = 0; int totpart, totchild, totgroup = 0 /*, pa_num */; - int dupli_type_hack = !BKE_scene_use_new_shading_nodes(scene); + const bool dupli_type_hack = !BKE_scene_use_new_shading_nodes(scene); int no_draw_flag = PARS_UNEXIST; diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 76ac13963a9..cb7c7c636c8 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -880,12 +880,12 @@ static void BKE_pbvh_search_callback_occluded(PBVH *bvh, } } -static int update_search_cb(PBVHNode *node, void *data_v) +static bool update_search_cb(PBVHNode *node, void *data_v) { int flag = GET_INT_FROM_POINTER(data_v); if (node->flag & PBVH_Leaf) - return (node->flag & flag); + return (node->flag & flag) != 0; return 1; } @@ -1362,7 +1362,7 @@ typedef struct { int original; } RaycastData; -static int ray_aabb_intersect(PBVHNode *node, void *data_v) +static bool ray_aabb_intersect(PBVHNode *node, void *data_v) { RaycastData *rcd = data_v; float bb_min[3], bb_max[3]; @@ -1387,11 +1387,11 @@ void BKE_pbvh_raycast(PBVH *bvh, BKE_pbvh_HitOccludedCallback cb, void *data, BKE_pbvh_search_callback_occluded(bvh, ray_aabb_intersect, &rcd, cb, data); } -int ray_face_intersection(const float ray_start[3], - const float ray_normal[3], - const float *t0, const float *t1, - const float *t2, const float *t3, - float *fdist) +bool ray_face_intersection(const float ray_start[3], + const float ray_normal[3], + const float t0[3], const float t1[3], + const float t2[3], const float t3[3], + float *fdist) { float dist; @@ -1406,14 +1406,15 @@ int ray_face_intersection(const float ray_start[3], } } -static int pbvh_faces_node_raycast(PBVH *bvh, const PBVHNode *node, - float (*origco)[3], - const float ray_start[3], - const float ray_normal[3], float *dist) +static bool pbvh_faces_node_raycast(PBVH *bvh, const PBVHNode *node, + float (*origco)[3], + const float ray_start[3], + const float ray_normal[3], float *dist) { const MVert *vert = bvh->verts; const int *faces = node->prim_indices; - int i, hit = 0, totface = node->totprim; + int i, totface = node->totprim; + bool hit = false; for (i = 0; i < totface; ++i) { const MFace *f = bvh->faces + faces[i]; @@ -1501,7 +1502,7 @@ int BKE_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3], int use const float ray_start[3], const float ray_normal[3], float *dist) { - int hit = 0; + bool hit = false; if (node->flag & PBVH_FullyHidden) return 0; @@ -1641,7 +1642,7 @@ static PlaneAABBIsect test_planes_aabb(const float bb_min[3], return ret; } -int BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data) +bool BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data) { float bb_min[3], bb_max[3]; @@ -1649,7 +1650,7 @@ int BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data) return test_planes_aabb(bb_min, bb_max, data) != ISECT_OUTSIDE; } -int BKE_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data) +bool BKE_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data) { float bb_min[3], bb_max[3]; @@ -1788,7 +1789,7 @@ void BKE_pbvh_apply_vertCos(PBVH *pbvh, float (*vertCos)[3]) } } -int BKE_pbvh_isDeformed(PBVH *pbvh) +bool BKE_pbvh_isDeformed(PBVH *pbvh) { return pbvh->deformed; } @@ -1911,7 +1912,7 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, vi->vmask = CustomData_get_layer(bvh->vdata, CD_PAINT_MASK); } -void pbvh_show_diffuse_color_set(PBVH *bvh, int show_diffuse_color) +void pbvh_show_diffuse_color_set(PBVH *bvh, bool show_diffuse_color) { bvh->show_diffuse_color = show_diffuse_color; } diff --git a/source/blender/blenkernel/intern/pbvh_intern.h b/source/blender/blenkernel/intern/pbvh_intern.h index bd72b0339c7..d4cd6bcf9d8 100644 --- a/source/blender/blenkernel/intern/pbvh_intern.h +++ b/source/blender/blenkernel/intern/pbvh_intern.h @@ -154,9 +154,9 @@ struct PBVH { #endif /* flag are verts/faces deformed */ - int deformed; + bool deformed; - int show_diffuse_color; + bool show_diffuse_color; /* Dynamic topology */ BMesh *bm; @@ -175,9 +175,9 @@ void BB_expand_with_bb(BB *bb, BB *bb2); void BBC_update_centroid(BBC *bbc); int BB_widest_axis(const BB *bb); void pbvh_grow_nodes(PBVH *bvh, int totnode); -int ray_face_intersection(const float ray_start[3], const float ray_normal[3], - const float *t0, const float *t1, const float *t2, - const float *t3, float *fdist); +bool ray_face_intersection(const float ray_start[3], const float ray_normal[3], + const float *t0, const float *t1, const float *t2, + const float *t3, float *fdist); void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes, int totnode, int flag); /* pbvh_bmesh.c */ diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 975e06467d4..936f76765c2 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -744,7 +744,7 @@ void BKE_scene_unlink(Main *bmain, Scene *sce, Scene *newsce) int BKE_scene_base_iter_next(EvaluationContext *eval_ctx, SceneBaseIter *iter, Scene **scene, int val, Base **base, Object **ob) { - int run_again = 1; + bool run_again = true; /* init */ if (val == 0) { @@ -1671,7 +1671,7 @@ SceneRenderLayer *BKE_scene_add_render_layer(Scene *sce, const char *name) return srl; } -int BKE_scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer *srl) +bool BKE_scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer *srl) { const int act = BLI_findindex(&scene->r.layers, srl); Scene *sce; @@ -1766,7 +1766,7 @@ Base *_setlooper_base_step(Scene **sce_iter, Base *base) return NULL; } -int BKE_scene_use_new_shading_nodes(Scene *scene) +bool BKE_scene_use_new_shading_nodes(Scene *scene) { RenderEngineType *type = RE_engines_find(scene->r.engine); return (type && type->flag & RE_USE_SHADING_NODES); @@ -1810,12 +1810,12 @@ void BKE_scene_disable_color_management(Scene *scene) } } -int BKE_scene_check_color_management_enabled(const Scene *scene) +bool BKE_scene_check_color_management_enabled(const Scene *scene) { return strcmp(scene->display_settings.display_device, "None") != 0; } -int BKE_scene_check_rigidbody_active(const Scene *scene) +bool BKE_scene_check_rigidbody_active(const Scene *scene) { return scene && scene->rigidbody_world && scene->rigidbody_world->group && !(scene->rigidbody_world->flag & RBW_FLAG_MUTED); } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index b261ad5686b..58d4a2acf33 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -176,7 +176,7 @@ static void seq_free_strip(Strip *strip) } /* only give option to skip cache locally (static func) */ -static void BKE_sequence_free_ex(Scene *scene, Sequence *seq, const int do_cache) +static void BKE_sequence_free_ex(Scene *scene, Sequence *seq, const bool do_cache) { if (seq->strip) seq_free_strip(seq->strip); @@ -752,7 +752,7 @@ void BKE_sequence_calc(Scene *scene, Sequence *seq) } /* note: caller should run BKE_sequence_calc(scene, seq) after */ -void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, int lock_range) +void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, const bool lock_range) { char str[FILE_MAX]; int prev_startdisp = 0, prev_enddisp = 0; @@ -1925,7 +1925,7 @@ int BKE_sequencer_input_have_to_preprocess(const SeqRenderData *UNUSED(context), } static ImBuf *input_preprocess(const SeqRenderData *context, Sequence *seq, float cfra, ImBuf *ibuf, - int is_proxy_image, int is_preprocessed) + const bool is_proxy_image, const bool is_preprocessed) { Scene *scene = context->scene; float mul; @@ -2457,11 +2457,11 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq * -jahka */ - const short is_rendering = G.is_rendering; - const short is_background = G.background; - const int do_seq_gl = is_rendering ? - 0 /* (context->scene->r.seq_flag & R_SEQ_GL_REND) */ : - (context->scene->r.seq_flag & R_SEQ_GL_PREV); + const bool is_rendering = G.is_rendering; + const bool is_background = G.background; + const bool do_seq_gl = is_rendering ? + 0 /* (context->scene->r.seq_flag & R_SEQ_GL_REND) */ : + (context->scene->r.seq_flag & R_SEQ_GL_PREV) != 0; int do_seq; // int have_seq = FALSE; /* UNUSED */ int have_comp = FALSE; @@ -2756,12 +2756,12 @@ static ImBuf *do_render_strip_uncached(const SeqRenderData *context, Sequence *s static ImBuf *seq_render_strip(const SeqRenderData *context, Sequence *seq, float cfra) { ImBuf *ibuf = NULL; - int use_preprocess = FALSE; - int is_proxy_image = FALSE; + bool use_preprocess = false; + bool is_proxy_image = false; float nr = give_stripelem_index(seq, cfra); /* all effects are handled similarly with the exception of speed effect */ int type = (seq->type & SEQ_TYPE_EFFECT && seq->type != SEQ_TYPE_SPEED) ? SEQ_TYPE_EFFECT : seq->type; - int is_preprocessed = !ELEM3(type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SCENE); + bool is_preprocessed = !ELEM3(type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SCENE); ibuf = BKE_sequencer_cache_get(context, seq, cfra, SEQ_STRIPELEM_IBUF); diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 74771378e9c..dce82f9cbc4 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -51,11 +51,11 @@ #include "BKE_lattice.h" #include "BKE_deform.h" -#include "BKE_mesh.h" #include "BKE_subsurf.h" -#include "BKE_mesh.h" #include "BKE_editmesh.h" +#include "BLI_strict_flags.h" + /* for timing... */ #if 0 # include "PIL_time.h" @@ -281,7 +281,6 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for int i; /* Options about projection direction */ - const char use_normal = calc->smd->shrinkOpts; const float proj_limit_squared = calc->smd->projLimit * calc->smd->projLimit; float proj_axis[3] = {0.0f, 0.0f, 0.0f}; @@ -300,7 +299,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for /* If the user doesn't allows to project in any direction of projection axis * then theres nothing todo. */ - if ((use_normal & (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0) + if ((calc->smd->shrinkOpts & (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0) return; @@ -370,7 +369,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for hit.dist = 10000.0f; /* TODO: we should use FLT_MAX here, but sweepsphere code isn't prepared for that */ /* Project over positive direction of axis */ - if (use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR) { + if (calc->smd->shrinkOpts & MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR) { if (auxData.tree) { BKE_shrinkwrap_project_normal(0, tmp_co, tmp_no, @@ -384,7 +383,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for } /* Project over negative direction of axis */ - if (use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR) { + if (calc->smd->shrinkOpts & MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR) { float inv_no[3]; negate_v3_v3(inv_no, tmp_no); diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 145f832063a..7fea20a14e2 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1230,7 +1230,7 @@ void txt_order_cursors(Text *text, const bool reverse) } } -int txt_has_sel(Text *text) +bool txt_has_sel(Text *text) { return ((text->curl != text->sell) || (text->curc != text->selc)); } @@ -3010,7 +3010,7 @@ int text_check_bracket(const char ch) } /* TODO, have a function for operators - http://docs.python.org/py3k/reference/lexical_analysis.html#operators */ -int text_check_delim(const char ch) +bool text_check_delim(const char ch) { int a; char delims[] = "():\"\' ~!%^&*-+=[]{};/<>|.#\t,@"; @@ -3022,14 +3022,14 @@ int text_check_delim(const char ch) return 0; } -int text_check_digit(const char ch) +bool text_check_digit(const char ch) { if (ch < '0') return 0; if (ch <= '9') return 1; return 0; } -int text_check_identifier(const char ch) +bool text_check_identifier(const char ch) { if (ch < '0') return 0; if (ch <= '9') return 1; @@ -3040,7 +3040,7 @@ int text_check_identifier(const char ch) return 0; } -int text_check_identifier_nodigit(const char ch) +bool text_check_identifier_nodigit(const char ch) { if (ch <= '9') return 0; if (ch < 'A') return 0; @@ -3051,18 +3051,18 @@ int text_check_identifier_nodigit(const char ch) } #ifndef WITH_PYTHON -int text_check_identifier_unicode(const unsigned int ch) +bool text_check_identifier_unicode(const unsigned int ch) { return (ch < 255 && text_check_identifier((char)ch)); } -int text_check_identifier_nodigit_unicode(const unsigned int ch) +bool text_check_identifier_nodigit_unicode(const unsigned int ch) { return (ch < 255 && text_check_identifier_nodigit((char)ch)); } #endif /* WITH_PYTHON */ -int text_check_whitespace(const char ch) +bool text_check_whitespace(const char ch) { if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n') return 1; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 786a490fa10..d192ca71c12 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -253,7 +253,7 @@ ColorBand *add_colorband(bool rangetype) /* ------------------------------------------------------------------------- */ -int do_colorband(const ColorBand *coba, float in, float out[4]) +bool do_colorband(const ColorBand *coba, float in, float out[4]) { const CBData *cbd1, *cbd2, *cbd0, *cbd3; float fac, mfac, t[4]; diff --git a/source/blender/blenkernel/intern/tracking_region_tracker.c b/source/blender/blenkernel/intern/tracking_region_tracker.c index 491a35602bd..6a274921d44 100644 --- a/source/blender/blenkernel/intern/tracking_region_tracker.c +++ b/source/blender/blenkernel/intern/tracking_region_tracker.c @@ -94,7 +94,8 @@ static void track_context_free(void *customdata) * for thread-safe tracking, allowing clip modifications during * tracking. */ -MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *user, short backwards, short sequence) +MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *user, + const bool backwards, const bool sequence) { MovieTrackingContext *context = MEM_callocN(sizeof(MovieTrackingContext), "trackingContext"); MovieTracking *tracking = &clip->tracking; diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index a26b579f5e5..ed32750e402 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -423,7 +423,7 @@ static size_t unit_as_string(char *str, int len_max, double value, int prec, bUn /* Used for drawing number buttons, try keep fast. * Return the length of the generated string. */ -size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, bool pad) +size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, bool split, bool pad) { bUnitCollection *usys = unit_get_system(system, type); diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 541d10637d5..ddd6780b0e9 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1596,7 +1596,7 @@ void BKE_ffmpeg_codec_settings_verify(RenderData *rd) ffmpeg_set_expert_options(rd); } -int BKE_ffmpeg_alpha_channel_is_supported(RenderData *rd) +bool BKE_ffmpeg_alpha_channel_is_supported(RenderData *rd) { int codec = rd->ffcodecdata.codec; diff --git a/source/blender/blenlib/BLI_graph.h b/source/blender/blenlib/BLI_graph.h index 864e92d8cac..7936f5a6fab 100644 --- a/source/blender/blenlib/BLI_graph.h +++ b/source/blender/blenlib/BLI_graph.h @@ -138,7 +138,7 @@ void BLI_removeArc(BGraph *graph, BArc *arc); void BLI_flagNodes(BGraph *graph, int flag); void BLI_flagArcs(BGraph *graph, int flag); -int BLI_hasAdjacencyList(BGraph *rg); +bool BLI_hasAdjacencyList(BGraph *rg); void BLI_buildAdjacencyList(BGraph *rg); void BLI_rebuildAdjacencyListForNode(BGraph *rg, BNode *node); void BLI_freeAdjacencyList(BGraph *rg); @@ -159,7 +159,7 @@ BNode *BLI_FindNodeByPosition(BGraph *graph, const float p[3], const float limit BArc *BLI_findConnectedArc(BGraph *graph, BArc *arc, BNode *v); -int BLI_isGraphCyclic(BGraph *graph); +bool BLI_isGraphCyclic(BGraph *graph); /*------------ Symmetry handling ------------*/ void BLI_markdownSymmetry(BGraph *graph, BNode *root_node, float limit); diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c index 9ec183ab9a2..e7651b70a5b 100644 --- a/source/blender/blenlib/intern/graph.c +++ b/source/blender/blenlib/intern/graph.c @@ -164,7 +164,7 @@ void BLI_freeAdjacencyList(BGraph *graph) } } -int BLI_hasAdjacencyList(BGraph *graph) +bool BLI_hasAdjacencyList(BGraph *graph) { BNode *node; @@ -317,9 +317,9 @@ void BLI_ReflagSubgraph(BGraph *graph, int old_subgraph, int new_subgraph) /*************************************** CYCLE DETECTION ***********************************************/ -static int detectCycle(BNode *node, BArc *src_arc) +static bool detectCycle(BNode *node, BArc *src_arc) { - int value = 0; + bool value = false; if (node->flag == 0) { int i; @@ -343,10 +343,10 @@ static int detectCycle(BNode *node, BArc *src_arc) return value; } -int BLI_isGraphCyclic(BGraph *graph) +bool BLI_isGraphCyclic(BGraph *graph) { BNode *node; - int value = 0; + bool value = false; /* NEED TO CHECK IF ADJACENCY LIST EXIST */ diff --git a/source/blender/blenlib/intern/uvproject.c b/source/blender/blenlib/intern/uvproject.c index a741c9858c3..730ab01bfd2 100644 --- a/source/blender/blenlib/intern/uvproject.c +++ b/source/blender/blenlib/intern/uvproject.c @@ -39,7 +39,7 @@ typedef struct ProjCameraInfo { float shiftx, shifty; float rotmat[4][4]; float caminv[4][4]; - short do_persp, do_pano, do_rotmat; + bool do_persp, do_pano, do_rotmat; } ProjCameraInfo; void BLI_uvproject_from_camera(float target[2], float source[3], ProjCameraInfo *uci) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3e10d7440bb..ad1fd3a302c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8703,11 +8703,11 @@ static int object_in_any_scene(Main *mainvar, Object *ob) return 0; } -static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const short idcode, const short is_link, const short active_lay) +static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const short idcode, const bool is_link, const short active_lay) { Object *ob; Base *base; - const short is_group_append = (is_link==FALSE && idcode==ID_GR); + const bool is_group_append = (is_link == false && idcode == ID_GR); /* give all objects which are LIB_INDIRECT a base, or for a group when *lib has been set */ for (ob = mainvar->object.first; ob; ob = ob->id.next) { @@ -9015,7 +9015,7 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in /* give a base to loose objects. If group append, do it for objects too */ if (scene) { - const short is_link = (flag & FILE_LINK) != 0; + const bool is_link = (flag & FILE_LINK) != 0; if (idcode == ID_SCE) { /* don't instance anything when linking in scenes, assume the scene its self instances the data */ } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 238ba0cce2f..0b582dacc5c 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -3418,7 +3418,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil /* do reverse file history: .blend1 -> .blend2, .blend -> .blend1 */ /* return: success(0), failure(1) */ -static int do_history(const char *name, ReportList *reports) +static bool do_history(const char *name, ReportList *reports) { char tempname1[FILE_MAX], tempname2[FILE_MAX]; int hisnr= U.versions; @@ -3524,7 +3524,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL /* file save to temporary file was successful */ /* now do reverse file history (move .blend1 -> .blend2, .blend -> .blend1) */ if (write_flags & G_FILE_HISTORY) { - int err_hist = do_history(filepath, reports); + const bool err_hist = do_history(filepath, reports); if (err_hist) { BKE_report(reports, RPT_ERROR, "Version backup failed (file saved with @)"); return 0; diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index a46079088fc..2e63aa5571f 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -3004,7 +3004,7 @@ static BevVert *bevel_vert_construct(BMesh *bm, BevelParams *bp, BMVert *v) } /* Face f has at least one beveled vertex. Rebuild f */ -static int bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f) +static bool bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f) { BMIter liter; BMLoop *l, *lprev; @@ -3013,7 +3013,7 @@ static int bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f) EdgeHalf *e, *eprev; VMesh *vm; int i, k; - int do_rebuild = FALSE; + bool do_rebuild = false; BMVert *bmv; BMVert **vv = NULL; BMVert **vv_fix = NULL; diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index f157487955b..6b8c01965f7 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -859,7 +859,7 @@ static void rearrange_animchannel_flatten_islands(ListBase *islands, ListBase *s /* ............................. */ /* performing rearranging of channels using islands */ -static short rearrange_animchannel_islands(ListBase *list, AnimChanRearrangeFp rearrange_func, short mode, short type) +static bool rearrange_animchannel_islands(ListBase *list, AnimChanRearrangeFp rearrange_func, short mode, short type) { ListBase islands = {NULL, NULL}; Link *channel, *chanNext = NULL; @@ -1027,7 +1027,7 @@ static void join_groups_action_temp(bAction *act) static void rearrange_action_channels(bAnimContext *ac, bAction *act, short mode) { bActionGroup tgrp; - short do_channels; + bool do_channels; /* get rearranging function */ AnimChanRearrangeFp rearrange_func = rearrange_get_mode_func(mode); diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index bbfa981c0c7..668c8cdceec 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -502,7 +502,8 @@ static int add_driver_button_exec(bContext *C, wmOperator *op) PointerRNA ptr = {{NULL}}; PropertyRNA *prop = NULL; short success = 0; - int index, all = RNA_boolean_get(op->ptr, "all"); + int index; + const bool all = RNA_boolean_get(op->ptr, "all"); /* try to create driver using property retrieved from UI */ uiContextActiveProperty(C, &ptr, &prop, &index); @@ -556,7 +557,8 @@ static int remove_driver_button_exec(bContext *C, wmOperator *op) PointerRNA ptr = {{NULL}}; PropertyRNA *prop = NULL; short success = 0; - int index, all = RNA_boolean_get(op->ptr, "all"); + int index; + const bool all = RNA_boolean_get(op->ptr, "all"); /* try to find driver using property retrieved from UI */ uiContextActiveProperty(C, &ptr, &prop, &index); diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 859485a55a6..1dea1329f9f 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -513,7 +513,7 @@ static void set_touched_actkeyblock(ActKeyBlock *ab) /* --------- */ /* Checks if ActKeyBlock should exist... */ -short actkeyblock_is_valid(ActKeyBlock *ab, DLRBT_Tree *keys) +bool actkeyblock_is_valid(ActKeyBlock *ab, DLRBT_Tree *keys) { ActKeyColumn *ak; short startCurves, endCurves, totCurves; diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 481012bf411..0ead68c4d4a 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -73,7 +73,7 @@ * Not recommended to be used many times successively. For that * there is delete_fcurve_keys(). */ -void delete_fcurve_key(FCurve *fcu, int index, short do_recalc) +void delete_fcurve_key(FCurve *fcu, int index, bool do_recalc) { /* sanity check */ if (fcu == NULL) diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 23f4ebeee66..a69403b085f 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1649,7 +1649,8 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) char *path; float cfra = (float)CFRA; short success = 0; - int a, index, length, all = RNA_boolean_get(op->ptr, "all"); + int a, index, length; + const bool all = RNA_boolean_get(op->ptr, "all"); short flag = 0; /* flags for inserting keyframes */ @@ -1740,7 +1741,8 @@ static int delete_key_button_exec(bContext *C, wmOperator *op) char *path; float cfra = (float)CFRA; // XXX for now, don't bother about all the yucky offset crap short success = 0; - int a, index, length, all = RNA_boolean_get(op->ptr, "all"); + int a, index, length; + const bool all = RNA_boolean_get(op->ptr, "all"); /* try to insert keyframe using property retrieved from UI */ uiContextActiveProperty(C, &ptr, &prop, &index); @@ -1809,7 +1811,8 @@ static int clear_key_button_exec(bContext *C, wmOperator *op) PropertyRNA *prop = NULL; char *path; short success = 0; - int a, index, length, all = RNA_boolean_get(op->ptr, "all"); + int a, index, length; + const bool all = RNA_boolean_get(op->ptr, "all"); /* try to insert keyframe using property retrieved from UI */ uiContextActiveProperty(C, &ptr, &prop, &index); @@ -1898,7 +1901,7 @@ int autokeyframe_cfra_can_key(Scene *scene, ID *id) /* --------------- API/Per-Datablock Handling ------------------- */ /* Checks if some F-Curve has a keyframe for a given frame */ -short fcurve_frame_has_keyframe(FCurve *fcu, float frame, short filter) +bool fcurve_frame_has_keyframe(FCurve *fcu, float frame, short filter) { /* quick sanity check */ if (ELEM(NULL, fcu, fcu->bezt)) diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 8d8290f83b7..b0b1ae3b0c9 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -296,7 +296,7 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op) char *path = NULL; short success = 0; int index = 0, pflag = 0; - int all = RNA_boolean_get(op->ptr, "all"); + const bool all = RNA_boolean_get(op->ptr, "all"); /* verify the Keying Set to use: * - use the active one for now (more control over this can be added later) diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c index ed8ae2d4cbb..456dd802086 100644 --- a/source/blender/editors/armature/armature_add.c +++ b/source/blender/editors/armature/armature_add.c @@ -527,7 +527,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op) bArmature *arm; EditBone *newbone, *ebone, *flipbone, *first = NULL; int a, totbone = 0, do_extrude; - int forked = RNA_boolean_get(op->ptr, "forked"); + bool forked = RNA_boolean_get(op->ptr, "forked"); obedit = CTX_data_edit_object(C); arm = obedit->data; diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index ed2d1388196..d51b27aefb8 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -973,7 +973,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op) bArmature *arm; EditBone *curbone, *pabone, *chbone; int direction = RNA_enum_get(op->ptr, "direction"); - int add_to_sel = RNA_boolean_get(op->ptr, "extend"); + const bool add_to_sel = RNA_boolean_get(op->ptr, "extend"); ob = obedit; arm = (bArmature *)ob->data; diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 36999c15665..a1ec0b595b0 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -1147,7 +1147,7 @@ static int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, return point_added; } -static void sk_addStrokePoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, short snap) +static void sk_addStrokePoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, const bool snap) { ToolSettings *ts = CTX_data_tool_settings(C); int point_added = 0; @@ -1165,7 +1165,7 @@ static void sk_addStrokePoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK } } -static void sk_getStrokePoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, short snap) +static void sk_getStrokePoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, const bool snap) { int point_added = 0; @@ -2180,7 +2180,7 @@ static void sk_start_draw_gesture(SK_Sketch *sketch) sketch->gesture = sk_createStroke(); } -static int sk_draw_stroke(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, short snap) +static int sk_draw_stroke(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, bool snap) { if (sk_stroke_filtermval(dd)) { sk_addStrokePoint(C, sketch, stk, dd, snap); @@ -2383,7 +2383,7 @@ static void sketch_draw_stroke_cancel(bContext *C, wmOperator *op) static int sketch_draw_stroke(bContext *C, wmOperator *op, const wmEvent *event) { - short snap = RNA_boolean_get(op->ptr, "snap"); + const bool snap = RNA_boolean_get(op->ptr, "snap"); SK_DrawData *dd; SK_Sketch *sketch = contextSketch(C, 1); @@ -2408,7 +2408,7 @@ static void sketch_draw_gesture_cancel(bContext *C, wmOperator *op) static int sketch_draw_gesture(bContext *C, wmOperator *op, const wmEvent *event) { - short snap = RNA_boolean_get(op->ptr, "snap"); + const bool snap = RNA_boolean_get(op->ptr, "snap"); SK_DrawData *dd; SK_Sketch *sketch = contextSketch(C, 1); /* create just to be sure */ sk_cancelStroke(sketch); @@ -2426,7 +2426,7 @@ static int sketch_draw_gesture(bContext *C, wmOperator *op, const wmEvent *event static int sketch_draw_modal(bContext *C, wmOperator *op, const wmEvent *event, short gesture, SK_Stroke *stk) { - short snap = RNA_boolean_get(op->ptr, "snap"); + bool snap = RNA_boolean_get(op->ptr, "snap"); SK_DrawData *dd = op->customdata; SK_Sketch *sketch = contextSketch(C, 1); /* create just to be sure */ int retval = OPERATOR_RUNNING_MODAL; @@ -2434,7 +2434,7 @@ static int sketch_draw_modal(bContext *C, wmOperator *op, const wmEvent *event, switch (event->type) { case LEFTCTRLKEY: case RIGHTCTRLKEY: - snap = event->ctrl; + snap = event->ctrl != 0; RNA_boolean_set(op->ptr, "snap", snap); break; case MOUSEMOVE: @@ -2496,7 +2496,7 @@ static int sketch_draw_gesture_modal(bContext *C, wmOperator *op, const wmEvent static int sketch_draw_preview(bContext *C, wmOperator *op, const wmEvent *event) { - short snap = RNA_boolean_get(op->ptr, "snap"); + const bool snap = RNA_boolean_get(op->ptr, "snap"); SK_Sketch *sketch = contextSketch(C, 0); if (sketch) { diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c index 34023d365ca..4038200d0a0 100644 --- a/source/blender/editors/armature/pose_select.c +++ b/source/blender/editors/armature/pose_select.c @@ -526,8 +526,8 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) bArmature *arm = ob->data; Bone *curbone, *pabone, *chbone; int direction = RNA_enum_get(op->ptr, "direction"); - int add_to_sel = RNA_boolean_get(op->ptr, "extend"); - int found = 0; + const bool add_to_sel = RNA_boolean_get(op->ptr, "extend"); + bool found = false; CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones) { diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c index 6beb442108f..5fba6554b8c 100644 --- a/source/blender/editors/armature/pose_transform.c +++ b/source/blender/editors/armature/pose_transform.c @@ -298,7 +298,7 @@ static void set_pose_keys(Object *ob) * * > returns: whether the bone that we pasted to if we succeeded */ -static bPoseChannel *pose_bone_do_paste(Object *ob, bPoseChannel *chan, short selOnly, short flip) +static bPoseChannel *pose_bone_do_paste(Object *ob, bPoseChannel *chan, const bool selOnly, const bool flip) { bPoseChannel *pchan; char name[MAXBONENAME]; @@ -459,8 +459,8 @@ static int pose_paste_exec(bContext *C, wmOperator *op) Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); Scene *scene = CTX_data_scene(C); bPoseChannel *chan; - int flip = RNA_boolean_get(op->ptr, "flipped"); - int selOnly = RNA_boolean_get(op->ptr, "selected_mask"); + const bool flip = RNA_boolean_get(op->ptr, "flipped"); + bool selOnly = RNA_boolean_get(op->ptr, "selected_mask"); /* get KeyingSet to use */ KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_WHOLE_CHARACTER_ID); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index b2a5844ccea..8d9e4737481 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -3019,7 +3019,8 @@ static int hide_exec(bContext *C, wmOperator *op) Nurb *nu; BPoint *bp; BezTriple *bezt; - int a, sel, invert = RNA_boolean_get(op->ptr, "unselected"); + int a, sel; + const bool invert = RNA_boolean_get(op->ptr, "unselected"); for (nu = editnurb->first; nu; nu = nu->next) { if (nu->type == CU_BEZIER) { diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 9f97a0aedff..7207c07b71a 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -631,7 +631,7 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, const WM_event_add_notifier(C, NC_OBJECT | NA_ADDED, obedit); } -void ED_text_to_object(bContext *C, Text *text, int split_lines) +void ED_text_to_object(bContext *C, Text *text, const bool split_lines) { RegionView3D *rv3d = CTX_wm_region_view3d(C); TextLine *line; diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 8d66a94f423..a5376741ffd 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1655,12 +1655,12 @@ static int gp_convert_layer_exec(bContext *C, wmOperator *op) static bool gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop) { const char *prop_id = RNA_property_identifier(prop); - int link_strokes = RNA_boolean_get(ptr, "use_link_strokes"); + const bool link_strokes = RNA_boolean_get(ptr, "use_link_strokes"); int timing_mode = RNA_enum_get(ptr, "timing_mode"); bool realtime = RNA_boolean_get(ptr, "use_realtime"); float gap_duration = RNA_float_get(ptr, "gap_duration"); float gap_randomness = RNA_float_get(ptr, "gap_randomness"); - int valid_timing = RNA_boolean_get(ptr, "use_timing_data"); + const bool valid_timing = RNA_boolean_get(ptr, "use_timing_data"); /* Always show those props */ if (strcmp(prop_id, "type") == 0 || diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index 296d7095938..d3b3425a27d 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -78,7 +78,7 @@ void make_editText(struct Object *obedit); void load_editText(struct Object *obedit); void free_editText(struct Object *obedit); -void ED_text_to_object(struct bContext *C, struct Text *text, int split_lines); +void ED_text_to_object(struct bContext *C, struct Text *text, const bool split_lines); bool ED_curve_select_nth(struct Curve *cu, int nth); diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index ffee46e30c6..58a262e150a 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -154,6 +154,6 @@ short compare_ak_cfraPtr(void *node, void *data); short compare_ab_cfraPtr(void *node, void *data); /* Checks if ActKeyBlock can be used (i.e. drawn/used to detect "holds") */ -short actkeyblock_is_valid(ActKeyBlock *ab, struct DLRBT_Tree *keys); +bool actkeyblock_is_valid(ActKeyBlock *ab, struct DLRBT_Tree *keys); #endif /* __ED_KEYFRAMES_DRAW_H__ */ diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index 5718a70208e..c99c70377ab 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -236,7 +236,7 @@ void bezt_remap_times(KeyframeEditData *ked, struct BezTriple *bezt); /* ************************************************ */ /* Destructive Editing API (keyframes_general.c) */ -void delete_fcurve_key(struct FCurve *fcu, int index, short do_recalc); +void delete_fcurve_key(struct FCurve *fcu, int index, bool do_recalc); bool delete_fcurve_keys(struct FCurve *fcu); void clear_fcurve_keys(struct FCurve *fcu); void duplicate_fcurve_keys(struct FCurve *fcu); diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index b9ad597558b..ad5f61a12f6 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -297,7 +297,7 @@ int autokeyframe_cfra_can_key(struct Scene *scene, struct ID *id); /* Lesser Keyframe Checking API call: * - Used for the buttons to check for keyframes... */ -short fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter); +bool fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter); /* Main Keyframe Checking API call: * Checks whether a keyframe exists for the given ID-block one the given frame. diff --git a/source/blender/editors/include/ED_mask.h b/source/blender/editors/include/ED_mask.h index 3f8d571b239..d8fe14282e3 100644 --- a/source/blender/editors/include/ED_mask.h +++ b/source/blender/editors/include/ED_mask.h @@ -60,7 +60,7 @@ void ED_mask_draw_region(struct Mask *mask, struct ARegion *ar, const char draw_flag, const char draw_type, const char overlay_mode, const int width_i, const int height_i, const float aspx, const float aspy, - const short do_scale_applied, const short do_draw_cb, + const bool do_scale_applied, const bool do_draw_cb, float stabmat[4][4], const struct bContext *C); @@ -76,7 +76,7 @@ short ED_masklayer_frames_looper(struct MaskLayer *masklay, struct Scene *scene, short (*masklay_shape_cb)(struct MaskLayerShape *, struct Scene *)); void ED_masklayer_make_cfra_list(struct MaskLayer *masklay, ListBase *elems, short onlysel); -short ED_masklayer_frame_select_check(struct MaskLayer *masklay); +bool ED_masklayer_frame_select_check(struct MaskLayer *masklay); void ED_masklayer_frame_select_set(struct MaskLayer *masklay, short mode); void ED_masklayer_frames_select_border(struct MaskLayer *masklay, float min, float max, short select_mode); void ED_mask_select_frames(struct MaskLayer *masklay, short select_mode); diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index 5fe2dd6c96b..f00af1dfede 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -91,9 +91,9 @@ void ED_node_link_insert(struct ScrArea *sa); /* node_edit.c */ void ED_node_set_tree_type(struct SpaceNode *snode, struct bNodeTreeType *typeinfo); -int ED_node_is_compositor(struct SpaceNode *snode); -int ED_node_is_shader(struct SpaceNode *snode); -int ED_node_is_texture(struct SpaceNode *snode); +bool ED_node_is_compositor(struct SpaceNode *snode); +bool ED_node_is_shader(struct SpaceNode *snode); +bool ED_node_is_texture(struct SpaceNode *snode); void ED_node_shader_default(const struct bContext *C, struct ID *id); void ED_node_composit_default(const struct bContext *C, struct Scene *scene); diff --git a/source/blender/editors/include/ED_sequencer.h b/source/blender/editors/include/ED_sequencer.h index 21477a72014..4e9d67df61e 100644 --- a/source/blender/editors/include/ED_sequencer.h +++ b/source/blender/editors/include/ED_sequencer.h @@ -34,11 +34,11 @@ struct SpaceSeq; void ED_sequencer_select_sequence_single(struct Scene *scene, struct Sequence *seq, bool deselect_all); void ED_sequencer_deselect_all(struct Scene *scene); -int ED_space_sequencer_maskedit_mask_poll(struct bContext *C); -int ED_space_sequencer_check_show_maskedit(struct SpaceSeq *sseq, struct Scene *scene); -int ED_space_sequencer_maskedit_poll(struct bContext *C); +int ED_space_sequencer_maskedit_mask_poll(struct bContext *C); +bool ED_space_sequencer_check_show_maskedit(struct SpaceSeq *sseq, struct Scene *scene); +int ED_space_sequencer_maskedit_poll(struct bContext *C); -int ED_space_sequencer_check_show_imbuf(struct SpaceSeq *sseq); +bool ED_space_sequencer_check_show_imbuf(struct SpaceSeq *sseq); void ED_operatormacros_sequencer(void); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index e98a04fea37..6317cb83a3a 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1749,7 +1749,7 @@ void ui_convert_to_unit_alt_name(uiBut *but, char *str, size_t maxlen) static void ui_get_but_string_unit(uiBut *but, char *str, int len_max, double value, bool pad, int float_precision) { UnitSettings *unit = but->block->unit; - int do_split = unit->flag & USER_UNIT_OPT_SPLIT; + int do_split = (unit->flag & USER_UNIT_OPT_SPLIT) != 0; int unit_type = uiButGetUnitType(but); int precision; diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 593f6e1dbe0..9286b589983 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -185,7 +185,8 @@ static int reset_default_button_exec(bContext *C, wmOperator *op) { PointerRNA ptr; PropertyRNA *prop; - int index, all = RNA_boolean_get(op->ptr, "all"); + int index; + const bool all = RNA_boolean_get(op->ptr, "all"); /* try to reset the nominated setting to its default value */ uiContextActiveProperty(C, &ptr, &prop, &index); @@ -333,7 +334,8 @@ static int copy_to_selected_button_exec(bContext *C, wmOperator *op) PointerRNA ptr, lptr, idptr; PropertyRNA *prop, *lprop; int success = 0; - int index, all = RNA_boolean_get(op->ptr, "all"); + int index; + const bool all = RNA_boolean_get(op->ptr, "all"); /* try to reset the nominated setting to its default value */ uiContextActiveProperty(C, &ptr, &prop, &index); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 2fb0b6b7e06..c2076f90a71 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -303,8 +303,8 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) break; case UI_ID_ALONE: if (id) { - const int do_scene_obj = (GS(id->name) == ID_OB) && - (template->ptr.type == &RNA_SceneObjects); + const bool do_scene_obj = (GS(id->name) == ID_OB) && + (template->ptr.type == &RNA_SceneObjects); /* make copy */ if (do_scene_obj) { diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index dfd6a9fb48f..a332e5bbcd7 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -743,8 +743,8 @@ static void VIEW2D_OT_zoom_in(wmOperatorType *ot) static int view_zoomout_exec(bContext *C, wmOperator *op) { ScrArea *sa = CTX_wm_area(C); - short do_zoom_x = true; - short do_zoom_y = true; + bool do_zoom_x = true; + bool do_zoom_y = true; /* check that there's an active region, as View2D data resides there */ if (!view_zoom_poll(C)) diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index d2704923de1..7fa41c361bb 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -408,9 +408,9 @@ static int add_vertex_extrude(const bContext *C, Mask *mask, MaskLayer *masklay, int point_index; float tangent_point[2]; float tangent_co[2]; - int do_cyclic_correct = FALSE; - int do_recalc_src = FALSE; /* when extruding from endpoints only */ - int do_prev; /* use prev point rather then next?? */ + bool do_cyclic_correct = false; + bool do_recalc_src = false; /* when extruding from endpoints only */ + bool do_prev; /* use prev point rather then next?? */ if (!masklay) { return FALSE; @@ -584,8 +584,8 @@ static int add_vertex_exec(bContext *C, wmOperator *op) MaskSpline *spline = masklay->act_spline; MaskSplinePoint *point = masklay->act_point; - int is_sta = (point == spline->points); - int is_end = (point == &spline->points[spline->tot_point - 1]); + const bool is_sta = (point == spline->points); + const bool is_end = (point == &spline->points[spline->tot_point - 1]); /* then check are we overlapping the mouse */ if ((is_sta || is_end) && equals_v2v2(co, point->bezt.vec[1])) { diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 4cf4cd1ddba..24fcbd19fc1 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -56,7 +56,7 @@ #include "mask_intern.h" /* own include */ -static void mask_spline_color_get(MaskLayer *masklay, MaskSpline *spline, const int is_sel, +static void mask_spline_color_get(MaskLayer *masklay, MaskSpline *spline, const bool is_sel, unsigned char r_rgb[4]) { if (is_sel) { @@ -76,7 +76,7 @@ static void mask_spline_color_get(MaskLayer *masklay, MaskSpline *spline, const r_rgb[3] = 255; } -static void mask_spline_feather_color_get(MaskLayer *UNUSED(masklay), MaskSpline *UNUSED(spline), const int is_sel, +static void mask_spline_feather_color_get(MaskLayer *UNUSED(masklay), MaskSpline *UNUSED(spline), const bool is_sel, unsigned char r_rgb[4]) { if (is_sel) { @@ -136,7 +136,7 @@ static void mask_point_undistort_pos(SpaceClip *sc, float r_co[2], const float c static void draw_spline_points(const bContext *C, MaskLayer *masklay, MaskSpline *spline, const char UNUSED(draw_flag), const char draw_type) { - const int is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0; + const bool is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0; unsigned char rgb_spline[4]; MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); SpaceClip *sc = CTX_wm_space_clip(C); @@ -212,7 +212,7 @@ static void draw_spline_points(const bContext *C, MaskLayer *masklay, MaskSpline float handle[2]; float vert[2]; - int has_handle = BKE_mask_point_has_handle(point); + const bool has_handle = BKE_mask_point_has_handle(point); copy_v2_v2(vert, bezt->vec[1]); BKE_mask_point_handle(point_deform, handle); @@ -295,7 +295,7 @@ static void mask_color_active_tint(unsigned char r_rgb[4], const unsigned char r } static void mask_draw_curve_type(const bContext *C, MaskSpline *spline, float (*orig_points)[2], int tot_point, - const short is_feather, const short is_smooth, const short is_active, + const bool is_feather, const bool is_smooth, const bool is_active, const unsigned char rgb_spline[4], const char draw_type) { const int draw_method = (spline->flag & MASK_SPLINE_CYCLIC) ? GL_LINE_LOOP : GL_LINE_STRIP; @@ -407,7 +407,7 @@ static void mask_draw_curve_type(const bContext *C, MaskSpline *spline, float (* static void draw_spline_curve(const bContext *C, MaskLayer *masklay, MaskSpline *spline, const char draw_flag, const char draw_type, - const short is_active, + const bool is_active, int width, int height) { const unsigned int resol = max_ii(BKE_mask_spline_feather_resolution(spline, width, height), @@ -415,9 +415,9 @@ static void draw_spline_curve(const bContext *C, MaskLayer *masklay, MaskSpline unsigned char rgb_tmp[4]; - const short is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0; - const short is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH); - const short is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0; + const bool is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0; + const bool is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH) != 0; + const bool is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0; unsigned int tot_diff_point; float (*diff_points)[2]; @@ -489,7 +489,7 @@ static void draw_masklays(const bContext *C, Mask *mask, const char draw_flag, c for (masklay = mask->masklayers.first, i = 0; masklay; masklay = masklay->next, i++) { MaskSpline *spline; - const short is_active = (i == mask->masklay_act); + const bool is_active = (i == mask->masklay_act); if (masklay->restrictflag & MASK_RESTRICT_VIEW) { continue; @@ -623,7 +623,7 @@ void ED_mask_draw_region(Mask *mask, ARegion *ar, const char draw_flag, const char draw_type, const char overlay_mode, const int width_i, const int height_i, /* convert directly into aspect corrected vars */ const float aspx, const float aspy, - const short do_scale_applied, const short do_draw_cb, + const bool do_scale_applied, const bool do_draw_cb, float stabmat[4][4], /* optional - only used by clip */ const bContext *C /* optional - only used when do_post_draw is set or called from clip editor */ ) diff --git a/source/blender/editors/mask/mask_editaction.c b/source/blender/editors/mask/mask_editaction.c index 20d49e89771..d4ac0338456 100644 --- a/source/blender/editors/mask/mask_editaction.c +++ b/source/blender/editors/mask/mask_editaction.c @@ -110,7 +110,7 @@ void ED_masklayer_make_cfra_list(MaskLayer *masklay, ListBase *elems, short only /* Selection Tools */ /* check if one of the frames in this layer is selected */ -short ED_masklayer_frame_select_check(MaskLayer *masklay) +bool ED_masklayer_frame_select_check(MaskLayer *masklay) { MaskLayerShape *masklay_shape; diff --git a/source/blender/editors/mask/mask_intern.h b/source/blender/editors/mask/mask_intern.h index a666daaafde..62872e72cb4 100644 --- a/source/blender/editors/mask/mask_intern.h +++ b/source/blender/editors/mask/mask_intern.h @@ -73,7 +73,7 @@ bool ED_mask_feather_find_nearest( struct MaskSplinePoint *ED_mask_point_find_nearest( const struct bContext *C, struct Mask *mask, const float normal_co[2], const float threshold, - struct MaskLayer **masklay_r, struct MaskSpline **spline_r, int *is_handle_r, + struct MaskLayer **masklay_r, struct MaskSpline **spline_r, bool *is_handle_r, float *score); void MASK_OT_layer_move(struct wmOperatorType *ot); diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index 13ae17c6efd..2f7ffd92f90 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -60,7 +60,7 @@ /******************** utility functions *********************/ MaskSplinePoint *ED_mask_point_find_nearest(const bContext *C, Mask *mask, const float normal_co[2], const float threshold, - MaskLayer **masklay_r, MaskSpline **spline_r, int *is_handle_r, + MaskLayer **masklay_r, MaskSpline **spline_r, bool *is_handle_r, float *score) { ScrArea *sa = CTX_wm_area(C); @@ -471,8 +471,9 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, const wmEvent * MaskSpline *spline, *cv_spline, *feather_spline; MaskSplinePoint *point, *cv_point, *feather_point; MaskSplinePointUW *uw = NULL; - int is_handle = FALSE, width, height, action = SLIDE_ACTION_NONE; - int slide_feather = RNA_boolean_get(op->ptr, "slide_feather"); + int width, height, action = SLIDE_ACTION_NONE; + bool is_handle = false; + const bool slide_feather = RNA_boolean_get(op->ptr, "slide_feather"); float co[2], cv_score, feather_score; const float threshold = 19; diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index 497aea27b26..16fd8414f22 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -256,7 +256,7 @@ static int select_exec(bContext *C, wmOperator *op) bool deselect = RNA_boolean_get(op->ptr, "deselect"); bool toggle = RNA_boolean_get(op->ptr, "toggle"); - int is_handle = 0; + bool is_handle = 0; const float threshold = 19; RNA_float_get_array(op->ptr, "location", co); @@ -703,7 +703,7 @@ static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE float co[2]; int do_select = !RNA_boolean_get(op->ptr, "deselect"); - int is_handle = 0; + bool is_handle = false; const float threshold = 19; bool changed = false; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 616553169c8..dbb15525dfe 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -4950,7 +4950,7 @@ static int edbm_mark_freestyle_edge_exec(bContext *C, wmOperator *op) BMEdge *eed; BMIter iter; FreestyleEdge *fed; - int clear = RNA_boolean_get(op->ptr, "clear"); + const bool clear = RNA_boolean_get(op->ptr, "clear"); if (em == NULL) return OPERATOR_FINISHED; @@ -5012,7 +5012,7 @@ static int edbm_mark_freestyle_face_exec(bContext *C, wmOperator *op) BMFace *efa; BMIter iter; FreestyleFace *ffa; - int clear = RNA_boolean_get(op->ptr, "clear"); + const bool clear = RNA_boolean_get(op->ptr, "clear"); if (em == NULL) return OPERATOR_FINISHED; diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 924e88babf1..025a7358d97 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -2092,7 +2092,7 @@ static int duplicate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - int linked = RNA_boolean_get(op->ptr, "linked"); + const bool linked = RNA_boolean_get(op->ptr, "linked"); int dupflag = (linked) ? 0 : U.dupflag; BKE_main_id_clear_newpoins(bmain); @@ -2161,7 +2161,7 @@ static int add_named_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); Base *basen, *base; Object *ob; - int linked = RNA_boolean_get(op->ptr, "linked"); + const bool linked = RNA_boolean_get(op->ptr, "linked"); int dupflag = (linked) ? 0 : U.dupflag; char name[MAX_ID_NAME - 2]; diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index b8a96bba874..0a4bbf10bf0 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -770,7 +770,7 @@ static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), const return OPERATOR_PASS_THROUGH; } -static int is_multires_bake(Scene *scene) +static bool is_multires_bake(Scene *scene) { if (ELEM4(scene->r.bake_mode, RE_BAKE_NORMALS, RE_BAKE_DISPLACEMENT, RE_BAKE_DERIVATIVE, RE_BAKE_AO)) return scene->r.bake_flag & R_BAKE_MULTIRES; diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 244bd5c1d71..3d055e7485f 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1613,7 +1613,7 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o } /* used by add constraint operators to add the constraint required */ -static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase *list, int type, short setTarget) +static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase *list, int type, const bool setTarget) { Main *bmain = CTX_data_main(C); bPoseChannel *pchan; @@ -1907,7 +1907,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED static int pose_ik_add_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); - int with_targets = RNA_boolean_get(op->ptr, "with_targets"); + const bool with_targets = RNA_boolean_get(op->ptr, "with_targets"); /* add the constraint - all necessary checks should have been done by the invoke() callback already... */ return constraint_add_exec(C, op, ob, get_active_constraints(ob), CONSTRAINT_TYPE_KINEMATIC, with_targets); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index bccbb5a23b3..c76b866bf2d 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1610,7 +1610,7 @@ static int object_mode_set_exec(bContext *C, wmOperator *op) Object *ob = CTX_data_active_object(C); ObjectMode mode = RNA_enum_get(op->ptr, "mode"); ObjectMode restore_mode = (ob) ? ob->mode : OB_MODE_OBJECT; - int toggle = RNA_boolean_get(op->ptr, "toggle"); + const bool toggle = RNA_boolean_get(op->ptr, "toggle"); if (!ob || !object_mode_compat_test(ob, mode)) return OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 50d708bb49e..cd99fd34aac 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1289,7 +1289,7 @@ static int multires_external_save_exec(bContext *C, wmOperator *op) Object *ob = ED_object_active_context(C); Mesh *me = (ob) ? ob->data : op->customdata; char path[FILE_MAX]; - int relative = RNA_boolean_get(op->ptr, "relative_path"); + const bool relative = RNA_boolean_get(op->ptr, "relative_path"); if (!me) return OPERATOR_CANCELLED; @@ -2097,7 +2097,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op) OceanCache *och; struct Ocean *ocean; int f, cfra, i = 0; - int free = RNA_boolean_get(op->ptr, "free"); + const bool free = RNA_boolean_get(op->ptr, "free"); wmJob *wm_job; OceanBakeJob *oj; diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 57cd464b7ad..3df4f721f7a 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -75,7 +75,7 @@ /*********************** add shape key ***********************/ -static void ED_object_shape_key_add(bContext *C, Scene *scene, Object *ob, int from_mix) +static void ED_object_shape_key_add(bContext *C, Scene *scene, Object *ob, const bool from_mix) { KeyBlock *kb; if ((kb = BKE_object_insert_shape_key(scene, ob, NULL, from_mix))) { @@ -312,7 +312,7 @@ static int shape_key_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *ob = ED_object_context(C); - int from_mix = RNA_boolean_get(op->ptr, "from_mix"); + const bool from_mix = RNA_boolean_get(op->ptr, "from_mix"); ED_object_shape_key_add(C, scene, ob, from_mix); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index d40d239319c..dbb4837b009 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -794,7 +794,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) Object *ob = ctx_ob->ptr.data; if ((ob->flag & OB_DONE) == 0) { - int do_inverse_offset = FALSE; + bool do_inverse_offset = false; ob->flag |= OB_DONE; if (centermode == ORIGIN_TO_CURSOR) { diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index bebc46d1242..8090cf4fefd 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -588,7 +588,7 @@ static int disconnect_hair_exec(bContext *C, wmOperator *op) Object *ob= ED_object_context(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= NULL; - int all = RNA_boolean_get(op->ptr, "all"); + const bool all = RNA_boolean_get(op->ptr, "all"); if (!ob) return OPERATOR_CANCELLED; @@ -739,7 +739,7 @@ static int connect_hair_exec(bContext *C, wmOperator *op) Object *ob= ED_object_context(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= NULL; - int all = RNA_boolean_get(op->ptr, "all"); + const bool all = RNA_boolean_get(op->ptr, "all"); int any_connected = FALSE; if (!ob) diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 3ef3ff8f366..a254cd01c30 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -196,7 +196,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender) rctf viewplane; float clipsta, clipend; - int is_ortho = ED_view3d_viewplane_get(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend, NULL); + bool is_ortho = ED_view3d_viewplane_get(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend, NULL); if (is_ortho) orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend); else perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend); } @@ -521,7 +521,7 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) int ok = 0; const short view_context = (oglrender->v3d != NULL); Object *camera = NULL; - int is_movie; + bool is_movie; /* go to next frame */ if (CFRA < oglrender->nfra) @@ -665,7 +665,7 @@ finally: /* Step the frame and bail early if needed */ static int screen_opengl_render_modal(bContext *C, wmOperator *op, const wmEvent *event) { OGLRender *oglrender = op->customdata; - int anim = RNA_boolean_get(op->ptr, "animation"); + const bool anim = RNA_boolean_get(op->ptr, "animation"); bool ret; switch (event->type) { @@ -706,7 +706,7 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, const wmEvent static int screen_opengl_render_invoke(bContext *C, wmOperator *op, const wmEvent *event) { OGLRender *oglrender; - int anim = RNA_boolean_get(op->ptr, "animation"); + const bool anim = RNA_boolean_get(op->ptr, "animation"); if (!screen_opengl_render_init(C, op)) return OPERATOR_CANCELLED; @@ -731,7 +731,7 @@ static int screen_opengl_render_invoke(bContext *C, wmOperator *op, const wmEven /* executes blocking render */ static int screen_opengl_render_exec(bContext *C, wmOperator *op) { - const short is_animation = RNA_boolean_get(op->ptr, "animation"); + const bool is_animation = RNA_boolean_get(op->ptr, "animation"); if (!screen_opengl_render_init(C, op)) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index f0507abaf95..482c855f067 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -1035,7 +1035,7 @@ static void icon_preview_startjob_all_sizes(void *customdata, short *stop, short { IconPreview *ip = (IconPreview *)customdata; IconPreviewSize *cur_size = ip->sizes.first; - int use_new_shading = BKE_scene_use_new_shading_nodes(ip->scene); + const bool use_new_shading = BKE_scene_use_new_shading_nodes(ip->scene); while (cur_size) { ShaderPreview *sp = MEM_callocN(sizeof(ShaderPreview), "Icon ShaderPreview"); diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 30337e81890..fa7fd62231b 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -259,7 +259,7 @@ void removenotused_scredges(bScreen *sc) } } -int scredge_is_horizontal(ScrEdge *se) +bool scredge_is_horizontal(ScrEdge *se) { return (se->v1->vec.y == se->v2->vec.y); } diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h index 66677aed68f..8a76c52d985 100644 --- a/source/blender/editors/screen/screen_intern.h +++ b/source/blender/editors/screen/screen_intern.h @@ -52,7 +52,7 @@ void removenotused_scrverts(bScreen *sc); void removedouble_scrverts(bScreen *sc); void removedouble_scredges(bScreen *sc); void removenotused_scredges(bScreen *sc); -int scredge_is_horizontal(ScrEdge *se); +bool scredge_is_horizontal(ScrEdge *se); ScrEdge *screen_find_active_scredge(bScreen *sc, const int winsize_x, const int winsize_y, const int mx, const int my); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index e6273749157..ae1b7cc937f 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2073,8 +2073,8 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) DLRBT_Tree keys; ActKeyColumn *ak; float cfra; - short next = RNA_boolean_get(op->ptr, "next"); - short done = FALSE; + const bool next = RNA_boolean_get(op->ptr, "next"); + bool done = false; /* sanity checks */ if (scene == NULL) @@ -2164,7 +2164,7 @@ static int marker_jump_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); TimeMarker *marker; int closest = CFRA; - short next = RNA_boolean_get(op->ptr, "next"); + const bool next = RNA_boolean_get(op->ptr, "next"); bool found = false; /* find matching marker in the right direction */ diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c index 0eb019afbf7..6542bb2ca9b 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.c +++ b/source/blender/editors/sculpt_paint/paint_hide.c @@ -72,10 +72,10 @@ #include <assert.h> /* return true if the element should be hidden/shown */ -static int is_effected(PartialVisArea area, - float planes[4][4], - const float co[3], - const float mask) +static bool is_effected(PartialVisArea area, + float planes[4][4], + const float co[3], + const float mask) { if (area == PARTIALVIS_ALL) return 1; diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index be2f8727ec4..19f2673d96a 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -653,7 +653,7 @@ static void brush_painter_2d_refresh_cache(ImagePaintState *s, BrushPainter *pai } /* keep these functions in sync */ -static void paint_2d_ibuf_rgb_get(ImBuf *ibuf, int x, int y, const short is_torus, float r_rgb[4]) +static void paint_2d_ibuf_rgb_get(ImBuf *ibuf, int x, int y, const bool is_torus, float r_rgb[4]) { if (is_torus) { x %= ibuf->x; @@ -671,7 +671,7 @@ static void paint_2d_ibuf_rgb_get(ImBuf *ibuf, int x, int y, const short is_toru straight_uchar_to_premul_float(r_rgb, rrgb); } } -static void paint_2d_ibuf_rgb_set(ImBuf *ibuf, int x, int y, const short is_torus, const float rgb[4]) +static void paint_2d_ibuf_rgb_set(ImBuf *ibuf, int x, int y, const bool is_torus, const float rgb[4]) { if (is_torus) { x %= ibuf->x; @@ -715,7 +715,7 @@ static int paint_2d_ibuf_add_if(ImBuf *ibuf, unsigned int x, unsigned int y, flo return 1; } -static void paint_2d_lift_soften(ImBuf *ibuf, ImBuf *ibufb, int *pos, const short is_torus) +static void paint_2d_lift_soften(ImBuf *ibuf, ImBuf *ibufb, int *pos, const bool is_torus) { int x, y, count, xi, yi, xo, yo; int out_off[2], in_off[2], dim[2]; diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 2e8a8a32ce9..d2714639a56 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -234,14 +234,14 @@ typedef struct ProjPaintState { int winx, winy; /* from the carea or from the projection render */ /* options for projection painting */ - int do_layer_clone; - int do_layer_stencil; - int do_layer_stencil_inv; - - short do_occlude; /* Use raytraced occlusion? - ortherwise will paint right through to the back*/ - short do_backfacecull; /* ignore faces with normals pointing away, skips a lot of raycasts if your normals are correctly flipped */ - short do_mask_normal; /* mask out pixels based on their normals */ - short do_new_shading_nodes; /* cache BKE_scene_use_new_shading_nodes value */ + bool do_layer_clone; + bool do_layer_stencil; + bool do_layer_stencil_inv; + + bool do_occlude; /* Use raytraced occlusion? - ortherwise will paint right through to the back*/ + bool do_backfacecull; /* ignore faces with normals pointing away, skips a lot of raycasts if your normals are correctly flipped */ + bool do_mask_normal; /* mask out pixels based on their normals */ + bool do_new_shading_nodes; /* cache BKE_scene_use_new_shading_nodes value */ float normal_angle; /* what angle to mask at*/ float normal_angle_inner; float normal_angle_range; /* difference between normal_angle and normal_angle_inner, for easy access */ @@ -1846,7 +1846,7 @@ static int float_z_sort(const void *p1, const void *p2) } static void project_bucket_clip_face( - const int is_ortho, + const bool is_ortho, rctf *bucket_bounds, float *v1coSS, float *v2coSS, float *v3coSS, float *uv1co, float *uv2co, float *uv3co, @@ -2210,10 +2210,10 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i float uv_clip[8][2]; int uv_clip_tot; - const short is_ortho = ps->is_ortho; - const short is_clone_other = ((ps->brush->imagepaint_tool == PAINT_TOOL_CLONE) && ps->dm_mtface_clone); - const short do_backfacecull = ps->do_backfacecull; - const short do_clip = ps->rv3d ? ps->rv3d->rflag & RV3D_CLIPPING : 0; + const bool is_ortho = ps->is_ortho; + const bool is_clone_other = ((ps->brush->imagepaint_tool == PAINT_TOOL_CLONE) && ps->dm_mtface_clone); + const bool do_backfacecull = ps->do_backfacecull; + const bool do_clip = ps->rv3d ? ps->rv3d->rflag & RV3D_CLIPPING : 0; vCo[0] = ps->dm_mvert[mf->v1].co; vCo[1] = ps->dm_mvert[mf->v2].co; @@ -4244,7 +4244,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int ps->do_new_shading_nodes = BKE_scene_use_new_shading_nodes(scene); /* only cache the value */ if (ps->tool == PAINT_TOOL_CLONE) - ps->do_layer_clone = (settings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_CLONE); + ps->do_layer_clone = (settings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_CLONE) ? 1 : 0; ps->do_layer_stencil = (settings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_STENCIL) ? 1 : 0; ps->do_layer_stencil_inv = (settings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_STENCIL_INV) ? 1 : 0; diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 809e9911e09..ce57b12d0ba 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -313,8 +313,8 @@ static Brush *brush_tool_toggle(Main *bmain, Brush *brush_orig, const int tool, static int brush_generic_tool_set(Main *bmain, Paint *paint, const int tool, const size_t tool_offset, const int ob_mode, - const char *tool_name, int create_missing, - int toggle) + const char *tool_name, const bool create_missing, + const bool toggle) { Brush *brush, *brush_orig = BKE_paint_brush(paint); @@ -350,8 +350,8 @@ static int brush_select_exec(bContext *C, wmOperator *op) ToolSettings *toolsettings = CTX_data_tool_settings(C); Paint *paint = NULL; int tool, paint_mode = RNA_enum_get(op->ptr, "paint_mode"); - int create_missing = RNA_boolean_get(op->ptr, "create_missing"); - int toggle = RNA_boolean_get(op->ptr, "toggle"); + const bool create_missing = RNA_boolean_get(op->ptr, "create_missing"); + const bool toggle = RNA_boolean_get(op->ptr, "toggle"); const char *tool_name = "Brush"; size_t tool_offset; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index d6d13decf4d..a1ce39a4833 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -280,12 +280,13 @@ static void do_shared_vertex_tesscol(Mesh *me, bool *mfacetag) MEM_freeN(scolmain); } -static void do_shared_vertexcol(Mesh *me, bool *mlooptag, bool *mfacetag, int do_tessface) +static void do_shared_vertexcol(Mesh *me, bool *mlooptag, bool *mfacetag, const bool do_tessface) { const int use_face_sel = (me->editflag & ME_EDIT_PAINT_FACE_SEL); MPoly *mp; int (*scol)[4]; - int i, j, has_shared = 0; + int i, j; + bool has_shared = false; /* if no mloopcol: do not do */ /* if mtexpoly: only the involved faces, otherwise all */ @@ -1464,7 +1465,7 @@ static void multipaint_selection(MDeformVert *dvert, const int defbase_tot, floa static float redistribute_change(MDeformVert *ndv, const int defbase_tot, char *change_status, const char change_me, int changeto, float totchange, float total_valid, - char do_auto_normalize) + bool do_auto_normalize) { bool changed; float change; @@ -1523,7 +1524,7 @@ static float get_mp_change(MDeformVert *odv, const int defbase_tot, const bool * static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, const int defbase_tot, const bool *defbase_sel, const bool *lock_flags, const bool *vgroup_validmap, - char do_auto_normalize, char do_multipaint) + bool do_auto_normalize, bool do_multipaint) { float totchange = 0.0f; float totchange_allowed = 0.0f; @@ -1697,9 +1698,9 @@ typedef struct WeightPaintInfo { const bool *vgroup_validmap; /* same as WeightPaintData.vgroup_validmap, * only added here for convenience */ - char do_flip; - char do_multipaint; - char do_auto_normalize; + bool do_flip; + bool do_multipaint; + bool do_auto_normalize; float brush_alpha_value; /* result of BKE_brush_alpha_get() */ } WeightPaintInfo; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 331701cb486..c8645b1f3de 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -995,7 +995,7 @@ typedef struct { } SculptSearchSphereData; /* Test AABB against sphere */ -static int sculpt_search_sphere_cb(PBVHNode *node, void *data_v) +static bool sculpt_search_sphere_cb(PBVHNode *node, void *data_v) { SculptSearchSphereData *data = data_v; float *center = data->ss->cache->location, nearest[3]; @@ -3552,7 +3552,7 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, MultiresModifierData *mmd = sculpt_multires_active(scene, ob); ss->modifiers_active = sculpt_modifiers_active(scene, sd, ob); - ss->show_diffuse_color = sd->flags & SCULPT_SHOW_DIFFUSE; + ss->show_diffuse_color = (sd->flags & SCULPT_SHOW_DIFFUSE) != 0; if (need_mask) { if (mmd == NULL) { diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index 6d5025f1a22..20f78690188 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -500,7 +500,7 @@ static void uv_sculpt_stroke_exit(bContext *C, wmOperator *op) op->customdata = NULL; } -static int uv_element_offset_from_face_get(UvElementMap *map, BMFace *efa, BMLoop *l, int island_index, int doIslands) +static int uv_element_offset_from_face_get(UvElementMap *map, BMFace *efa, BMLoop *l, int island_index, const bool doIslands) { UvElement *element = BM_uv_element_get(map, efa, l); if (!element || (doIslands && element->island != island_index)) { @@ -555,7 +555,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm GHash *edgeHash; GHashIterator *ghi; - int do_island_optimization = !(ts->uv_sculpt_settings & UV_SCULPT_ALL_ISLANDS); + bool do_island_optimization = !(ts->uv_sculpt_settings & UV_SCULPT_ALL_ISLANDS); int island_index = 0; /* Holds, for each UvElement in elementMap, a pointer to its unique uv.*/ int *uniqueUv; diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 45f00462147..1ff8bac67d2 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -307,7 +307,7 @@ static int delete_marker_exec(bContext *C, wmOperator *UNUSED(op)) MovieTrackingTrack *track = tracksbase->first, *next; MovieTrackingPlaneTrack *plane_track, *plane_track_next; int framenr = ED_space_clip_get_clip_frame_number(sc); - int has_selection = 0; + bool has_selection = false; bool changed = false; while (track) { @@ -1335,8 +1335,8 @@ static int track_markers_exec(bContext *C, wmOperator *op) struct MovieTrackingContext *context; MovieClipUser *user, fake_user = {0}; int framenr, sfra, efra; - int backwards = RNA_boolean_get(op->ptr, "backwards"); - int sequence = RNA_boolean_get(op->ptr, "sequence"); + const bool backwards = RNA_boolean_get(op->ptr, "backwards"); + const bool sequence = RNA_boolean_get(op->ptr, "sequence"); int frames_limit; if (RNA_struct_property_is_set(op->ptr, "clip")) { @@ -1846,7 +1846,7 @@ static int clear_track_path_exec(bContext *C, wmOperator *op) MovieTrackingTrack *track; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); int action = RNA_enum_get(op->ptr, "action"); - int clear_active = RNA_boolean_get(op->ptr, "clear_active"); + const bool clear_active = RNA_boolean_get(op->ptr, "clear_active"); int framenr = ED_space_clip_get_clip_frame_number(sc); if (clear_active) { @@ -2186,7 +2186,7 @@ static void set_axis(Scene *scene, Object *ob, MovieClip *clip, MovieTrackingOb MovieTrackingTrack *track, char axis) { Object *camera = get_camera_with_movieclip(scene, clip); - int is_camera = tracking_object->flag & TRACKING_OBJECT_CAMERA; + const bool is_camera = (tracking_object->flag & TRACKING_OBJECT_CAMERA) != 0; bool flip = false; float mat[4][4], vec[3], obmat[4][4], dvec[3]; diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 3b1af1acdf8..36144a074e3 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -668,8 +668,8 @@ static int console_clear_exec(bContext *C, wmOperator *op) SpaceConsole *sc = CTX_wm_space_console(C); ARegion *ar = CTX_wm_region(C); - short scrollback = RNA_boolean_get(op->ptr, "scrollback"); - short history = RNA_boolean_get(op->ptr, "history"); + const bool scrollback = RNA_boolean_get(op->ptr, "scrollback"); + const bool history = RNA_boolean_get(op->ptr, "history"); /*ConsoleLine *ci = */ console_history_verify(C); @@ -715,7 +715,7 @@ static int console_history_cycle_exec(bContext *C, wmOperator *op) ARegion *ar = CTX_wm_region(C); ConsoleLine *ci = console_history_verify(C); /* TODO - stupid, just prevents crashes when no command line */ - short reverse = RNA_boolean_get(op->ptr, "reverse"); /* assumes down, reverse is up */ + const bool reverse = RNA_boolean_get(op->ptr, "reverse"); /* assumes down, reverse is up */ int prev_len = ci->len; /* keep a copy of the line above so when history is cycled @@ -783,7 +783,7 @@ static int console_history_append_exec(bContext *C, wmOperator *op) ConsoleLine *ci = console_history_verify(C); char *str = RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, don't free */ int cursor = RNA_int_get(op->ptr, "current_character"); - short rem_dupes = RNA_boolean_get(op->ptr, "remove_duplicates"); + const bool rem_dupes = RNA_boolean_get(op->ptr, "remove_duplicates"); int prev_len = ci->len; if (rem_dupes) { diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 841cb0d5f77..7147353b3f1 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -53,7 +53,7 @@ void file_calc_previews(const bContext *C, ARegion *ar); void file_draw_list(const bContext *C, ARegion *ar); void file_draw_check_cb(bContext *C, void *arg1, void *arg2); -int file_draw_check_exists(SpaceFile *sfile); +bool file_draw_check_exists(SpaceFile *sfile); /* file_ops.h */ struct wmOperatorType; diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 523383a8955..94f6174de65 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -765,7 +765,7 @@ void file_draw_check_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) } } -int file_draw_check_exists(SpaceFile *sfile) +bool file_draw_check_exists(SpaceFile *sfile) { if (sfile->op) { /* fails on reload */ if (RNA_struct_find_property(sfile->op->ptr, "check_existing")) { diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 79b6a13b459..249ab3ef2c1 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -990,7 +990,7 @@ void filelist_select(struct FileList *filelist, FileSelection *sel, FileSelType } } -int filelist_is_selected(struct FileList *filelist, int index, FileCheckType check) +bool filelist_is_selected(struct FileList *filelist, int index, FileCheckType check) { struct direntry *file = filelist_file(filelist, index); if (!file) { @@ -1003,7 +1003,7 @@ int filelist_is_selected(struct FileList *filelist, int index, FileCheckType che return S_ISREG(file->type) && (file->selflag & SELECTED_FILE); case CHECK_ALL: default: - return (file->selflag & SELECTED_FILE); + return (file->selflag & SELECTED_FILE) != 0; } } @@ -1028,7 +1028,7 @@ void filelist_sort(struct FileList *filelist, short sort) } -int filelist_islibrary(struct FileList *filelist, char *dir, char *group) +bool filelist_islibrary(struct FileList *filelist, char *dir, char *group) { return BLO_is_a_library(filelist->dir, dir, group); } diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index eb99b0d21ab..c37bb882168 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -72,7 +72,7 @@ void filelist_setdir(struct FileList *filelist, const char *dir); struct direntry * filelist_file(struct FileList *filelist, int index); void filelist_select(struct FileList *filelist, FileSelection *sel, FileSelType select, unsigned int flag, FileCheckType check); void filelist_select_file(struct FileList *filelist, int index, FileSelType select, unsigned int flag, FileCheckType check); -int filelist_is_selected(struct FileList *filelist, int index, FileCheckType check); +bool filelist_is_selected(struct FileList *filelist, int index, FileCheckType check); void filelist_hidedot(struct FileList *filelist, short hide); void filelist_setfilter(struct FileList *filelist, unsigned int filter); void filelist_setfilter_types(struct FileList *filelist, const char *filter_glob); @@ -87,7 +87,7 @@ int filelist_empty(struct FileList *filelist); void filelist_parent(struct FileList *filelist); struct BlendHandle *filelist_lib(struct FileList *filelist); -int filelist_islibrary(struct FileList *filelist, char *dir, char *group); +bool filelist_islibrary(struct FileList *filelist, char *dir, char *group); void filelist_from_main(struct FileList *filelist); void filelist_from_library(struct FileList *filelist); void filelist_freelib(struct FileList *filelist); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 120e6f52d95..e075ea09a59 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -657,7 +657,7 @@ static int image_view_all_exec(bContext *C, wmOperator *op) ARegion *ar; float aspx, aspy, zoomx, zoomy, w, h; int width, height; - int fit_view = RNA_boolean_get(op->ptr, "fit_view"); + const bool fit_view = RNA_boolean_get(op->ptr, "fit_view"); /* retrieve state */ sima = CTX_wm_space_image(C); @@ -2118,7 +2118,7 @@ void IMAGE_OT_invert(wmOperatorType *ot) static bool image_pack_test(bContext *C, wmOperator *op) { Image *ima = CTX_data_edit_image(C); - int as_png = RNA_boolean_get(op->ptr, "as_png"); + const bool as_png = RNA_boolean_get(op->ptr, "as_png"); if (!ima) return 0; @@ -2138,7 +2138,7 @@ static int image_pack_exec(bContext *C, wmOperator *op) struct Main *bmain = CTX_data_main(C); Image *ima = CTX_data_edit_image(C); ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL); - int as_png = RNA_boolean_get(op->ptr, "as_png"); + const bool as_png = RNA_boolean_get(op->ptr, "as_png"); if (!image_pack_test(C, op)) return OPERATOR_CANCELLED; @@ -2166,7 +2166,7 @@ static int image_pack_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED( ImBuf *ibuf; uiPopupMenu *pup; uiLayout *layout; - int as_png = RNA_boolean_get(op->ptr, "as_png"); + const bool as_png = RNA_boolean_get(op->ptr, "as_png"); if (!image_pack_test(C, op)) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index c9a86547984..9f83bc80314 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -641,7 +641,7 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View short indent = 0, offset = 0, sel = 0, group = 0; int special = -1; char name[128]; - short do_draw = FALSE; + bool do_draw = false; /* determine what needs to be drawn */ switch (ale->type) { diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 7347b446bce..37efd52f246 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1587,7 +1587,7 @@ static int nlaedit_sync_actlen_exec(bContext *C, wmOperator *op) ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - short active_only = RNA_boolean_get(op->ptr, "active"); + const bool active_only = RNA_boolean_get(op->ptr, "active"); /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -2004,7 +2004,7 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) FModifier *fcm; int type = RNA_enum_get(op->ptr, "type"); - short onlyActive = RNA_boolean_get(op->ptr, "only_active"); + const bool active_only = RNA_boolean_get(op->ptr, "only_active"); /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -2021,7 +2021,7 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) for (strip = nlt->strips.first; strip; strip = strip->next) { /* can F-Modifier be added to the current strip? */ - if (onlyActive) { + if (active_only) { /* if not active, cannot add since we're only adding to active strip */ if ((strip->flag & NLASTRIP_FLAG_ACTIVE) == 0) continue; diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 2ad2418fc77..dedd6404a2c 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -141,7 +141,7 @@ void NLA_OT_selected_objects_add(wmOperatorType *ot); int nlaop_poll_tweakmode_off(bContext *C); int nlaop_poll_tweakmode_on(bContext *C); -short nlaedit_is_tweakmode_on(bAnimContext *ac); +bool nlaedit_is_tweakmode_on(bAnimContext *ac); /* --- */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index aa3224507bc..149690e10f7 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -101,10 +101,10 @@ int nlaop_poll_tweakmode_on(bContext *C) } /* is tweakmode enabled - for use in NLA operator code */ -short nlaedit_is_tweakmode_on(bAnimContext *ac) +bool nlaedit_is_tweakmode_on(bAnimContext *ac) { if (ac && ac->scene) - return (ac->scene->flag & SCE_NLA_EDIT_ON); + return (ac->scene->flag & SCE_NLA_EDIT_ON) != 0; return 0; } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 5f133aea2bb..b3d29c7bbdd 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3202,7 +3202,7 @@ int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, floa #define LINK_ARROW 12 /* position of arrow on the link, LINK_RESOL/2 */ #define ARROW_SIZE 7 void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, - int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3) + int th_col1, bool do_shaded, int th_col2, bool do_triple, int th_col3) { float coord_array[LINK_RESOL + 1][2]; @@ -3388,8 +3388,9 @@ void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, /* note; this is used for fake links in groups too */ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) { - int do_shaded = FALSE, th_col1 = TH_HEADER, th_col2 = TH_HEADER; - int do_triple = FALSE, th_col3 = TH_WIRE; + bool do_shaded = false; + bool do_triple = false; + int th_col1 = TH_HEADER, th_col2 = TH_HEADER, th_col3 = TH_WIRE; if (link->fromsock == NULL && link->tosock == NULL) return; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 360b394d406..7a12ed9ef08 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -364,17 +364,17 @@ void ED_node_set_tree_type(SpaceNode *snode, bNodeTreeType *typeinfo) snode->tree_idname[0] = '\0'; } -int ED_node_is_compositor(struct SpaceNode *snode) +bool ED_node_is_compositor(struct SpaceNode *snode) { return STREQ(snode->tree_idname, ntreeType_Composite->idname); } -int ED_node_is_shader(struct SpaceNode *snode) +bool ED_node_is_shader(struct SpaceNode *snode) { return STREQ(snode->tree_idname, ntreeType_Shader->idname); } -int ED_node_is_texture(struct SpaceNode *snode) +bool ED_node_is_texture(struct SpaceNode *snode) { return STREQ(snode->tree_idname, ntreeType_Texture->idname); } @@ -1130,7 +1130,7 @@ static int node_duplicate_exec(bContext *C, wmOperator *op) bNodeTree *ntree = snode->edittree; bNode *node, *newnode, *lastnode; bNodeLink *link, *newlink, *lastlink; - int keep_inputs = RNA_boolean_get(op->ptr, "keep_inputs"); + const bool keep_inputs = RNA_boolean_get(op->ptr, "keep_inputs"); ED_preview_kill_jobs(C); diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c index 1ecedf32499..20e6900a268 100644 --- a/source/blender/editors/space_node/node_group.c +++ b/source/blender/editors/space_node/node_group.c @@ -145,7 +145,7 @@ static int node_group_edit_exec(bContext *C, wmOperator *op) SpaceNode *snode = CTX_wm_space_node(C); const char *node_idname = group_node_idname(C); bNode *gnode; - int exit = RNA_boolean_get(op->ptr, "exit"); + const bool exit = RNA_boolean_get(op->ptr, "exit"); ED_preview_kill_jobs(C); diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index f598a13bea9..fa20aeb8624 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -104,9 +104,9 @@ void node_keymap(struct wmKeyConfig *keyconf); /* node_select.c */ void node_deselect_all(struct SpaceNode *snode); void node_socket_select(struct bNode *node, struct bNodeSocket *sock); -void node_socket_deselect(struct bNode *node, struct bNodeSocket *sock, int deselect_node); -void node_deselect_all_input_sockets(struct SpaceNode *snode, int deselect_nodes); -void node_deselect_all_output_sockets(struct SpaceNode *snode, int deselect_nodes); +void node_socket_deselect(struct bNode *node, struct bNodeSocket *sock, const bool deselect_node); +void node_deselect_all_input_sockets(struct SpaceNode *snode, const bool deselect_nodes); +void node_deselect_all_output_sockets(struct SpaceNode *snode, const bool deselect_nodes); int node_select_same_type(struct SpaceNode *snode); int node_select_same_type_np(struct SpaceNode *snode, int dir); void node_select_single(struct bContext *C, struct bNode *node); @@ -136,7 +136,7 @@ void NODE_OT_backimage_sample(struct wmOperatorType *ot); /* drawnode.c */ void node_draw_link(struct View2D *v2d, struct SpaceNode *snode, struct bNodeLink *link); -void node_draw_link_bezier(struct View2D *v2d, struct SpaceNode *snode, struct bNodeLink *link, int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3); +void node_draw_link_bezier(struct View2D *v2d, struct SpaceNode *snode, struct bNodeLink *link, int th_col1, bool do_shaded, int th_col2, bool do_triple, int th_col3); int node_link_bezier_points(struct View2D *v2d, struct SpaceNode *snode, struct bNodeLink *link, float coord_array[][2], int resol); // void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3 ); void draw_nodespace_back_pix(const struct bContext *C, struct ARegion *ar, struct SpaceNode *snode, bNodeInstanceKey parent_key); diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c index b50066560fb..4f9af022639 100644 --- a/source/blender/editors/space_node/node_relationships.c +++ b/source/blender/editors/space_node/node_relationships.c @@ -78,7 +78,7 @@ static int sort_nodes_locx(void *a, void *b) return 0; } -static int socket_is_available(bNodeTree *UNUSED(ntree), bNodeSocket *sock, int allow_used) +static int socket_is_available(bNodeTree *UNUSED(ntree), bNodeSocket *sock, const bool allow_used) { if (nodeSocketIsHidden(sock)) return 0; @@ -89,7 +89,7 @@ static int socket_is_available(bNodeTree *UNUSED(ntree), bNodeSocket *sock, int return 1; } -static bNodeSocket *best_socket_output(bNodeTree *ntree, bNode *node, bNodeSocket *sock_target, int allow_multiple) +static bNodeSocket *best_socket_output(bNodeTree *ntree, bNode *node, bNodeSocket *sock_target, const bool allow_multiple) { bNodeSocket *sock; @@ -184,7 +184,7 @@ static int snode_autoconnect_input(SpaceNode *snode, bNode *node_fr, bNodeSocket return 1; } -static void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace) +static void snode_autoconnect(SpaceNode *snode, const bool allow_multiple, const bool replace) { bNodeTree *ntree = snode->edittree; ListBase *nodelist = MEM_callocN(sizeof(ListBase), "items_list"); @@ -545,7 +545,7 @@ static int node_link_modal(bContext *C, wmOperator *op, const wmEvent *event) } /* return 1 when socket clicked */ -static bNodeLinkDrag *node_link_init(SpaceNode *snode, float cursor[2], int detach) +static bNodeLinkDrag *node_link_init(SpaceNode *snode, float cursor[2], const bool detach) { bNode *node; bNodeSocket *sock; @@ -641,7 +641,7 @@ static int node_link_invoke(bContext *C, wmOperator *op, const wmEvent *event) bNodeLinkDrag *nldrag; float cursor[2]; - int detach = RNA_boolean_get(op->ptr, "detach"); + const bool detach = RNA_boolean_get(op->ptr, "detach"); UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &cursor[0], &cursor[1]); @@ -700,7 +700,7 @@ void NODE_OT_link(wmOperatorType *ot) static int node_make_link_exec(bContext *C, wmOperator *op) { SpaceNode *snode = CTX_wm_space_node(C); - int replace = RNA_boolean_get(op->ptr, "replace"); + const bool replace = RNA_boolean_get(op->ptr, "replace"); ED_preview_kill_jobs(C); diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index de0665e13b1..89f07950fe9 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -101,12 +101,12 @@ void node_socket_select(bNode *node, bNodeSocket *sock) node->flag |= SELECT; } -void node_socket_deselect(bNode *node, bNodeSocket *sock, int deselect_node) +void node_socket_deselect(bNode *node, bNodeSocket *sock, const bool deselect_node) { sock->flag &= ~SELECT; if (node && deselect_node) { - int sel = 0; + bool sel = 0; /* if no selected sockets remain, also deselect the node */ for (sock = node->inputs.first; sock; sock = sock->next) { @@ -144,7 +144,7 @@ void node_deselect_all(SpaceNode *snode) nodeSetSelected(node, FALSE); } -void node_deselect_all_input_sockets(SpaceNode *snode, int deselect_nodes) +void node_deselect_all_input_sockets(SpaceNode *snode, const bool deselect_nodes) { bNode *node; bNodeSocket *sock; @@ -175,7 +175,7 @@ void node_deselect_all_input_sockets(SpaceNode *snode, int deselect_nodes) } } -void node_deselect_all_output_sockets(SpaceNode *snode, int deselect_nodes) +void node_deselect_all_output_sockets(SpaceNode *snode, const bool deselect_nodes) { bNode *node; bNodeSocket *sock; @@ -186,7 +186,7 @@ void node_deselect_all_output_sockets(SpaceNode *snode, int deselect_nodes) */ for (node = snode->edittree->nodes.first; node; node = node->next) { - int sel = 0; + bool sel = false; for (sock = node->outputs.first; sock; sock = sock->next) sock->flag &= ~SELECT; @@ -473,7 +473,7 @@ static int node_borderselect_exec(bContext *C, wmOperator *op) static int node_border_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int tweak = RNA_boolean_get(op->ptr, "tweak"); + const bool tweak = RNA_boolean_get(op->ptr, "tweak"); if (tweak) { /* prevent initiating the border select if the mouse is over a node */ @@ -835,8 +835,8 @@ static int node_select_same_type_step_exec(bContext *C, wmOperator *op) bNode **node_array; bNode *active = nodeGetActive(snode->edittree); int totnodes; - int revert = RNA_boolean_get(op->ptr, "prev"); - int same_type = 1; + const bool revert = RNA_boolean_get(op->ptr, "prev"); + const bool same_type = 1; ntreeGetDependencyList(snode->edittree, &node_array, &totnodes); diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 61e6b09e7be..f80937bf63f 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -149,7 +149,7 @@ TreeElement *outliner_dropzone_find(const SpaceOops *soops, const float fmval[2] /* Toggle Open/Closed ------------------------------------------- */ -static int do_outliner_item_openclose(bContext *C, SpaceOops *soops, TreeElement *te, int all, const float mval[2]) +static int do_outliner_item_openclose(bContext *C, SpaceOops *soops, TreeElement *te, const bool all, const float mval[2]) { if (mval[1] > te->ys && mval[1] < te->ys + UI_UNIT_Y) { @@ -183,7 +183,7 @@ static int outliner_item_openclose(bContext *C, wmOperator *op, const wmEvent *e SpaceOops *soops = CTX_wm_space_outliner(C); TreeElement *te; float fmval[2]; - int all = RNA_boolean_get(op->ptr, "all"); + const bool all = RNA_boolean_get(op->ptr, "all"); UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], fmval, fmval + 1); @@ -852,7 +852,7 @@ static int outliner_one_level_exec(bContext *C, wmOperator *op) { SpaceOops *soops = CTX_wm_space_outliner(C); ARegion *ar = CTX_wm_region(C); - int add = RNA_boolean_get(op->ptr, "open"); + const bool add = RNA_boolean_get(op->ptr, "open"); int level; level = outliner_has_one_flag(soops, &soops->tree, TSE_CLOSED, 1); diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 93dfc347b1f..fcd8acd391d 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -179,7 +179,8 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, i static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) { - int relative = RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path"); + PropertyRNA *prop; + const bool relative = (prop = RNA_struct_find_property(op->ptr, "relative_path")) && RNA_property_boolean_get(op->ptr, prop); int is_file = -1; memset(seq_load, 0, sizeof(SeqLoadInfo)); @@ -189,12 +190,12 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) seq_load->channel = RNA_int_get(op->ptr, "channel"); seq_load->len = 1; // images only, if endframe isn't set! - if (RNA_struct_find_property(op->ptr, "filepath")) { - RNA_string_get(op->ptr, "filepath", seq_load->path); /* full path, file is set by the caller */ + if ((prop = RNA_struct_find_property(op->ptr, "filepath"))) { + RNA_property_string_get(op->ptr, prop, seq_load->path); /* full path, file is set by the caller */ is_file = 1; } - else if (RNA_struct_find_property(op->ptr, "directory")) { - RNA_string_get(op->ptr, "directory", seq_load->path); /* full path, file is set by the caller */ + else if ((prop = RNA_struct_find_property(op->ptr, "directory"))) { + RNA_property_string_get(op->ptr, prop, seq_load->path); /* full path, file is set by the caller */ is_file = 0; } @@ -202,17 +203,17 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) BLI_path_rel(seq_load->path, G.main->name); - if (RNA_struct_find_property(op->ptr, "frame_end")) { - seq_load->end_frame = RNA_int_get(op->ptr, "frame_end"); + if ((prop = RNA_struct_find_property(op->ptr, "frame_end"))) { + seq_load->end_frame = RNA_property_int_get(op->ptr, prop); } - if (RNA_struct_find_property(op->ptr, "replace_sel") && RNA_boolean_get(op->ptr, "replace_sel")) + if ((prop = RNA_struct_find_property(op->ptr, "replace_sel")) && RNA_property_boolean_get(op->ptr, prop)) seq_load->flag |= SEQ_LOAD_REPLACE_SEL; - if (RNA_struct_find_property(op->ptr, "cache") && RNA_boolean_get(op->ptr, "cache")) + if ((prop = RNA_struct_find_property(op->ptr, "cache")) && RNA_property_boolean_get(op->ptr, prop)) seq_load->flag |= SEQ_LOAD_SOUND_CACHE; - if (RNA_struct_find_property(op->ptr, "sound") && RNA_boolean_get(op->ptr, "sound")) + if ((prop = RNA_struct_find_property(op->ptr, "sound")) && RNA_property_boolean_get(op->ptr, prop)) seq_load->flag |= SEQ_LOAD_MOVIE_SOUND; /* always use this for ops */ @@ -222,17 +223,17 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) if (is_file == 1) { BLI_strncpy(seq_load->name, BLI_path_basename(seq_load->path), sizeof(seq_load->name)); } - else if (RNA_struct_find_property(op->ptr, "files")) { + else if ((prop = RNA_struct_find_property(op->ptr, "files"))) { /* used for image strip */ /* best guess, first images name */ - RNA_BEGIN (op->ptr, itemptr, "files") + RNA_PROP_BEGIN (op->ptr, itemptr, prop) { char *name = RNA_string_get_alloc(&itemptr, "name", NULL, 0); BLI_strncpy(seq_load->name, name, sizeof(seq_load->name)); MEM_freeN(name); break; } - RNA_END; + RNA_PROP_END; } } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 3253d344ff6..c360987bd1f 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -475,7 +475,7 @@ int ED_space_sequencer_maskedit_mask_poll(bContext *C) return ED_space_sequencer_maskedit_poll(C); } -int ED_space_sequencer_check_show_maskedit(SpaceSeq *sseq, Scene *scene) +bool ED_space_sequencer_check_show_maskedit(SpaceSeq *sseq, Scene *scene) { if (sseq && sseq->mainb == SEQ_DRAW_IMG_IMBUF) { return (BKE_sequencer_mask_get(scene) != NULL); @@ -497,7 +497,7 @@ int ED_space_sequencer_maskedit_poll(bContext *C) } /* are we displaying the seq output (not channels or histogram)*/ -int ED_space_sequencer_check_show_imbuf(SpaceSeq *sseq) +bool ED_space_sequencer_check_show_imbuf(SpaceSeq *sseq) { return (ELEM(sseq->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW) && ELEM(sseq->mainb, SEQ_DRAW_SEQUENCE, SEQ_DRAW_IMG_IMBUF)); @@ -1394,7 +1394,7 @@ static int sequencer_reload_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, FALSE); Sequence *seq; - int adjust_length = RNA_boolean_get(op->ptr, "adjust_length"); + const bool adjust_length = RNA_boolean_get(op->ptr, "adjust_length"); for (seq = ed->seqbasep->first; seq; seq = seq->next) { if (seq->flag & SELECT) { @@ -2414,7 +2414,7 @@ void SEQUENCER_OT_view_selected(wmOperatorType *ot) static int find_next_prev_edit(Scene *scene, int cfra, const short side, - const short do_skip_mute, const short do_center) + const bool do_skip_mute, const bool do_center) { Editing *ed = BKE_sequencer_editing_get(scene, FALSE); Sequence *seq, *best_seq = NULL, *frame_seq = NULL; @@ -2488,7 +2488,7 @@ static int find_next_prev_edit(Scene *scene, int cfra, static bool strip_jump_internal(Scene *scene, const short side, - const short do_skip_mute, const short do_center) + const bool do_skip_mute, const bool do_center) { bool changed = false; int cfra = CFRA; @@ -2515,8 +2515,8 @@ static int sequencer_strip_jump_poll(bContext *C) static int sequencer_strip_jump_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - short next = RNA_boolean_get(op->ptr, "next"); - short center = RNA_boolean_get(op->ptr, "center"); + const bool next = RNA_boolean_get(op->ptr, "next"); + const bool center = RNA_boolean_get(op->ptr, "center"); /* currently do_skip_mute is always TRUE */ if (!strip_jump_internal(scene, next ? SEQ_SIDE_RIGHT : SEQ_SIDE_LEFT, TRUE, center)) { diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index d1cc2091265..c8178259dc2 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -927,7 +927,7 @@ static EnumPropertyItem sequencer_prop_select_grouped_types[] = { #define SEQ_IS_SOUND(_seq) ((_seq->type & SEQ_TYPE_SOUND_RAM) && !(_seq->type & SEQ_TYPE_EFFECT)) -#define SEQ_IS_EFFECT(_seq) (_seq->type & SEQ_TYPE_EFFECT) +#define SEQ_IS_EFFECT(_seq) ((_seq->type & SEQ_TYPE_EFFECT) != 0) #define SEQ_USE_DATA(_seq) (ELEM3(_seq->type, SEQ_TYPE_SCENE, SEQ_TYPE_MOVIECLIP, SEQ_TYPE_MASK) || SEQ_HAS_PATH(_seq)) @@ -970,7 +970,7 @@ static bool select_grouped_type_effect(Editing *ed, Sequence *actseq) { Sequence *seq; bool changed = false; - short is_effect = SEQ_IS_EFFECT(actseq); + const bool is_effect = SEQ_IS_EFFECT(actseq); SEQP_BEGIN (ed, seq) { @@ -1093,7 +1093,7 @@ static bool select_grouped_effect_link(Editing *ed, Sequence *actseq) { Sequence *seq = NULL; bool changed = false; - short is_audio = ((actseq->type == SEQ_TYPE_META) || SEQ_IS_SOUND(actseq)); + const bool is_audio = ((actseq->type == SEQ_TYPE_META) || SEQ_IS_SOUND(actseq)); int startdisp = actseq->startdisp; int enddisp = actseq->enddisp; int machine = actseq->machine; diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index b17fff3aca9..43776f28c62 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -231,7 +231,7 @@ static int text_open_exec(bContext *C, wmOperator *op) PropertyPointerRNA *pprop; PointerRNA idptr; char str[FILE_MAX]; - short internal = RNA_boolean_get(op->ptr, "internal"); + const bool internal = RNA_boolean_get(op->ptr, "internal"); RNA_string_get(op->ptr, "filepath", str); @@ -3190,7 +3190,7 @@ void TEXT_OT_resolve_conflict(wmOperatorType *ot) static int text_to_3d_object_exec(bContext *C, wmOperator *op) { Text *text = CTX_data_edit_text(C); - int split_lines = RNA_boolean_get(op->ptr, "split_lines"); + const bool split_lines = RNA_boolean_get(op->ptr, "split_lines"); ED_text_to_object(C, text, split_lines); diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 52897aa023e..681d5ca22fb 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -82,8 +82,8 @@ typedef struct drawMeshFaceSelect_userData { typedef struct drawEMTFMapped_userData { BMEditMesh *em; - short has_mcol; - short has_mtface; + bool has_mcol; + bool has_mtface; MFace *mf; MTFace *tf; } drawEMTFMapped_userData; @@ -393,7 +393,7 @@ static void draw_textured_end(void) glPopMatrix(); } -static DMDrawOption draw_tface__set_draw_legacy(MTFace *tface, int has_mcol, int matnr) +static DMDrawOption draw_tface__set_draw_legacy(MTFace *tface, const bool has_mcol, int matnr) { Material *ma = give_current_material(Gtexdraw.ob, matnr + 1); bool invalidtexture = false; @@ -434,7 +434,7 @@ static DMDrawOption draw_tface__set_draw_legacy(MTFace *tface, int has_mcol, int } } -static DMDrawOption draw_mcol__set_draw_legacy(MTFace *UNUSED(tface), int has_mcol, int UNUSED(matnr)) +static DMDrawOption draw_mcol__set_draw_legacy(MTFace *UNUSED(tface), const bool has_mcol, int UNUSED(matnr)) { if (has_mcol) return DM_DRAW_OPTION_NORMAL; @@ -442,7 +442,7 @@ static DMDrawOption draw_mcol__set_draw_legacy(MTFace *UNUSED(tface), int has_mc return DM_DRAW_OPTION_NO_MCOL; } -static DMDrawOption draw_tface__set_draw(MTFace *tface, int UNUSED(has_mcol), int matnr) +static DMDrawOption draw_tface__set_draw(MTFace *tface, const bool UNUSED(has_mcol), int matnr) { Material *ma = give_current_material(Gtexdraw.ob, matnr + 1); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 1214a1bfe02..b62193e09a4 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3373,7 +3373,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D Object *ob = BKE_object_lod_meshob_get(base->object, scene); Mesh *me = ob->data; Material *ma = give_current_material(ob, 1); - const short hasHaloMat = (ma && (ma->material_type == MA_TYPE_HALO) && !BKE_scene_use_new_shading_nodes(scene)); + const bool hasHaloMat = (ma && (ma->material_type == MA_TYPE_HALO) && !BKE_scene_use_new_shading_nodes(scene)); eWireDrawMode draw_wire = OBDRAW_WIRE_OFF; int /* totvert,*/ totedge, totface; DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 595e6dd98f2..faf83cdd772 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -748,10 +748,10 @@ void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) RegionView3D *rv3d = ar->regiondata; rctf viewplane; float clipsta, clipend, x1, y1, x2, y2; - int orth; + bool is_ortho; - orth = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend, NULL); - rv3d->is_persp = !orth; + is_ortho = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend, NULL); + rv3d->is_persp = !is_ortho; #if 0 printf("%s: %d %d %f %f %f %f %f %f\n", __func__, winx, winy, @@ -774,12 +774,12 @@ void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) rect->ymax /= (float)ar->winy; rect->ymax = y1 + rect->ymax * (y2 - y1); - if (orth) wmOrtho(rect->xmin, rect->xmax, rect->ymin, rect->ymax, -clipend, clipend); + if (is_ortho) wmOrtho(rect->xmin, rect->xmax, rect->ymin, rect->ymax, -clipend, clipend); else wmFrustum(rect->xmin, rect->xmax, rect->ymin, rect->ymax, clipsta, clipend); } else { - if (orth) wmOrtho(x1, x2, y1, y2, clipsta, clipend); + if (is_ortho) wmOrtho(x1, x2, y1, y2, clipsta, clipend); else wmFrustum(x1, x2, y1, y2, clipsta, clipend); } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 2103073d5e9..e22dc84d432 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5110,7 +5110,7 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, } } else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) { - short do_loc = FALSE, do_rot = FALSE, do_scale = FALSE; + bool do_loc = false, do_rot = false, do_scale = false; /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ if (tmode == TFM_TRANSLATION) { diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 26e32904976..f20fda27d37 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -250,9 +250,9 @@ static void TRANSFORM_OT_delete_orientation(struct wmOperatorType *ot) static int create_orientation_exec(bContext *C, wmOperator *op) { char name[MAX_NAME]; - int use = RNA_boolean_get(op->ptr, "use"); - int overwrite = RNA_boolean_get(op->ptr, "overwrite"); - int use_view = RNA_boolean_get(op->ptr, "use_view"); + const bool use = RNA_boolean_get(op->ptr, "use"); + const bool overwrite = RNA_boolean_get(op->ptr, "overwrite"); + const bool use_view = RNA_boolean_get(op->ptr, "use_view"); RNA_string_get(op->ptr, "name", name); diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 0d1778ea69f..8e980bdd4d2 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3460,7 +3460,7 @@ static int uv_pin_exec(bContext *C, wmOperator *op) BMIter iter, liter; MTexPoly *tface; MLoopUV *luv; - int clear = RNA_boolean_get(op->ptr, "clear"); + const bool clear = RNA_boolean_get(op->ptr, "clear"); const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY); @@ -3589,7 +3589,7 @@ static int uv_hide_exec(bContext *C, wmOperator *op) BMIter iter, liter; MLoopUV *luv; MTexPoly *tf; - int swap = RNA_boolean_get(op->ptr, "unselected"); + const bool swap = RNA_boolean_get(op->ptr, "unselected"); Image *ima = sima ? sima->image : NULL; const int use_face_center = (ts->uv_selectmode == UV_SELECT_FACE); @@ -3950,8 +3950,8 @@ static int uv_seams_from_islands_exec(bContext *C, wmOperator *op) BMEditMesh *em; BMEdge *editedge; float limit[2] = {STD_UV_CONNECT_LIMIT, STD_UV_CONNECT_LIMIT}; - char mark_seams = RNA_boolean_get(op->ptr, "mark_seams"); - char mark_sharp = RNA_boolean_get(op->ptr, "mark_sharp"); + const bool mark_seams = RNA_boolean_get(op->ptr, "mark_seams"); + const bool mark_sharp = RNA_boolean_get(op->ptr, "mark_sharp"); BMesh *bm; BMIter iter; diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index c931c843a23..f60972abdcb 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -114,7 +114,7 @@ typedef struct IslandStitchData { /* flag an island to be considered for determining static island */ char stitchableCandidate; /* if edge rotation is used, flag so that vertex rotation is not used */ - char use_edge_rotation; + bool use_edge_rotation; } IslandStitchData; /* just for averaging UVs */ @@ -142,17 +142,17 @@ typedef struct UvEdge { typedef struct StitchState { float aspect; /* use limit flag */ - char use_limit; + bool use_limit; /* limit to operator, same as original operator */ float limit_dist; /* snap uv islands together during stitching */ - char snap_islands; + bool snap_islands; /* stich at midpoints or at islands */ - char midpoints; + bool midpoints; /* editmesh, cached for use in modal handler */ BMEditMesh *em; /* clear seams of stitched edges after stitch */ - char clear_seams; + bool clear_seams; /* element map for getting info about uv connectivity */ UvElementMap *element_map; /* edge container */ @@ -271,10 +271,10 @@ static void stitch_update_header(StitchState *state, bContext *C) if (sa) { BLI_snprintf(msg, HEADER_LENGTH, str, state->mode == STITCH_VERT ? "Vertex" : "Edge", - state->snap_islands ? "On" : "Off", - state->midpoints ? "On" : "Off", + WM_bool_as_string(state->snap_islands), + WM_bool_as_string(state->midpoints), state->limit_dist, - state->use_limit ? "On" : "Off"); + WM_bool_as_string(state->use_limit)); ED_area_headerprint(sa, msg); } diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 8a05b33d105..c0a5e505f38 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -86,10 +86,10 @@ #include "uvedit_intern.h" #include "uvedit_parametrizer.h" -static void modifier_unwrap_state(Object *obedit, Scene *scene, short *use_subsurf) +static void modifier_unwrap_state(Object *obedit, Scene *scene, bool *r_use_subsurf) { ModifierData *md; - short subsurf = scene->toolsettings->uvcalc_flag & UVCALC_USESUBSURF; + bool subsurf = (scene->toolsettings->uvcalc_flag & UVCALC_USESUBSURF) != 0; md = obedit->modifiers.first; @@ -101,7 +101,7 @@ static void modifier_unwrap_state(Object *obedit, Scene *scene, short *use_subsu subsurf = FALSE; } - *use_subsurf = subsurf; + *r_use_subsurf = subsurf; } static bool ED_uvedit_ensure_uvs(bContext *C, Scene *scene, Object *obedit) @@ -256,8 +256,8 @@ static void construct_param_handle_face_add(ParamHandle *handle, Scene *scene, } static ParamHandle *construct_param_handle(Scene *scene, Object *ob, BMEditMesh *em, - short implicit, short fill, short sel, - short correct_aspect) + const bool implicit, const bool fill, const bool sel, + const bool correct_aspect) { BMesh *bm = em->bm; ParamHandle *handle; @@ -516,7 +516,7 @@ static bool minimize_stretch_init(bContext *C, wmOperator *op) Object *obedit = CTX_data_edit_object(C); BMEditMesh *em = BKE_editmesh_from_object(obedit); MinStretch *ms; - int fill_holes = RNA_boolean_get(op->ptr, "fill_holes"); + const bool fill_holes = RNA_boolean_get(op->ptr, "fill_holes"); bool implicit = true; if (!uvedit_have_selection(scene, em, implicit)) { @@ -802,9 +802,9 @@ static ParamHandle *liveHandle = NULL; void ED_uvedit_live_unwrap_begin(Scene *scene, Object *obedit) { BMEditMesh *em = BKE_editmesh_from_object(obedit); - short abf = scene->toolsettings->unwrapper == 0; - short fillholes = scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES; - short use_subsurf; + const bool abf = (scene->toolsettings->unwrapper == 0); + const bool fillholes = (scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES) != 0; + bool use_subsurf; modifier_unwrap_state(obedit, scene, &use_subsurf); @@ -1068,9 +1068,9 @@ static void uv_map_clip_correct(Scene *scene, Object *ob, BMEditMesh *em, wmOper BMIter iter, liter; MLoopUV *luv; float dx, dy, min[2], max[2]; - int correct_aspect = RNA_boolean_get(op->ptr, "correct_aspect"); - int clip_to_bounds = RNA_boolean_get(op->ptr, "clip_to_bounds"); - int scale_to_bounds = RNA_boolean_get(op->ptr, "scale_to_bounds"); + const bool correct_aspect = RNA_boolean_get(op->ptr, "correct_aspect"); + const bool clip_to_bounds = RNA_boolean_get(op->ptr, "clip_to_bounds"); + const bool scale_to_bounds = RNA_boolean_get(op->ptr, "scale_to_bounds"); const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); @@ -1135,9 +1135,9 @@ void ED_unwrap_lscm(Scene *scene, Object *obedit, const short sel) BMEditMesh *em = BKE_editmesh_from_object(obedit); ParamHandle *handle; - const short fill_holes = scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES; - const short correct_aspect = !(scene->toolsettings->uvcalc_flag & UVCALC_NO_ASPECT_CORRECT); - short use_subsurf; + const bool fill_holes = (scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES) != 0; + const bool correct_aspect = (scene->toolsettings->uvcalc_flag & UVCALC_NO_ASPECT_CORRECT) != 0; + bool use_subsurf; modifier_unwrap_state(obedit, scene, &use_subsurf); @@ -1164,10 +1164,10 @@ static int unwrap_exec(bContext *C, wmOperator *op) Object *obedit = CTX_data_edit_object(C); BMEditMesh *em = BKE_editmesh_from_object(obedit); int method = RNA_enum_get(op->ptr, "method"); - int fill_holes = RNA_boolean_get(op->ptr, "fill_holes"); - int correct_aspect = RNA_boolean_get(op->ptr, "correct_aspect"); - int use_subsurf = RNA_boolean_get(op->ptr, "use_subsurf_data"); - short use_subsurf_final; + const bool fill_holes = RNA_boolean_get(op->ptr, "fill_holes"); + const bool correct_aspect = RNA_boolean_get(op->ptr, "correct_aspect"); + const bool use_subsurf = RNA_boolean_get(op->ptr, "use_subsurf_data"); + bool use_subsurf_final; float obsize[3]; bool implicit = false; diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index 63e5f64e6bc..cd8e9e74906 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -114,8 +114,8 @@ GPUNodeLink *GPU_texture(int size, float *pixels); GPUNodeLink *GPU_dynamic_texture(struct GPUTexture *tex, int dynamictype, void *data); GPUNodeLink *GPU_builtin(GPUBuiltin builtin); -int GPU_link(GPUMaterial *mat, const char *name, ...); -int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...); +bool GPU_link(GPUMaterial *mat, const char *name, ...); +bool GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...); void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link); void GPU_material_enable_alpha(GPUMaterial *material); @@ -235,7 +235,7 @@ void GPU_free_shader_export(GPUShaderExport *shader); GPULamp *GPU_lamp_from_blender(struct Scene *scene, struct Object *ob, struct Object *par); void GPU_lamp_free(struct Object *ob); -int GPU_lamp_has_shadow_buffer(GPULamp *lamp); +bool GPU_lamp_has_shadow_buffer(GPULamp *lamp); void GPU_lamp_update_buffer_mats(GPULamp *lamp); void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[4][4], int *winsize, float winmat[4][4]); void GPU_lamp_shadow_buffer_unbind(GPULamp *lamp); diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index ecd4ad6f0c3..68cf51f10d3 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1191,7 +1191,7 @@ GPUNodeLink *GPU_builtin(GPUBuiltin builtin) return link; } -int GPU_link(GPUMaterial *mat, const char *name, ...) +bool GPU_link(GPUMaterial *mat, const char *name, ...) { GPUNode *node; GPUFunction *function; @@ -1227,7 +1227,7 @@ int GPU_link(GPUMaterial *mat, const char *name, ...) return 1; } -int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...) +bool GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...) { GPUNode *node; GPUFunction *function; diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index c4827a5868c..7de0bf9e504 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1336,11 +1336,11 @@ static struct GPUMaterialState { float (*gviewmat)[4]; float (*gviewinv)[4]; - int backface_culling; + bool backface_culling; GPUBlendMode *alphablend; GPUBlendMode alphablend_fixed[FIXEDMAT]; - int use_alpha_pass, is_alpha_pass; + bool use_alpha_pass, is_alpha_pass; int lastmatnr, lastretval; GPUBlendMode lastalphablend; @@ -1397,9 +1397,9 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O GPUMaterial *gpumat; GPUBlendMode alphablend; int a; - int gamma = BKE_scene_check_color_management_enabled(scene); - int new_shading_nodes = BKE_scene_use_new_shading_nodes(scene); - int use_matcap = (v3d->flag2 & V3D_SHOW_SOLID_MATCAP); /* assumes v3d->defmaterial->preview is set */ + const bool gamma = BKE_scene_check_color_management_enabled(scene); + const bool new_shading_nodes = BKE_scene_use_new_shading_nodes(scene); + const bool use_matcap = (v3d->flag2 & V3D_SHOW_SOLID_MATCAP) != 0; /* assumes v3d->defmaterial->preview is set */ ob = BKE_object_lod_matob_get(ob, scene); @@ -1409,7 +1409,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O GMS.lastretval = -1; GMS.lastalphablend = GPU_BLEND_SOLID; - GMS.backface_culling = (v3d->flag2 & V3D_BACKFACE_CULLING); + GMS.backface_culling = (v3d->flag2 & V3D_BACKFACE_CULLING) != 0; GMS.gob = ob; GMS.gscene = scene; diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 7c67e615217..2781437225b 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1891,11 +1891,11 @@ void GPU_lamp_free(Object *ob) BLI_freelistN(&ob->gpulamp); } -int GPU_lamp_has_shadow_buffer(GPULamp *lamp) +bool GPU_lamp_has_shadow_buffer(GPULamp *lamp) { return (!(lamp->scene->gm.flag & GAME_GLSL_NO_SHADOWS) && - !(lamp->scene->gm.flag & GAME_GLSL_NO_LIGHTS) && - lamp->tex && lamp->fb); + !(lamp->scene->gm.flag & GAME_GLSL_NO_LIGHTS) && + lamp->tex && lamp->fb); } void GPU_lamp_update_buffer_mats(GPULamp *lamp) diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index c70ab5d7189..be0069f5bfa 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -360,7 +360,7 @@ int IMB_ispic(const char *name); * * \attention Defined in util.c */ -int IMB_isanim(const char *name); +bool IMB_isanim(const char *name); /** * diff --git a/source/blender/imbuf/IMB_moviecache.h b/source/blender/imbuf/IMB_moviecache.h index 3432741596f..0c72d1b4f01 100644 --- a/source/blender/imbuf/IMB_moviecache.h +++ b/source/blender/imbuf/IMB_moviecache.h @@ -58,9 +58,9 @@ void IMB_moviecache_set_priority_callback(struct MovieCache *cache, MovieCacheGe MovieCachePriorityDeleterFP prioritydeleterfp); void IMB_moviecache_put(struct MovieCache *cache, void *userkey, struct ImBuf *ibuf); -int IMB_moviecache_put_if_possible(struct MovieCache *cache, void *userkey, struct ImBuf *ibuf); +bool IMB_moviecache_put_if_possible(struct MovieCache *cache, void *userkey, struct ImBuf *ibuf); struct ImBuf *IMB_moviecache_get(struct MovieCache *cache, void *userkey); -int IMB_moviecache_has_frame(struct MovieCache *cache, void *userkey); +bool IMB_moviecache_has_frame(struct MovieCache *cache, void *userkey); void IMB_moviecache_free(struct MovieCache *cache); void IMB_moviecache_cleanup(struct MovieCache *cache, diff --git a/source/blender/imbuf/intern/moviecache.c b/source/blender/imbuf/intern/moviecache.c index 00d9dd2fe04..07ce3c39d73 100644 --- a/source/blender/imbuf/intern/moviecache.c +++ b/source/blender/imbuf/intern/moviecache.c @@ -384,10 +384,10 @@ void IMB_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf) do_moviecache_put(cache, userkey, ibuf, TRUE); } -int IMB_moviecache_put_if_possible(MovieCache *cache, void *userkey, ImBuf *ibuf) +bool IMB_moviecache_put_if_possible(MovieCache *cache, void *userkey, ImBuf *ibuf) { size_t mem_in_use, mem_limit, elem_size; - int result = FALSE; + bool result = false; elem_size = IMB_get_size_in_memory(ibuf); mem_limit = MEM_CacheLimiter_get_maximum(); @@ -429,7 +429,7 @@ ImBuf *IMB_moviecache_get(MovieCache *cache, void *userkey) return NULL; } -int IMB_moviecache_has_frame(MovieCache *cache, void *userkey) +bool IMB_moviecache_has_frame(MovieCache *cache, void *userkey) { MovieCacheKey key; MovieCacheItem *item; diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index 2ae05315c85..3c24864c671 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -58,7 +58,7 @@ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1) short a, r, g, b; int x, y; float af, rf, gf, bf, *p1f, *_p1f, *destf; - int do_rect, do_float; + bool do_rect, do_float; if (ibuf1 == NULL) return (NULL); if (ibuf1->rect == NULL && ibuf1->rect_float == NULL) return (NULL); @@ -1130,7 +1130,8 @@ static ImBuf *scaleupx(struct ImBuf *ibuf, int newx) float val_bf, nval_bf, diff_bf; float val_gf, nval_gf, diff_gf; float val_rf, nval_rf, diff_rf; - int x, y, do_rect = FALSE, do_float = FALSE; + int x, y; + bool do_rect = false, do_float = false; val_a = nval_a = diff_a = val_b = nval_b = diff_b = 0; val_g = nval_g = diff_g = val_r = nval_r = diff_r = 0; diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index d929304d185..a8d7949b8cd 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -450,7 +450,7 @@ int imb_get_anim_type(const char *name) return ANIM_NONE; } -int IMB_isanim(const char *filename) +bool IMB_isanim(const char *filename) { int type; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 06e75ca62de..6eebbd6b47d 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -738,7 +738,8 @@ typedef struct ShrinkwrapModifierData { char vgroup_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ float keepDist; /* distance offset to keep from mesh/projection point */ short shrinkType; /* shrink type projection */ - short shrinkOpts; /* shrink options */ + char shrinkOpts; /* shrink options */ + char pad1; float projLimit; /* limit the projection ray cast */ char projAxis; /* axis to project over */ diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 4f75364e8bb..d3080abb007 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1254,8 +1254,8 @@ void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA if (!(prop->flag & PROP_ENUM_NO_TRANSLATE)) { int i; /* Note: Only do those tests once, and then use BLF_pgettext. */ - int do_iface = BLF_translate_iface(); - int do_tooltip = BLF_translate_tooltips(); + bool do_iface = BLF_translate_iface(); + bool do_tooltip = BLF_translate_tooltips(); EnumPropertyItem *nitem; if (!(do_iface || do_tooltip)) diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index 5c3b87bd92c..348b0361464 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -244,8 +244,8 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne * vertex index (in case the weight array does not cover the whole vertices...). */ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, MDeformWeight **dws, int num, - const int *indices, const float *weights, int do_add, - float add_thresh, int do_rem, float rem_thresh) + const int *indices, const float *weights, const bool do_add, + const float add_thresh, const bool do_rem, const float rem_thresh) { int i; diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.h b/source/blender/modifiers/intern/MOD_weightvg_util.h index afb77458d7c..03bcbb6eb97 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.h +++ b/source/blender/modifiers/intern/MOD_weightvg_util.h @@ -80,7 +80,7 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne * vertex index (in case the weight table does not cover the whole vertices...). */ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, MDeformWeight **dws, int num, - const int *indices, const float *weights, int do_add, - float add_thresh, int do_rem, float rem_thresh); + const int *indices, const float *weights, const bool do_add, + const float add_thresh, const bool do_rem, const float rem_thresh); #endif /* __MOD_WEIGHTVG_UTIL_H__ */ diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index fee4e81cb2d..0dfb0403c68 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -184,11 +184,11 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der int defgrp_index; int i; /* Flags. */ - int do_add = (wmd->edit_flags & MOD_WVG_EDIT_ADD2VG) != 0; - int do_rem = (wmd->edit_flags & MOD_WVG_EDIT_REMFVG) != 0; + const bool do_add = (wmd->edit_flags & MOD_WVG_EDIT_ADD2VG) != 0; + const bool do_rem = (wmd->edit_flags & MOD_WVG_EDIT_REMFVG) != 0; /* Only do weight-preview in Object, Sculpt and Pose modes! */ #if 0 - int do_prev = (wmd->modifier.mode & eModifierMode_DoWeightPreview); + const bool do_prev = (wmd->modifier.mode & eModifierMode_DoWeightPreview); #endif /* Get number of verts. */ diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c index 747390abd0d..5dcf67e5417 100644 --- a/source/blender/python/intern/gpu.c +++ b/source/blender/python/intern/gpu.c @@ -39,8 +39,6 @@ #include <Python.h> -#include "GPU_material.h" - #include "DNA_scene_types.h" #include "DNA_image_types.h" #include "DNA_material_types.h" @@ -58,6 +56,8 @@ #include "../generic/py_capi_utils.h" +#include "GPU_material.h" + #include "gpu.h" #define PY_MODULE_ADD_CONSTANT(module, name) PyModule_AddIntConstant(module, # name, name) diff --git a/source/blender/render/extern/include/RE_engine.h b/source/blender/render/extern/include/RE_engine.h index 559f21f6961..bd976e6c14a 100644 --- a/source/blender/render/extern/include/RE_engine.h +++ b/source/blender/render/extern/include/RE_engine.h @@ -142,7 +142,7 @@ void RE_engine_report(RenderEngine *engine, int type, const char *msg); int RE_engine_render(struct Render *re, int do_all); -int RE_engine_is_external(struct Render *re); +bool RE_engine_is_external(struct Render *re); /* Engine Types */ diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index bc07f0ce6c0..18367b9777c 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -288,7 +288,7 @@ void RE_DataBase_GetView(struct Render *re, float mat[4][4]); void RE_GetCameraWindow(struct Render *re, struct Object *camera, int frame, float mat[4][4]); struct Scene *RE_GetScene(struct Render *re); -int RE_is_rendering_allowed(struct Scene *scene, struct Object *camera_override, struct ReportList *reports); +bool RE_is_rendering_allowed(struct Scene *scene, struct Object *camera_override, struct ReportList *reports); bool RE_allow_render_generic_object(struct Object *ob); diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index dbde29ea7ac..57e52a9316b 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -168,8 +168,8 @@ typedef struct ShadeInput { float surfnor[3], surfdist; /* from initialize, part or renderlayer */ - short do_preview; /* for nodes, in previewrender */ - short do_manage; /* color management flag */ + bool do_preview; /* for nodes, in previewrender */ + bool do_manage; /* color management flag */ short thread, sample; /* sample: ShadeSample array index */ short nodes; /* indicate node shading, temp hack to prevent recursion */ diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 02a9f1eb347..b9e06d3e6f7 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -132,7 +132,7 @@ struct Render short flag, osa, ok, result_ok; /* due to performance issues, getting initialized from color management settings once on Render initialization */ - short scene_color_manage; + bool scene_color_manage; /* result of rendering */ RenderResult *result; diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 6ae7d732e82..5255e574c41 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -121,7 +121,7 @@ RenderEngineType *RE_engines_find(const char *idname) return type; } -int RE_engine_is_external(Render *re) +bool RE_engine_is_external(Render *re) { RenderEngineType *type = RE_engines_find(re->r.engine); return (type && type->render); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 39bc571853a..c0ef820b6d8 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2391,7 +2391,7 @@ static int check_composite_output(Scene *scene) return node_tree_has_composite_output(scene->nodetree); } -int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *reports) +bool RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *reports) { SceneRenderLayer *srl; int scemode = check_mode_full_sample(&scene->r); @@ -2659,7 +2659,7 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie /* write movie or image */ if (BKE_imtype_is_movie(scene->r.im_format.imtype)) { - int do_free = FALSE; + bool do_free = false; ImBuf *ibuf = render_result_rect_to_ibuf(&rres, &scene->r); /* note; the way it gets 32 bits rects is weak... */ diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index a47018e21eb..c9ed198d0cf 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -231,7 +231,7 @@ int WM_operator_call_ex(struct bContext *C, struct wmOperator *op, const int WM_operator_call (struct bContext *C, struct wmOperator *op); int WM_operator_call_notest(struct bContext *C, struct wmOperator *op); int WM_operator_repeat (struct bContext *C, struct wmOperator *op); -int WM_operator_repeat_check(const struct bContext *C, struct wmOperator *op); +bool WM_operator_repeat_check(const struct bContext *C, struct wmOperator *op); int WM_operator_name_call (struct bContext *C, const char *opstring, short context, struct PointerRNA *properties); int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, short context, struct PointerRNA *properties, struct ReportList *reports, const bool is_undo); diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index e89980f53fc..f390ef13667 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -710,7 +710,7 @@ static int wm_draw_update_test_window(wmWindow *win) { ScrArea *sa; ARegion *ar; - int do_draw = FALSE; + bool do_draw = false; for (ar = win->screen->regionbase.first; ar; ar = ar->next) { if (ar->do_draw_overlay) { diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 30a51b268a0..3fc4fe8e9ef 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -249,7 +249,7 @@ void wm_event_do_notifiers(bContext *C) /* cache & catch WM level notifiers, such as frame change, scene/screen set */ for (win = wm->windows.first; win; win = win->next) { - int do_anim = FALSE; + bool do_anim = false; CTX_wm_window_set(C, win); @@ -777,7 +777,7 @@ int WM_operator_repeat(bContext *C, wmOperator *op) * simple check for now but may become more involved. * To be sure the operator can run call WM_operator_poll(C, op->type) also, since this call * checks if WM_operator_repeat() can run at all, not that it WILL run at any time. */ -int WM_operator_repeat_check(const bContext *UNUSED(C), wmOperator *op) +bool WM_operator_repeat_check(const bContext *UNUSED(C), wmOperator *op) { if (op->type->exec != NULL) { return true; diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index f2f9443c111..643242102a3 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -267,7 +267,7 @@ wmWindow *wm_window_copy(bContext *C, wmWindow *winorig) void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win) { wmWindow *tmpwin; - int do_exit = 0; + bool do_exit = false; /* first check if we have to quit (there are non-temp remaining windows) */ for (tmpwin = wm->windows.first; tmpwin; tmpwin = tmpwin->next) { |