From 5804ecfa5e85fb2a33cabbb1953142ef0e7da599 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 17 Sep 2013 18:53:09 +0100 Subject: [PATCH] Revised Uuid::null, and turned it into a static method, not a variable. --- modules/juce_core/misc/juce_Uuid.cpp | 5 ++++- modules/juce_core/misc/juce_Uuid.h | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/juce_core/misc/juce_Uuid.cpp b/modules/juce_core/misc/juce_Uuid.cpp index a9d71ec31d..1abd213246 100644 --- a/modules/juce_core/misc/juce_Uuid.cpp +++ b/modules/juce_core/misc/juce_Uuid.cpp @@ -51,7 +51,10 @@ Uuid& Uuid::operator= (const Uuid& other) noexcept bool Uuid::operator== (const Uuid& other) const noexcept { return memcmp (uuid, other.uuid, sizeof (uuid)) == 0; } bool Uuid::operator!= (const Uuid& other) const noexcept { return ! operator== (other); } -Uuid Uuid::null ((const uint8*) nullptr); +Uuid Uuid::null() noexcept +{ + return Uuid ((const uint8*) nullptr); +} bool Uuid::isNull() const noexcept { diff --git a/modules/juce_core/misc/juce_Uuid.h b/modules/juce_core/misc/juce_Uuid.h index b05b3c2a62..d6ceaafa24 100644 --- a/modules/juce_core/misc/juce_Uuid.h +++ b/modules/juce_core/misc/juce_Uuid.h @@ -51,20 +51,20 @@ public: ~Uuid() noexcept; /** Creates a copy of another UUID. */ - Uuid (const Uuid& other) noexcept; + Uuid (const Uuid&) noexcept; /** Copies another UUID. */ - Uuid& operator= (const Uuid& other) noexcept; + Uuid& operator= (const Uuid&) noexcept; //============================================================================== /** Returns true if the ID is zero. */ bool isNull() const noexcept; - /** A static null Uuid object. */ - static Uuid null; + /** Returns a null Uuid object. */ + static Uuid null() noexcept; - bool operator== (const Uuid& other) const noexcept; - bool operator!= (const Uuid& other) const noexcept; + bool operator== (const Uuid&) const noexcept; + bool operator!= (const Uuid&) const noexcept; //============================================================================== /** Returns a stringified version of this UUID.