style cleanup
This commit is contained in:
@@ -47,8 +47,8 @@ void ExecutionSystemHelper::addbNodeTree(ExecutionSystem &system, int nodes_star
|
||||
|
||||
const bNodeTree *basetree = system.getContext().getbNodeTree();
|
||||
/* update viewers in the active edittree as well the base tree (for backdrop) */
|
||||
bool is_active_group = (parent_key.value == basetree->active_viewer_key.value
|
||||
|| tree == basetree);
|
||||
bool is_active_group = ((parent_key.value == basetree->active_viewer_key.value) ||
|
||||
(tree == basetree));
|
||||
|
||||
/* add all nodes of the tree to the node list */
|
||||
bNode *node = (bNode *)tree->nodes.first;
|
||||
|
||||
@@ -290,41 +290,41 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, float sigma, unsign
|
||||
X = (double *)MEM_callocN(sz * sizeof(double), "IIR_gauss X buf");
|
||||
Y = (double *)MEM_callocN(sz * sizeof(double), "IIR_gauss Y buf");
|
||||
W = (double *)MEM_callocN(sz * sizeof(double), "IIR_gauss W buf");
|
||||
if (xy & 1) { // H
|
||||
int offset;
|
||||
if (xy & 1) { // H
|
||||
int offset;
|
||||
for (y = 0; y < src_height; ++y) {
|
||||
const int yx = y * src_width;
|
||||
offset = yx*COM_NUMBER_OF_CHANNELS + chan;
|
||||
for (x = 0; x < src_width; ++x) {
|
||||
X[x] = buffer[offset];
|
||||
offset += COM_NUMBER_OF_CHANNELS;
|
||||
}
|
||||
const int yx = y * src_width;
|
||||
offset = yx*COM_NUMBER_OF_CHANNELS + chan;
|
||||
for (x = 0; x < src_width; ++x) {
|
||||
X[x] = buffer[offset];
|
||||
offset += COM_NUMBER_OF_CHANNELS;
|
||||
}
|
||||
YVV(src_width);
|
||||
offset = yx*COM_NUMBER_OF_CHANNELS + chan;
|
||||
for (x = 0; x < src_width; ++x) {
|
||||
buffer[offset] = Y[x];
|
||||
offset += COM_NUMBER_OF_CHANNELS;
|
||||
}
|
||||
}
|
||||
offset = yx*COM_NUMBER_OF_CHANNELS + chan;
|
||||
for (x = 0; x < src_width; ++x) {
|
||||
buffer[offset] = Y[x];
|
||||
offset += COM_NUMBER_OF_CHANNELS;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (xy & 2) { // V
|
||||
int offset;
|
||||
const int add = src_width * COM_NUMBER_OF_CHANNELS;
|
||||
if (xy & 2) { // V
|
||||
int offset;
|
||||
const int add = src_width * COM_NUMBER_OF_CHANNELS;
|
||||
|
||||
for (x = 0; x < src_width; ++x) {
|
||||
offset = x * COM_NUMBER_OF_CHANNELS + chan;
|
||||
for (y = 0; y < src_height; ++y) {
|
||||
X[y] = buffer[offset];
|
||||
offset += add;
|
||||
}
|
||||
for (x = 0; x < src_width; ++x) {
|
||||
offset = x * COM_NUMBER_OF_CHANNELS + chan;
|
||||
for (y = 0; y < src_height; ++y) {
|
||||
X[y] = buffer[offset];
|
||||
offset += add;
|
||||
}
|
||||
YVV(src_height);
|
||||
offset = x * COM_NUMBER_OF_CHANNELS + chan;
|
||||
for (y = 0; y < src_height; ++y) {
|
||||
buffer[offset] = Y[y];
|
||||
offset += add;
|
||||
}
|
||||
}
|
||||
}
|
||||
offset = x * COM_NUMBER_OF_CHANNELS + chan;
|
||||
for (y = 0; y < src_height; ++y) {
|
||||
buffer[offset] = Y[y];
|
||||
offset += add;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MEM_freeN(X);
|
||||
MEM_freeN(W);
|
||||
|
||||
@@ -1107,7 +1107,6 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op)
|
||||
break;
|
||||
|
||||
case ANIMCONT_SHAPEKEY: // DOUBLE CHECK ME...
|
||||
|
||||
default: /* some collection of actions */
|
||||
if (adt->action)
|
||||
rearrange_action_channels(&ac, adt->action, mode);
|
||||
@@ -2455,7 +2454,7 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
|
||||
* Only do this if "Only Selected" dopesheet filter is not active, or else it
|
||||
* becomes too unpredictable/tricky to manage
|
||||
*/
|
||||
if ((ac->ads->filterflag & ADS_FILTER_ONLYSEL)==0) {
|
||||
if ((ac->ads->filterflag & ADS_FILTER_ONLYSEL) == 0) {
|
||||
if ((ale->id) && (GS(ale->id->name) == ID_OB)) {
|
||||
ob = (Object *)ale->id;
|
||||
|
||||
|
||||
@@ -2032,7 +2032,8 @@ static void adduplicateflagNurb(Object *obedit, ListBase *newnurb,
|
||||
MEM_freeN(usel);
|
||||
|
||||
if ((newu == 0 || newv == 0) ||
|
||||
(split && !isNurbselU(nu, &newv, SELECT) && !isNurbselV(nu, &newu, SELECT))) {
|
||||
(split && !isNurbselU(nu, &newv, SELECT) && !isNurbselV(nu, &newu, SELECT)))
|
||||
{
|
||||
if (G.debug & G_DEBUG)
|
||||
printf("Can't duplicate Nurb\n");
|
||||
}
|
||||
@@ -6076,7 +6077,8 @@ static int curve_delete_segments(Object *obedit, const bool split)
|
||||
bezt2 = &nu->bezt[1];
|
||||
|
||||
if (BEZSELECTED_HIDDENHANDLES(cu, bezt1) &&
|
||||
BEZSELECTED_HIDDENHANDLES(cu, bezt2)) {
|
||||
BEZSELECTED_HIDDENHANDLES(cu, bezt2))
|
||||
{
|
||||
nu1 = BKE_nurb_copy(nu, 1, 1);
|
||||
ED_curve_beztcpy(editnurb, nu1->bezt, bezt1, 1);
|
||||
BLI_addtail(&newnurb, nu1);
|
||||
@@ -6086,7 +6088,8 @@ static int curve_delete_segments(Object *obedit, const bool split)
|
||||
bezt2 = &nu->bezt[nu->pntsu - 2];
|
||||
|
||||
if (BEZSELECTED_HIDDENHANDLES(cu, bezt1) &&
|
||||
BEZSELECTED_HIDDENHANDLES(cu, bezt2)) {
|
||||
BEZSELECTED_HIDDENHANDLES(cu, bezt2))
|
||||
{
|
||||
nu1 = BKE_nurb_copy(nu, 1, 1);
|
||||
ED_curve_beztcpy(editnurb, nu1->bezt, bezt1, 1);
|
||||
BLI_addtail(&newnurb, nu1);
|
||||
|
||||
@@ -186,7 +186,7 @@ static void draw_tracks_curves(View2D *v2d, SpaceClip *sc)
|
||||
/* selected knot handles on top of curves */
|
||||
userdata.sel = TRUE;
|
||||
clip_graph_tracking_values_iterate(sc,
|
||||
(sc->flag & SC_SHOW_GRAPH_SEL_ONLY) !=0,
|
||||
(sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
|
||||
(sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
|
||||
&userdata, tracking_segment_knot_cb, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -415,9 +415,9 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
|
||||
if (result != kCFURLEnumeratorSuccess)
|
||||
continue;
|
||||
|
||||
CFURLGetFileSystemRepresentation(cfURL, false, (UInt8*)defPath, FILE_MAX);
|
||||
CFURLGetFileSystemRepresentation(cfURL, false, (UInt8 *)defPath, FILE_MAX);
|
||||
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)defPath, FS_INSERT_SORTED);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(volEnum);
|
||||
|
||||
|
||||
@@ -475,14 +475,14 @@ static void text_drop_copy(wmDrag *drag, wmDropBox *drop)
|
||||
static int text_drop_paste_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
|
||||
{
|
||||
if (drag->type == WM_DRAG_ID)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void text_drop_paste(wmDrag *drag, wmDropBox *drop)
|
||||
{
|
||||
RNA_string_set(drop->ptr, "text", ((ID*)drag->poin)->name + 2);
|
||||
RNA_string_set(drop->ptr, "text", ((ID *)drag->poin)->name + 2);
|
||||
}
|
||||
|
||||
/* this region dropbox definition */
|
||||
|
||||
@@ -6591,8 +6591,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
|
||||
if (ob->restrictflag & OB_RESTRICT_VIEW) {
|
||||
return;
|
||||
}
|
||||
else if ((ob->restrictflag & OB_RESTRICT_RENDER) && render_override)
|
||||
{
|
||||
else if ((ob->restrictflag & OB_RESTRICT_RENDER) && render_override) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,13 +99,16 @@ static ImBuf *imb_oiio_load_image(ImageInput *in, int width, int height, int com
|
||||
try
|
||||
{
|
||||
if (!in->read_image(TypeDesc::UINT8,
|
||||
(uchar *)ibuf->rect + (height - 1) * scanlinesize,
|
||||
AutoStride,
|
||||
-scanlinesize,
|
||||
AutoStride)) {
|
||||
(uchar *)ibuf->rect + (height - 1) * scanlinesize,
|
||||
AutoStride,
|
||||
-scanlinesize,
|
||||
AutoStride))
|
||||
{
|
||||
std::cerr << __func__ << ": ImageInput::read_image() failed:" << std::endl
|
||||
<< in->geterror() << std::endl;
|
||||
if (ibuf) IMB_freeImBuf(ibuf);
|
||||
<< in->geterror() << std::endl;
|
||||
|
||||
if (ibuf)
|
||||
IMB_freeImBuf(ibuf);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -135,13 +138,16 @@ static ImBuf *imb_oiio_load_image_float(ImageInput *in, int width, int height, i
|
||||
try
|
||||
{
|
||||
if (!in->read_image(TypeDesc::FLOAT,
|
||||
(uchar *)ibuf->rect_float + (height - 1) * scanlinesize,
|
||||
AutoStride,
|
||||
-scanlinesize,
|
||||
AutoStride)) {
|
||||
(uchar *)ibuf->rect_float + (height - 1) * scanlinesize,
|
||||
AutoStride,
|
||||
-scanlinesize,
|
||||
AutoStride))
|
||||
{
|
||||
std::cerr << __func__ << ": ImageInput::read_image() failed:" << std::endl
|
||||
<< in->geterror() << std::endl;
|
||||
if (ibuf) IMB_freeImBuf(ibuf);
|
||||
<< in->geterror() << std::endl;
|
||||
|
||||
if (ibuf)
|
||||
IMB_freeImBuf(ibuf);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -205,7 +211,7 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac
|
||||
in = ImageInput::create(filename);
|
||||
if (!in) {
|
||||
std::cerr << __func__ << ": ImageInput::create() failed:" << std::endl
|
||||
<< OpenImageIO::geterror() << std::endl;
|
||||
<< OpenImageIO::geterror() << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -214,7 +220,7 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac
|
||||
|
||||
if (!in->open(filename, spec, config)) {
|
||||
std::cerr << __func__ << ": ImageInput::open() failed:" << std::endl
|
||||
<< in->geterror() << std::endl;
|
||||
<< in->geterror() << std::endl;
|
||||
delete in;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,8 @@ void WM_keymap_properties_reset(wmKeyMapItem *kmi, struct IDProperty *properties
|
||||
wm_keymap_item_properties_set(kmi);
|
||||
}
|
||||
|
||||
int WM_keymap_map_type_get(wmKeyMapItem *kmi) {
|
||||
int WM_keymap_map_type_get(wmKeyMapItem *kmi)
|
||||
{
|
||||
if (ISTIMER(kmi->type)) {
|
||||
return KMI_TYPE_TIMER;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user