Revision: 41065
http://brlcad.svn.sourceforge.net/brlcad/?rev=41065&view=rev
Author: brlcad
Date: 2010-10-18 22:22:11 +0000 (Mon, 18 Oct 2010)
Log Message:
-----------
remove the remainder of places where the bu_opt* family was being declared as
extern and were a problem with Windows portability. removed since bu.h
declares them portably and properly.
Modified Paths:
--------------
brlcad/trunk/src/canon/canonlib.c
brlcad/trunk/src/conv/proe-g.c
brlcad/trunk/src/fb/cell-fb.c
brlcad/trunk/src/fb/fb-orle.c
brlcad/trunk/src/fb/fbcmap.c
brlcad/trunk/src/fbed/fbed.c
brlcad/trunk/src/gtools/g_lint.c
brlcad/trunk/src/gtools/remapid.c
brlcad/trunk/src/lgt/do_options.c
brlcad/trunk/src/libged/push.c
brlcad/trunk/src/libged/wdb_obj.c
brlcad/trunk/src/librtserver/rtserverTest.c
brlcad/trunk/src/nirt/showshot.c
brlcad/trunk/src/tab/scriptsort.c
brlcad/trunk/src/tab/tabinterp.c
brlcad/trunk/src/vdeck/parsarg.c
Modified: brlcad/trunk/src/canon/canonlib.c
===================================================================
--- brlcad/trunk/src/canon/canonlib.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/canon/canonlib.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -1151,7 +1151,6 @@
#endif /* __sgi__ */
char *options = "P:p:Q:q:acd:g:hmn:s:t:vw:zAC:M:R:D:N:S:W:X:Y:U:V#:";
-extern char *bu_optarg;
char *progname = "(noname)";
char scsi_device[1024] = "/dev/scsi/sc0d6l3";
Modified: brlcad/trunk/src/conv/proe-g.c
===================================================================
--- brlcad/trunk/src/conv/proe-g.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/conv/proe-g.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -37,14 +37,13 @@
#include <errno.h>
#include "bio.h"
+#include "bu.h"
#include "vmath.h"
#include "nmg.h"
#include "rtgeom.h"
#include "raytrace.h"
#include "wdb.h"
-extern char *bu_optarg;
-extern int bu_optind, bu_opterr, optopt;
static struct wmember all_head;
static char *input_file; /* name of the input file */
Modified: brlcad/trunk/src/fb/cell-fb.c
===================================================================
--- brlcad/trunk/src/fb/cell-fb.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/fb/cell-fb.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -27,10 +27,10 @@
#include <time.h>
#include <math.h>
-#include "vmath.h"
-#include "raytrace.h"
#include "bu.h"
#include "fb.h"
+#include "vmath.h"
+#include "raytrace.h"
/* Macros without arguments */
@@ -697,8 +697,6 @@
static bool pars_Argv (int argc, char **argv)
{
int c;
- extern int bu_optind;
- extern char *bu_optarg;
/* Parse options. */
while ((c = bu_getopt(argc, argv, OPT_STRING)) != EOF)
Modified: brlcad/trunk/src/fb/fb-orle.c
===================================================================
--- brlcad/trunk/src/fb/fb-orle.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/fb/fb-orle.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -158,8 +158,6 @@
parsArgv(int argc, char **argv)
{
int c;
- extern int bu_optind;
- extern char *bu_optarg;
/* Parse options. */
while ( (c = bu_getopt( argc, argv, "CF:Scdhl:p:vw" )) != EOF )
Modified: brlcad/trunk/src/fb/fbcmap.c
===================================================================
--- brlcad/trunk/src/fb/fbcmap.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/fb/fbcmap.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -234,7 +234,6 @@
pars_Argv(int argc, char **argv)
{
int c;
- extern int bu_optind;
while ( (c = bu_getopt( argc, argv, "hF:s:S:w:W:n:N:" )) != EOF ) {
switch ( c ) {
Modified: brlcad/trunk/src/fbed/fbed.c
===================================================================
--- brlcad/trunk/src/fbed/fbed.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/fbed/fbed.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -30,6 +30,7 @@
#include <string.h>
#include "bio.h"
+#include "bu.h"
#include "fb.h"
/* FIXME */
@@ -1940,7 +1941,6 @@
pars_Argv(int argc, char **argv)
{
int c;
- extern int bu_optind;
/* Parse options. */
while ( (c = bu_getopt( argc, argv, "hp" )) != EOF )
Modified: brlcad/trunk/src/gtools/g_lint.c
===================================================================
--- brlcad/trunk/src/gtools/g_lint.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/gtools/g_lint.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -828,9 +828,6 @@
vect_t unit_H;
vect_t unit_V;
- extern int bu_optind; /* For use with getopt */
- extern char *bu_optarg;
-
bu_log("%s\n", rt_version());
control.glc_magic = G_LINT_CTRL_MAGIC;
Modified: brlcad/trunk/src/gtools/remapid.c
===================================================================
--- brlcad/trunk/src/gtools/remapid.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/gtools/remapid.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -37,9 +37,9 @@
#include "bio.h"
#include "bu.h"
-#include "vmath.h"
#include "bn.h"
#include "db.h"
+#include "vmath.h"
#include "raytrace.h"
@@ -859,8 +859,6 @@
int ch; /* Command-line character */
int tankill = 0; /* TANKILL format (vs. BRL-CAD)? */
- extern int bu_optind; /* index from bu_getopt(3C) */
-
bu_stdin->file_ptr = stdin; /* LINUX-required init */
while ((ch = bu_getopt(argc, argv, "gt?")) != EOF)
Modified: brlcad/trunk/src/lgt/do_options.c
===================================================================
--- brlcad/trunk/src/lgt/do_options.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/lgt/do_options.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -31,9 +31,10 @@
#include <math.h>
#include <signal.h>
+#include "bu.h"
+#include "fb.h"
#include "vmath.h"
#include "raytrace.h"
-#include "fb.h"
#include "./hmenu.h"
#include "./lgt.h"
@@ -3648,8 +3649,6 @@
pars_Argv(int argc, char **argv)
{
int c;
- extern int bu_optind;
- extern char *bu_optarg;
prog_id = argv[0];
/* Initialize terminal I/O. */
Modified: brlcad/trunk/src/libged/push.c
===================================================================
--- brlcad/trunk/src/libged/push.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/libged/push.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -29,6 +29,7 @@
#include <string.h>
#include "bio.h"
+#include "bu.h"
#include "cmd.h"
#include "./ged_private.h"
@@ -165,8 +166,6 @@
int c;
int old_debug;
int push_error;
- extern int bu_optind;
- extern char *bu_optarg;
static const char *usage = "object(s)";
GED_CHECK_DATABASE_OPEN(gedp, GED_ERROR);
Modified: brlcad/trunk/src/libged/wdb_obj.c
===================================================================
--- brlcad/trunk/src/libged/wdb_obj.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/libged/wdb_obj.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -5905,8 +5905,6 @@
int c;
int old_debug;
int push_error;
- extern int bu_optind;
- extern char *bu_optarg;
WDB_TCL_CHECK_READ_ONLY;
Modified: brlcad/trunk/src/librtserver/rtserverTest.c
===================================================================
--- brlcad/trunk/src/librtserver/rtserverTest.c 2010-10-18 22:18:55 UTC (rev
41064)
+++ brlcad/trunk/src/librtserver/rtserverTest.c 2010-10-18 22:22:11 UTC (rev
41065)
@@ -30,6 +30,7 @@
#include <string.h>
#include <pthread.h>
+#include "bu.h"
#include "vmath.h"
#include "nmg.h"
#include "raytrace.h"
@@ -131,8 +132,6 @@
struct application *ap;
int ret;
int c;
- extern char *bu_optarg;
- extern int bu_optind, bu_opterr, optopt;
struct xray aray;
int verbose = 0;
char *name;
@@ -154,8 +153,6 @@
point_t mdl_max;
struct bu_vlb *vlb;
-// bu_debug = BU_DEBUG_MEM_CHECK;
-
/* Things like bu_malloc() must have these initialized for use with
parallel processing */
bu_semaphore_init( RT_SEM_LAST );
Modified: brlcad/trunk/src/nirt/showshot.c
===================================================================
--- brlcad/trunk/src/nirt/showshot.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/nirt/showshot.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -31,9 +31,9 @@
#include <string.h>
#include "bio.h"
+#include "bu.h"
#include "vmath.h"
#include "db.h"
-#include "bu.h"
#define BUF_LEN 128
@@ -58,11 +58,6 @@
int opt; /* Command-line option returned by bu_getopt */
int pid; /* Process ID for unique group name */
- extern char *bu_optarg;
- extern int bu_optind, bu_opterr;
-
- int bu_getopt(int, char *const *, const char *);
-
pid = bu_process_id();
*rayname = '\0';
Modified: brlcad/trunk/src/tab/scriptsort.c
===================================================================
--- brlcad/trunk/src/tab/scriptsort.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/tab/scriptsort.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -27,6 +27,14 @@
#include "./tokens.h"
+#define OPT_STR "qb:fso:"
+
+#define FLAG_CLEAN 0x1
+#define FLAG_SCRIPT 0x2
+
+#define MAGIC 0x0deadbefL
+
+
struct frame {
struct bu_list l;
@@ -38,19 +46,15 @@
int tp;
int tl;
};
-#define MAGIC 0x0deadbefL
-#define FLAG_CLEAN 0x1
-#define FLAG_SCRIPT 0x2
+
struct bu_list head = {MAGIC, &head, &head};
struct frame globals;
extern FILE *yyin;
extern int yylex(void);
-extern int bu_optind;
-extern char *bu_optarg;
-int get_args(int argc, char **argv);
+
int verbose; /* print status on stderr */
int specify_base; /* user specified a base */
int user_base; /* value of user-specified base */
@@ -58,9 +62,64 @@
int suppress_shell; /* suppress shell script for each frame */
int frame_offset; /* offset added to frame numbers */
-void squirtframes(int base);
-static void sf(int start, int skip);
+static void
+printframe(struct frame *fp)
+{
+ fprintf(stdout, "start %d;%s\n", fp->number,
+ (fp->flags & FLAG_CLEAN) ? "clean ;" : "");
+ if (fp->text) {
+ fprintf(stdout, "%s", fp->text);
+ }
+ fprintf(stdout, "end;\n");
+ if ((force_shell || (fp->flags & FLAG_SCRIPT)) && !suppress_shell) {
+ fprintf(stdout, "!end_of_frame.sh %d\n", fp->number);
+ }
+}
+
+
+static void
+sf(int start, int skip)
+{
+ int i;
+ struct frame *runner;
+
+/*
+ * skip to staring point.
+ */
+ i = 0;
+ runner = (struct frame *)head.forw;
+ while (&runner->l != &head && i<start) {
+ runner = (struct frame *)runner->l.forw;
+ i++;
+ }
+ if (&runner->l == &head) return;
+/*
+ * now start the main loop.
+ */
+ while (&runner->l != &head) {
+ printframe(runner);
+ for (i=0; i<skip; i++) {
+ runner = (struct frame *)runner->l.forw;
+ if (&runner->l == &head) return;
+ }
+ }
+}
+
+
+void
+squirtframes(int base)
+{
+
+ sf(0, base); /* start by outputing every base entries at one */
+
+ while (base > 1 ) {
+ sf(base/2, base);
+ base /= 2;
+ }
+}
+
+
void addtext(struct frame *fp, char *tp)
{
char *p;
@@ -174,34 +233,7 @@
return new;
}
-#ifdef never
-void
-bubblesort()
-{
- struct frame *a, *b, *hold;
- for (a = head.forw; a->forw != &head; a = a->forw) {
- for (b= a->forw; b != &head; b = b->forw) {
- if (a->number > b->number) {
- hold = b->back;
- REMOVE(b);
- INSERT(a, b) /* put b after a */
- if (a != hold) {
- REMOVE(a);
- APPEND(hold, a); /* but a where b was */
- }
-#if 0
- a=b;
- b=hold->forw;
-#else
- a=&head;
- break;
-#endif
- }
- }
- }
-}
-#else /* never */
void
bubblesort(void)
{
@@ -221,22 +253,11 @@
}
}
}
-#endif /* never */
+
+
void
-printframe(struct frame *fp)
+merge(void)
{
- fprintf(stdout, "start %d;%s\n", fp->number,
- (fp->flags & FLAG_CLEAN) ? "clean ;" : "");
- if (fp->text) {
- fprintf(stdout, "%s", fp->text);
- }
- fprintf(stdout, "end;\n");
- if ((force_shell || (fp->flags & FLAG_SCRIPT)) && !suppress_shell) {
- fprintf(stdout, "!end_of_frame.sh %d\n", fp->number);
- }
-}
-void merge(void)
-{
struct frame *cur, *next;
for (BU_LIST_FOR(cur, frame, &head)) {
@@ -255,11 +276,48 @@
}
}
+
+int
+get_args(int argc, char **argv)
+{
+ int c;
+ verbose = 1;
+ specify_base = force_shell = suppress_shell = 0;
+ frame_offset = 0;
+ while ( (c=bu_getopt(argc, argv, OPT_STR)) != EOF) {
+ switch (c) {
+ case 'q':
+ verbose = 0;
+ break;
+ case 'b':
+ specify_base = 1;
+ user_base = atoi(bu_optarg);
+ break;
+ case 'f':
+ force_shell = 1;
+ suppress_shell = 0;
+ break;
+ case 's':
+ suppress_shell = 1;
+ force_shell = 0;
+ break;
+ case 'o':
+ frame_offset = atoi(bu_optarg);
+ break;
+ default:
+ fprintf(stderr, "Unknown option: -%c\n", c);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+
/*
* M A I N
*/
int
-main(int argc, char **argv)
+main(int argc, char *argv[])
{
struct frame *new, *lp;
@@ -339,82 +397,8 @@
return 1;
}
-void
-squirtframes(int base)
-{
- sf(0, base); /* start by outputing every base entries at one */
-
- while (base > 1 ) {
- sf(base/2, base);
- base /= 2;
- }
-}
-
-static void
-sf(int start, int skip)
-{
- int i;
- struct frame *runner;
-
/*
- * skip to staring point.
- */
- i = 0;
- runner = (struct frame *)head.forw;
- while (&runner->l != &head && i<start) {
- runner = (struct frame *)runner->l.forw;
- i++;
- }
- if (&runner->l == &head) return;
-/*
- * now start the main loop.
- */
- while (&runner->l != &head) {
- printframe(runner);
- for (i=0; i<skip; i++) {
- runner = (struct frame *)runner->l.forw;
- if (&runner->l == &head) return;
- }
- }
-}
-
-#define OPT_STR "qb:fso:"
-int get_args (int argc, char **argv)
-{
- int c;
- verbose = 1;
- specify_base = force_shell = suppress_shell = 0;
- frame_offset = 0;
- while ( (c=bu_getopt(argc, argv, OPT_STR)) != EOF) {
- switch (c) {
- case 'q':
- verbose = 0;
- break;
- case 'b':
- specify_base = 1;
- user_base = atoi(bu_optarg);
- break;
- case 'f':
- force_shell = 1;
- suppress_shell = 0;
- break;
- case 's':
- suppress_shell = 1;
- force_shell = 0;
- break;
- case 'o':
- frame_offset = atoi(bu_optarg);
- break;
- default:
- fprintf(stderr, "Unknown option: -%c\n", c);
- return 0;
- }
- }
- return 1;
-}
-
-/*
* Local Variables:
* mode: C
* tab-width: 8
Modified: brlcad/trunk/src/tab/tabinterp.c
===================================================================
--- brlcad/trunk/src/tab/tabinterp.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/tab/tabinterp.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -71,9 +71,6 @@
int c_offset; /* source offset (NEXT) */
};
-extern int bu_optind;
-extern char *bu_optarg;
-
int verbose = 1;
int o_len; /* length of all output arrays */
@@ -1225,7 +1222,7 @@
if (verbose) bu_log("writing output\n");
output();
- bu_exit(0, NULL);
+ return 0;
}
Modified: brlcad/trunk/src/vdeck/parsarg.c
===================================================================
--- brlcad/trunk/src/vdeck/parsarg.c 2010-10-18 22:18:55 UTC (rev 41064)
+++ brlcad/trunk/src/vdeck/parsarg.c 2010-10-18 22:22:11 UTC (rev 41065)
@@ -27,18 +27,20 @@
#include <string.h>
#include "bio.h"
+#include "bu.h"
#include "vmath.h"
#include "raytrace.h"
+
#include "./vextern.h"
-/* p a r s A r g ( )
- Parse the command line arguments.
-*/
+
+/*
+ * Parse the command line arguments.
+ */
int
parsArg(int argc, char **argv)
{
int i, c, arg_cnt;
- extern int bu_optind;
while ( (c = bu_getopt( argc, argv, "d" )) != EOF )
{
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits