[Pomp-commits] r1225 - in pkg/pomp: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 18 23:16:50 CEST 2015


Author: kingaa
Date: 2015-06-18 23:16:50 +0200 (Thu, 18 Jun 2015)
New Revision: 1225

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/src/dmeasure.c
   pkg/pomp/src/euler.c
   pkg/pomp/src/initstate.c
   pkg/pomp/src/pomp_fun.c
   pkg/pomp/src/rmeasure.c
Log:
- initialize certain SEXPs to avoid (false positive) -Wuninitialized warnings

Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2015-06-18 19:11:42 UTC (rev 1224)
+++ pkg/pomp/DESCRIPTION	2015-06-18 21:16:50 UTC (rev 1225)
@@ -1,7 +1,7 @@
 Package: pomp
 Type: Package
 Title: Statistical Inference for Partially Observed Markov Processes
-Version: 0.68-3
+Version: 0.68-4
 Date: 2015-06-18
 Authors at R: c(person(given=c("Aaron","A."),family="King",
 		role=c("aut","cre"),email="kingaa at umich.edu"),

Modified: pkg/pomp/src/dmeasure.c
===================================================================
--- pkg/pomp/src/dmeasure.c	2015-06-18 19:11:42 UTC (rev 1224)
+++ pkg/pomp/src/dmeasure.c	2015-06-18 21:16:50 UTC (rev 1225)
@@ -16,8 +16,9 @@
   int ntimes, nvars, npars, ncovars, nreps, nrepsx, nrepsp, nobs;
   SEXP Snames, Pnames, Cnames, Onames;
   SEXP pompfun;
-  SEXP tvec, xvec, yvec, pvec, cvec;
-  SEXP fn, fcall, rho, ans;
+  SEXP cvec, tvec = R_NilValue;
+  SEXP xvec = R_NilValue, yvec = R_NilValue, pvec = R_NilValue;
+  SEXP fn, ans, fcall, rho = R_NilValue;
   SEXP F;
   int *sidx = 0, *pidx = 0, *cidx = 0, *oidx = 0;
   int *dim;

Modified: pkg/pomp/src/euler.c
===================================================================
--- pkg/pomp/src/euler.c	2015-06-18 19:11:42 UTC (rev 1224)
+++ pkg/pomp/src/euler.c	2015-06-18 21:16:50 UTC (rev 1225)
@@ -12,12 +12,14 @@
   pompfunmode mode = undef;
   int nstep, nvars, npars, nreps, ntimes, nzeros, ncovars, covlen;
   SEXP X;
-  SEXP fn, fcall, rho, ans, nm;
+  SEXP ans, nm, fn, fcall = R_NilValue, rho = R_NilValue;
   SEXP Snames, Pnames, Cnames;
-  SEXP tvec, xvec, pvec, cvec, dtvec;
+  SEXP cvec, tvec = R_NilValue;
+  SEXP xvec = R_NilValue, pvec = R_NilValue, dtvec = R_NilValue;
   int *pidx = 0, *sidx = 0, *cidx = 0, *zidx = 0;
   pomp_onestep_sim *ff = NULL;
-  int meth = *(INTEGER(AS_INTEGER(method))); // 0 = Euler, 1 = one-step, 2 = fixed step
+  int meth = *(INTEGER(AS_INTEGER(method))); 
+  // meth: 0 = Euler, 1 = one-step, 2 = fixed step
 
   {
     int *dim;
@@ -252,9 +254,11 @@
   int give_log;
   int nvars, npars, nreps, ntimes, ncovars, covlen;
   pomp_onestep_pdf *ff = NULL;
-  SEXP t1vec, t2vec, x1vec, x2vec, pvec, cvec;
+  SEXP cvec, pvec = R_NilValue;
+  SEXP t1vec = R_NilValue, t2vec = R_NilValue;
+  SEXP x1vec = R_NilValue, x2vec = R_NilValue;
   SEXP Snames, Pnames, Cnames;
-  SEXP rho, fcall, fn;
+  SEXP fn, rho = R_NilValue, fcall = R_NilValue;
   SEXP F;
   int *pidx = 0, *sidx = 0, *cidx = 0;
 

Modified: pkg/pomp/src/initstate.c
===================================================================
--- pkg/pomp/src/initstate.c	2015-06-18 19:11:42 UTC (rev 1224)
+++ pkg/pomp/src/initstate.c	2015-06-18 21:16:50 UTC (rev 1225)
@@ -80,7 +80,7 @@
 
   } else {			// user-supplied initializer
     
-    SEXP pompfun, fcall, fn, tcovar, covar, covars;
+    SEXP pompfun, fcall, fn, tcovar, covar, covars = R_NilValue;
     pompfunmode mode = undef;
     double *cp = NULL;
 

Modified: pkg/pomp/src/pomp_fun.c
===================================================================
--- pkg/pomp/src/pomp_fun.c	2015-06-18 19:11:42 UTC (rev 1224)
+++ pkg/pomp/src/pomp_fun.c	2015-06-18 21:16:50 UTC (rev 1225)
@@ -54,6 +54,9 @@
 	  PROTECT(f = R_MakeExternalPtr(ff,R_NilValue,R_NilValue)); nprotect++;
 	}
 	break;
+      
+      case Rfun: case undef: default:
+	break;
       }
 
       SET_SLOT(pfun,install("address"),f);
@@ -68,9 +71,8 @@
 
     break;
 
-  case undef: default:
-    error("operation cannot be completed: some needed function has not been specified");
-    break;
+    case undef: default:
+      error("operation cannot be completed: some needed function has not been specified");
   }
 
   UNPROTECT(nprotect);

Modified: pkg/pomp/src/rmeasure.c
===================================================================
--- pkg/pomp/src/rmeasure.c	2015-06-18 19:11:42 UTC (rev 1224)
+++ pkg/pomp/src/rmeasure.c	2015-06-18 21:16:50 UTC (rev 1225)
@@ -14,8 +14,8 @@
   pompfunmode mode = undef;
   int ntimes, nvars, npars, ncovars, nreps, nrepsx, nrepsp, nobs;
   SEXP Snames, Pnames, Cnames, Onames;
-  SEXP tvec, xvec, pvec, cvec;
-  SEXP fn, fcall, rho, ans, nm;
+  SEXP cvec, tvec = R_NilValue, xvec = R_NilValue, pvec = R_NilValue;
+  SEXP fn, fcall, rho = R_NilValue, ans, nm;
   SEXP pompfun;
   SEXP Y;
   int *dim;



More information about the pomp-commits mailing list