Cleanup: whitespace & break placement

This commit is contained in:
Campbell Barton 2015-07-18 19:02:39 +10:00
parent 2199a3e38b
commit ecb3e0fe73
15 changed files with 81 additions and 64 deletions

@ -1045,16 +1045,17 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
}
eventData = (GHOST_TEventDataPtr) ibuf;
}
break;
}
default:
return GHOST_kFailure;
break;
}
pushEvent(new GHOST_EventDragnDrop(getMilliSeconds(),eventType,draggedObjectType,window,mouseX,mouseY,eventData));
}
break;
}
default:
return GHOST_kFailure;
}

@ -320,8 +320,9 @@ GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
g_event = new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowClose, window);
break;
}
}
break;
}
case SDL_QUIT:
g_event = new GHOST_Event(getMilliSeconds(), GHOST_kEventQuit, NULL);
break;
@ -417,8 +418,8 @@ GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
GHOST_WindowSDL *window = findGhostWindow(SDL_GetWindowFromID_fallback(sdl_sub_evt.windowID));
assert(window != NULL);
g_event = new GHOST_EventWheel(getMilliSeconds(), window, sdl_sub_evt.y);
}
break;
}
case SDL_KEYDOWN:
case SDL_KEYUP:
{
@ -488,8 +489,8 @@ GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
}
g_event = new GHOST_EventKey(getMilliSeconds(), type, window, gkey, sym, NULL);
}
break;
}
}
if (g_event) {

@ -2861,12 +2861,12 @@ static ImBuf *seq_render_movie_strip(const SeqRenderData *context, Sequence *seq
seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN,
proxy_size);
/* fetching for requested proxy size failed, try fetching the original instead */
if (!ibuf_arr[i] && proxy_size != IMB_PROXY_NONE) {
ibuf_arr[i] = IMB_anim_absolute(sanim->anim, nr + seq->anim_startofs,
seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN,
IMB_PROXY_NONE);
}
/* fetching for requested proxy size failed, try fetching the original instead */
if (!ibuf_arr[i] && proxy_size != IMB_PROXY_NONE) {
ibuf_arr[i] = IMB_anim_absolute(sanim->anim, nr + seq->anim_startofs,
seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN,
IMB_PROXY_NONE);
}
if (ibuf_arr[i]) {
/* we don't need both (speed reasons)! */
if (ibuf_arr[i]->rect_float && ibuf_arr[i]->rect)

@ -2107,8 +2107,9 @@ static void lib_link_fmodifiers(FileData *fd, ID *id, ListBase *list)
{
FMod_Python *data = (FMod_Python *)fcm->data;
data->script = newlibadr(fd, id->lib, data->script);
}
break;
}
}
}
}
@ -2166,23 +2167,26 @@ static void direct_link_fmodifiers(FileData *fd, ListBase *list)
if (fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
BLI_endian_switch_float_array(data->coefficients, data->arraysize);
}
}
break;
}
case FMODIFIER_TYPE_ENVELOPE:
{
FMod_Envelope *data= (FMod_Envelope *)fcm->data;
data->data= newdataadr(fd, data->data);
}
break;
}
case FMODIFIER_TYPE_PYTHON:
{
FMod_Python *data = (FMod_Python *)fcm->data;
data->prop = newdataadr(fd, data->prop);
IDP_DirectLinkGroup_OrFree(&data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
}
break;
}
}
}
}
@ -4554,7 +4558,7 @@ static void lib_link_object(FileData *fd, Main *main)
bCameraActuator *ca = act->data;
ca->ob= newlibadr(fd, ob->id.lib, ca->ob);
}
/* leave this one, it's obsolete but necessary to read for conversion */
/* leave this one, it's obsolete but necessary to read for conversion */
else if (act->type == ACT_ADD_OBJECT) {
bAddObjectActuator *eoa = act->data;
if (eoa) eoa->ob= newlibadr(fd, ob->id.lib, eoa->ob);
@ -8375,8 +8379,9 @@ static void expand_fmodifiers(FileData *fd, Main *mainvar, ListBase *list)
FMod_Python *data = (FMod_Python *)fcm->data;
expand_doit(fd, mainvar, data->script);
}
break;
}
}
}
}

