style cleanup

This commit is contained in:
Campbell Barton 2012-07-21 16:21:42 +00:00
parent 62a73381a7
commit 2a98e83abd
5 changed files with 39 additions and 21 deletions

@ -1164,8 +1164,8 @@ void mat3_to_compatible_eul(float eul[3], const float oldrot[3], float mat[][3])
compatible_eul(eul1, oldrot);
compatible_eul(eul2, oldrot);
d1 = (float)fabsf(eul1[0] - oldrot[0]) + (float)fabsf(eul1[1] - oldrot[1]) + (float)fabsf(eul1[2] - oldrot[2]);
d2 = (float)fabsf(eul2[0] - oldrot[0]) + (float)fabsf(eul2[1] - oldrot[1]) + (float)fabsf(eul2[2] - oldrot[2]);
d1 = fabsf(eul1[0] - oldrot[0]) + fabsf(eul1[1] - oldrot[1]) + fabsf(eul1[2] - oldrot[2]);
d2 = fabsf(eul2[0] - oldrot[0]) + fabsf(eul2[1] - oldrot[1]) + fabsf(eul2[2] - oldrot[2]);
/* return best, which is just the one with lowest difference */
if (d1 > d2) {

@ -2243,8 +2243,12 @@ void ui_check_but(uiBut *but)
UI_GET_BUT_VALUE_INIT(but, value);
if (ui_is_but_float(but)) {
if (value == (double) FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%sinf", but->str);
else if (value == (double) -FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s-inf", but->str);
if (value == (double) FLT_MAX) {
BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%sinf", but->str);
}
else if (value == (double) -FLT_MAX) {
BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s-inf", but->str);
}
/* support length type buttons */
else if (ui_is_but_unit(but)) {
char new_str[sizeof(but->drawstr)];
@ -2550,7 +2554,9 @@ void ui_block_do_align(uiBlock *block)
* - \a a2 Number of decimal point values to display. 0 defaults to 3 (0.000)
* 1,2,3, and a maximum of 4, all greater values will be clamped to 4.
*/
static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
int x1, int y1, short x2, short y2,
void *poin, float min, float max, float a1, float a2, const char *tip)
{
uiBut *but;
int slen;
@ -2622,10 +2628,14 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
}
}
if ((block->flag & UI_BLOCK_LOOP) || ELEM8(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR))
if ((block->flag & UI_BLOCK_LOOP) ||
ELEM8(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR))
{
but->flag |= (UI_TEXT_LEFT | UI_ICON_LEFT);
else if (but->type == BUT_TOGDUAL)
}
else if (but->type == BUT_TOGDUAL) {
but->flag |= UI_ICON_LEFT;
}
but->flag |= (block->flag & UI_BUT_ALIGN);
@ -2670,7 +2680,10 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
but->lockstr = ""
static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, float a1, float a2, const char *tip)
static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str,
int x1, int y1, short x2, short y2,
PointerRNA *ptr, PropertyRNA *prop, int index,
float min, float max, float a1, float a2, const char *tip)
{
const PropertyType proptype = RNA_property_type(prop);
uiBut *but;

@ -861,7 +861,8 @@ static void icon_set_image(bContext *C, ID *id, PreviewImage *prv_img, enum eIco
prv_img->w[size], prv_img->h[size]);
}
static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh, unsigned int *rect, float alpha, const float rgb[3], short is_preview)
static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh,
unsigned int *rect, float alpha, const float rgb[3], short is_preview)
{
ImBuf *ima = NULL;
@ -914,7 +915,8 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect),
}
}
static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy, int UNUSED(iw), int ih, float alpha, const float rgb[3])
static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy,
int UNUSED(iw), int ih, float alpha, const float rgb[3])
{
float x1, x2, y1, y2;
@ -957,7 +959,8 @@ static int get_draw_size(enum eIconSizes size)
return 0;
}
static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, const float rgb[3], enum eIconSizes size, int draw_size, int UNUSED(nocreate), short is_preview)
static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, const float rgb[3],
enum eIconSizes size, int draw_size, int UNUSED(nocreate), short is_preview)
{
bTheme *btheme = UI_GetTheme();
Icon *icon = NULL;

@ -1213,7 +1213,8 @@ void UI_GetColorPtrShade3ubv(const unsigned char cp[3], unsigned char col[3], in
}
// get a 3 byte color, blended and shaded between two other char color pointers
void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset)
void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3],
float fac, int offset)
{
int r, g, b;
@ -1740,7 +1741,8 @@ void init_userdef_do_versions(void)
}
if (bmain->versionfile < 257) {
/* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs, so that it doesn't linger around from old configs like a ghost */
/* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs,
* so that it doesn't linger around from old configs like a ghost */
U.autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET;
}

@ -499,15 +499,15 @@ static void VIEW2D_OT_scroll_up(wmOperatorType *ot)
/* ********************************************************* */
/* SINGLE-STEP VIEW ZOOMING OPERATOR */
/* This group of operators come in several forms:
* 1) Scrollwheel 'steps' - rolling mousewheel by one step zooms view by predefined amount
* 2) Scrollwheel 'steps' + alt + ctrl/shift - zooms view on one axis only (ctrl=x, shift=y) // XXX this could be implemented...
* 3) Pad +/- Keys - pressing each key moves the zooms the view by a predefined amount
/* This group of operators come in several forms:
* 1) Scrollwheel 'steps' - rolling mousewheel by one step zooms view by predefined amount
* 2) Scrollwheel 'steps' + alt + ctrl/shift - zooms view on one axis only (ctrl=x, shift=y) // XXX this could be implemented...
* 3) Pad +/- Keys - pressing each key moves the zooms the view by a predefined amount
*
* In order to make sure this works, each operator must define the following RNA-Operator Props:
* zoomfacx, zoomfacy - These two zoom factors allow for non-uniform scaling.
* It is safe to scale by 0, as these factors are used to determine
* amount to enlarge 'cur' by
* In order to make sure this works, each operator must define the following RNA-Operator Props:
* zoomfacx, zoomfacy - These two zoom factors allow for non-uniform scaling.
* It is safe to scale by 0, as these factors are used to determine
* amount to enlarge 'cur' by
*/
/* ------------------ 'Shared' stuff ------------------------ */