diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-09 21:05:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-09 21:05:47 +0400 |
commit | 6665cf4cde7f94e269dc76997150b0d72c2970a7 (patch) | |
tree | 7e4f8e4804382ae00f8468f2619a6159a854cb5d /source/blender/editors | |
parent | a1d5261951ab621d2874ea24e80c95f1b83b5ac8 (diff) |
code cleanup: remove pointless casts (int -> short -> int)
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 12 |
2 files changed, 16 insertions, 9 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 41b4063a29a..5df978e73de 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -221,8 +221,10 @@ static void node_draw_output_default(const bContext *C, uiBlock *block, ofs++; slen = snode->aspect_sqrt * UI_GetStringWidth(ui_name + ofs); } - uiDefBut(block, LABEL, 0, ui_name + ofs, (short)(sock->locx - (15.0f * snode->aspect_sqrt) - slen), (short)(sock->locy - 9.0f), - (short)(node->width - NODE_DY), NODE_DY, NULL, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, 0, ui_name + ofs, + (int)(sock->locx - (15.0f * snode->aspect_sqrt) - slen), (int)(sock->locy - 9.0f), + (short)(node->width - NODE_DY), (short)NODE_DY, + NULL, 0, 0, 0, 0, ""); } /* ****************** BASE DRAW FUNCTIONS FOR NEW OPERATOR NODES ***************** */ @@ -387,8 +389,8 @@ static void node_buts_normal(uiLayout *layout, bContext *UNUSED(C), PointerRNA * uiBut *bt; bt = uiDefButF(block, BUT_NORMAL, B_NODE_EXEC, "", - (short)butr->xmin, (short)butr->xmin, - butr->xmax - butr->xmin, butr->xmax - butr->xmin, + (int)butr->xmin, (int)butr->xmin, + (short)(butr->xmax - butr->xmin), (short)(butr->xmax - butr->xmin), nor, 0.0f, 1.0f, 0, 0, ""); uiButSetFunc(bt, node_normal_cb, ntree, node); } @@ -827,7 +829,8 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN /* backdrop title */ UI_ThemeColor(TH_TEXT_HI); - layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, (short)(rect.xmin + 15), (short)(rect.ymax + group_header), + layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, + (int)(rect.xmin + 15), (int)(rect.ymax + group_header), MIN2((int)(rect.xmax - rect.xmin - 18.0f), node_group_frame + 20), group_header, UI_GetStyle()); RNA_pointer_create(&ntree->id, &RNA_Node, gnode, &ptr); uiTemplateIDBrowse(layout, (bContext *)C, &ptr, "node_tree", NULL, NULL, NULL); diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 745582c1125..fdd3f6330ab 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -797,8 +797,10 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN //if (node->flag & NODE_MUTED) // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - don't print into self! - uiDefBut(node->block, LABEL, 0, showname, (short)(rct->xmin+15), (short)(rct->ymax-NODE_DY), - (int)(iconofs - rct->xmin-18.0f), NODE_DY, NULL, 0, 0, 0, 0, ""); + uiDefBut(node->block, LABEL, 0, showname, + (int)(rct->xmin + 15), (int)(rct->ymax - NODE_DY), + (short)(iconofs - rct->xmin - 18.0f), (short)NODE_DY, + NULL, 0, 0, 0, 0, ""); /* body */ if (node->flag & NODE_CUSTOM_COLOR) @@ -946,8 +948,10 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b //if (node->flag & NODE_MUTED) // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - don't print into self! - uiDefBut(node->block, LABEL, 0, showname, (short)(rct->xmin+15), (short)(centy-10), - (int)(rct->xmax - rct->xmin-18.0f -12.0f), NODE_DY, NULL, 0, 0, 0, 0, ""); + uiDefBut(node->block, LABEL, 0, showname, + (int)(rct->xmin + 15), (int)(centy - 10), + (short)(rct->xmax - rct->xmin-18.0f -12.0f), (short)NODE_DY, + NULL, 0, 0, 0, 0, ""); } /* scale widget thing */ |