[brlcad-commits] SF.net SVN: brlcad: [30352] brlcad/trunk/src
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2008-02-19 01:30:22
|
Revision: 30352 http://brlcad.svn.sourceforge.net/brlcad/?rev=30352&view=rev Author: brlcad Date: 2008-02-18 17:30:27 -0800 (Mon, 18 Feb 2008) Log Message: ----------- start unraveling the horrible whitesmith-pico indentation style that put statements on the same line as open parens (and still indenting the paren). put the statement on the next line. also caught a few that just had comments following the open paren, but move them down a line too. applying auto-style formatting should clean up their indentation later. one step closer towards global consistency.. Modified Paths: -------------- brlcad/trunk/src/adrt/librender/path.c brlcad/trunk/src/anim/anim_cascade.c brlcad/trunk/src/anim/anim_hardtrack.c brlcad/trunk/src/anim/anim_keyread.c brlcad/trunk/src/anim/anim_orient.c brlcad/trunk/src/anim/anim_script.c brlcad/trunk/src/anim/anim_sort.c brlcad/trunk/src/anim/anim_track.c brlcad/trunk/src/anim/anim_turn.c brlcad/trunk/src/anim/chan_permute.c brlcad/trunk/src/burst/Hm.c brlcad/trunk/src/burst/burst.c brlcad/trunk/src/burst/fb.c brlcad/trunk/src/burst/grid.c brlcad/trunk/src/burst/idents.c brlcad/trunk/src/burst/paint.c brlcad/trunk/src/burst/plot.c brlcad/trunk/src/burst/prnt.c brlcad/trunk/src/burst/trie.c brlcad/trunk/src/burst/ui.c brlcad/trunk/src/bwish/input.c brlcad/trunk/src/bwish/tcl.c brlcad/trunk/src/conv/comgeom/f2a.c brlcad/trunk/src/conv/comgeom/tools.c brlcad/trunk/src/conv/dxf-g.c brlcad/trunk/src/conv/g2asc.c brlcad/trunk/src/conv/off/off-g.c brlcad/trunk/src/conv/patch/patch-g.c brlcad/trunk/src/external/Cubit/g-sat.cxx brlcad/trunk/src/fb/cell-fb.c brlcad/trunk/src/fb/fbgrid.c brlcad/trunk/src/fb/gif-fb.c brlcad/trunk/src/fb/orle-fb.c brlcad/trunk/src/fb/pl-fb.c brlcad/trunk/src/fbed/char.c brlcad/trunk/src/fbed/empty.c brlcad/trunk/src/fbed/execshell.c brlcad/trunk/src/fbed/fbed.c brlcad/trunk/src/fbed/getinput.c brlcad/trunk/src/fbed/prnt.c brlcad/trunk/src/fbed/sgi_dep.c brlcad/trunk/src/fbed/squash.c brlcad/trunk/src/fbed/try.c brlcad/trunk/src/gtools/beset/fitness.c brlcad/trunk/src/gtools/g_qa.c brlcad/trunk/src/irprep/all_sf.c brlcad/trunk/src/irprep/firpass.c brlcad/trunk/src/irprep/ir-X.c brlcad/trunk/src/irprep/ir-sgi.c brlcad/trunk/src/irprep/secpass.c brlcad/trunk/src/irprep/see.c brlcad/trunk/src/irprep/see2.c brlcad/trunk/src/irprep/shapefact.c brlcad/trunk/src/irprep/showtherm.c brlcad/trunk/src/lgt/char.c brlcad/trunk/src/lgt/do_options.c brlcad/trunk/src/lgt/fb.c brlcad/trunk/src/lgt/grid_rotate.c brlcad/trunk/src/lgt/hmenu.c brlcad/trunk/src/lgt/ir.c brlcad/trunk/src/lgt/lgt.c brlcad/trunk/src/lgt/lgt_db.c brlcad/trunk/src/lgt/mat_db.c brlcad/trunk/src/lgt/octree.c brlcad/trunk/src/lgt/prnt.c brlcad/trunk/src/lgt/reflect.c brlcad/trunk/src/lgt/sgi_dep.c brlcad/trunk/src/lgt/texture.c brlcad/trunk/src/lgt/trie.c brlcad/trunk/src/libbn/anim.c brlcad/trunk/src/libbn/complex.c brlcad/trunk/src/libbu/bomb.c brlcad/trunk/src/libbu/bu_tcl.c brlcad/trunk/src/libbu/convert.c brlcad/trunk/src/libbu/getopt.c brlcad/trunk/src/libbu/lex.c brlcad/trunk/src/libbu/log.c brlcad/trunk/src/libbu/parse.c brlcad/trunk/src/libcursor/cursor.c brlcad/trunk/src/libdm/clip.c brlcad/trunk/src/libfb/fb_obj.c brlcad/trunk/src/libfb/if_X.c brlcad/trunk/src/libfb/if_X24.c brlcad/trunk/src/libfb/if_ap.c brlcad/trunk/src/libfb/if_ogl.c brlcad/trunk/src/libfb/if_rat.c brlcad/trunk/src/libfb/if_sgi.c brlcad/trunk/src/libfb/if_sgiw.c brlcad/trunk/src/libfb/if_sun.c brlcad/trunk/src/libfb/if_wgl.c brlcad/trunk/src/liboptical/photonmap.c brlcad/trunk/src/liboptical/refract.c brlcad/trunk/src/liboptical/sh_fire.c brlcad/trunk/src/liboptical/sh_toyota.c brlcad/trunk/src/liborle/rle.c brlcad/trunk/src/librt/bezier_2d_isect.c brlcad/trunk/src/librt/brep_test.cpp brlcad/trunk/src/librt/db_comb.c brlcad/trunk/src/librt/g_arb.c brlcad/trunk/src/librt/g_brep.cpp brlcad/trunk/src/librt/g_dsp.c brlcad/trunk/src/librt/g_ehy.c brlcad/trunk/src/librt/g_epa.c brlcad/trunk/src/librt/g_extrude.c brlcad/trunk/src/librt/g_hf.c brlcad/trunk/src/librt/g_metaball.c brlcad/trunk/src/librt/g_submodel.c brlcad/trunk/src/librt/nirt.c brlcad/trunk/src/librt/nurb_refine.c brlcad/trunk/src/librt/nurb_solve.c brlcad/trunk/src/librt/nurb_trim.c brlcad/trunk/src/librt/parse.c brlcad/trunk/src/librt/qray.c brlcad/trunk/src/librt/shoot.c brlcad/trunk/src/librt/vdraw.c brlcad/trunk/src/librt/view_obj.c brlcad/trunk/src/librt/vshoot.c brlcad/trunk/src/libtermio/termio.c brlcad/trunk/src/mged/animedit.c brlcad/trunk/src/mged/cad_boundp.c brlcad/trunk/src/mged/cad_parea.c brlcad/trunk/src/mged/chgmodel.c brlcad/trunk/src/mged/clone.c brlcad/trunk/src/mged/cmd.c brlcad/trunk/src/mged/edarb.c brlcad/trunk/src/mged/edsol.c brlcad/trunk/src/mged/facedef.c brlcad/trunk/src/mged/ged.c brlcad/trunk/src/mged/qray.c brlcad/trunk/src/mged/red.c brlcad/trunk/src/mged/rtif.c brlcad/trunk/src/mged/typein.c brlcad/trunk/src/mk/mk_bolt.c brlcad/trunk/src/mk/mk_gastank.c brlcad/trunk/src/mk/mk_handle.c brlcad/trunk/src/mk/mk_window.c brlcad/trunk/src/mk/mk_winfrm.c brlcad/trunk/src/mk/mk_wire.c brlcad/trunk/src/proc-db/vegitation.c brlcad/trunk/src/rt/opt.c brlcad/trunk/src/sig/fhor.c brlcad/trunk/src/util/bwrot.c brlcad/trunk/src/util/hex.c brlcad/trunk/src/util/mac-pix.c brlcad/trunk/src/util/orle-pix.c brlcad/trunk/src/util/pix-sun.c brlcad/trunk/src/util/pixblend.c brlcad/trunk/src/util/pixrot.c brlcad/trunk/src/util/pl-dm.c brlcad/trunk/src/util/query.c brlcad/trunk/src/vdeck/cgarbs.c brlcad/trunk/src/vdeck/match.c brlcad/trunk/src/vdeck/parsarg.c brlcad/trunk/src/vdeck/vdeck.c brlcad/trunk/src/vdeck/vproc.c Modified: brlcad/trunk/src/adrt/librender/path.c =================================================================== --- brlcad/trunk/src/adrt/librender/path.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/adrt/librender/path.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -83,13 +83,16 @@ /* Terminate if depth is too great. */ while (propogate) { if ((new_mesh = (adrt_mesh_t *)tie_work(tie, &new_ray, &new_id, render_hit, NULL)) && new_ray.depth < RENDER_MAX_DEPTH) { - if (new_mesh->attributes->ior != 1.0) { /* Refractive Caustic */ + if (new_mesh->attributes->ior != 1.0) { + /* Refractive Caustic */ /* Deal with refractive-fu */ - } else if (new_mesh->attributes->emission > 0.0) { /* Emitting Light Source */ + } else if (new_mesh->attributes->emission > 0.0) { + /* Emitting Light Source */ T = new_mesh->attributes->color; MATH_VEC_MUL_SCALAR(T, T, new_mesh->attributes->emission); propogate = 0; - } else { /* Diffuse */ + } else { + /* Diffuse */ if (new_mesh->texture) { new_mesh->texture->work(new_mesh->texture, new_mesh, &new_ray, &new_id, &T); } else { Modified: brlcad/trunk/src/anim/anim_cascade.c =================================================================== --- brlcad/trunk/src/anim/anim_cascade.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/anim/anim_cascade.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -282,7 +282,8 @@ output_mode = CASCADE_R; } else if (d == 'f') { output_mode = CASCADE_F; - } else if (d == 'a') { /* default */ + } else if (d == 'a') { + /* default */ output_mode = CASCADE_A; } else { fprintf(stderr, "anim_cascade: unknown option -i%c\n", d); Modified: brlcad/trunk/src/anim/anim_hardtrack.c =================================================================== --- brlcad/trunk/src/anim/anim_hardtrack.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/anim/anim_hardtrack.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -141,7 +141,8 @@ return(-1); } - if (axes || cent ) { /* vehicle has own reference frame */ + if (axes || cent ) { + /* vehicle has own reference frame */ anim_add_trans(m_axes, centroid, zero); anim_add_trans(m_rev_axes, zero, rcentroid); } @@ -216,17 +217,21 @@ anim_dy_p_r2mat(mat_v, yaw, pitch, roll); anim_add_trans(mat_v, p3, rcentroid); } - else { /* analyze positions for steering */ + else { + /* analyze positions for steering */ /*get useful direction unit vectors*/ - if (frame == first_frame) { /* first frame*/ + if (frame == first_frame) { + /* first frame*/ VSUBUNIT(dir, p3, p2); VMOVE(dir2, dir); } - else if (val < 3) { /*last frame*/ + else if (val < 3) { + /*last frame*/ VSUBUNIT(dir, p2, p1); VMOVE(dir2, dir); } - else if (frame > first_frame) { /*normal*/ + else if (frame > first_frame) { + /*normal*/ VSUBUNIT(dir, p3, p1); VSUBUNIT(dir2, p2, p1);/*needed for vertical case*/ } @@ -240,7 +245,8 @@ /*determine distance traveled*/ VMOVE(wheel_prev, wheel_now); MAT4X3PNT(wheel_now, mat_v, to_track); - if (frame > first_frame) { /* increment distance by distance moved */ + if (frame > first_frame) { + /* increment distance by distance moved */ VSUB2(vdelta, wheel_now, wheel_prev); MAT3X3VEC(temp, mat_v, to_front);/*new front of vehicle*/ distance += VDOT(temp, vdelta);/*portion of vdelta in line with track*/ @@ -258,11 +264,13 @@ (void) get_link(position, &y_rot, distance+tracklen*count/num_links+init_dist); anim_y_p_r2mat(wmat, 0.0, y_rot+r[count].ang, 0.0); anim_add_trans(wmat, position, r[count].pos); - if ((axes || cent) && links_placed) { /* link moved from vehicle coords */ + if ((axes || cent) && links_placed) { + /* link moved from vehicle coords */ bn_mat_mul(mat_x, wmat, m_rev_axes); bn_mat_mul(wmat, m_axes, mat_x); } - else if (axes || cent) { /* link moved to vehicle coords */ + else if (axes || cent) { + /* link moved to vehicle coords */ MAT_MOVE(mat_x, wmat); bn_mat_mul(wmat, m_axes, mat_x); } @@ -334,12 +342,14 @@ arc_angle = x[i].w.ang0 - x[i].w.ang1; while (arc_angle < 0.0) arc_angle += 2.0*M_PI; - if (arc_angle > M_PI) { /* concave */ + if (arc_angle > M_PI) { + /* concave */ x[i].w.ang0 = 0.5*(x[i].w.ang0 + x[i].w.ang1); x[i].w.ang1 = x[i].w.ang0; x[i].w.arc = 0.0; } - else { /* convex - angles are already correct */ + else { + /* convex - angles are already correct */ x[i].w.arc = arc_angle; } } Modified: brlcad/trunk/src/anim/anim_keyread.c =================================================================== --- brlcad/trunk/src/anim/anim_keyread.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/anim/anim_keyread.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -84,7 +84,8 @@ if (!get_args(argc, argv)) fprintf(stderr, "anim_keyread: get_args error"); - while (!feof(stdin)) { /* read one keyframe */ + while (!feof(stdin)) { + /* read one keyframe */ scanf("%lf", &time); scanf("%lf", &viewsize); scanf("%lf %lf %lf", eyept, eyept+1, eyept+2); Modified: brlcad/trunk/src/anim/anim_orient.c =================================================================== --- brlcad/trunk/src/anim/anim_orient.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/anim/anim_orient.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -146,7 +146,8 @@ } /* end of input conversion, begin output conversion*/ - if (upright) { /* force right-side up */ + if (upright) { + /* force right-side up */ VSET(temp, matrix[0], matrix[4], matrix[8]); VSET(temp2, matrix[1], matrix[5], matrix[9]); anim_dirn2mat(matrix, temp, temp2); @@ -215,7 +216,8 @@ output_inv = 0; length = 4; - if (argc > 2) { /*read output mode */ + if (argc > 2) { + /*read output mode */ cp = argv[2]; while ( (c=*cp++) ) { switch (c) { @@ -252,7 +254,8 @@ } } } - if (argc > 1) { /*read input mode */ + if (argc > 1) { + /*read input mode */ cp = argv[1]; while ( (c=*cp++) ) { switch (c) { Modified: brlcad/trunk/src/anim/anim_script.c =================================================================== --- brlcad/trunk/src/anim/anim_script.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/anim/anim_script.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -107,7 +107,8 @@ val=scanf("%lf %lf %lf", &yaw, &pitch, &roll); } - if (val < 3) { /* ie. scanf not completely successful */ + if (val < 3) { + /* ie. scanf not completely successful */ /* with steering option, must go extra loop after end of file */ if (steer && !last_steer) last_steer = 1; @@ -132,12 +133,14 @@ anim_v_unpermute(a); /* make final matrix, including translation etc */ - if (axes) { /* add pre-rotation from original axes */ + if (axes) { + /* add pre-rotation from original axes */ bn_mat_mul(m_x, a, m_rev_axes); MAT_MOVE(a, m_x); } anim_add_trans(a, point, rcentroid); /* add translation */ - if (axes && relative_a) { /* add post-rotation back to original axes */ + if (axes && relative_a) { + /* add post-rotation back to original axes */ bn_mat_mul(m_x, m_axes, a); MAT_MOVE(a, m_x); } Modified: brlcad/trunk/src/anim/anim_sort.c =================================================================== --- brlcad/trunk/src/anim/anim_sort.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/anim/anim_sort.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -113,7 +113,8 @@ } } if (number==frame_number) { - if (!success) { /*first successful match*/ + if (!success) { + /*first successful match*/ printf("%s", line); if (!suppressed) printf("clean;\n"); success = 1; Modified: brlcad/trunk/src/anim/anim_track.c =================================================================== --- brlcad/trunk/src/anim/anim_track.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/anim/anim_track.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -143,7 +143,8 @@ if (!get_args(argc, argv)) fprintf(stderr, "Anim_track: Argument error.\n"); - if (axes || cent ) { /* vehicle has own reference frame */ + if (axes || cent ) { + /* vehicle has own reference frame */ anim_add_trans(m_axes, centroid, zero); anim_add_trans(m_rev_axes, zero, rcentroid); } @@ -284,7 +285,8 @@ /*determine distance traveled*/ VMOVE(wheel_prev, wheel_now); MAT4X3PNT(wheel_now, mat_x, to_track); - if (frame > first_frame) { /* increment distance by distance moved*/ + if (frame > first_frame) { + /* increment distance by distance moved*/ VSUB2(vdelta, wheel_now, wheel_prev); MAT3X3VEC(temp, mat_x, to_front);/*new front of vehicle*/ distance += VDOT(temp, vdelta);/*portion of vdelta in line with track*/ @@ -312,7 +314,8 @@ (void) get_link(position, &y_rot, distance+tracklen*count/num_links+init_dist); anim_y_p_r2mat(wmat, 0.0, y_rot, 0.0); anim_add_trans(wmat, position, zero); - if (axes || cent) { /* link moved to vehicle coords */ + if (axes || cent) { + /* link moved to vehicle coords */ MAT_MOVE(mat_x, wmat); bn_mat_mul(wmat, m_axes, mat_x); } @@ -522,12 +525,14 @@ arc_angle = x[i].w.ang0 - x[i].w.ang1; while (arc_angle < 0.0) arc_angle += 2.0*M_PI; - if (arc_angle > M_PI) { /* concave */ + if (arc_angle > M_PI) { + /* concave */ x[i].w.ang0 = 0.5*(x[i].w.ang0 + x[i].w.ang1); x[i].w.ang1 = x[i].w.ang0; x[i].w.arc = 0.0; } - else { /* convex - angles are already correct */ + else { + /* convex - angles are already correct */ x[i].w.arc = arc_angle; } } @@ -566,7 +571,8 @@ /* calculate geometry of hyperbolic segment */ hyperlen = tracklen - linearlen; - if (hyperlen < x[0].t.len) { /* desired length of hyperbola less than straight line*/ + if (hyperlen < x[0].t.len) { + /* desired length of hyperbola less than straight line*/ if ((len_mode==TRACK_ELASTIC)||(len_mode==TRACK_STRETCH)) { tracklen += (x[0].t.len-hyperlen); hyperlen = tracklen - linearlen; @@ -643,7 +649,8 @@ pos[X] += curve_c; *angle_p = hyper_get_ang(curve_a, curve_c, pos[X]); } - else { /* practically linear */ + else { + /* practically linear */ VSCALE(temp, (x[0].t.dir), dist); VADD2(pos, x[0].t.pos0, temp); *angle_p = atan2(x[0].t.dir[Z], x[0].t.dir[X]); Modified: brlcad/trunk/src/anim/anim_turn.c =================================================================== --- brlcad/trunk/src/anim/anim_turn.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/anim/anim_turn.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -80,7 +80,8 @@ if (!get_args(argc, argv)) fprintf(stderr, "ascript: Get_args error"); - if (!angle_set) { /* set angle if not yet done */ + if (!angle_set) { + /* set angle if not yet done */ scanf("%*f%*[^-0123456789]"); VSCAN(temp1); scanf("%*f%*[^-0123456789]"); @@ -99,7 +100,8 @@ /*update to and from matrices */ - if (count) { /* not first time through */ + if (count) { + /* not first time through */ /* calculate matrices corrsponding to last position*/ anim_y_p_r2mat(m_to_world, angle, 0.0, 0.0); anim_add_trans(m_to_world, front, zero); @@ -124,7 +126,8 @@ VSUB2(temp1, front, back); angle = bn_atan2(temp1[1], temp1[0]); } - else { /*first time through */ + else { + /*first time through */ /*angle is already determined*/ VMOVE(front, point); } @@ -143,7 +146,8 @@ if (!(count%print_int)) printf("%.10g %.10g %.10g 0.0\n", time, factor*RTOD*yaw, RTOD*roll_ang); } - else { /* print position and orientation of vehicle */ + else { + /* print position and orientation of vehicle */ if (!(count%print_int)) printf("%.10g %.10g %.10g %.10g %.10g 0.0 0.0\n", time, front[0], front[1], front[2], RTOD * angle); } Modified: brlcad/trunk/src/anim/chan_permute.c =================================================================== --- brlcad/trunk/src/anim/chan_permute.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/anim/chan_permute.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -116,9 +116,11 @@ } arrayd = (Word *) bu_calloc(argc, sizeof(Word), "Word"); /*may use more memory than absolutely necessary*/ num_done = 0; - while (num_done < icount ) { /* go until all in files are done */ + while (num_done < icount ) { + /* go until all in files are done */ num_done = 0; - for (x=y;x<y+ocount+icount;x++) { /* do one line */ + for (x=y;x<y+ocount+icount;x++) { + /* do one line */ if (num_done >= icount) ;/*chill - all in files done */ else if (x->i_o == 1) { Modified: brlcad/trunk/src/burst/Hm.c =================================================================== --- brlcad/trunk/src/burst/Hm.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/burst/Hm.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -77,7 +77,8 @@ #define P_FORCE (1<<1) #define PutMenuChar(_c, _co, _ro, _map, _bit)\ - { static int lro = -1, lco = -1;\ + {\ + static int lro = -1, lco = -1;\ if ( (_map) & (_bit) || (_bit) == 0 )\ {\ if ( lco++ != (_co)-1 || lro != (_ro) )\ @@ -89,7 +90,7 @@ }\ (_bit) <<= 1;\ (_co)++;\ - }\ + } static boolean HmDirty = 0; static boolean HmMyxflag = 0; @@ -288,7 +289,8 @@ if ( bitmap == 0 ) return; if ( itemp->text[0] & 0200 ) /* right-justified */ - { register int i; + { + register int i; label_len--; for ( i = 0; i < width - label_len; i++ ) *p++ = itemp->text[0] & 0177; @@ -297,7 +299,8 @@ } else /* left-justified */ if ( itemp->text[label_len-1] & 0200 ) - { register int i; + { + register int i; label_len--; for ( i = 0; !(itemp->text[i] & 0200); i++ ) *p++ = itemp->text[i]; @@ -305,7 +308,8 @@ *p++ = itemp->text[label_len] & 0177; } else /* centered */ - { register int i, j; + { + register int i, j; for ( i = 0; i < (width - label_len)/2; i++ ) *p++ = ' '; for ( j = 0; itemp->text[j] != '\0'; j++ ) @@ -330,7 +334,8 @@ bit <<= p-buf; } else - { register int i; + { + register int i; for ( i = 0; i < p-buf; i++ ) writemask |= 1<<(i+1); for ( i = 0; i < p-buf; i++ ) @@ -379,7 +384,8 @@ *p++ = mark; *p = '\0'; if ( bitmap == ~0 ) - { /* All bits dirty. */ + { + /* All bits dirty. */ (void) ScMvCursor( col, row ); (void) fputs( buf, stdout ); } @@ -466,7 +472,8 @@ ); #endif for (; win != (HmWindow *) NULL; win = win->next ) - { register int height = HmHEIGHT; + { + register int height = HmHEIGHT; if ( ! (x < win->menux || x > win->menux + win->width + 1 || y < win->menuy || y > win->menuy + height + 1) ) @@ -492,7 +499,8 @@ win->menux, win->menux+win->width+1, win->menuy, win->menuy+HmHEIGHT+1 ); - { register int i; + { + register int i; for ( i = 0; i <= HmHEIGHT+1; i++ ) (void) ErLog( "\tdirty[%d]=0x%x\r\n", i, win->dirty[i] ); } @@ -571,7 +579,8 @@ for ( row = win->menuy; row < endrow; row++ ) { for ( col = win->menux; col < endcol; col++ ) - { register HmWindow *olwin; + { + register HmWindow *olwin; if ( (olwin = HmInWin( col, row, win->next )) != (HmWindow *) NULL ) @@ -909,7 +918,8 @@ menu items. */ if ( (dynamic = (menup->item == (HmItem *) NULL) )) - { register int i; + { + register int i; register HmItem *gitemp; HmLList llhead, **listp; for ( i = 0, listp = &llhead.next; @@ -968,7 +978,8 @@ emulate the static allocation of menu items. */ if ( i > 0 ) - { register int ii; + { + register int ii; register HmLList *lp; if ( (menup->item = MmVAllo( i+1, HmItem )) == NULL ) { @@ -1010,7 +1021,8 @@ HmSetmap( win ); HmDrawWin( win ); while ( ! done ) - { int c; + { + int c; if ( HmDirty ) HmRefreshWin( windows ); (void) ScMvCursor( HmXPROMPT, HmYPROMPT ); @@ -1066,24 +1078,28 @@ } break; case M_MYXMOUSE : - { static int mousex, mousey; + { + static int mousex, mousey; register HmItem *lastitemp; if ( HmGetchar() != Ctrl('_') || HmGetchar() != '1' ) goto m_badinput; HmMyxMouse( &mousex, &mousey ); if ( HmInWin( mousex, mousey, win ) != win ) - { /* Mouse cursor outside of menu. */ + { + /* Mouse cursor outside of menu. */ HmRingbell(); break; } if ( mousey == win->menuy && win->menup->prevtop == 0 ) - { /* Top border of menu and can't scroll. */ + { + /* Top border of menu and can't scroll. */ goto m_noselect; } if ( mousey == win->menuy + HmHEIGHT + 1 && win->height <= HmMaxVis + win->menup->prevtop ) - { /* Bottom border of menu and can't scroll. */ + { + /* Bottom border of menu and can't scroll. */ HmRingbell(); break; } @@ -1126,9 +1142,11 @@ m_select : case M_SELECT : if ( itemp->next != (HmMenu *) NULL ) - { HmItem *subitemp; + { + HmItem *subitemp; if ( itemp->dfn != (void (*)()) NULL ) - { int level = HmLevel; + { + int level = HmLevel; HmTtyReset(); HmLevel = 0; (*itemp->dfn)( itemp ); @@ -1137,7 +1155,8 @@ } subitemp = HmHit( itemp->next ); if ( itemp->bfn != (void (*)()) NULL ) - { int level = HmLevel; + { + int level = HmLevel; HmTtyReset(); HmLevel = 0; (*itemp->bfn)( itemp ); @@ -1154,7 +1173,8 @@ { retitemp = itemp; if ( itemp->hfn != (void (*)()) NULL ) - { int level = HmLevel; + { + int level = HmLevel; HmTtyReset(); HmLevel = 0; (*itemp->hfn)( itemp ); @@ -1185,7 +1205,8 @@ if ( dynamic ) { if ( retitemp != (HmItem *) NULL ) - { /* Must make copy of item we are returning. */ + { + /* Must make copy of item we are returning. */ static HmItem dynitem; dynitem = *retitemp; retitemp = &dynitem; Modified: brlcad/trunk/src/burst/burst.c =================================================================== --- brlcad/trunk/src/burst/burst.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/burst/burst.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -71,7 +71,8 @@ continue; } else - { /* Generate comment command. */ + { + /* Generate comment command. */ bu_strlcpy( name, CMD_COMMENT, LNBUFSZ ); return 1; } @@ -122,7 +123,8 @@ */ static int parsArgv( int argc, char **argv ) -{ register int c; +{ + register int c; /* Parse options. */ while ( (c = bu_getopt( argc, argv, "b" )) != EOF ) { @@ -149,9 +151,11 @@ assert( fp != (FILE *) NULL ); batchmode = 1; while ( getCommand( cmdname, cmdbuf, LNBUFSZ, fp ) ) - { Func *cmdfunc; + { + Func *cmdfunc; if ( (cmdfunc = getTrie( cmdname, cmdtrie )) == NULL ) - { register int i, len = strlen( cmdname ); + { + register int i, len = strlen( cmdname ); brst_log( "ERROR -- command syntax:\n" ); brst_log( "\t%s\n", cmdbuf ); brst_log( "\t" ); @@ -161,13 +165,15 @@ } else if ( strcmp( cmdname, CMD_COMMENT ) == 0 ) - { /* special handling for comments */ + { + /* special handling for comments */ cmdptr = cmdbuf; cmdbuf[strlen(cmdbuf)-1] = '\0'; /* clobber newline */ (*cmdfunc)( (HmItem *) 0 ); } else - { /* Advance pointer past nul at end of + { + /* Advance pointer past nul at end of command name. */ cmdptr = cmdbuf + strlen( cmdname ) + 1; (*cmdfunc)( (HmItem *) 0 ); Modified: brlcad/trunk/src/burst/fb.c =================================================================== --- brlcad/trunk/src/burst/fb.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/burst/fb.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -39,7 +39,8 @@ boolean imageInit() - { boolean needopen = 0; + { + boolean needopen = 0; static char lastfbfile[LNBUFSZ]={0}; /* last fbfile */ devwid = 512; devhgt = 512; @@ -84,7 +85,8 @@ boolean openFbDevice( devname ) char *devname; - { boolean ret = 1; + { + boolean ret = 1; notify( "Opening frame buffer", NOTIFY_APPEND ); if ( zoom < 1 ) { @@ -143,7 +145,8 @@ boolean closFbDevice() - { int ret; + { + int ret; notify( "Closing frame buffer", NOTIFY_APPEND ); if ( fb_close( fbiop ) == -1 ) ret = 0; Modified: brlcad/trunk/src/burst/grid.c =================================================================== --- brlcad/trunk/src/burst/grid.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/burst/grid.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -91,7 +91,8 @@ colorPartition( regp, type ) register struct region *regp; int type; - { Colors *colorp; + { + Colors *colorp; if ( plotfile[0] == NUL ) return; assert( plotfp != NULL ); @@ -149,7 +150,8 @@ */ static boolean doBursts() - { boolean status = 1; + { + boolean status = 1; noverlaps = 0; CopyVec( ag.a_ray.r_dir, viewdir ); /* XXX -- could be done up in gridModel() */ @@ -189,9 +191,11 @@ enforceLOS( ap, pt_headp ) register struct application *ap; register struct partition *pt_headp; - { register struct partition *pp; + { + register struct partition *pp; for ( pp = pt_headp->pt_forw; pp != pt_headp; ) - { register struct partition *nextpp = pp->pt_forw; + { + register struct partition *nextpp = pp->pt_forw; if ( pp->pt_outhit->hit_dist - pp->pt_inhit->hit_dist <= LOS_TOL ) { @@ -218,7 +222,8 @@ struct application *ap; struct partition *pt_headp; struct seg *segp; - { Pt_Queue *qshield = PT_Q_NULL; + { + Pt_Queue *qshield = PT_Q_NULL; register struct partition *cpp, *spp; register int nbar; register int ncrit = 0; @@ -236,12 +241,14 @@ cpp != pt_headp && nbar <= nbarriers; cpp = cpp->pt_forw ) - { register struct region *regp = cpp->pt_regionp; + { + register struct region *regp = cpp->pt_regionp; struct xray *rayp = &ap->a_ray; if ( Air( regp ) ) continue; /* Air doesn't matter here. */ if ( findIdents( regp->reg_regionid, &critids ) ) - { fastf_t entrynorm[3], exitnorm[3]; + { + fastf_t entrynorm[3], exitnorm[3]; if ( ncrit == 0 ) prntRayHeader( ap->a_ray.r_dir, viewdir, ap->a_user ); @@ -304,7 +311,8 @@ struct partition *pp; struct region *reg1, *reg2; struct partition *pheadp; - { fastf_t depth; + { + fastf_t depth; depth = pp->pt_outhit->hit_dist - pp->pt_inhit->hit_dist; if ( depth >= OVERLAP_TOL ) noverlaps++; @@ -314,7 +322,8 @@ /* reg1 was air, replace with reg2 */ return 2; if ( pp->pt_back != pheadp ) - { /* Repeat a prev region, if that is a choice */ + { + /* Repeat a prev region, if that is a choice */ if ( pp->pt_back->pt_regionp == reg1 ) return 1; if ( pp->pt_back->pt_regionp == reg2 ) @@ -348,7 +357,8 @@ struct partition *pp; struct region *reg1, *reg2; struct partition *pheadp; - { fastf_t depth; + { + fastf_t depth; point_t pt; depth = pp->pt_outhit->hit_dist - pp->pt_inhit->hit_dist; if ( depth >= OVERLAP_TOL ) @@ -376,7 +386,8 @@ /* reg1 was air, replace with reg2 */ return 2; if ( pp->pt_back != pheadp ) - { /* Repeat a prev region, if that is a choice */ + { + /* Repeat a prev region, if that is a choice */ if ( pp->pt_back->pt_regionp == reg1 ) return 1; if ( pp->pt_back->pt_regionp == reg2 ) @@ -405,7 +416,8 @@ struct application *ap; struct partition *pt_headp; struct seg *segp; - { register struct partition *pp; + { + register struct partition *pp; struct partition *bp = PT_NULL; fastf_t burstnorm[3]; /* normal at burst point */ #if DEBUG_GRID @@ -438,14 +450,16 @@ and imagined (implicit). */ for ( pp = pt_headp->pt_forw; pp != pt_headp; pp = pp->pt_forw ) - { fastf_t los = 0.0; + { + fastf_t los = 0.0; int voidflag = 0; register struct partition *np = pp->pt_forw; register struct partition *cp; register struct region *regp = pp->pt_regionp; register struct region *nregp = pp->pt_forw->pt_regionp; /* Fill in entry and exit points into hit structures. */ - { register struct hit *ihitp = pp->pt_inhit; + { + register struct hit *ihitp = pp->pt_inhit; register struct hit *ohitp = pp->pt_outhit; register struct xray *rayp = &ap->a_ray; VJOIN1( ihitp->hit_point, rayp->r_pt, ihitp->hit_dist, @@ -533,7 +547,8 @@ /* Check for possible phantom armor before internal air, that is if it is the first thing hit. */ if ( pp->pt_back == pt_headp && InsideAir( regp ) ) - { fastf_t slos; + { + fastf_t slos; /* If adjacent partitions are the same air, extend the first on to include them. */ #if DEBUG_GRID @@ -559,7 +574,8 @@ } else if ( ! Air( regp ) ) /* If we have a component, output it. */ - { fastf_t entrynorm[3]; /* normal at entry */ + { + fastf_t entrynorm[3]; /* normal at entry */ fastf_t exitnorm[3]; /* normal at exit */ /* Get entry normal. */ getRtHitNorm( pp->pt_inhit, pp->pt_inseg->seg_stp, @@ -593,7 +609,8 @@ if ( bp == PT_NULL && ! reqburstair && findIdents( regp->reg_regionid, &armorids ) ) - { /* Bursting on armor/void (ouchh). */ + { + /* Bursting on armor/void (ouchh). */ bp = pp; CopyVec( burstnorm, exitnorm ); } @@ -675,7 +692,8 @@ #endif /* See if inside air follows impl. outside air. */ if ( voidflag && InsideAir( nregp ) ) - { fastf_t slos = + { + fastf_t slos = np->pt_outhit->hit_dist - np->pt_inhit->hit_dist; #if DEBUG_GRID @@ -691,7 +709,8 @@ && Air( nregp ) && DiffAir( nregp, regp ) ) - { fastf_t slos = np->pt_outhit->hit_dist - + { + fastf_t slos = np->pt_outhit->hit_dist - np->pt_inhit->hit_dist; #if DEBUG_GRID brst_log( "\t\tdiffering airs are adjacent\n" ); @@ -714,10 +733,12 @@ return 1; if ( bp != PT_NULL ) - { fastf_t burstpt[3]; + { + fastf_t burstpt[3]; /* This is a burst point, calculate coordinates. */ if ( bdist > 0.0 ) - { /* Exterior burst point (i.e. case-fragmenting + { + /* Exterior burst point (i.e. case-fragmenting munition with contact-fuzed set-back device): location is bdist prior to entry point. */ VJOIN1( burstpt, bp->pt_inhit->hit_point, -bdist, @@ -725,7 +746,8 @@ } else if ( bdist < 0.0 ) - { /* Interior burst point (i.e. case-fragment + { + /* Interior burst point (i.e. case-fragment munition with delayed fuzing): location is the magnitude of bdist beyond the exit point. */ @@ -772,7 +794,8 @@ struct xray *rayp; fastf_t normvec[3]; char *purpose; - { fastf_t f; + { + fastf_t f; static int flipct = 0; static int totalct = 0; struct soltab *stp = pp->pt_inseg->seg_stp; @@ -822,7 +845,8 @@ struct xray *rayp; fastf_t normvec[3]; char *purpose; - { fastf_t f; + { + fastf_t f; static int flipct = 0; static int totalct = 0; struct soltab *stp = pp->pt_outseg->seg_stp; @@ -878,7 +902,8 @@ register struct application *ap; { if ( groundburst ) - { fastf_t dist; + { + fastf_t dist; fastf_t hitpoint[3]; /* first find intersection of shot with ground plane */ if ( ap->a_ray.r_dir[Z] >= 0.0 ) @@ -904,13 +929,15 @@ paintCellFb( ap, pixghit, zoom == 1 ? pixblack : pixbkgr ); if ( bdist > 0.0 ) - { /* simulate standoff fuzing */ + { + /* simulate standoff fuzing */ VJOIN1( hitpoint, hitpoint, -bdist, ap->a_ray.r_dir ); } else if ( bdist < 0.0 ) - { /* interior burst not implemented in ground */ + { + /* interior burst not implemented in ground */ brst_log( "User error: %s %s.\n", "negative burst distance can not be", "specified with ground plane bursting" @@ -963,7 +990,8 @@ static int getRayOrigin( ap ) register struct application *ap; - { register fastf_t *vec = ap->a_uvec; + { + register fastf_t *vec = ap->a_uvec; fastf_t gridyinc[3], gridxinc[3]; fastf_t scalecx, scalecy; if ( TSTBIT(firemode, FM_SHOT) ) @@ -980,7 +1008,8 @@ else /* Single shot specified. */ CopyVec( vec, fire ); if ( TSTBIT(firemode, FM_3DIM) ) - { fastf_t hitpoint[3]; + { + fastf_t hitpoint[3]; /* Project 3-d hit-point back into grid space. */ CopyVec( hitpoint, vec ); vec[X] = Dot( gridhor, hitpoint ); @@ -992,7 +1021,8 @@ scalecy = vec[Y]; } else - { fastf_t xoffset = 0.0; + { + fastf_t xoffset = 0.0; fastf_t yoffset = 0.0; ap->a_x = currshot % gridwidth + gridxorg; ap->a_y = currshot / gridwidth + gridyorg; @@ -1075,7 +1105,8 @@ gridRotate( viewazim, viewelev, 0.0, gridhor, gridver ); if ( yaw != 0.0 || pitch != 0.0 ) - { fastf_t negsinyaw = -sin( yaw ); + { + fastf_t negsinyaw = -sin( yaw ); fastf_t sinpitch = sin( pitch ); fastf_t xdeltavec[3], ydeltavec[3]; #if DEBUG_SHOT @@ -1101,10 +1132,12 @@ border of grid, and grid indices at borders of grid. */ if ( ! TSTBIT(firemode, FM_PART) ) - { fastf_t modelmin[3]; + { + fastf_t modelmin[3]; fastf_t modelmax[3]; if ( groundburst ) - { /* extend grid to include ground platform */ + { + /* extend grid to include ground platform */ modelmax[X] = Max( rtip->mdl_max[X], grndfr ); modelmin[X] = Min( rtip->mdl_min[X], -grndbk ); modelmax[Y] = Max( rtip->mdl_max[Y], grndlf ); @@ -1113,7 +1146,8 @@ modelmin[Z] = Min( rtip->mdl_min[Z], -grndht ); } else - { /* size grid by model RPP */ + { + /* size grid by model RPP */ CopyVec( modelmin, rtip->mdl_min ); CopyVec( modelmax, rtip->mdl_max ); } @@ -1262,7 +1296,8 @@ ag.a_logoverlap = rt_silent_logoverlap; ag.a_rt_i = rtip; if ( ! TSTBIT(firemode, FM_BURST) ) - { /* set up for shotlines */ + { + /* set up for shotlines */ ag.a_hit = f_ShotHit; ag.a_miss = f_ShotMiss; } @@ -1311,7 +1346,8 @@ */ static boolean gridShot() - { boolean status = 1; + { + boolean status = 1; struct application a; a = ag; a.a_resource = RESOURCE_NULL; @@ -1370,7 +1406,8 @@ struct hit *hitp; struct xray *rayp; fastf_t surfnorm[3]; - { Colors *colorp; + { + Colors *colorp; fastf_t intensity = -Dot( viewdir, surfnorm ); if ( intensity < 0.0 ) intensity = -intensity; @@ -1429,7 +1466,8 @@ static int readBurst( vec ) register fastf_t *vec; - { int items; + { + int items; assert( burstfp != (FILE *) NULL ); /* read 3D firing coordinates from input stream */ if ( (items = @@ -1473,7 +1511,8 @@ { assert( shotfp != (FILE *) NULL ); if ( ! TSTBIT(firemode, FM_3DIM) ) /* absence of 3D flag means 2D */ - { int items; + { + int items; /* read 2D firing coordinates from input stream */ if ( (items = #if SINGLE_PRECISION @@ -1499,7 +1538,8 @@ } else if ( TSTBIT(firemode, FM_3DIM) ) /* 3D coordinates */ - { int items; + { + int items; /* read 3D firing coordinates from input stream */ if ( (items = #if SINGLE_PRECISION @@ -1539,7 +1579,8 @@ RETURN CODES: the nearest integer to f. */ int roundToInt( fastf_t f ) - { register int a; + { + register int a; a = f; if ( f - a >= 0.5 ) return a + 1; @@ -1563,7 +1604,8 @@ */ void spallInit() - { fastf_t theta; /* solid angle of spall sampling cone */ + { + fastf_t theta; /* solid angle of spall sampling cone */ fastf_t phi; /* angle between ray and cone axis */ fastf_t philast; /* guard against floating point error */ int spallct = 0; /* actual no. of sampling rays */ @@ -1587,7 +1629,8 @@ generated. */ for ( phi = 0.0; phi <= philast; phi += phiinc ) - { fastf_t sinphi = sin( phi ); + { + fastf_t sinphi = sin( phi ); fastf_t gamma, gammainc, gammalast; int m; sinphi = Abs( sinphi ); @@ -1658,7 +1701,8 @@ static boolean burstRay() - { /* Need local copy of all but readonly variables for concurrent + { + /* Need local copy of all but readonly variables for concurrent threads of execution. */ struct application a_spall; fastf_t phi; @@ -1666,7 +1710,8 @@ a_spall = a_burst; a_spall.a_resource = RESOURCE_NULL; for (; ! userinterrupt;) - { fastf_t sinphi; + { + fastf_t sinphi; fastf_t gamma, gammainc, gammalast; register int done; int m; @@ -1683,7 +1728,8 @@ gammainc = TWO_PI / m; gammalast = TWO_PI - gammainc + EPSILON; for ( gamma = 0.0; gamma <= gammalast; gamma += gammainc ) - { register int ncrit; + { + register int ncrit; spallVec( a_burst.a_ray.r_dir, a_spall.a_ray.r_dir, phi, gamma ); plotRay( &a_spall.a_ray ); @@ -1724,7 +1770,8 @@ spallVec( dvec, s_rdir, phi, gamma ) register fastf_t *dvec, *s_rdir; fastf_t phi, gamma; - { fastf_t cosphi = cos( phi ); + { + fastf_t cosphi = cos( phi ); fastf_t singamma = sin( gamma ); fastf_t cosgamma = cos( gamma ); fastf_t csgaphi, ssgaphi; @@ -1760,7 +1807,8 @@ consVector( vec, azim, elev ) register fastf_t *vec; fastf_t azim, elev; - { /* Store cosine of the elevation to save calculating twice. */ + { + /* Store cosine of the elevation to save calculating twice. */ fastf_t cosE; cosE = cos( elev ); vec[0] = cos( azim ) * cosE; @@ -1786,7 +1834,8 @@ ipow( d, n ) register fastf_t d; register int n; - { register fastf_t result = 1.0; + { + register fastf_t result = 1.0; if ( d == 0.0 ) return 0.0; while ( n-- > 0 ) Modified: brlcad/trunk/src/burst/idents.c =================================================================== --- brlcad/trunk/src/burst/idents.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/burst/idents.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -96,14 +96,16 @@ readIdents( idlist, fp ) Ids *idlist; FILE *fp; - { char input_buf[BUFSIZ]; + { + char input_buf[BUFSIZ]; int lower, upper; register Ids *idp; freeIdents( idlist ); /* free old list if it exists */ for ( idp = idlist; bu_fgets( input_buf, BUFSIZ, fp ) != NULL; ) - { char *token; + { + char *token; token = strtok( input_buf, ",-:; \t" ); if ( token == NULL || sscanf( token, "%d", &lower ) < 1 ) continue; @@ -127,14 +129,16 @@ readColors( colorlist, fp ) Colors *colorlist; FILE *fp; - { char input_buf[BUFSIZ]; + { + char input_buf[BUFSIZ]; int lower, upper; int rgb[3]; register Colors *colp; for ( colp = colorlist; bu_fgets( input_buf, BUFSIZ, fp ) != NULL; ) - { int items; + { + int items; if ( (items = sscanf( input_buf, "%d %d %d %d %d\n", Modified: brlcad/trunk/src/burst/paint.c =================================================================== --- brlcad/trunk/src/burst/paint.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/burst/paint.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -114,7 +114,8 @@ register struct application *ap; unsigned char *pixpaint; unsigned char *pixexpendable; - { int gx, gy; + { + int gx, gy; register int gyfin, gxfin; register int gxorg, gyorg; register int x, y; @@ -174,7 +175,8 @@ void paintSpallFb( ap ) register struct application *ap; - { unsigned char pixel[3]; + { + unsigned char pixel[3]; int x, y; int err; fastf_t celldist; Modified: brlcad/trunk/src/burst/plot.c =================================================================== --- brlcad/trunk/src/burst/plot.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/burst/plot.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -40,7 +40,8 @@ void plotInit() - { int x1, y1, z1, x2, y2, z2; + { + int x1, y1, z1, x2, y2, z2; if ( plotfp == NULL ) return; x1 = (int) rtip->mdl_min[X] - 1; @@ -67,7 +68,8 @@ void plotRay( rayp ) register struct xray *rayp; - { int endpoint[3]; + { + int endpoint[3]; if ( plotfp == NULL ) return; VJOIN1( endpoint, rayp->r_pt, cellsz, rayp->r_dir ); Modified: brlcad/trunk/src/burst/prnt.c =================================================================== --- brlcad/trunk/src/burst/prnt.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/burst/prnt.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -53,7 +53,8 @@ int doMore( linesp ) int *linesp; - { register int ret = 1; + { + register int ret = 1; if ( ! tty ) return 1; save_Tty( HmTtyFd ); @@ -104,7 +105,8 @@ struct application *ap; struct partition *pt_headp; struct seg *segp; - { register struct partition *pp = pt_headp->pt_forw; + { + register struct partition *pp = pt_headp->pt_forw; register struct partition *cp; register struct hit *ohitp; for ( cp = pp->pt_forw; @@ -137,7 +139,8 @@ notify( str, mode ) char *str; int mode; - { register int i; + { + register int i; static int lastlen = -1; register int len; static char buf[LNBUFSZ] = { 0 }; @@ -191,7 +194,8 @@ */ void prntAspectInit() - { fastf_t projarea; /* projected area */ + { + fastf_t projarea; /* projected area */ /* Convert to user units before squaring cell size. */ projarea = cellsz*unitconv; projarea *= projarea; @@ -256,7 +260,8 @@ prntBurstHdr( bpt, shotdir ) fastf_t *bpt; /* burst point in model coords */ fastf_t *shotdir; /* shotline direction vector */ - { fastf_t vec[3]; + { + fastf_t vec[3]; /* Transform burst point (model coordinate system) into the shotline coordinate system. */ vec[Y] = Dot( gridhor, bpt ); /* Y' */ @@ -362,7 +367,8 @@ fastf_t entrynorm[3]; fastf_t exitnorm[3]; boolean burstflag; /* Was a burst generated by this partition? */ - { fastf_t icosobliquity; /* cosine of obliquity at entry */ + { + fastf_t icosobliquity; /* cosine of obliquity at entry */ fastf_t ocosobliquity; /* cosine of obliquity at exit */ fastf_t entryangle; /* obliquity angle at entry */ fastf_t exitangle; /* obliquity angle at exit */ @@ -476,7 +482,8 @@ fastf_t *raydir; /* burst ray direction vector */ fastf_t *shotdir; /* shotline direction vector */ unsigned rayno; /* ray number for this burst point */ - { double cosxr; /* cosine of angle between X' and raydir */ + { + double cosxr; /* cosine of angle between X' and raydir */ double cosyr; /* cosine of angle between Y' and raydir */ fastf_t azim; /* ray azim in radians */ fastf_t sinelev; /* sine of ray elevation */ @@ -518,7 +525,8 @@ struct partition *pt_headp; struct partition *pp; fastf_t entrynorm[3], exitnorm[3]; - { fastf_t cosobliquity; + { + fastf_t cosobliquity; fastf_t normthickness; register struct hit *ihitp = pp->pt_inhit; register struct hit *ohitp = pp->pt_outhit; @@ -617,7 +625,8 @@ pp, normvec[X], normvec[Y], normvec[Z] ); #endif if ( AproxEq( cosobliquity, 1.0, COS_TOL ) ) - { /* Trajectory was normal to surface, so no need + { + /* Trajectory was normal to surface, so no need to shoot another ray. */ fastf_t thickness = pp->pt_outhit->hit_dist - pp->pt_inhit->hit_dist; @@ -631,7 +640,8 @@ return thickness; } else - { /* need to shoot ray */ + { + /* need to shoot ray */ struct application a_thick; register struct hit *ihitp = pp->pt_inhit; register struct region *regp = pp->pt_regionp; @@ -644,7 +654,8 @@ CopyVec( a_thick.a_ray.r_pt, ihitp->hit_point ); Scale2Vec( normvec, -1.0, a_thick.a_ray.r_dir ); if ( rt_shootray( &a_thick ) == -1 && fatalerror ) - { /* Fatal error in application routine. */ + { + /* Fatal error in application routine. */ brst_log( "Fatal error: raytracing aborted.\n" ); return 0.0; } @@ -658,7 +669,8 @@ struct application *ap; struct partition *pt_headp; char *label; - { struct partition *dpp; + { + struct partition *dpp; brst_log( "%s (0x%x)\n", label, pt_headp ); if ( ap != NULL ) brst_log( "\tPnt %g,%g,%g Dir %g,%g,%g\n", @@ -693,7 +705,8 @@ struct application *ap; struct partition *pt_headp; register Pt_Queue *qp; - { fastf_t entrynorm[3], exitnorm[3]; + { + fastf_t entrynorm[3], exitnorm[3]; if ( outfile[0] == NUL ) return; if ( qp == PT_Q_NULL ) @@ -780,7 +793,8 @@ void prntPagedMenu( menu ) register char **menu; - { register int done = 0; + { + register int done = 0; int lines = (PROMPT_Y-SCROLL_TOP); if ( ! tty ) { @@ -878,7 +892,8 @@ } else if ( ScSetScrlReg( SCROLL_TOP, SCROLL_BTM+1 ) ) - { char buf[LNBUFSZ]; + { + char buf[LNBUFSZ]; (void) ScMvCursor( 1, SCROLL_BTM+1 ); (void) ScClrEOL(); /* Work around for problem with vprintf(): it doesn't @@ -944,7 +959,8 @@ }; void prntUsage() - { register char **p = usage; + { + register char **p = usage; while ( *p != NULL ) (void) fprintf( stderr, "%s\n", *p++ ); } @@ -969,7 +985,8 @@ qAdd( pp, qpp ) struct partition *pp; Pt_Queue **qpp; - { Pt_Queue *newq; + { + Pt_Queue *newq; bu_semaphore_acquire( BU_SEM_SYSCALL ); if ( (newq = (Pt_Queue *) malloc( sizeof(Pt_Queue) )) == PT_Q_NULL ) { Modified: brlcad/trunk/src/burst/trie.c =================================================================== --- brlcad/trunk/src/burst/trie.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/burst/trie.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -49,11 +49,14 @@ addTrie( name, triepp ) register char *name; register Trie **triepp; - { register Trie *curp; + { + register Trie *curp; if ( *name == NUL ) - { /* End of name, see if name already exists. */ + { + /* End of name, see if name already exists. */ if ( *triepp == TRIE_NULL ) - { /* Name does not exist, make leaf node. */ + { + /* Name does not exist, make leaf node. */ NewTrie( *triepp ); (*triepp)->l.t_altr = (*triepp)->l.t_next = TRIE_NULL; @@ -73,7 +76,8 @@ ) ; if ( curp == TRIE_NULL ) - { /* No Match, this level, so create new alternate. */ + { + /* No Match, this level, so create new alternate. */ curp = *triepp; NewTrie( *triepp ); (*triepp)->n.t_altr = curp; @@ -90,7 +94,8 @@ getTrie( name, triep ) register char *name; register Trie *triep; - { register Trie *curp = NULL; + { + register Trie *curp = NULL; assert( triep != TRIE_NULL ); /* Traverse next links to end of region name. */ @@ -98,7 +103,8 @@ { curp = triep; if ( *name == NUL ) - { /* End of user-typed name. */ + { + /* End of user-typed name. */ if ( triep->n.t_altr != TRIE_NULL ) /* Ambiguous at this point. */ return NULL_FUNC; @@ -143,7 +149,8 @@ static Func * matchTrie( triep ) register Trie *triep; - { Func *func; + { + Func *func; if ( triep == TRIE_NULL ) func = NULL_FUNC; else @@ -161,7 +168,8 @@ prntTrie( triep, level ) Trie *triep; int level; - { register Trie *tp = triep; + { + register Trie *tp = triep; static char name_buf[MAX_TRIE_LEVEL+1], *namep; #if DEBUG_TRIE brst_log( "prntTrie(triep=0x%x, level=%d)\n", triep, level ); @@ -193,7 +201,8 @@ Trie *triep; int level; FILE *fp; - { register Trie *tp = triep; + { + register Trie *tp = triep; static char name_buf[MAX_TRIE_LEVEL+1], *namep; if ( tp == TRIE_NULL ) return 1; @@ -221,7 +230,8 @@ readTrie( fp, triepp ) FILE *fp; Trie **triepp; - { static char name_buf[MAX_TRIE_LEVEL+1]; + { + static char name_buf[MAX_TRIE_LEVEL+1]; while ( bu_fgets( name_buf, MAX_TRIE_LEVEL, fp ) != NULL ) { name_buf[strlen(name_buf)-1] = '\0'; /* Clobber new-line. */ @@ -240,7 +250,8 @@ char * char_To_String( i ) int i; - { static char buf[4]; + { + static char buf[4]; if ( i >= SP && i < DEL ) { buf[0] = i; @@ -273,7 +284,8 @@ int bufsz; char *msg; Trie **triepp; - { static char buffer[BUFSIZ]; + { + static char buffer[BUFSIZ]; register char *p = buffer; register int c; Func *funcp; @@ -326,7 +338,8 @@ --p; break; case Ctrl('D') : /* Delete character under cursor. */ - { register char *q = p; + { + register char *q = p; if ( *p == NUL ) { ring_Bell(); @@ -372,7 +385,8 @@ *p = NUL; break; case Ctrl('P') : /* Yank previous contents of "inbuf". */ - { register int len = strlen( inbuf ); + { + register int len = strlen( inbuf ); if ( (p + len) - buffer >= BUFSIZ ) { ring_Bell(); @@ -390,7 +404,8 @@ break; } for (; p > buffer; --p ) - { register char *q = p; + { + register char *q = p; (void) putchar( BS ); for (; *(q-1) != NUL; ++q ) { @@ -402,7 +417,8 @@ } break; case Ctrl('R') : /* Print line, cursor doesn't move. */ - { register int i; + { + register int i; if ( buffer[0] == NUL ) break; for ( i = p - buffer; i > 0; i-- ) @@ -413,7 +429,8 @@ break; } case DEL : /* Delete character behind cursor. */ - { register char *q = p; + { + register char *q = p; if ( p == buffer ) { ring_Bell(); @@ -452,7 +469,8 @@ c = hm_getchar(); /* Fall through to default case! */ default : /* Insert character at cursor. */ - { register char *q = p; + { + register char *q = p; register int len = strlen( p ); /* Scroll characters forward. */ if ( c >= NUL && c < SP ) Modified: brlcad/trunk/src/burst/ui.c =================================================================== --- brlcad/trunk/src/burst/ui.c 2008-02-18 23:35:41 UTC (rev 30351) +++ brlcad/trunk/src/burst/ui.c 2008-02-19 01:30:27 UTC (rev 30352) @@ -47,11 +47,13 @@ static char promptbuf[LNBUFSZ]; static const char *bannerp = "BURST (2.2)"; -#define AddCmd( nm, f )\ - { Trie *p;\ - if ( (p = addTrie( nm, &cmdtrie )) == TRIE_NULL )\ - prntScr( "BUG: addTrie(%s) returned NULL.", nm );\ - else p->l.t_func = f;\ +#define AddCmd( nm, f ) \ + { \ + Trie *p; \ + if ( (p = addTrie( nm, &cmdtrie )) == TRIE_NULL ) \ + prntScr( "BUG: addTrie(%s) returned NULL.", nm ); \ + else \ + p->l.t_func = f; \ } #define GetBool( var, ptr ) \ @@ -73,40 +75,34 @@ #define GetVar( var, ptr, conv )\ {\ - if ( ! batchmode )\ - {\ - (void) snprintf( (ptr)->buffer, LNBUFSZ, (ptr)->fmt, var*conv );\ - (void) getInput( ptr );\ - if ( (sscanf( (ptr)->buffer, (ptr)->fmt, &(var) )) != 1 )\ + if ( ! batchmode ) {\ + (void) snprintf( (ptr)->buffer, LNBUFSZ, (ptr)->fmt, var*conv );\ + (void) getInput( ptr );\ + if ( (sscanf( (ptr)->buffer, (ptr)->fmt, &(var) )) != 1 )\ {\ - bu_strlcpy( (ptr)->buffer, "", LNBUFSZ );\ - return;\ + bu_strlcpy( (ptr)->buffer, "", LNBUFSZ );\ + return;\ }\ - (ptr)++;\ - }\ - else\ - { char *tokptr = strtok( cmdptr, WHITESPACE );\ - if ( tokptr == NULL\ - || sscanf( tokptr, (ptr)->fmt, &(var) ) != 1 )\ - {\ - brst_log( "ERROR -- command syntax:\n" );\ - brst_log( "\t%s\n", cmdbuf );\ - brst_log( "\tcommand (%s): argument (%s) is of wrong type, %s expected.\n", \ - cmdptr, tokptr == NULL ? "(null)" : tokptr, \ - (ptr)->fmt );\ + (ptr)++;\ + } else {\ + char *tokptr = strtok( cmdptr, WHITESPACE );\ + if (tokptr == NULL || sscanf( tokptr, (ptr)->fmt, &(var) ) != 1 ) {\ + brst_log( "ERROR -- command syntax:\n" );\ + brst_log( "\t%s\n", cmdbuf );\ + brst_log( "\tcommand (%s): argument (%s) is of wrong type, %s expected.\n", \ + cmdptr, tokptr == NULL ? "(null)" : tokptr, \ + (ptr)->fmt );\ }\ - cmdptr = NULL;\ + cmdptr = NULL;\ }\ } -typedef struct - { - char *prompt; - char buffer[LNBUFSZ]; - char *fmt; - char *range; - } -Input; +typedef struct { + char *prompt; + char buffer[LNBUFSZ]; + char *fmt; + char *range; +} Input; /* local menu functions, names all start with M */ static void MattackDir(); @@ -382,7 +378,8 @@ static HmMenu * addMenu( tp ) Ftable *tp; - { register HmMenu *menup; + { + register HmMenu *menup; register HmItem *itemp; register Ftable *ftp = tp; register int cnt; @@ -437,7 +434,8 @@ Input *ip; { if ( ! batchmode ) - { register int c; + { + register int c; register char *p; char *defaultp = ip->buffer; if ( *defaultp == NUL ) @@ -458,7 +456,8 @@ prompt( (char *) NULL ); } else - { char *str = strtok( cmdptr, WHITESPACE ); + { + char *str = strtok( cmdptr, WHITESPACE ); if ( str == NULL ) return 0; bu_strlcpy( ip->buffer, str, LNBUFSZ ); @@ -546,7 +545,8 @@ static void MattackDir( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Attack azimuth", "", "%lf", "degrees" }, { "Attack elevation", "", "%lf", "degrees" }, @@ -567,7 +567,8 @@ static void MautoBurst( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Burst along shotline", "n", "%d", "y or n" }, { "Require burst air", "y", "%d", "y or n" } @@ -597,7 +598,8 @@ static void MburstAir( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of burst air file", "", "%s", 0 }, }; @@ -630,7 +632,8 @@ static void MburstArmor( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of burst armor file", "", "%s", 0 }, }; @@ -663,7 +666,8 @@ static void MburstDist( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Burst distance", "", "%lf", 0 }, }; @@ -681,7 +685,8 @@ static void MburstFile( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of burst output file", "", "%s", 0 }, }; @@ -709,7 +714,8 @@ static void McellSize( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Cell size", "", "%lf", 0 } }; @@ -727,7 +733,8 @@ static void McolorFile( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of ident-to-color mapping file", "", "%s", 0 }, @@ -760,7 +767,8 @@ static void Mcomment( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Comment", " ", "%s", 0 }, }; @@ -784,7 +792,8 @@ static void MconeHalfAngle( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Cone angle", "", "%lf", "degrees" }, }; @@ -802,7 +811,8 @@ static void McritComp( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of critical component file", "", "%s", 0 }, }; @@ -836,7 +846,8 @@ static void MdeflectSpallCone( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Deflect cone", "n", "%d", "y or n" }, }; @@ -853,7 +864,8 @@ static void Mdither( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Dither cells", "n", "%d", "y or n" }, }; @@ -870,7 +882,8 @@ static void MenclosePortion( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Left border of grid", "", "%lf", 0 }, { "Right border of grid", "", "%lf", 0 }, @@ -911,7 +924,8 @@ static void MerrorFile( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of error output file", "", "%s", 0 }, }; @@ -945,7 +959,8 @@ static void Mexecute( itemp ) HmItem *itemp; - { static boolean gottree = 0; + { + static boolean gottree = 0; boolean loaderror = 0; (void) snprintf( scrbuf, LNBUFSZ, "%s", @@ -972,7 +987,8 @@ */ rtip->useair = 1; if ( ! gottree ) - { char *ptr, *obj; + { + char *ptr, *obj; rt_prep_timer(); for ( ptr = objects; (obj = strtok( ptr, WHITESPACE )) != NULL; @@ -1017,7 +1033,8 @@ static void MfbFile( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of frame buffer device", "", "%s", 0 }, }; @@ -1065,7 +1082,8 @@ static void MgridFile( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of grid file", "", "%s", 0 }, }; @@ -1093,7 +1111,8 @@ static void MgroundPlane( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Activate ground plane bursting", "n", "%d", "y or n" }, @@ -1138,7 +1157,8 @@ static void MhistFile( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of histogram file", "", "%s", 0 }, }; @@ -1165,7 +1185,8 @@ static void MinputBurst( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "X-coordinate of burst point", "", "%lf", 0 }, { "Y-coordinate of burst point", "", "%lf", 0 }, @@ -1190,7 +1211,8 @@ static void Minput2dShot( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Y'-coordinate of shotline", "", "%lf", 0 }, { "Z'-coordinate of shotline", "", "%lf", 0 }, @@ -1212,7 +1234,8 @@ static void Minput3dShot( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "X-coordinate of shotline", "", "%lf", 0 }, { "Y-coordinate of shotline", "", "%lf", 0 }, @@ -1245,7 +1268,8 @@ static void Mobjects( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "List of objects from target file", "", "%s", 0 }, }; @@ -1263,7 +1287,8 @@ static void Moverlaps( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Report overlaps", "y", "%d", "y or n" }, }; @@ -1280,7 +1305,8 @@ static void MmaxBarriers( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Maximum spall barriers per ray", "", "%d", 0 }, }; @@ -1297,7 +1323,8 @@ static void MmaxSpallRays( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Maximum rays per burst", "", "%d", 0 }, }; @@ -1314,7 +1341,8 @@ static void MplotFile( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of UNIX plot file", "", "%s", 0 }, }; @@ -1342,7 +1370,8 @@ static void Mread2dShotFile( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of 2-D shot input file", "", "%s", 0 }, }; @@ -1369,7 +1398,8 @@ static void Mread3dShotFile( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of 3-D shot input file", "", "%s", 0 }, }; @@ -1396,7 +1426,8 @@ static void MreadBurstFile( itemp ) HmItem *itemp; - { static Input input[] = + { + static Input input[] = { { "Name of 3-D burst input file", "", "%s", 0 }, }; @@ -1423,7 +1454,8 @@ static void Mre... [truncated message content] |