diff --git a/core/Bench.carp b/core/Bench.carp index 22db7fa1..38c3f02d 100644 --- a/core/Bench.carp +++ b/core/Bench.carp @@ -1,3 +1,5 @@ +(load "Statistics.carp") + (system-include "bench.h") (register get-time-elapsed (Fn [] Double)) diff --git a/core/Statistics.carp b/core/Statistics.carp index 5a39d609..32782652 100644 --- a/core/Statistics.carp +++ b/core/Statistics.carp @@ -27,7 +27,7 @@ total)))) (defn mean [data] - (/ (sum data) (from-int (Array.count data)))) + (/ (Statistics.sum data) (from-int (Array.count data)))) (defn min [a] (let [m (Double.copy (Array.nth a 0))] @@ -184,7 +184,7 @@ (defn summary [samples] (Summary.init - (sum samples) + (Statistics.sum samples) (min samples) (max samples) (mean samples) diff --git a/src/Deftype.hs b/src/Deftype.hs index 8b9780cc..fa2bb344 100644 --- a/src/Deftype.hs +++ b/src/Deftype.hs @@ -226,6 +226,7 @@ templatePrn pathStrings structTy@(StructTy name varTys) [XObj (Arr membersXObjs) , " // convert members to string here:" , " string temp = NULL;" , " int tempsize = 0;" + , " (void)tempsize; // that way we remove the occasional unused warning " , calculateStructStrSize typeEnv env correctedMembers structTy , " string buffer = CARP_MALLOC(size);" , " string bufferPtr = buffer;" @@ -260,6 +261,7 @@ templateStr typeEnv env t@(StructTy typeName _) members = , " // convert members to string here:" , " string temp = NULL;" , " int tempsize = 0;" + , " (void)tempsize; // that way we remove the occasional unused warning " , calculateStructStrSize typeEnv env correctedMembers structTy , " string buffer = CARP_MALLOC(size);" , " string bufferPtr = buffer;"