Revision: 42105
http://brlcad.svn.sourceforge.net/brlcad/?rev=42105&view=rev
Author: brlcad
Date: 2011-01-12 00:42:25 +0000 (Wed, 12 Jan 2011)
Log Message:
-----------
this is a really tricky one. quell warnings about variables getting clobbered
after a longjmp or vfork by making them all static. we can do this here
because they're all just main() variables fortunately. bu's jump mechanism
uses setjump, so an implementation could clobber local non-static non-volatile
variables. this tricking making them static works or it would have also worked
to wrap the BU_SETJUMP/BU_UNSETJUMP calls into functions that are passed
parameters (i.e., no variables in that frame).
Modified Paths:
--------------
brlcad/trunk/src/libbn/bntester.c
Modified: brlcad/trunk/src/libbn/bntester.c
===================================================================
--- brlcad/trunk/src/libbn/bntester.c 2011-01-12 00:32:56 UTC (rev 42104)
+++ brlcad/trunk/src/libbn/bntester.c 2011-01-12 00:42:25 UTC (rev 42105)
@@ -135,44 +135,44 @@
int
main(int argc, char **argv)
{
- char buf[BUFSIZ];
- FILE *fp_in = NULL;
- FILE *stream = NULL;
- char *endp = NULL;
- unsigned long line_num = 0;
- unsigned long failed_cnt = 0;
- unsigned long bomb_cnt = 0;
- unsigned long success_cnt = 0;
- int string_length;
- int argv_idx;
- char c;
- char dt_fmt[50]; /* data type format string */
- char *buf_p1;
- char *buf_p;
- struct bn_tol tol;
- int ret = 0;
+ static char buf[BUFSIZ];
+ static FILE *fp_in = NULL;
+ static FILE *stream = NULL;
+ static char *endp = NULL;
+ static unsigned long line_num = 0;
+ static unsigned long failed_cnt = 0;
+ static unsigned long bomb_cnt = 0;
+ static unsigned long success_cnt = 0;
+ static int string_length;
+ static int argv_idx;
+ static char c;
+ static char dt_fmt[50]; /* data type format string */
+ static char *buf_p1;
+ static char *buf_p;
+ static struct bn_tol tol;
+ static int ret = 0;
/* command line parameters */
- char input_file_name[BUFSIZ] = {0};
- char output_file_name[BUFSIZ] = {0};
- unsigned long test_case_line_num = 0;
- unsigned long function_num = 0;
+ static char input_file_name[BUFSIZ] = {0};
+ static char output_file_name[BUFSIZ] = {0};
+ static unsigned long test_case_line_num = 0;
+ static unsigned long function_num = 0;
/* function parameter arrays */
- int i[50] = {0};
- long l[50] = {0};
- double d[50] = {0.0};
- unsigned long u[50] = {0};
+ static int i[50] = {0};
+ static long l[50] = {0};
+ static double d[50] = {0.0};
+ static unsigned long u[50] = {0};
/* boolean variables */
- int input_file_name_defined = 0;
- int output_file_name_defined = 0;
- int process_single_test_case = 0;
- int process_single_function = 0;
- int valid_function_number = 0;
- int process_test_case = 0;
- int early_exit = 0;
- int found_eof = 0;
+ static int input_file_name_defined = 0;
+ static int output_file_name_defined = 0;
+ static int process_single_test_case = 0;
+ static int process_single_function = 0;
+ static int valid_function_number = 0;
+ static int process_test_case = 0;
+ static int early_exit = 0;
+ static int found_eof = 0;
/* set initial values in tol structure */
tol.magic = BN_TOL_MAGIC;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits