Revision: 41320
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41320&view=rev
Author:   brlcad
Date:     2010-11-10 21:16:56 +0000 (Wed, 10 Nov 2010)

Log Message:
-----------
more MAXARGS elimination.  use a -1 magic to imply unlimited args for the 
funtab.

Modified Paths:
--------------
    brlcad/trunk/src/mged/animedit.c
    brlcad/trunk/src/mged/cmd.c
    brlcad/trunk/src/mged/mged.h

Modified: brlcad/trunk/src/mged/animedit.c
===================================================================
--- brlcad/trunk/src/mged/animedit.c    2010-11-10 21:09:31 UTC (rev 41319)
+++ brlcad/trunk/src/mged/animedit.c    2010-11-10 21:16:56 UTC (rev 41320)
@@ -85,29 +85,29 @@
     {"joint ", "", "Joint command table",
      0, 0, 0, FALSE},
     {"?", "[commands]", "summary of available joint commands",
-     f_jfhelp, 0, MAXARGS, FALSE},
+     f_jfhelp, 0, FUNTAB_UNLIMITED, FALSE},
     {"accept", "[joints]", "accept a series of moves",
-     f_jaccept, 1, MAXARGS, FALSE},
+     f_jaccept, 1, FUNTAB_UNLIMITED, FALSE},
     {"debug", "[hex code]", "Show/set debuging bit vector for joints",
      f_jdebug, 1, 2, FALSE},
     {"help", "[commands]", "give usage message for given joint commands",
-     f_jhelp, 0, MAXARGS, FALSE},
+     f_jhelp, 0, FUNTAB_UNLIMITED, FALSE},
     {"holds", "[names]", "list constraints",
-     f_jhold, 1, MAXARGS, FALSE},
+     f_jhold, 1, FUNTAB_UNLIMITED, FALSE},
     {"list", "[names]", "list joints.",
-     f_jlist, 1, MAXARGS, FALSE},
+     f_jlist, 1, FUNTAB_UNLIMITED, FALSE},
     {"load", "file_name", "load a joint/constraint file",
-     f_jload, 2, MAXARGS, FALSE},
+     f_jload, 2, FUNTAB_UNLIMITED, FALSE},
     {"mesh", "", "Build the grip mesh",
      f_jmesh, 0, 1, FALSE},
     {"move", "joint_name p1 [p2...p6]", "Manual adjust a joint",
      f_jmove, 3, 8, FALSE},
     {"reject", "[joint_names]", "reject joint motions",
-     f_jreject, 1, MAXARGS, FALSE},
+     f_jreject, 1, FUNTAB_UNLIMITED, FALSE},
     {"save",   "file_name", "Save joints and constraints to disk",
      f_jsave, 2, 2, FALSE},
     {"solve", "constraint", "Solve a or all constraints",
-     f_jsolve, 1, MAXARGS, FALSE},
+     f_jsolve, 1, FUNTAB_UNLIMITED, FALSE},
     {"test", "file_name", "test use of bu_lex routine.",
      f_jtest, 2, 2, FALSE},
     {"unload", "", "Unload any joint/constrants that have been loaded",

Modified: brlcad/trunk/src/mged/cmd.c
===================================================================
--- brlcad/trunk/src/mged/cmd.c 2010-11-10 21:09:31 UTC (rev 41319)
+++ brlcad/trunk/src/mged/cmd.c 2010-11-10 21:16:56 UTC (rev 41320)
@@ -1219,7 +1219,7 @@
        if (strcmp(ftp->ft_name, argv[0]) != 0)
            continue;
        /* We have a match */
-       if ((ftp->ft_min <= argc) && (argc <= ftp->ft_max)) {
+       if ((ftp->ft_min <= argc) && (ftp->ft_max < 0 || argc <= ftp->ft_max)) {
            /* Input has the right number of args.  Call function
             * listed in table, with main(argc, argv) style args
             */

Modified: brlcad/trunk/src/mged/mged.h
===================================================================
--- brlcad/trunk/src/mged/mged.h        2010-11-10 21:09:31 UTC (rev 41319)
+++ brlcad/trunk/src/mged/mged.h        2010-11-10 21:16:56 UTC (rev 41320)
@@ -398,6 +398,9 @@
                return TCL_ERROR; \
        }
 
+
+#define FUNTAB_UNLIMITED -1
+
 struct funtab {
     char *ft_name;
     char *ft_parms;


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

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to