mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
compiler: remove unused variable warning; core: add Statistics usage to Bench, fix ambiguity in Statistics
This commit is contained in:
parent
58f22c8000
commit
a6e44d3c56
@ -1,3 +1,5 @@
|
||||
(load "Statistics.carp")
|
||||
|
||||
(system-include "bench.h")
|
||||
(register get-time-elapsed (Fn [] Double))
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;"
|
||||
|
Loading…
Reference in New Issue
Block a user