Cleanup: use booleans
This commit is contained in:
parent
6bf2c73249
commit
054cec404b
|
@ -134,7 +134,7 @@ void *BKE_sound_add_scene_sound_defaults(struct Scene *scene, struct Sequence *s
|
|||
|
||||
void BKE_sound_remove_scene_sound(struct Scene *scene, void *handle);
|
||||
|
||||
void BKE_sound_mute_scene_sound(void *handle, char mute);
|
||||
void BKE_sound_mute_scene_sound(void *handle, bool mute);
|
||||
|
||||
void BKE_sound_move_scene_sound(const struct Scene *scene,
|
||||
void *handle,
|
||||
|
|
|
@ -756,7 +756,7 @@ void BKE_sound_remove_scene_sound(Scene *scene, void *handle)
|
|||
AUD_Sequence_remove(scene->sound_scene, handle);
|
||||
}
|
||||
|
||||
void BKE_sound_mute_scene_sound(void *handle, char mute)
|
||||
void BKE_sound_mute_scene_sound(void *handle, bool mute)
|
||||
{
|
||||
AUD_SequenceEntry_setMuted(handle, mute);
|
||||
}
|
||||
|
@ -1346,7 +1346,7 @@ void *BKE_sound_add_scene_sound_defaults(Scene *UNUSED(scene), Sequence *UNUSED(
|
|||
void BKE_sound_remove_scene_sound(Scene *UNUSED(scene), void *UNUSED(handle))
|
||||
{
|
||||
}
|
||||
void BKE_sound_mute_scene_sound(void *UNUSED(handle), char UNUSED(mute))
|
||||
void BKE_sound_mute_scene_sound(void *UNUSED(handle), bool UNUSED(mute))
|
||||
{
|
||||
}
|
||||
void BKE_sound_move_scene_sound(const Scene *UNUSED(scene),
|
||||
|
|
|
@ -2637,12 +2637,12 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
|
|||
Sequence *seq_other;
|
||||
const char *error_msg;
|
||||
|
||||
if (SEQ_select_active_get_pair(scene, &seq_act, &seq_other) == 0) {
|
||||
if (SEQ_select_active_get_pair(scene, &seq_act, &seq_other) == false) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Please select two strips");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
if (SEQ_edit_sequence_swap(scene, seq_act, seq_other, &error_msg) == 0) {
|
||||
if (SEQ_edit_sequence_swap(scene, seq_act, seq_other, &error_msg) == false) {
|
||||
BKE_report(op->reports, RPT_ERROR, error_msg);
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
|
|
@ -3712,9 +3712,9 @@ void UV_OT_select_box(wmOperatorType *ot)
|
|||
/** \name Circle Select Operator
|
||||
* \{ */
|
||||
|
||||
static int uv_circle_select_is_point_inside(const float uv[2],
|
||||
const float offset[2],
|
||||
const float ellipse[2])
|
||||
static bool uv_circle_select_is_point_inside(const float uv[2],
|
||||
const float offset[2],
|
||||
const float ellipse[2])
|
||||
{
|
||||
/* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */
|
||||
const float co[2] = {
|
||||
|
@ -3724,10 +3724,10 @@ static int uv_circle_select_is_point_inside(const float uv[2],
|
|||
return len_squared_v2(co) < 1.0f;
|
||||
}
|
||||
|
||||
static int uv_circle_select_is_edge_inside(const float uv_a[2],
|
||||
const float uv_b[2],
|
||||
const float offset[2],
|
||||
const float ellipse[2])
|
||||
static bool uv_circle_select_is_edge_inside(const float uv_a[2],
|
||||
const float uv_b[2],
|
||||
const float offset[2],
|
||||
const float ellipse[2])
|
||||
{
|
||||
/* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */
|
||||
const float co_a[2] = {
|
||||
|
|
|
@ -2008,7 +2008,7 @@ struct ImBuf *imb_load_openexr(const unsigned char *mem,
|
|||
printf("Error: can't process EXR multilayer file\n");
|
||||
}
|
||||
else {
|
||||
const int is_alpha = exr_has_alpha(*file);
|
||||
const bool is_alpha = exr_has_alpha(*file);
|
||||
|
||||
ibuf = IMB_allocImBuf(width, height, is_alpha ? 32 : 24, 0);
|
||||
ibuf->flags |= exr_is_half_float(*file) ? IB_halffloat : 0;
|
||||
|
|
|
@ -63,7 +63,7 @@ static void rna_Sequence_swap_internal(ID *id,
|
|||
const char *error_msg;
|
||||
Scene *scene = (Scene *)id;
|
||||
|
||||
if (SEQ_edit_sequence_swap(scene, seq_self, seq_other, &error_msg) == 0) {
|
||||
if (SEQ_edit_sequence_swap(scene, seq_self, seq_other, &error_msg) == false) {
|
||||
BKE_report(reports, RPT_ERROR, error_msg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ void BPY_pyconstraint_exec(struct bPythonConstraint *con,
|
|||
// void BPY_pyconstraint_settings(void *arg1, void *arg2);
|
||||
void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTarget *ct);
|
||||
void BPY_pyconstraint_update(struct Object *owner, struct bConstraint *con);
|
||||
int BPY_is_pyconstraint(struct Text *text);
|
||||
bool BPY_is_pyconstraint(struct Text *text);
|
||||
// void BPY_free_pyconstraint_links(struct Text *text);
|
||||
|
||||
/* global interpreter lock */
|
||||
|
|
|
@ -25,7 +25,7 @@ void BPY_pyconstraint_exec(struct bPythonConstraint *con,
|
|||
void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTarget *ct)
|
||||
{
|
||||
}
|
||||
int BPY_is_pyconstraint(struct Text *text)
|
||||
bool BPY_is_pyconstraint(struct Text *text)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -16,10 +16,10 @@ struct Main;
|
|||
struct Scene;
|
||||
struct Sequence;
|
||||
|
||||
int SEQ_edit_sequence_swap(struct Scene *scene,
|
||||
struct Sequence *seq_a,
|
||||
struct Sequence *seq_b,
|
||||
const char **error_str);
|
||||
bool SEQ_edit_sequence_swap(struct Scene *scene,
|
||||
struct Sequence *seq_a,
|
||||
struct Sequence *seq_b,
|
||||
const char **error_str);
|
||||
/**
|
||||
* Move sequence to seqbase.
|
||||
*
|
||||
|
|
|
@ -15,9 +15,9 @@ struct Scene;
|
|||
struct Sequence;
|
||||
|
||||
struct Sequence *SEQ_select_active_get(struct Scene *scene);
|
||||
int SEQ_select_active_get_pair(struct Scene *scene,
|
||||
struct Sequence **r_seq_act,
|
||||
struct Sequence **r_seq_other);
|
||||
bool SEQ_select_active_get_pair(struct Scene *scene,
|
||||
struct Sequence **r_seq_act,
|
||||
struct Sequence **r_seq_other);
|
||||
void SEQ_select_active_set(struct Scene *scene, struct Sequence *seq);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -37,32 +37,32 @@
|
|||
#include "SEQ_transform.h"
|
||||
#include "SEQ_utils.h"
|
||||
|
||||
int SEQ_edit_sequence_swap(Scene *scene, Sequence *seq_a, Sequence *seq_b, const char **error_str)
|
||||
bool SEQ_edit_sequence_swap(Scene *scene, Sequence *seq_a, Sequence *seq_b, const char **error_str)
|
||||
{
|
||||
char name[sizeof(seq_a->name)];
|
||||
|
||||
if (SEQ_time_strip_length_get(scene, seq_a) != SEQ_time_strip_length_get(scene, seq_b)) {
|
||||
*error_str = N_("Strips must be the same length");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* type checking, could be more advanced but disallow sound vs non-sound copy */
|
||||
if (seq_a->type != seq_b->type) {
|
||||
if (seq_a->type == SEQ_TYPE_SOUND_RAM || seq_b->type == SEQ_TYPE_SOUND_RAM) {
|
||||
*error_str = N_("Strips were not compatible");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* disallow effects to swap with non-effects strips */
|
||||
if ((seq_a->type & SEQ_TYPE_EFFECT) != (seq_b->type & SEQ_TYPE_EFFECT)) {
|
||||
*error_str = N_("Strips were not compatible");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((seq_a->type & SEQ_TYPE_EFFECT) && (seq_b->type & SEQ_TYPE_EFFECT)) {
|
||||
if (SEQ_effect_get_num_inputs(seq_a->type) != SEQ_effect_get_num_inputs(seq_b->type)) {
|
||||
*error_str = N_("Strips must have the same number of inputs");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -87,26 +87,26 @@ int SEQ_edit_sequence_swap(Scene *scene, Sequence *seq_a, Sequence *seq_b, const
|
|||
seq_time_effect_range_set(scene, seq_a);
|
||||
seq_time_effect_range_set(scene, seq_b);
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void seq_update_muting_recursive(ListBase *channels,
|
||||
ListBase *seqbasep,
|
||||
Sequence *metaseq,
|
||||
int mute)
|
||||
const bool mute)
|
||||
{
|
||||
Sequence *seq;
|
||||
|
||||
/* For sound we go over full meta tree to update muted state,
|
||||
* since sound is played outside of evaluating the imbufs. */
|
||||
for (seq = seqbasep->first; seq; seq = seq->next) {
|
||||
int seqmute = (mute || SEQ_render_is_muted(channels, seq));
|
||||
bool seqmute = (mute || SEQ_render_is_muted(channels, seq));
|
||||
|
||||
if (seq->type == SEQ_TYPE_META) {
|
||||
/* if this is the current meta sequence, unmute because
|
||||
* all sequences above this were set to mute */
|
||||
if (seq == metaseq) {
|
||||
seqmute = 0;
|
||||
seqmute = false;
|
||||
}
|
||||
|
||||
seq_update_muting_recursive(&seq->channels, &seq->seqbase, metaseq, seqmute);
|
||||
|
@ -126,10 +126,10 @@ void SEQ_edit_update_muting(Editing *ed)
|
|||
MetaStack *ms = ed->metastack.last;
|
||||
|
||||
if (ms) {
|
||||
seq_update_muting_recursive(&ed->channels, &ed->seqbase, ms->parseq, 1);
|
||||
seq_update_muting_recursive(&ed->channels, &ed->seqbase, ms->parseq, true);
|
||||
}
|
||||
else {
|
||||
seq_update_muting_recursive(&ed->channels, &ed->seqbase, NULL, 0);
|
||||
seq_update_muting_recursive(&ed->channels, &ed->seqbase, NULL, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,14 +37,14 @@ void SEQ_select_active_set(Scene *scene, Sequence *seq)
|
|||
ed->act_seq = seq;
|
||||
}
|
||||
|
||||
int SEQ_select_active_get_pair(Scene *scene, Sequence **r_seq_act, Sequence **r_seq_other)
|
||||
bool SEQ_select_active_get_pair(Scene *scene, Sequence **r_seq_act, Sequence **r_seq_other)
|
||||
{
|
||||
Editing *ed = SEQ_editing_get(scene);
|
||||
|
||||
*r_seq_act = SEQ_select_active_get(scene);
|
||||
|
||||
if (*r_seq_act == NULL) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
Sequence *seq;
|
||||
|
@ -54,7 +54,7 @@ int SEQ_select_active_get_pair(Scene *scene, Sequence **r_seq_act, Sequence **r_
|
|||
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
||||
if (seq->flag & SELECT && (seq != (*r_seq_act))) {
|
||||
if (*r_seq_other) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
*r_seq_other = seq;
|
||||
|
|
|
@ -671,7 +671,7 @@ void wm_event_do_notifiers(bContext *C)
|
|||
wm_test_autorun_warning(C);
|
||||
}
|
||||
|
||||
static int wm_event_always_pass(const wmEvent *event)
|
||||
static bool wm_event_always_pass(const wmEvent *event)
|
||||
{
|
||||
/* Some events we always pass on, to ensure proper communication. */
|
||||
return ISTIMER(event->type) || (event->type == WINDEACTIVATE);
|
||||
|
@ -2754,7 +2754,7 @@ static int wm_handler_fileselect_call(bContext *C,
|
|||
return wm_handler_fileselect_do(C, handlers, handler, event->val);
|
||||
}
|
||||
|
||||
static int wm_action_not_handled(int action)
|
||||
static bool wm_action_not_handled(int action)
|
||||
{
|
||||
return action == WM_HANDLER_CONTINUE || action == (WM_HANDLER_BREAK | WM_HANDLER_MODAL);
|
||||
}
|
||||
|
|
|
@ -970,8 +970,8 @@ typedef enum {
|
|||
OS = 'C',
|
||||
} modifierKeyType;
|
||||
|
||||
/* check if specified modifier key type is pressed */
|
||||
static int query_qual(modifierKeyType qual)
|
||||
/** Check if specified modifier key type is pressed. */
|
||||
static bool query_qual(modifierKeyType qual)
|
||||
{
|
||||
GHOST_TModifierKey left, right;
|
||||
switch (qual) {
|
||||
|
|
Loading…
Reference in New Issue