Revision: 55035
          http://brlcad.svn.sourceforge.net/brlcad/?rev=55035&view=rev
Author:   brlcad
Date:     2013-04-04 03:18:52 +0000 (Thu, 04 Apr 2013)
Log Message:
-----------
ironically fewer lines of code without the goto even though we duplicate the 
usage statement.  cleanup.

Modified Paths:
--------------
    brlcad/trunk/src/libged/model2view.c

Modified: brlcad/trunk/src/libged/model2view.c
===================================================================
--- brlcad/trunk/src/libged/model2view.c        2013-04-04 03:13:41 UTC (rev 
55034)
+++ brlcad/trunk/src/libged/model2view.c        2013-04-04 03:18:52 UTC (rev 
55035)
@@ -17,11 +17,6 @@
  * License along with this file; see the file named COPYING for more
  * information.
  */
-/** @file libged/model2view.c
- *
- * The model2view command.
- *
- */
 
 #include "common.h"
 
@@ -32,15 +27,13 @@
 
 #include "./ged_private.h"
 
+
 /**
- * M O D E L 2 V I E W
- *
- * Given a point in model space coordinates (in mm) convert it to
- * view (screen) coordinates which must be scaled to correspond to
- * actual screen coordinates. If no input coordinates are supplied,
- * the model2view matrix is displayed.
+ * Given a point in model space coordinates (in mm) convert it to view
+ * (screen) coordinates which must be scaled to correspond to actual
+ * screen coordinates. If no input coordinates are supplied, the
+ * model2view matrix is displayed.
  */
-
 int
 ged_model2view(struct ged *gedp, int argc, const char *argv[])
 {
@@ -62,23 +55,22 @@
     }
 
     if (argc != 4) {
-       goto bad;
+       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
+       return GED_ERROR;
     }
 
-    if (sscanf(argv[1], "%lf", &model_pt[X]) != 1 ||
-       sscanf(argv[2], "%lf", &model_pt[Y]) != 1 ||
-       sscanf(argv[3], "%lf", &model_pt[Z]) != 1) {
-       goto bad;
+    if (sscanf(argv[1], "%lf", &model_pt[X]) != 1
+       || sscanf(argv[2], "%lf", &model_pt[Y]) != 1
+       || sscanf(argv[3], "%lf", &model_pt[Z]) != 1)
+    {
+       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
+       return GED_ERROR;
     }
 
     MAT4X3PNT(view_pt, gedp->ged_gvp->gv_model2view, model_pt);
     bn_encode_vect(gedp->ged_result_str, view_pt);
 
     return GED_OK;
-
-bad:
-    bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-    return GED_ERROR;
 }
 
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to