Revision: 55212
          http://sourceforge.net/p/brlcad/code/55212
Author:   n_reed
Date:     2013-04-23 01:27:05 +0000 (Tue, 23 Apr 2013)
Log Message:
-----------
Make dm func decls C++ friendly. Specifying the dm_processOptions params 
revealed mged_attach needs to dup its argv since the former doesn't make the 
same const promise (presumably because it wraps bu_getopt, which imitates 
getopt's signature).

Modified Paths:
--------------
    brlcad/trunk/include/dm.h
    brlcad/trunk/src/mged/attach.c

Modified: brlcad/trunk/include/dm.h
===================================================================
--- brlcad/trunk/include/dm.h   2013-04-23 01:07:51 UTC (rev 55211)
+++ brlcad/trunk/include/dm.h   2013-04-23 01:27:05 UTC (rev 55212)
@@ -106,7 +106,7 @@
 #define DM_TYPE_OGL    4
 #define DM_TYPE_GLX    5
 #define DM_TYPE_PEX    6
-#define DM_TYPE_WGL     7
+#define DM_TYPE_WGL    7
 #define DM_TYPE_TK     8
 #define DM_TYPE_RTGL   9
 
@@ -321,6 +321,8 @@
 #define DM_GEN_DLISTS(_dmp, _range) _dmp->dm_genDLists(_dmp, _range)
 #define DM_GET_DISPLAY_IMAGE(_dmp, _image) _dmp->dm_getDisplayImage(_dmp, 
_image)
 
+__BEGIN_DECLS
+
 DM_EXPORT extern struct dm dm_ogl;
 DM_EXPORT extern struct dm dm_plot;
 DM_EXPORT extern struct dm dm_ps;
@@ -348,7 +350,7 @@
                                  int use_aspect);
 DM_EXPORT extern void dm_fogHint(struct dm *dmp,
                                 int fastfog);
-DM_EXPORT extern int dm_processOptions();
+DM_EXPORT extern int dm_processOptions(struct dm *dmp, struct bu_vls 
*init_proc_vls, int argc, char **argv);
 DM_EXPORT extern int dm_limit(int i);
 DM_EXPORT extern int dm_unlimit(int i);
 DM_EXPORT extern fastf_t dm_wrap(fastf_t f);
@@ -408,7 +410,9 @@
 /* vers.c */
 DM_EXPORT extern const char *dm_version(void);
 
+__END_DECLS
 
+
 /************************************************/
 /* dm-*.c macros for autogenerating common code */
 /************************************************/

Modified: brlcad/trunk/src/mged/attach.c
===================================================================
--- brlcad/trunk/src/mged/attach.c      2013-04-23 01:07:51 UTC (rev 55211)
+++ brlcad/trunk/src/mged/attach.c      2013-04-23 01:27:05 UTC (rev 55212)
@@ -460,6 +460,8 @@
 int
 mged_attach(struct w_dm *wp, int argc, const char *argv[])
 {
+    int opt_argc;
+    char **opt_argv;
     struct dm_list *o_dm_list;
 
     if (!wp) {
@@ -483,7 +485,11 @@
        bu_vls_init(&tmp_dmp->dm_pathName);
        bu_vls_init(&tmp_dmp->dm_dName);
 
-       dm_processOptions(tmp_dmp, &tmp_vls, argc - 1, argv + 1);
+       opt_argc = argc - 1;
+       opt_argv = bu_dup_argv(opt_argc, argv + 1);
+       dm_processOptions(tmp_dmp, &tmp_vls, opt_argc, opt_argv);
+       bu_free_argv(opt_argc, opt_argv);
+
        if (strlen(bu_vls_addr(&tmp_dmp->dm_dName))) {
            if (gui_setup(bu_vls_addr(&tmp_dmp->dm_dName)) == TCL_ERROR) {
                bu_free((genptr_t)curr_dm_list, "f_attach: dm_list");

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


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to