diff --git a/compiler/boxes/boxcomplexity.cpp b/compiler/boxes/boxcomplexity.cpp index 66e245f080..1a8bbfa89e 100644 --- a/compiler/boxes/boxcomplexity.cpp +++ b/compiler/boxes/boxcomplexity.cpp @@ -76,8 +76,6 @@ int boxComplexity(Tree box) */ static int computeBoxComplexity(Tree box) { - int i; - double r; prim0 p0; prim1 p1; prim2 p2; @@ -92,9 +90,9 @@ static int computeBoxComplexity(Tree box) // simple elements if (xt) return 1; - else if (isBoxInt(box, &i)) + else if (isBoxInt(box)) return 1; - else if (isBoxReal(box, &r)) + else if (isBoxReal(box)) return 1; else if (isBoxWaveform(box)) @@ -126,7 +124,7 @@ static int computeBoxComplexity(Tree box) else if (isBoxFVar(box, type, name, file)) return 1; // slots and symbolic boxes - else if (isBoxSlot(box, &i)) + else if (isBoxSlot(box)) return 1; else if (isBoxSymbolic(box, t1, t2)) return 1 + BC(t2); diff --git a/compiler/boxes/boxes.cpp b/compiler/boxes/boxes.cpp index ac4ad40b1b..e57f8aee7a 100644 --- a/compiler/boxes/boxes.cpp +++ b/compiler/boxes/boxes.cpp @@ -41,7 +41,6 @@ #include #include "exception.hh" #include "global.hh" -#include "ppbox.hh" #include "prim2.hh" #include "xtended.hh" diff --git a/compiler/boxes/boxes.hh b/compiler/boxes/boxes.hh index 9d9c1da717..d00131f40f 100644 --- a/compiler/boxes/boxes.hh +++ b/compiler/boxes/boxes.hh @@ -347,4 +347,24 @@ LIBFAUST_API bool isBoxMetadata(Tree s, Tree& exp, Tree& mdlist); // Return the number of inputs and outputs LIBFAUST_API bool getBoxType(Tree box, int* inum, int* onum); +/** + * Produces "1 input" or "n inputs" according to n + * \param n the number of inputs + * \return the corresponding string + */ +inline std::string inputs(int n) +{ + return std::to_string(n) + ((n == 1) ? " input" : " inputs"); +} + +/** + * Produces "1 output" or "n outputs" according to n + * \param n the number of outputs + * \return the corresponding string + */ +inline std::string outputs(int n) +{ + return std::to_string(n) + ((n == 1) ? " output" : " outputs"); +} + #endif diff --git a/compiler/boxes/boxtype.cpp b/compiler/boxes/boxtype.cpp index 526169df9f..cf5e7d22c5 100644 --- a/compiler/boxes/boxtype.cpp +++ b/compiler/boxes/boxtype.cpp @@ -80,28 +80,6 @@ LIBFAUST_API bool getBoxType(Tree box, int* inum, int* onum) } } -/** - * Produces "1 output" or "n outputs" according to n - * \param n the number of outputs - * \return the corresponding string - */ - -static string outputs(int n) -{ - return std::to_string(n) + ((n == 1) ? " output" : " outputs"); -} - -/** - * Produces "1 input" or "n inputs" according to n - * \param n the number of inputs - * \return the corresponding string - */ - -static string inputs(int n) -{ - return std::to_string(n) + ((n == 1) ? " input" : " inputs"); -} - /** * Compute a parametric type error message * \param a the LHS expression diff --git a/compiler/generator/c/c_code_container.cpp b/compiler/generator/c/c_code_container.cpp index 5b3ff458e0..03c5f07d29 100644 --- a/compiler/generator/c/c_code_container.cpp +++ b/compiler/generator/c/c_code_container.cpp @@ -78,7 +78,7 @@ CodeContainer* CCodeContainer::createScalarContainer(const string& name, int sub CodeContainer* CCodeContainer::createContainer(const string& name, int numInputs, int numOutputs, ostream* dst) { - gGlobal->gDSPStruct = true; + gGlobal->gDSPStruct = true; // for -vec -fun mode CodeContainer* container; if (gGlobal->gOpenCLSwitch) { diff --git a/compiler/generator/codebox/codebox_code_container.cpp b/compiler/generator/codebox/codebox_code_container.cpp index e2885e4003..c22dd8f424 100644 --- a/compiler/generator/codebox/codebox_code_container.cpp +++ b/compiler/generator/codebox/codebox_code_container.cpp @@ -85,7 +85,6 @@ CodeContainer* CodeboxCodeContainer::createScalarContainer(const string& name, i CodeContainer* CodeboxCodeContainer::createContainer(const string& name, int numInputs, int numOutputs, ostream* dst) { - gGlobal->gDSPStruct = true; CodeContainer* container; if (gGlobal->gOpenCLSwitch) { diff --git a/compiler/generator/jax/jax_code_container.cpp b/compiler/generator/jax/jax_code_container.cpp index da65f8a935..0c3b448bc0 100644 --- a/compiler/generator/jax/jax_code_container.cpp +++ b/compiler/generator/jax/jax_code_container.cpp @@ -85,7 +85,6 @@ CodeContainer* JAXCodeContainer::createScalarContainer(const string& name, int s CodeContainer* JAXCodeContainer::createContainer(const string& name, int numInputs, int numOutputs, ostream* dst) { - gGlobal->gDSPStruct = true; CodeContainer* container; if (gGlobal->gOpenCLSwitch) { diff --git a/compiler/generator/jsfx/jsfx_code_container.cpp b/compiler/generator/jsfx/jsfx_code_container.cpp index d167239ef4..1dcc38dfcb 100644 --- a/compiler/generator/jsfx/jsfx_code_container.cpp +++ b/compiler/generator/jsfx/jsfx_code_container.cpp @@ -59,7 +59,6 @@ CodeContainer* JSFXCodeContainer::createScalarContainer(const string& name, int CodeContainer* JSFXCodeContainer::createContainer(const string& name, int numInputs, int numOutputs, ostream* dst) { - gGlobal->gDSPStruct = true; CodeContainer* container; if (gGlobal->gOpenCLSwitch) { diff --git a/compiler/generator/julia/julia_code_container.cpp b/compiler/generator/julia/julia_code_container.cpp index 06624f395c..e00af0bf5a 100644 --- a/compiler/generator/julia/julia_code_container.cpp +++ b/compiler/generator/julia/julia_code_container.cpp @@ -71,7 +71,6 @@ CodeContainer* JuliaCodeContainer::createScalarContainer(const string& name, int CodeContainer* JuliaCodeContainer::createContainer(const string& name, int numInputs, int numOutputs, ostream* dst) { - gGlobal->gDSPStruct = true; CodeContainer* container; if (gGlobal->gOpenCLSwitch) { diff --git a/compiler/generator/llvm/llvm_code_container.cpp b/compiler/generator/llvm/llvm_code_container.cpp index 42c6ef0db9..a24f5f30a8 100644 --- a/compiler/generator/llvm/llvm_code_container.cpp +++ b/compiler/generator/llvm/llvm_code_container.cpp @@ -95,7 +95,7 @@ LLVMCodeContainer::~LLVMCodeContainer() CodeContainer* LLVMCodeContainer::createContainer(const string& name, int numInputs, int numOutputs) { - gGlobal->gDSPStruct = true; + gGlobal->gDSPStruct = true; // for -vec -fun mode CodeContainer* container; if (gGlobal->gFloatSize == 3) { diff --git a/compiler/generator/rust/rust_code_container.cpp b/compiler/generator/rust/rust_code_container.cpp index 456043bde4..4bbbc16f7a 100644 --- a/compiler/generator/rust/rust_code_container.cpp +++ b/compiler/generator/rust/rust_code_container.cpp @@ -61,7 +61,6 @@ CodeContainer* RustCodeContainer::createVectorContainer(const string& name, int CodeContainer* RustCodeContainer::createContainer(const string& name, int numInputs, int numOutputs, ostream* dst) { - gGlobal->gDSPStruct = true; CodeContainer* container; if (gGlobal->gFloatSize == 3) { diff --git a/compiler/generator/template/template_code_container.cpp b/compiler/generator/template/template_code_container.cpp index 9cf2abb7d3..eafe8f6a20 100644 --- a/compiler/generator/template/template_code_container.cpp +++ b/compiler/generator/template/template_code_container.cpp @@ -63,7 +63,6 @@ CodeContainer* TemplateCodeContainer::createScalarContainer(const string& name, */ CodeContainer* TemplateCodeContainer::createContainer(const string& name, int numInputs, int numOutputs, ostream* dst) { - gGlobal->gDSPStruct = true; CodeContainer* container; if (gGlobal->gOpenCLSwitch) { diff --git a/compiler/libcode.cpp b/compiler/libcode.cpp index d9c96630a7..0ba8517dc6 100644 --- a/compiler/libcode.cpp +++ b/compiler/libcode.cpp @@ -300,7 +300,7 @@ static Tree evaluateBlockDiagram(Tree expandedDefList, int& numInputs, int& numO } if (gGlobal->gDetailsSwitch) { - cout << "process has " << numInputs << " inputs, and " << numOutputs << " outputs" << endl; + cout << "process has " << inputs(numInputs) << ", and " << outputs(numOutputs) << endl; } endTiming("evaluation"); diff --git a/compiler/propagate/propagate.cpp b/compiler/propagate/propagate.cpp index 256a47f4ea..8064f2d0f3 100644 --- a/compiler/propagate/propagate.cpp +++ b/compiler/propagate/propagate.cpp @@ -284,8 +284,6 @@ static siglist realPropagate(Tree slotenv, Tree path, Tree box, const siglist& l Tree sig; faustassert(lsig.size() == 0); if (!searchEnv(box, sig, slotenv)) { - // test YO : diagrams simplification - // cerr << "propagate : internal error (slot undefined)\n"); sig = sigInput(++gGlobal->gDummyInput); } return makeList(sig); @@ -359,7 +357,6 @@ static siglist realPropagate(Tree slotenv, Tree path, Tree box, const siglist& l } else if (isBoxFFun(box, ff)) { - // cerr << "propagate en boxFFun of arity " << ffarity(ff) << endl; faustassert(int(lsig.size()) == ffarity(ff)); return makeList(sigFFun(ff, listConvert(lsig))); } @@ -575,9 +572,9 @@ siglist propagate(Tree slotenv, Tree path, Tree box, const siglist& lsig) result = realPropagate(slotenv, path, box, lsig); setPropagateProperty(args, result); } - // cerr << "propagate in " << boxpp(box) << endl; - // for (int i = 0; i < lsig.size(); i++) { cerr << " -> signal " << i << " : " << *(lsig[i]) << endl; } - // cerr << endl; + // cerr << "propagate in " << boxpp(box) << endl; + // for (int i = 0; i < lsig.size(); i++) { cerr << " -> signal " << i << " : " << *(lsig[i]) << endl; } + // cerr << endl; return result; }