@ -807,7 +807,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
}
#undef SEQ_USE_PROXY_CUSTOM_DIR
#undef SEQ_USE_PROXY_CUSTOM_FILE
}
}
SEQ_END
}
}
@ -1589,7 +1589,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
bAnimVizSettings *avs = &ob->pose->avs;
/* ghosting settings ---------------- */
/* ranges */
/* ranges */
avs->ghost_bc = avs->ghost_ac = arm->ghostep;
avs->ghost_sf = arm->ghostsf;
@ -1599,19 +1599,19 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
avs->ghost_ef = 100;
}
/* type */
/* type */
if (arm->ghostep == 0)
avs->ghost_type = GHOST_TYPE_NONE;
else
avs->ghost_type = arm->ghosttype + 1;
/* stepsize */
/* stepsize */
avs->ghost_step = arm->ghostsize;
if (avs->ghost_step == 0)
avs->ghost_step = 1;
/* path settings --------------------- */
/* ranges */
/* ranges */
avs->path_bc = arm->pathbc;
avs->path_ac = arm->pathac;
if ((avs->path_bc == avs->path_ac) && (avs->path_bc == 0))
@ -1624,7 +1624,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
avs->path_ef = 250;
}
/* flags */
/* flags */
if (arm->pathflag & ARM_PATH_FNUMS)
avs->path_viewflag |= MOTIONPATH_VIEW_FNUMS;
if (arm->pathflag & ARM_PATH_KFRAS)
@ -1632,15 +1632,15 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
if (arm->pathflag & ARM_PATH_KFNOS)
avs->path_viewflag |= MOTIONPATH_VIEW_KFNOS;
/* bake flags */
/* bake flags */
if (arm->pathflag & ARM_PATH_HEADS)
avs->path_bakeflag |= MOTIONPATH_BAKE_HEADS;
/* type */
/* type */
if (arm->pathflag & ARM_PATH_ACFRA)
avs->path_type = MOTIONPATH_TYPE_ACFRA;
/* stepsize */
/* stepsize */
avs->path_step = arm->pathsize;
if (avs->path_step == 0)
avs->path_step = 1;

@ -2401,8 +2401,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
data->flag |= MINMAX_STICKY;
else
data->flag &= ~MINMAX_STICKY;
}
break;
}
case CONSTRAINT_TYPE_ROTLIKE:
{
bRotateLikeConstraint *data = curcon->data;
@ -2410,8 +2411,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
/* version patch from buttons_object.c */
if (data->flag == 0)
data->flag = ROTLIKE_X|ROTLIKE_Y|ROTLIKE_Z;
}
break;
}
}
}
}

@ -613,8 +613,9 @@ static void write_fmodifiers(WriteData *wd, ListBase *fmodifiers)
/* write coefficients array */
if (data->coefficients)
writedata(wd, DATA, sizeof(float)*(data->arraysize), data->coefficients);
}
break;
}
case FMODIFIER_TYPE_ENVELOPE:
{
FMod_Envelope *data= (FMod_Envelope *)fcm->data;
@ -622,8 +623,9 @@ static void write_fmodifiers(WriteData *wd, ListBase *fmodifiers)
/* write envelope data */
if (data->data)
writestruct(wd, DATA, "FCM_EnvelopeData", data->totvert, data->data);
}
break;
}
case FMODIFIER_TYPE_PYTHON:
{
FMod_Python *data = (FMod_Python *)fcm->data;
@ -631,8 +633,9 @@ static void write_fmodifiers(WriteData *wd, ListBase *fmodifiers)
/* Write ID Properties -- and copy this comment EXACTLY for easy finding
* of library blocks that implement this.*/
IDP_WriteProperty(data->prop, wd);
}
break;
}
}
}
}
@ -1425,16 +1428,18 @@ static void write_constraints(WriteData *wd, ListBase *conlist)
/* Write ID Properties -- and copy this comment EXACTLY for easy finding
* of library blocks that implement this.*/
IDP_WriteProperty(data->prop, wd);
}
break;
}
case CONSTRAINT_TYPE_SPLINEIK:
{
bSplineIKConstraint *data = (bSplineIKConstraint *)con->data;
/* write points array */
writedata(wd, DATA, sizeof(float)*(data->numpoints), data->points);
}
break;
}
}
}

@ -160,14 +160,16 @@ static bool acf_show_channel_colors(bAnimContext *ac)
{
SpaceAction *saction = (SpaceAction *)ac->sl;
showGroupColors = !(saction->flag & SACTION_NODRAWGCOLORS);
}
break;
}
case SPACE_IPO:
{
SpaceIpo *sipo = (SpaceIpo *)ac->sl;
showGroupColors = !(sipo->flag & SIPO_NODRAWGCOLORS);
}
break;
}
}
}

