[cig-commits] r15074 - mc/1D/hc/trunk

becker at geodynamics.org becker at geodynamics.org
Wed May 27 23:04:39 PDT 2009


Author: becker
Date: 2009-05-27 23:04:38 -0700 (Wed, 27 May 2009)
New Revision: 15074

Modified:
   mc/1D/hc/trunk/prem2dsm.c
   mc/1D/hc/trunk/sh_exp.c
   mc/1D/hc/trunk/sh_model.c
Log:
A few statics should have been const.



Modified: mc/1D/hc/trunk/prem2dsm.c
===================================================================
--- mc/1D/hc/trunk/prem2dsm.c	2009-05-28 02:03:25 UTC (rev 15073)
+++ mc/1D/hc/trunk/prem2dsm.c	2009-05-28 06:04:38 UTC (rev 15074)
@@ -5,13 +5,17 @@
 
  */
 
-void main(void)
+void main(int argc,char **argv)
 {
   int i,j;
   double rlast;
   struct prem_model prem[1];
   char filename[HC_CHAR_LENGTH];
-  strncpy(filename,PREM_MODEL_FILE,HC_CHAR_LENGTH);
+  if(argc>1)
+    strncpy(filename,argv[1],HC_CHAR_LENGTH);
+  else
+    strncpy(filename,PREM_MODEL_FILE,HC_CHAR_LENGTH);
+
   prem_read_model(filename,prem,TRUE);
   //fprintf(stderr,"nl %i np %i\n",prem->n,prem->np);
   printf("%i\tn_structure_zone\n",prem->n);

Modified: mc/1D/hc/trunk/sh_exp.c
===================================================================
--- mc/1D/hc/trunk/sh_exp.c	2009-05-28 02:03:25 UTC (rev 15073)
+++ mc/1D/hc/trunk/sh_exp.c	2009-05-28 06:04:38 UTC (rev 15074)
@@ -1678,7 +1678,7 @@
 		  hc_boolean phys_norm, HC_CPREC *value)
 {
 #ifdef HC_USE_HEALPIX
-  static HC_CPREC sqrt2 = SQRT_TWO;
+  const HC_CPREC sqrt2 = SQRT_TWO;
 #endif
   HC_CPREC s1;
   int index;
@@ -1782,7 +1782,7 @@
 		    HC_CPREC *value)
 {
 #ifdef HC_USE_HEALPIX
-  static HC_CPREC sqrt2 = SQRT_TWO;
+  const HC_CPREC sqrt2 = SQRT_TWO;
 #endif
   HC_CPREC s1;
   int index;

Modified: mc/1D/hc/trunk/sh_model.c
===================================================================
--- mc/1D/hc/trunk/sh_model.c	2009-05-28 02:03:25 UTC (rev 15073)
+++ mc/1D/hc/trunk/sh_model.c	2009-05-28 06:04:38 UTC (rev 15074)
@@ -278,7 +278,7 @@
 			       hc_boolean verbose)
 {
   int i;
-  static int unity = 1,zero = 0;
+  const int unity = 1,zero = 0;
   if(!model->spatial_init)
     HC_ERROR("sh_compute_model_spectral","spatial set not initialized");
   if(((model->ivec)&&(model->shps != 3))||
@@ -319,7 +319,7 @@
 			      float **data,hc_boolean verbose)
 {
   int i;
-  static int unity = 1, zero = 0;
+  const int unity = 1, zero = 0;
   /* 
      resize data
   */



More information about the CIG-COMMITS mailing list