summaryrefslogtreecommitdiff
path: root/src/statwrapper.cc
diff options
context:
space:
mode:
authorNick <[email protected]>2019-09-13 07:54:00 -0400
committerNick <[email protected]>2019-09-13 07:54:00 -0400
commita34a4baad45a40840308167307c79371b4024a9d (patch)
treec9bef005b3a42ba7d65173ef68aba8eedfbb35d9 /src/statwrapper.cc
parentae63df6d86f995876f38ab3cdf47eac61ccda8cd (diff)
Big reformat change using clang-format-6.0
Diffstat (limited to 'src/statwrapper.cc')
-rw-r--r--src/statwrapper.cc59
1 files changed, 21 insertions, 38 deletions
diff --git a/src/statwrapper.cc b/src/statwrapper.cc
index e273e78..cda25b6 100644
--- a/src/statwrapper.cc
+++ b/src/statwrapper.cc
@@ -1,48 +1,33 @@
-//a Wraper function for stats class
-#include "intersim2/stats.hpp"
+// a Wraper function for stats class
#include <stdio.h>
+#include "intersim2/stats.hpp"
-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
@@ -55,5 +40,3 @@ int main ()
StatDisp(mytest);
}
#endif
-
-