On Sep 12, 2013, at 7:50 AM, Tom Browder wrote:

> I think I have it in shape enough for criticism, but I'm still working on it.

Seriously big thank you for working on this... we'll only need to use this 
interface in about 700+ places, probably more.

Looking at the bu_opt_parse.h, a few questions and comments come to mind:

1) bu_arg_parse_result_t seems unnecessary and redundant with BRLCAD_OK / 
BRLCAD_ERROR
2) bu_arg_value_t has different float types but not different int types?  maybe 
kill BU_ARG_FLOAT and replace INT with LONG so they're always max size for that 
compilation.  reduces complexity slightly too.
3) bu_arg_req_t seems unnecessary?  we use int for booleans elsewhere.  perhaps 
a uint8_t
4) is there any value in making the sizes explicit in bu_arg_value or is the 
variable size important?
5) suggest including the bu_arg_value type with the value, not in bu_arg_vars 
separately.  something like typdef struct {int type; union {char c; long i; 
double d; char *s;}} bu_arg_value_t;
6) all typedefs should be bu_arg_something_t for bu API consistency, or we can 
just be explicit with "struct bu_arg_value *" for example.  the indirection 
doesn't buy much in this context, saves few keystrokes.
7) bu_opt_parse() looks pretty cool.  shouldn't argv be const?  (i.e., char * 
const argv[]).  matches getopt signature.

Cheers!
Sean


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to