From 214fc97b8438f30618f55b68eee7e9a9c48369cf Mon Sep 17 00:00:00 2001 From: yye00 Date: Mon, 30 Aug 2004 20:55:24 +0000 Subject: removed all warnings git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/LocalReduce/trunk@38 7daa882c-dc44-4453-834e-278d26b18e6a --- src/ReductionAvg.c | 9 +++++++-- src/ReductionCount.c | 10 ++++++---- src/ReductionMax.c | 11 ++++++----- src/ReductionMin.c | 9 +++++++-- src/ReductionNorm1.c | 9 +++++++-- src/ReductionNorm2.c | 9 +++++++-- src/ReductionNorm3.c | 9 +++++++-- src/ReductionNorm4.c | 9 +++++++-- src/ReductionNormInf.c | 9 +++++++-- src/ReductionSum.c | 9 +++++++-- src/local_reductions.h | 2 +- 11 files changed, 69 insertions(+), 26 deletions(-) diff --git a/src/ReductionAvg.c b/src/ReductionAvg.c index 5238ef0..24cb152 100644 --- a/src/ReductionAvg.c +++ b/src/ReductionAvg.c @@ -142,8 +142,7 @@ static int ReductionAvg (int N_dims, int operator_handle, int * indices; int * actual_indices; int * actual_iters_per_dim; - int index = 0; - int max_iter = 0;; + int max_iter = 0; int iter = 0; int sum_indices = 0; int max_index = 1; @@ -161,6 +160,12 @@ static int ReductionAvg (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; + /* prevent warnings for unused vars */ + (void)(mask_array); + (void)(mask_offset + 0); + (void)(mask_time_level + 0); + (void)(operator_handle + 0); + /* set the number of points */ num_points = 0; diff --git a/src/ReductionCount.c b/src/ReductionCount.c index 9ee492e..5b5d92c 100644 --- a/src/ReductionCount.c +++ b/src/ReductionCount.c @@ -142,8 +142,7 @@ static int ReductionCount (int N_dims, int operator_handle, int * indices; int * actual_indices; int * actual_iters_per_dim; - int index = 0; - int max_iter = 0;; + int max_iter = 0; int iter = 0; int sum_indices = 0; int max_index = 1; @@ -161,8 +160,11 @@ static int ReductionCount (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; - - + /* prevent warnings for unused vars */ + (void)(mask_array); + (void)(mask_offset + 0); + (void)(mask_time_level + 0); + (void)(operator_handle + 0); /* set the number of points */ num_points = 0; diff --git a/src/ReductionMax.c b/src/ReductionMax.c index 8e79338..6c110eb 100644 --- a/src/ReductionMax.c +++ b/src/ReductionMax.c @@ -137,14 +137,12 @@ static int ReductionMax (int N_dims, int operator_handle, int i, j, k, flag, product, num_points; int ierr; int * iters_per_dim; - void * output_buffer[10]; /* indices to hold the temp indices of size N_dims and iteration indices*/ int * indices; int * actual_indices; int * actual_iters_per_dim; - int index = 0; - int max_iter = 0;; + int max_iter = 0; int iter = 0; int sum_indices = 0; int max_index = 1; @@ -162,8 +160,11 @@ static int ReductionMax (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; - - + /* prevent warnings for unused vars */ + (void)(mask_array); + (void)(mask_offset + 0); + (void)(mask_time_level + 0); + (void)(operator_handle + 0); /* set the number of points */ num_points = 0; diff --git a/src/ReductionMin.c b/src/ReductionMin.c index 10f3944..19ba68f 100644 --- a/src/ReductionMin.c +++ b/src/ReductionMin.c @@ -142,8 +142,7 @@ static int ReductionMin (int N_dims, int operator_handle, int * indices; int * actual_indices; int * actual_iters_per_dim; - int index = 0; - int max_iter = 0;; + int max_iter = 0; int iter = 0; int sum_indices = 0; int max_index = 1; @@ -161,6 +160,12 @@ static int ReductionMin (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; + /* prevent warnings for unused vars */ + (void)(mask_array ); + (void)(mask_offset + 0); + (void)(mask_time_level + 0); + (void)(operator_handle + 0); + /* set the number of points */ num_points = 0; diff --git a/src/ReductionNorm1.c b/src/ReductionNorm1.c index 859ea01..c8f5839 100644 --- a/src/ReductionNorm1.c +++ b/src/ReductionNorm1.c @@ -142,8 +142,7 @@ static int ReductionL1 (int N_dims, int operator_handle, int * indices; int * actual_indices; int * actual_iters_per_dim; - int index = 0; - int max_iter = 0;; + int max_iter = 0; int iter = 0; int sum_indices = 0; int max_index = 1; @@ -161,6 +160,12 @@ static int ReductionL1 (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; + /* prevent warnings for unused vars */ + (void)(mask_array); + (void)(mask_offset + 0); + (void)(mask_time_level + 0); + (void)(operator_handle + 0); + /* set the number of points */ num_points = 0; diff --git a/src/ReductionNorm2.c b/src/ReductionNorm2.c index 6a75ea6..222ab3c 100644 --- a/src/ReductionNorm2.c +++ b/src/ReductionNorm2.c @@ -142,8 +142,7 @@ static int ReductionL2 (int N_dims, int operator_handle, int * indices; int * actual_indices; int * actual_iters_per_dim; - int index = 0; - int max_iter = 0;; + int max_iter = 0; int iter = 0; int sum_indices = 0; int max_index = 1; @@ -161,6 +160,12 @@ static int ReductionL2 (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; + /* prevent warnings for unused vars */ + (void)(mask_array); + (void)(mask_offset + 0); + (void)(mask_time_level + 0); + (void)(operator_handle + 0); + /* set the number of points */ num_points = 0; diff --git a/src/ReductionNorm3.c b/src/ReductionNorm3.c index d27b674..3f95560 100644 --- a/src/ReductionNorm3.c +++ b/src/ReductionNorm3.c @@ -142,8 +142,7 @@ static int ReductionL3 (int N_dims, int operator_handle, int * indices; int * actual_indices; int * actual_iters_per_dim; - int index = 0; - int max_iter = 0;; + int max_iter = 0; int iter = 0; int sum_indices = 0; int max_index = 1; @@ -161,6 +160,12 @@ static int ReductionL3 (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; + /* prevent warnings for unused vars */ + (void)(mask_array); + (void)(mask_offset + 0); + (void)(mask_time_level + 0); + (void)(operator_handle + 0); + /* set the number of points */ num_points = 0; diff --git a/src/ReductionNorm4.c b/src/ReductionNorm4.c index f44a84c..268edb8 100644 --- a/src/ReductionNorm4.c +++ b/src/ReductionNorm4.c @@ -142,8 +142,7 @@ static int ReductionL4 (int N_dims, int operator_handle, int * indices; int * actual_indices; int * actual_iters_per_dim; - int index = 0; - int max_iter = 0;; + int max_iter = 0; int iter = 0; int sum_indices = 0; int max_index = 1; @@ -161,6 +160,12 @@ static int ReductionL4 (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; + /* prevent warnings for unused vars */ + (void)(mask_array); + (void)(mask_offset + 0); + (void)(mask_time_level + 0); + (void)(operator_handle + 0); + /* set the number of points */ num_points = 0; diff --git a/src/ReductionNormInf.c b/src/ReductionNormInf.c index f2216b2..34e4c65 100644 --- a/src/ReductionNormInf.c +++ b/src/ReductionNormInf.c @@ -142,8 +142,7 @@ static int ReductionLInf (int N_dims, int operator_handle, int * indices; int * actual_indices; int * actual_iters_per_dim; - int index = 0; - int max_iter = 0;; + int max_iter = 0; int iter = 0; int sum_indices = 0; int max_index = 1; @@ -161,6 +160,12 @@ static int ReductionLInf (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; + /* prevent warnings for unused vars */ + (void)(mask_array); + (void)(mask_offset + 0); + (void)(mask_time_level + 0); + (void)(operator_handle + 0); + /* set the number of points */ num_points = 0; diff --git a/src/ReductionSum.c b/src/ReductionSum.c index e30d4c7..78ac920 100644 --- a/src/ReductionSum.c +++ b/src/ReductionSum.c @@ -142,8 +142,7 @@ static int ReductionSum (int N_dims, int operator_handle, int * indices; int * actual_indices; int * actual_iters_per_dim; - int index = 0; - int max_iter = 0;; + int max_iter = 0; int iter = 0; int sum_indices = 0; int max_index = 1; @@ -161,6 +160,12 @@ static int ReductionSum (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; + /* prevent warnings for unused vars */ + (void)(mask_array); + (void)(mask_offset + 0); + (void)(mask_time_level + 0); + (void)(operator_handle + 0); + /* set the number of points */ num_points = 0; diff --git a/src/local_reductions.h b/src/local_reductions.h index 5f3f5e3..7ed8446 100644 --- a/src/local_reductions.h +++ b/src/local_reductions.h @@ -28,7 +28,7 @@ extern "C" { iter = 0; \ sum_indices = 0; \ num_points = 1; \ - const cctk_type *typed_vdata = (cctk_type *)(in_data); \ + const cctk_type * typed_vdata = (const cctk_type *)(in_data); \ out_type inval; \ out_type * outval = (out_type *) out_num; \ REDUCTION_INITIAL( * outval) \ -- cgit v1.2.3