diff --git a/example/gmt/gmt2.c b/example/gmt/gmt2.c index 64a838157..98571f5fa 100644 --- a/example/gmt/gmt2.c +++ b/example/gmt/gmt2.c @@ -302,14 +302,14 @@ main (int argc, char **argv) ue = usagerrf (opt, "maxlevel not between minlevel and %d", P4EST_QMAXLEVEL); } - if (g->synthetic >= 0 ? (g->latlongno >= 0 || g->sphere == 1) - : (g->latlongno >= 0 && g->sphere == 1) + if (g->synthetic >= 0 ? (g->latlongno >= 0 || g->sphere) + : (g->latlongno >= 0 && g->sphere) ) { ue = usagerrf (opt, "set only one of the synthetic, sphere and latlong models"); } - if (g->synthetic < 0 && g->latlongno < 0 && g->sphere == 0) { + if (g->synthetic < 0 && g->latlongno < 0 && !g->sphere) { ue = usagerrf (opt, "set one of the synthetic, sphere, and latlong models"); @@ -334,7 +334,6 @@ main (int argc, char **argv) /* cleanup application model */ if (g->model != NULL) { - p4est_connectivity_destroy (g->model->conn); p4est_gmt_model_destroy (g->model); } diff --git a/example/gmt/gmt_models.c b/example/gmt/gmt_models.c index b61f2a0d7..f06406e11 100644 --- a/example/gmt/gmt_models.c +++ b/example/gmt/gmt_models.c @@ -144,7 +144,9 @@ static int model_latlong_intersect (p4est_topidx_t which_tree, const double coord[4], size_t m, void *vmodel) { +#ifdef P4EST_ENABLE_DEBUG p4est_gmt_model_t *model = (p4est_gmt_model_t *) vmodel; +#endif P4EST_ASSERT (model != NULL); P4EST_ASSERT (m < model->M); @@ -453,5 +455,6 @@ p4est_gmt_model_destroy (p4est_gmt_model_t * model) P4EST_FREE (model->model_data); } p4est_geometry_destroy (model->model_geom); + p4est_connectivity_destroy (model->conn); P4EST_FREE (model); } diff --git a/example/gmt/sphere_preprocessing.c b/example/gmt/sphere_preprocessing.c index 890c66b17..f9174909b 100644 --- a/example/gmt/sphere_preprocessing.c +++ b/example/gmt/sphere_preprocessing.c @@ -574,9 +574,10 @@ main (int argc, char **argv) mpiret = sc_MPI_Init (&argc, &argv); SC_CHECK_MPI (mpiret); - /* default communicator used for logging */ + /* default communicator and packages used for logging */ mpicomm = sc_MPI_COMM_WORLD; sc_init (mpicomm, 1, 1, NULL, SC_LP_DEFAULT); + p4est_init (NULL, SC_LP_DEFAULT); /* Get rank and number of processes */ mpiret = sc_MPI_Comm_size (mpicomm, &num_procs);