diff --git a/packages/xod-arduino/platform/implList.tpl.cpp b/packages/xod-arduino/platform/implList.tpl.cpp index f4f9107b..2513e992 100644 --- a/packages/xod-arduino/platform/implList.tpl.cpp +++ b/packages/xod-arduino/platform/implList.tpl.cpp @@ -8,7 +8,7 @@ * =============================================================================*/ -namespace _program { +namespace xod { {{#each this}} //----------------------------------------------------------------------------- @@ -21,4 +21,4 @@ namespace {{ owner }}__{{ libName }}__{{ patchName }} { } // namespace {{ owner }}__{{ libName }}__{{ patchName }} {{/each}} -} // namespace _program +} // namespace xod diff --git a/packages/xod-arduino/platform/program.tpl.cpp b/packages/xod-arduino/platform/program.tpl.cpp index 4eb8908a..dba8b480 100644 --- a/packages/xod-arduino/platform/program.tpl.cpp +++ b/packages/xod-arduino/platform/program.tpl.cpp @@ -8,7 +8,7 @@ * =============================================================================*/ -namespace _program { +namespace xod { {{#each nodes}} {{mergePins }} {{#each outputs }} diff --git a/packages/xod-arduino/platform/runtime.cpp b/packages/xod-arduino/platform/runtime.cpp index c32b63dd..48135040 100644 --- a/packages/xod-arduino/platform/runtime.cpp +++ b/packages/xod-arduino/platform/runtime.cpp @@ -32,7 +32,7 @@ #define PIN_KEY_OFFSET_BITS (16 - MAX_OUTPUT_COUNT) #define NO_NODE ((NodeId)-1) -namespace _program { +namespace xod { typedef double Number; typedef bool Logic; @@ -72,7 +72,7 @@ namespace _program { //---------------------------------------------------------------------------- // Engine //---------------------------------------------------------------------------- -namespace _program { +namespace xod { extern void* storages[NODE_COUNT]; extern EvalFuncPtr evaluationFuncs[NODE_COUNT]; extern DirtyFlags dirtyFlags[NODE_COUNT]; @@ -261,6 +261,6 @@ void setup() { } void loop() { - _program::idle(); - _program::runTransaction(); + xod::idle(); + xod::runTransaction(); } diff --git a/packages/xod-arduino/src/templates.js b/packages/xod-arduino/src/templates.js index 498b4704..bf9db337 100644 --- a/packages/xod-arduino/src/templates.js +++ b/packages/xod-arduino/src/templates.js @@ -60,7 +60,7 @@ Handlebars.registerHelper('global', function global(options) { '// --- Enter global namespace ---', '}}', options.fn(this), - 'namespace _program {', + 'namespace xod {', `namespace ${this.owner}__${this.libName}__${this.patchName} {`, '// --- Back to local namespace ---', ].join('\n'); diff --git a/packages/xod-arduino/test/fixtures/implList.cpp b/packages/xod-arduino/test/fixtures/implList.cpp index 027ea0ca..44c084bb 100644 --- a/packages/xod-arduino/test/fixtures/implList.cpp +++ b/packages/xod-arduino/test/fixtures/implList.cpp @@ -6,7 +6,7 @@ * =============================================================================*/ -namespace _program { +namespace xod { //----------------------------------------------------------------------------- // xod/math/multiply implementation @@ -38,4 +38,4 @@ void evaluate(Context ctx) { } // namespace xod__math__multiply -} // namespace _program +} // namespace xod diff --git a/packages/xod-arduino/test/fixtures/program.cpp b/packages/xod-arduino/test/fixtures/program.cpp index 097bc859..35d7ddee 100644 --- a/packages/xod-arduino/test/fixtures/program.cpp +++ b/packages/xod-arduino/test/fixtures/program.cpp @@ -6,7 +6,7 @@ * =============================================================================*/ -namespace _program { +namespace xod { NodeId links_0_OUT[] = { 1, NO_NODE }; xod__math__multiply::Storage storage_0 = { diff --git a/packages/xod-client-electron/test-func/fixtures/blink.cpp b/packages/xod-client-electron/test-func/fixtures/blink.cpp index 257defbb..b25e0517 100644 --- a/packages/xod-client-electron/test-func/fixtures/blink.cpp +++ b/packages/xod-client-electron/test-func/fixtures/blink.cpp @@ -671,7 +671,7 @@ template class List { #define PIN_KEY_OFFSET_BITS (16 - MAX_OUTPUT_COUNT) #define NO_NODE ((NodeId)-1) -namespace _program { +namespace xod { typedef double Number; typedef bool Logic; @@ -711,7 +711,7 @@ namespace _program { //---------------------------------------------------------------------------- // Engine //---------------------------------------------------------------------------- -namespace _program { +namespace xod { extern void* storages[NODE_COUNT]; extern EvalFuncPtr evaluationFuncs[NODE_COUNT]; extern DirtyFlags dirtyFlags[NODE_COUNT]; @@ -900,8 +900,8 @@ void setup() { } void loop() { - _program::idle(); - _program::runTransaction(); + xod::idle(); + xod::runTransaction(); } /*============================================================================= @@ -912,7 +912,7 @@ void loop() { * =============================================================================*/ -namespace _program { +namespace xod { //----------------------------------------------------------------------------- // xod/core/clock implementation @@ -1072,7 +1072,7 @@ void evaluate(Context ctx) { } // namespace xod__core__constant_number -} // namespace _program +} // namespace xod /*============================================================================= * @@ -1082,7 +1082,7 @@ void evaluate(Context ctx) { * =============================================================================*/ -namespace _program { +namespace xod { NodeId links_0_TICK[] = { 1, NO_NODE }; xod__core__clock::Storage storage_0 = { diff --git a/workspace/blink/__fixtures__/arduino.cpp b/workspace/blink/__fixtures__/arduino.cpp index af7c6bd0..47de495a 100644 --- a/workspace/blink/__fixtures__/arduino.cpp +++ b/workspace/blink/__fixtures__/arduino.cpp @@ -671,7 +671,7 @@ template class List { #define PIN_KEY_OFFSET_BITS (16 - MAX_OUTPUT_COUNT) #define NO_NODE ((NodeId)-1) -namespace _program { +namespace xod { typedef double Number; typedef bool Logic; @@ -711,7 +711,7 @@ namespace _program { //---------------------------------------------------------------------------- // Engine //---------------------------------------------------------------------------- -namespace _program { +namespace xod { extern void* storages[NODE_COUNT]; extern EvalFuncPtr evaluationFuncs[NODE_COUNT]; extern DirtyFlags dirtyFlags[NODE_COUNT]; @@ -900,8 +900,8 @@ void setup() { } void loop() { - _program::idle(); - _program::runTransaction(); + xod::idle(); + xod::runTransaction(); } /*============================================================================= @@ -912,7 +912,7 @@ void loop() { * =============================================================================*/ -namespace _program { +namespace xod { //----------------------------------------------------------------------------- // xod/core/clock implementation @@ -1072,7 +1072,7 @@ void evaluate(Context ctx) { } // namespace xod__core__constant_number -} // namespace _program +} // namespace xod /*============================================================================= * @@ -1082,7 +1082,7 @@ void evaluate(Context ctx) { * =============================================================================*/ -namespace _program { +namespace xod { NodeId links_0_TICK[] = { 2, NO_NODE }; xod__core__clock::Storage storage_0 = { diff --git a/workspace/lcd-time/__fixtures__/arduino.cpp b/workspace/lcd-time/__fixtures__/arduino.cpp index f1cffb9c..e90655f5 100644 --- a/workspace/lcd-time/__fixtures__/arduino.cpp +++ b/workspace/lcd-time/__fixtures__/arduino.cpp @@ -671,7 +671,7 @@ template class List { #define PIN_KEY_OFFSET_BITS (16 - MAX_OUTPUT_COUNT) #define NO_NODE ((NodeId)-1) -namespace _program { +namespace xod { typedef double Number; typedef bool Logic; @@ -711,7 +711,7 @@ namespace _program { //---------------------------------------------------------------------------- // Engine //---------------------------------------------------------------------------- -namespace _program { +namespace xod { extern void* storages[NODE_COUNT]; extern EvalFuncPtr evaluationFuncs[NODE_COUNT]; extern DirtyFlags dirtyFlags[NODE_COUNT]; @@ -900,8 +900,8 @@ void setup() { } void loop() { - _program::idle(); - _program::runTransaction(); + xod::idle(); + xod::runTransaction(); } /*============================================================================= @@ -912,7 +912,7 @@ void loop() { * =============================================================================*/ -namespace _program { +namespace xod { //----------------------------------------------------------------------------- // xod/core/system_time implementation @@ -951,7 +951,7 @@ namespace xod__common_hardware__text_lcd_16x2 { }} #include -namespace _program { +namespace xod { namespace xod__common_hardware__text_lcd_16x2 { // --- Back to local namespace --- struct State { @@ -1119,7 +1119,7 @@ void evaluate(Context ctx) { } // namespace xod__core__constant_string -} // namespace _program +} // namespace xod /*============================================================================= * @@ -1129,7 +1129,7 @@ void evaluate(Context ctx) { * =============================================================================*/ -namespace _program { +namespace xod { NodeId links_0_TIME[] = { 2, NO_NODE }; xod__core__system_time::Storage storage_0 = { diff --git a/workspace/two-button-switch/__fixtures__/arduino.cpp b/workspace/two-button-switch/__fixtures__/arduino.cpp index 9d042581..09ec684e 100644 --- a/workspace/two-button-switch/__fixtures__/arduino.cpp +++ b/workspace/two-button-switch/__fixtures__/arduino.cpp @@ -671,7 +671,7 @@ template class List { #define PIN_KEY_OFFSET_BITS (16 - MAX_OUTPUT_COUNT) #define NO_NODE ((NodeId)-1) -namespace _program { +namespace xod { typedef double Number; typedef bool Logic; @@ -711,7 +711,7 @@ namespace _program { //---------------------------------------------------------------------------- // Engine //---------------------------------------------------------------------------- -namespace _program { +namespace xod { extern void* storages[NODE_COUNT]; extern EvalFuncPtr evaluationFuncs[NODE_COUNT]; extern DirtyFlags dirtyFlags[NODE_COUNT]; @@ -900,8 +900,8 @@ void setup() { } void loop() { - _program::idle(); - _program::runTransaction(); + xod::idle(); + xod::runTransaction(); } /*============================================================================= @@ -912,7 +912,7 @@ void loop() { * =============================================================================*/ -namespace _program { +namespace xod { //----------------------------------------------------------------------------- // xod/core/gate implementation @@ -1131,7 +1131,7 @@ void evaluate(Context ctx) { } // namespace xod__core__constant_number -} // namespace _program +} // namespace xod /*============================================================================= * @@ -1141,7 +1141,7 @@ void evaluate(Context ctx) { * =============================================================================*/ -namespace _program { +namespace xod { NodeId links_0_T[] = { NO_NODE }; NodeId links_0_F[] = { 2, NO_NODE };