@ -1396,9 +1396,9 @@ static int animchannels_grouping_poll(bContext *C)
/* dopesheet and action only - all others are for other datatypes or have no groups */
if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_DOPESHEET) == 0)
return 0;
}
break;
}
case SPACE_IPO:
{
SpaceIpo *sipo = (SpaceIpo *)sl;
@ -1406,9 +1406,9 @@ static int animchannels_grouping_poll(bContext *C)
/* drivers can't have groups... */
if (sipo->mode != SIPO_MODE_ANIMATION)
return 0;
}
break;
}
/* unsupported... */
default:
return 0;

@ -8106,7 +8106,7 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
retval = WM_UI_HANDLER_CONTINUE;
break;
}
/* XXX hardcoded keymap check... but anyway, while view changes, tooltips should be removed */
/* XXX hardcoded keymap check... but anyway, while view changes, tooltips should be removed */
case WHEELUPMOUSE:
case WHEELDOWNMOUSE:
case MIDDLEMOUSE:

@ -276,8 +276,8 @@ static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
view_pan_apply(C, op);
break;
}
/* XXX - Mode switching isn't implemented. See comments in 36818.
* switch to zoom */
/* XXX - Mode switching isn't implemented. See comments in 36818.
* switch to zoom */
#if 0
case LEFTMOUSE:
if (event->val == KM_PRESS) {

@ -1498,46 +1498,47 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op)
outliner_do_data_operation(soops, datalevel, event, &soops->tree, pchan_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "PoseChannel operation");
}
break;
}
case TSE_BONE:
{
outliner_do_data_operation(soops, datalevel, event, &soops->tree, bone_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "Bone operation");
}
break;
}
case TSE_EBONE:
{
outliner_do_data_operation(soops, datalevel, event, &soops->tree, ebone_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "EditBone operation");
}
break;
}
case TSE_SEQUENCE:
{
Scene *scene = CTX_data_scene(C);
outliner_do_data_operation(soops, datalevel, event, &soops->tree, sequence_cb, scene);
}
break;
}
case TSE_GP_LAYER:
{
outliner_do_data_operation(soops, datalevel, event, &soops->tree, gp_layer_cb, NULL);
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, NULL);
ED_undo_push(C, "Grease Pencil Layer operation");
}
break;
}
case TSE_RNA_STRUCT:
if (event == OL_DOP_SELECT_LINKED) {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, data_select_linked_cb, C);
}
break;
default:
BKE_report(op->reports, RPT_WARNING, "Not yet implemented");
break;

@ -223,10 +223,10 @@ static int FrsMaterial_mathutils_get_index(BaseMathObject *bmo, int subtype, int
BPy_FrsMaterial *self = (BPy_FrsMaterial *)bmo->cb_user;
switch (subtype) {
case MATHUTILS_SUBTYPE_LINE:
{
const float *color = self->m->line();
bmo->data[index] = color[index];
}
{
const float *color = self->m->line();
bmo->data[index] = color[index];
}
break;
case MATHUTILS_SUBTYPE_DIFFUSE:
{

@ -378,7 +378,7 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, bool do_verte
{
int a;
/* clear all vertex normals */
/* clear all vertex normals */
if (do_vertex_normal) {
for (a=0; a<obr->totvert; a++) {
VertRen *ver= RE_findOrAddVert(obr, a);
@ -386,8 +386,8 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, bool do_verte
}
}
/* calculate cos of angles and point-masses, use as weight factor to
* add face normal to vertex */
/* calculate cos of angles and point-masses, use as weight factor to
* add face normal to vertex */
for (a=0; a<obr->totvlak; a++) {
VlakRen *vlr= RE_findOrAddVlak(obr, a);
if (do_vertex_normal && vlr->flag & ME_SMOOTH) {
@ -404,7 +404,7 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, bool do_verte
}
}
/* do solid faces */
/* do solid faces */
for (a=0; a<obr->totvlak; a++) {
VlakRen *vlr= RE_findOrAddVlak(obr, a);

@ -548,9 +548,9 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
fp[2]= shr->winspeed[2];
fp[3]= shr->winspeed[3];
}
}
break;
break;
}
case SCE_PASS_RAYHITS:
/* */
col= shr->rayhits;