Thread: [Brlcad-commits] CVS: brlcad/src/rt read-rtlog.c,14.6,14.7 rt_simple.c,14.7,14.8 rtexample.c,14.8,14
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: Sean M. <br...@us...> - 2006-02-27 10:08:45
|
Update of /cvsroot/brlcad/brlcad/src/rt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26124/rt Modified Files: read-rtlog.c rt_simple.c rtexample.c rtregis.c rtwalk.c view_bot_faces.c Log Message: stdlib.h and exit() Index: read-rtlog.c =================================================================== RCS file: /cvsroot/brlcad/brlcad/src/rt/read-rtlog.c,v retrieving revision 14.6 retrieving revision 14.7 diff -w -u -r14.6 -r14.7 --- read-rtlog.c 18 Jan 2006 06:46:23 -0000 14.6 +++ read-rtlog.c 27 Feb 2006 10:08:41 -0000 14.7 @@ -97,7 +97,7 @@ fp = fopen(name, "r"); if( fp == NULL ) { perror(name); - exit(-1); + bu_bomb("unable to open file for reading"); } /* Set all flags to ready state. */ Index: rt_simple.c =================================================================== RCS file: /cvsroot/brlcad/brlcad/src/rt/rt_simple.c,v retrieving revision 14.7 retrieving revision 14.8 diff -w -u -r14.7 -r14.8 --- rt_simple.c 18 Jan 2006 06:46:23 -0000 14.7 +++ rt_simple.c 27 Feb 2006 10:08:41 -0000 14.8 @@ -54,6 +54,7 @@ #include "common.h" +#include <stdlib.h> #include <stdio.h> #ifdef HAVE_STRING_H # include <string.h> @@ -108,7 +109,7 @@ */ if( (rtip=rt_dirbuild(argv[1], (char *)NULL, 0)) == RTI_NULL ) { fprintf(stderr,"rt_dirbuild failure\n"); - exit(2); + return 2; } /* skip over the program name, and database name, leaving only the @@ -123,7 +124,7 @@ if( rt_gettrees_and_attrs( rtip, (const char **)NULL, argc, (const char **)argv, 1 ) ) { fprintf(stderr,"rt_gettrees FAILED\n"); - exit( 1 ); + return 1; } /* prepare objects for ray-tracing */ Index: rtexample.c =================================================================== RCS file: /cvsroot/brlcad/brlcad/src/rt/rtexample.c,v retrieving revision 14.8 retrieving revision 14.9 diff -w -u -r14.8 -r14.9 --- rtexample.c 20 Jan 2006 22:43:55 -0000 14.8 +++ rtexample.c 27 Feb 2006 10:08:41 -0000 14.9 @@ -33,6 +33,7 @@ */ #include "common.h" +#include <stdlib.h> #include <stdio.h> #include <math.h> @@ -61,7 +62,7 @@ if( argc < 3 ) { (void)fputs(usage, stderr); - exit(1); + return 1; } /* @@ -72,7 +73,7 @@ */ if( (rtip=rt_dirbuild(argv[1], idbuf, sizeof(idbuf))) == RTI_NULL ) { fprintf(stderr,"rtexample: rt_dirbuild failure\n"); - exit(2); + return 2; } /* intialize the application structure to all zeros */ Index: rtregis.c =================================================================== RCS file: /cvsroot/brlcad/brlcad/src/rt/rtregis.c,v retrieving revision 14.6 retrieving revision 14.7 diff -w -u -r14.6 -r14.7 --- rtregis.c 18 Jan 2006 06:46:23 -0000 14.6 +++ rtregis.c 27 Feb 2006 10:08:41 -0000 14.7 @@ -60,20 +60,21 @@ #include "common.h" +#include <stdlib.h> #include <stdio.h> - #ifdef HAVE_STRING_H # include <string.h> #else # include <strings.h> #endif - #include <math.h> + #include "machine.h" #include "vmath.h" #include "bu.h" #include "raytrace.h" + #define NAMELEN 40 #define BUFF_LEN 256 #define FALSE 0 @@ -117,7 +118,7 @@ if(argc != 3) { fputs(usage, stderr); - exit(-1); + return 1; } /* Now process the arguments from main: i.e. open the log files @@ -130,24 +131,24 @@ fp = fopen(argv[1], "r"); if( fp == NULL ) { perror(argv[1]); - exit(-1); + return 1; } ret = read_rt_file(fp, argv[1], mod2view1); if(ret < 0) { - exit(-1); + return 2; } fclose(fp); /* clean up */ fp = fopen(argv[2], "r"); if( fp == NULL ) { perror(argv[2]); - exit(-1); + return 2; } ret = read_rt_file(fp, argv[2], mod2view2); if(ret < 0) { - exit(-1); + return 2; } fclose(fp); @@ -165,11 +166,11 @@ ret = mat_build(mod2view1, mod2view2, regismat); if(ret == FALSE) { fprintf(stderr, "regis: can't build registration matrix!\n"); - exit(-1); + return 3; } print_info(regismat); - exit(0); + return 0; } Index: rtwalk.c =================================================================== RCS file: /cvsroot/brlcad/brlcad/src/rt/rtwalk.c,v retrieving revision 14.8 retrieving revision 14.9 diff -w -u -r14.8 -r14.9 --- rtwalk.c 28 Jan 2006 00:36:29 -0000 14.8 +++ rtwalk.c 27 Feb 2006 10:08:41 -0000 14.9 @@ -43,6 +43,11 @@ #include <stdio.h> #include <ctype.h> #include <math.h> +#ifdef HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif #include "machine.h" #include "vmath.h" Index: view_bot_faces.c =================================================================== RCS file: /cvsroot/brlcad/brlcad/src/rt/view_bot_faces.c,v retrieving revision 14.8 retrieving revision 14.9 diff -w -u -r14.8 -r14.9 --- view_bot_faces.c 18 Jan 2006 06:46:24 -0000 14.8 +++ view_bot_faces.c 27 Feb 2006 10:08:41 -0000 14.9 @@ -35,19 +35,19 @@ #include "common.h" +#include <stdlib.h> #include <stdio.h> #include <math.h> - #ifdef HAVE_UNIX_IO # include <sys/types.h> # include <sys/stat.h> #endif - #ifdef HAVE_STRING_H # include <string.h> #else # include <strings.h> #endif +#include <ctype.h> #include "machine.h" #include "vmath.h" @@ -57,7 +57,6 @@ #include "plot3.h" #include "rtprivate.h" -#include <ctype.h> extern char *outputfile; /* output file name */ #define MAX_LINE_LEN 1024 /* max line length in output file */ @@ -166,7 +165,7 @@ while( line[i] != '\0' && isspace( line[i] ) ) i++; if( line[i] == '\0' ) { bu_log( "Unexpected EOF found in partial results (%s)\n", outputfile ); - exit( 1 ); + bu_bomb("Unexpected EOF"); } j = i; while( line[j] != '\0' && !isspace( line[j] ) ) j++; @@ -189,8 +188,7 @@ long int face_num; if( !faces ) { - bu_log( "No faces structure while reading partial data!!!\n" ); - exit( 1 ); + bu_bomb( "No faces structure while reading partial data!!!\n" ); } face_num = atoi( line ); bu_ptbl_ins_unique( faces, (long *)face_num ); |