From 941d7146306eca5c10c326c4109c4936d0ac0d35 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 28 Mar 2019 06:24:20 -0500 Subject: [PATCH] [nostalgia/core] Replace old namespace nesting with C++17 nesting --- src/nostalgia/core/core.cpp | 4 +--- src/nostalgia/core/core.hpp | 4 +--- src/nostalgia/core/gba/gba.hpp | 4 +--- src/nostalgia/core/gba/gfx.cpp | 4 +--- src/nostalgia/core/gba/media.cpp | 4 +--- src/nostalgia/core/gba/panic.cpp | 5 +---- src/nostalgia/core/gba/panic.hpp | 4 +--- src/nostalgia/core/gfx.hpp | 4 +--- src/nostalgia/core/media.hpp | 4 +--- src/nostalgia/core/mem.hpp | 4 +--- src/nostalgia/core/qt/gfx.cpp | 4 +--- src/nostalgia/core/studio/import_tilesheet_wizard.cpp | 4 +--- src/nostalgia/core/studio/import_tilesheet_wizard.hpp | 4 +--- src/nostalgia/core/studio/plugin.cpp | 4 +--- src/nostalgia/core/studio/plugin.hpp | 4 +--- src/nostalgia/core/userland/media.cpp | 4 +--- src/nostalgia/core/userland/mem.cpp | 4 +--- 17 files changed, 17 insertions(+), 52 deletions(-) diff --git a/src/nostalgia/core/core.cpp b/src/nostalgia/core/core.cpp index 03607f43..8e8d40c1 100644 --- a/src/nostalgia/core/core.cpp +++ b/src/nostalgia/core/core.cpp @@ -9,8 +9,7 @@ #include "mem.hpp" #include "core.hpp" -namespace nostalgia { -namespace core { +namespace nostalgia::core { ox::Error init(Context *ctx) { ox::Error err = 0; @@ -20,4 +19,3 @@ ox::Error init(Context *ctx) { } } -} diff --git a/src/nostalgia/core/core.hpp b/src/nostalgia/core/core.hpp index da54ef87..bbf1aac6 100644 --- a/src/nostalgia/core/core.hpp +++ b/src/nostalgia/core/core.hpp @@ -14,10 +14,8 @@ #include "media.hpp" #include "types.hpp" -namespace nostalgia { -namespace core { +namespace nostalgia::core { ox::Error init(Context *ctx); } -} diff --git a/src/nostalgia/core/gba/gba.hpp b/src/nostalgia/core/gba/gba.hpp index 644fea65..e9ef9850 100644 --- a/src/nostalgia/core/gba/gba.hpp +++ b/src/nostalgia/core/gba/gba.hpp @@ -10,8 +10,7 @@ #include -namespace nostalgia { -namespace core { +namespace nostalgia::core { typedef struct { uint32_t data[8]; } __attribute__((aligned(4))) Tile, Tile4; // d-tile: double-sized tile (8bpp) @@ -33,4 +32,3 @@ struct __attribute__((packed)) GbaImageData { }; } -} diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index 4693e812..4fa5a2e2 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -17,8 +17,7 @@ #include "../gfx.hpp" -namespace nostalgia { -namespace core { +namespace nostalgia::core { using namespace ox; @@ -249,4 +248,3 @@ void setTile(Context *ctx, int layer, int column, int row, uint8_t tile) { } } -} diff --git a/src/nostalgia/core/gba/media.cpp b/src/nostalgia/core/gba/media.cpp index 0ef781af..cfc8d156 100644 --- a/src/nostalgia/core/gba/media.cpp +++ b/src/nostalgia/core/gba/media.cpp @@ -12,8 +12,7 @@ #include "../media.hpp" -namespace nostalgia { -namespace core { +namespace nostalgia::core { uint8_t *loadRom(const char*) { // put the header in the wrong order to prevent mistaking this code for the @@ -34,4 +33,3 @@ uint8_t *loadRom(const char*) { } } -} diff --git a/src/nostalgia/core/gba/panic.cpp b/src/nostalgia/core/gba/panic.cpp index 9d68281a..d1ada3a7 100644 --- a/src/nostalgia/core/gba/panic.cpp +++ b/src/nostalgia/core/gba/panic.cpp @@ -9,8 +9,7 @@ #include "../core.hpp" #include "panic.hpp" -namespace nostalgia { -namespace core { +namespace nostalgia::core { void panic(const char *msg) { initConsole(nullptr); @@ -23,5 +22,3 @@ void panic(const char *msg) { } } -} - diff --git a/src/nostalgia/core/gba/panic.hpp b/src/nostalgia/core/gba/panic.hpp index cc52fae7..f2f728f6 100644 --- a/src/nostalgia/core/gba/panic.hpp +++ b/src/nostalgia/core/gba/panic.hpp @@ -10,11 +10,9 @@ #include "panic.hpp" -namespace nostalgia { -namespace core { +namespace nostalgia::core { void panic(const char *msg); } -} diff --git a/src/nostalgia/core/gfx.hpp b/src/nostalgia/core/gfx.hpp index 51837276..f144a068 100644 --- a/src/nostalgia/core/gfx.hpp +++ b/src/nostalgia/core/gfx.hpp @@ -13,8 +13,7 @@ #include "context.hpp" #include "types.hpp" -namespace nostalgia { -namespace core { +namespace nostalgia::core { ox::Error initGfx(Context *ctx); @@ -27,4 +26,3 @@ void puts(Context *ctx, int loc, const char *str); void setTile(Context *ctx, int layer, int column, int row, uint8_t tile); } -} diff --git a/src/nostalgia/core/media.hpp b/src/nostalgia/core/media.hpp index 557f5264..fcee137d 100644 --- a/src/nostalgia/core/media.hpp +++ b/src/nostalgia/core/media.hpp @@ -10,10 +10,8 @@ #include -namespace nostalgia { -namespace core { +namespace nostalgia::core { uint8_t *loadRom(const char *path = ""); } -} diff --git a/src/nostalgia/core/mem.hpp b/src/nostalgia/core/mem.hpp index 912326d5..18043b71 100644 --- a/src/nostalgia/core/mem.hpp +++ b/src/nostalgia/core/mem.hpp @@ -6,10 +6,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -namespace nostalgia { -namespace core { +namespace nostalgia::core { void initHeap(); } -} diff --git a/src/nostalgia/core/qt/gfx.cpp b/src/nostalgia/core/qt/gfx.cpp index f13f470e..aa271894 100644 --- a/src/nostalgia/core/qt/gfx.cpp +++ b/src/nostalgia/core/qt/gfx.cpp @@ -8,8 +8,7 @@ #include "../gfx.hpp" -namespace nostalgia { -namespace core { +namespace nostalgia::core { ox::Error initGfx(Context *ctx) { return 1; @@ -30,4 +29,3 @@ void setTile(Context *ctx, int layer, int column, int row, uint8_t tile) { } } -} diff --git a/src/nostalgia/core/studio/import_tilesheet_wizard.cpp b/src/nostalgia/core/studio/import_tilesheet_wizard.cpp index 72b72a33..002f73f4 100644 --- a/src/nostalgia/core/studio/import_tilesheet_wizard.cpp +++ b/src/nostalgia/core/studio/import_tilesheet_wizard.cpp @@ -11,8 +11,7 @@ #include "import_tilesheet_wizard.hpp" -namespace nostalgia { -namespace core { +namespace nostalgia::core { const QString ImportTilesheetWizardPage::TileSheetDir = "/TileSheets/"; const QString ImportTilesheetWizardPage::TileSheetName = "projectName"; @@ -75,4 +74,3 @@ int ImportTilesheetWizardPage::importImage(QFile &srcFile, QString tilesheetName } } -} diff --git a/src/nostalgia/core/studio/import_tilesheet_wizard.hpp b/src/nostalgia/core/studio/import_tilesheet_wizard.hpp index 152367be..9b2a47fd 100644 --- a/src/nostalgia/core/studio/import_tilesheet_wizard.hpp +++ b/src/nostalgia/core/studio/import_tilesheet_wizard.hpp @@ -10,8 +10,7 @@ #include -namespace nostalgia { -namespace core { +namespace nostalgia::core { class ImportTilesheetWizardPage: public studio::WizardFormPage { private: @@ -31,4 +30,3 @@ class ImportTilesheetWizardPage: public studio::WizardFormPage { }; } -} diff --git a/src/nostalgia/core/studio/plugin.cpp b/src/nostalgia/core/studio/plugin.cpp index fa79968f..5104a21a 100644 --- a/src/nostalgia/core/studio/plugin.cpp +++ b/src/nostalgia/core/studio/plugin.cpp @@ -12,8 +12,7 @@ using namespace nostalgia::studio; -namespace nostalgia { -namespace core { +namespace nostalgia::core { Plugin::Plugin() { } @@ -32,4 +31,3 @@ QVector Plugin::importWizards(const studio::Context *args) } } -} diff --git a/src/nostalgia/core/studio/plugin.hpp b/src/nostalgia/core/studio/plugin.hpp index 6a4c5c0b..35aa6205 100644 --- a/src/nostalgia/core/studio/plugin.hpp +++ b/src/nostalgia/core/studio/plugin.hpp @@ -12,8 +12,7 @@ #include -namespace nostalgia { -namespace core { +namespace nostalgia::core { class Plugin: public QObject, studio::Plugin { Q_OBJECT @@ -27,4 +26,3 @@ class Plugin: public QObject, studio::Plugin { }; } -} diff --git a/src/nostalgia/core/userland/media.cpp b/src/nostalgia/core/userland/media.cpp index 0dce3779..17a20d5f 100644 --- a/src/nostalgia/core/userland/media.cpp +++ b/src/nostalgia/core/userland/media.cpp @@ -11,12 +11,10 @@ #include "../media.hpp" -namespace nostalgia { -namespace core { +namespace nostalgia::core { uint8_t *loadRom(const char*) { return nullptr; } } -} diff --git a/src/nostalgia/core/userland/mem.cpp b/src/nostalgia/core/userland/mem.cpp index 9c2a5b69..e3e44b6c 100644 --- a/src/nostalgia/core/userland/mem.cpp +++ b/src/nostalgia/core/userland/mem.cpp @@ -6,11 +6,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -namespace nostalgia { -namespace core { +namespace nostalgia::core { void initHeap() { } } -}