Skip to content

Commit 158220d

Browse files
Formatting: Use nested namespace definitions
1 parent 90c458d commit 158220d

File tree

142 files changed

+398
-800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+398
-800
lines changed

.clang-tidy

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Checks: >
33
-clang-analyzer-optin.performance.Padding,
44
-clang-analyzer-security.FloatLoopCounter,
55
-clang-analyzer-security.insecureAPI.strcpy,
6+
modernize-concat-nested-namespaces,
67
78
WarningsAsErrors: '*'
89

extras/Build/juce_build_tools/utils/juce_BinaryResourceFile.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
static const char* resourceFileIdentifierString = "JUCER_BINARY_RESOURCE";
3130

3231
//==============================================================================
@@ -285,5 +284,5 @@ namespace build_tools
285284

286285
return { Result::ok(), std::move (filesCreated) };
287286
}
288-
}
289-
}
287+
288+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_BinaryResourceFile.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
class ResourceFile
3130
{
3231
public:
@@ -70,5 +69,5 @@ namespace build_tools
7069

7170
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResourceFile)
7271
};
73-
}
74-
}
72+
73+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_BuildHelperFunctions.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
void overwriteFileIfDifferentOrThrow (const File& file, const MemoryOutputStream& newData)
3130
{
3231
if (! overwriteFileWithNewDataIfDifferent (file, newData))
@@ -355,5 +354,5 @@ namespace build_tools
355354
writer (mo);
356355
overwriteFileIfDifferentOrThrow (file, mo);
357356
}
358-
}
359-
}
357+
358+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_BuildHelperFunctions.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
void overwriteFileIfDifferentOrThrow (const File& file, const MemoryOutputStream& newData);
3130
void overwriteFileIfDifferentOrThrow (const File& file, const String& newData);
3231

@@ -82,5 +81,5 @@ namespace build_tools
8281
String getRelativePathFrom (const File& file, const File& sourceFolder);
8382

8483
void writeStreamToFile (const File& file, const std::function<void (MemoryOutputStream&)>& writer);
85-
}
86-
}
84+
85+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_CppTokeniserFunctions.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
static bool isReservedKeyword (String::CharPointerType token, const int tokenLength) noexcept
3130
{
3231
static const char* const keywords2Char[] =
@@ -202,5 +201,5 @@ namespace build_tools
202201
}
203202
}
204203
}
205-
}
206-
}
204+
205+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_Entitlements.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce:: build_tools
2927
{
28+
3029
String EntitlementOptions::getEntitlementsFileContent() const
3130
{
3231
String content =
@@ -132,5 +131,5 @@ namespace build_tools
132131

133132
return entitlements;
134133
}
135-
}
136-
}
134+
135+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_Entitlements.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
struct EntitlementOptions final
3130
{
3231
String getEntitlementsFileContent() const;
@@ -61,5 +60,5 @@ namespace build_tools
6160
private:
6261
StringPairArray getEntitlements() const;
6362
};
64-
}
65-
}
63+
64+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_Icons.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
Array<Drawable*> asArray (const Icons& icons)
3130
{
3231
Array<Drawable*> result;
@@ -495,5 +494,5 @@ namespace build_tools
495494

496495
return { assets, targetFolder, RelativePath::buildTargetFolder };
497496
}
498-
}
499-
}
497+
498+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_Icons.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
struct Icons
3130
{
3231
std::unique_ptr<Drawable> small;
@@ -45,5 +44,5 @@ namespace build_tools
4544
RelativePath createXcassetsFolderFromIcons (const Icons& icons,
4645
const File& targetFolder,
4746
String projectFilenameRootString);
48-
}
49-
}
47+
48+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_PlistOptions.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
//==============================================================================
3130
static XmlElement* getKeyWithName (XmlElement& xml, const String& key)
3231
{
@@ -374,5 +373,5 @@ namespace build_tools
374373

375374
return { plistKey, plistEntry };
376375
}
377-
}
378-
}
376+
377+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_PlistOptions.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
class PlistOptions final
3130
{
3231
public:
@@ -103,5 +102,5 @@ namespace build_tools
103102
Array<XmlElement> createExtraAudioUnitTargetPlistOptions() const;
104103
Array<XmlElement> createExtraAudioUnitV3TargetPlistOptions() const;
105104
};
106-
}
107-
}
105+
106+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_ProjectType.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
//==============================================================================
3130
class ProjectType
3231
{
@@ -321,5 +320,5 @@ namespace build_tools
321320

322321
return Array<ProjectType*> (&guiApp, &consoleApp, &staticLib, &dll, &plugin, &araplugin);
323322
}
324-
}
325-
}
323+
324+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_RelativePath.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
//==============================================================================
3130
/** Manipulates a cross-platform partial file path. (Needed because File is designed
3231
for absolute paths on the active OS)
@@ -125,5 +124,5 @@ namespace build_tools
125124
return currentWorkingDirectory.getChildFile (path);
126125
}
127126
};
128-
}
129-
}
127+
128+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_ResourceFileHelpers.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
uint64 calculateStreamHashCode (InputStream& in)
3130
{
3231
uint64 t = 0;
@@ -87,5 +86,5 @@ namespace build_tools
8786
const char* const utf8 = newData.toUTF8();
8887
return overwriteFileWithNewDataIfDifferent (file, utf8, strlen (utf8));
8988
}
90-
}
91-
}
89+
90+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_ResourceFileHelpers.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce:: build_tools
2927
{
28+
3029
uint64 calculateStreamHashCode (InputStream& in);
3130
uint64 calculateFileHashCode (const File& file);
3231
uint64 calculateMemoryHashCode (const void* data, size_t numBytes);
3332

3433
bool overwriteFileWithNewDataIfDifferent (const File& file, const void* data, size_t numBytes);
3534
bool overwriteFileWithNewDataIfDifferent (const File& file, const MemoryOutputStream& newData);
3635
bool overwriteFileWithNewDataIfDifferent (const File& file, const String& newData);
37-
}
38-
}
36+
37+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_ResourceRc.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
static String getCommaSeparatedVersionNumber (const String& version)
3130
{
3231
auto versionParts = StringArray::fromTokens (version, ",.", "");
@@ -93,5 +92,5 @@ namespace build_tools
9392

9493
overwriteFileIfDifferentOrThrow (resourceRcFile, mo);
9594
}
96-
}
97-
}
95+
96+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_ResourceRc.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
class ResourceRcOptions final
3130
{
3231
public:
@@ -39,5 +38,5 @@ namespace build_tools
3938
String projectName;
4039
File icon;
4140
};
42-
}
43-
}
41+
42+
} // namespace juce::build_tools

extras/Build/juce_build_tools/utils/juce_VersionNumbers.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
==============================================================================
2424
*/
2525

26-
namespace juce
27-
{
28-
namespace build_tools
26+
namespace juce::build_tools
2927
{
28+
3029
StringArray getVersionSegments (StringRef p)
3130
{
3231
auto segments = StringArray::fromTokens (p, ",.", "");
@@ -56,5 +55,5 @@ namespace build_tools
5655
{
5756
return "0x" + String::toHexString (getVersionAsHexInteger (versionString));
5857
}
59-
}
60-
}
58+
59+
} // namespace juce::build_tools

0 commit comments

Comments
 (0)