summaryrefslogtreecommitdiff
path: root/src/statwrapper.cc
diff options
context:
space:
mode:
authorNick <[email protected]>2019-09-13 07:48:08 -0400
committerNick <[email protected]>2019-09-13 07:48:08 -0400
commitae63df6d86f995876f38ab3cdf47eac61ccda8cd (patch)
treecd789844612b2a2d85fbd574926da02d9e4bee15 /src/statwrapper.cc
parent9b1e6dba9f721c772e801abc4851a88aa61929da (diff)
Revert "Add src/ director formatting"
This reverts commit 26ca8de4a6ec9bfe422a14cbe325a5f257df453b.
Diffstat (limited to 'src/statwrapper.cc')
-rw-r--r--src/statwrapper.cc59
1 files changed, 38 insertions, 21 deletions
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 <stdio.h>
+//a Wraper function for stats class
#include "intersim2/stats.hpp"
+#include <stdio.h>
-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
+
+