From ae63df6d86f995876f38ab3cdf47eac61ccda8cd Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 07:48:08 -0400 Subject: Revert "Add src/ director formatting" This reverts commit 26ca8de4a6ec9bfe422a14cbe325a5f257df453b. --- src/statwrapper.cc | 59 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 21 deletions(-) (limited to 'src/statwrapper.cc') diff --git a/src/statwrapper.cc b/src/statwrapper.cc index cda25b6..e273e78 100644 --- a/src/statwrapper.cc +++ b/src/statwrapper.cc @@ -1,33 +1,48 @@ -// a Wraper function for stats class -#include +//a Wraper function for stats class #include "intersim2/stats.hpp" +#include -Stats *StatCreate(const char *name, double bin_size, int num_bins) { - Stats *newstat = new Stats(NULL, name, bin_size, num_bins); - newstat->Clear(); - return newstat; +Stats* StatCreate (const char * name, double bin_size, int num_bins) { + Stats* newstat = new Stats(NULL,name,bin_size,num_bins); + newstat->Clear (); + return newstat; } -void StatClear(void *st) { ((Stats *)st)->Clear(); } +void StatClear(void * st) +{ + ((Stats *)st)->Clear(); +} -void StatAddSample(void *st, int val) { ((Stats *)st)->AddSample(val); } +void StatAddSample (void * st, int val) +{ + ((Stats *)st)->AddSample(val); +} -double StatAverage(void *st) { return ((Stats *)st)->Average(); } +double StatAverage(void * st) +{ + return((Stats *)st)->Average(); +} -double StatMax(void *st) { return ((Stats *)st)->Max(); } +double StatMax(void * st) +{ + return((Stats *)st)->Max(); +} -double StatMin(void *st) { return ((Stats *)st)->Min(); } +double StatMin(void * st) +{ + return((Stats *)st)->Min(); +} -void StatDisp(void *st) { - printf("Stats for "); - ((Stats *)st)->DisplayHierarchy(); - // if (((Stats *)st)->NeverUsed()) { - // printf (" was never updated!\n"); - // } else { - printf("Min %f Max %f Average %f \n", ((Stats *)st)->Min(), - ((Stats *)st)->Max(), StatAverage(st)); - ((Stats *)st)->Display(); - // } +void StatDisp (void * st) +{ + printf ("Stats for "); + ((Stats *)st)->DisplayHierarchy(); +// if (((Stats *)st)->NeverUsed()) { +// printf (" was never updated!\n"); +// } else { + printf("Min %f Max %f Average %f \n",((Stats *)st)->Min(),((Stats *)st)->Max(),StatAverage(st)); + ((Stats *)st)->Display(); +// } } #if 0 @@ -40,3 +55,5 @@ int main () StatDisp(mytest); } #endif + + -- cgit v1.3