r41: ANSI C changes
[ctsim.git] / src / ctrec.c
index fb23af9f456ea3a7fbf9270d790a2d180edd6985..8015376fff4d3b40507276b68131f560df48181c 100644 (file)
@@ -2,8 +2,11 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ctrec.c,v 1.8 2000/05/04 18:16:34 kevin Exp $
+**  $Id: ctrec.c,v 1.9 2000/05/08 20:02:32 kevin Exp $
 **  $Log: ctrec.c,v $
+**  Revision 1.9  2000/05/08 20:02:32  kevin
+**  ANSI C changes
+**
 **  Revision 1.8  2000/05/04 18:16:34  kevin
 **  renamed filter definitions
 **
 
 #include "ct.h"
 
-#define O_INTERP       1
-#define O_FILTER       2
-#define O_FILTER_PARAM 3
-#define O_BACKPROJ     4
-#define O_VERBOSE      5
-#define O_TRACE        6
-#define O_HELP         7
-#define O_DEBUG        8
-#define O_VERSION      9
+enum {O_INTERP, O_FILTER, O_FILTER_PARAM, O_BACKPROJ, O_VERBOSE, O_TRACE, O_HELP, O_DEBUG, O_VERSION};
 
 static struct option my_options[] =
 {
@@ -150,7 +145,7 @@ main (const int argc, char *const argv[])
   int opt_filter = FILTER_ABS_BANDLIMIT;
   int opt_interp = I_LINEAR;
   int opt_interp_param = 1;
-  int opt_backproj = O_BPROJ_DIFF2;
+  BackprojType opt_backproj = O_BPROJ_DIFF2;
 #ifdef MPI_CT
   IMAGE *im_local;
   RAYSUM *rs_local;
@@ -251,8 +246,7 @@ main (const int argc, char *const argv[])
     else
       sprintf (filt_name, "%s", name_of_filter (opt_filter));
   
-    sprintf (remark,
-            "Reconstruct: %dx%d, %s, %s, %s",
+    sprintf (remark, "Reconstruct: %dx%d, %s, %s, %s",
             nx, ny, filt_name, name_of_interpolation (opt_interp), name_of_backproj(opt_backproj));
   
     if (opt_verbose)
@@ -376,7 +370,7 @@ main (const int argc, char *const argv[])
       printf("Time to reduce image = %f secs, max time = %f\n", mpi_t, mpi_t_g);
   }
   if (mpi_ct.my_rank == 0) {
-    strncpy (im_global->remark, remark, MAXREMARK);
+    strncpy (im_global->remark, remark, sizeof(im_global->remark));
     time_end = MPI_Wtime();
     im_global->calctime = time_end - time_start;
     image_save (im_global);
@@ -385,7 +379,7 @@ main (const int argc, char *const argv[])
     }
 #else  
   raysum_close (rs_global);
-  strncpy (im_global->remark, remark, MAXREMARK);
+  strncpy (im_global->remark, remark, sizeof(im_global->remark));
   time_end = td_current_sec();
   im_global->calctime = time_end - time_start;
   image_save (im_global);