From 572cf1deb8ea156d31f1e19c9c1c26557ad50b3e Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 11 Apr 2012 13:33:08 +0100 Subject: [PATCH] Cleaned up some docs. --- .../utility/juce_IncludeModuleHeaders.h | 2 +- modules/juce_core/maths/juce_MathsFunctions.h | 18 ------------------ modules/juce_core/memory/juce_Atomic.h | 19 ++++++++++++++++++- modules/juce_core/memory/juce_Memory.h | 14 -------------- .../juce_core/text/juce_CharacterFunctions.h | 6 ++++-- 5 files changed, 23 insertions(+), 36 deletions(-) diff --git a/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h b/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h index e24d59e28c..9427662c4c 100644 --- a/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h +++ b/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h @@ -27,7 +27,7 @@ using namespace juce; -#if JUCE_MAC +#if JUCE_MAC && ! DOXYGEN #define Point juce::Point #define Component juce::Component #endif diff --git a/modules/juce_core/maths/juce_MathsFunctions.h b/modules/juce_core/maths/juce_MathsFunctions.h index 2cf9a11b61..b436f520db 100644 --- a/modules/juce_core/maths/juce_MathsFunctions.h +++ b/modules/juce_core/maths/juce_MathsFunctions.h @@ -298,24 +298,6 @@ inline int64 abs64 (const int64 n) noexcept return (n >= 0) ? n : -n; } -/** This templated negate function will negate pointers as well as integers */ -template -inline Type juce_negate (Type n) noexcept -{ - return sizeof (Type) == 1 ? (Type) -(signed char) n - : (sizeof (Type) == 2 ? (Type) -(short) n - : (sizeof (Type) == 4 ? (Type) -(int) n - : ((Type) -(int64) n))); -} - -/** This templated negate function will negate pointers as well as integers */ -template -inline Type* juce_negate (Type* n) noexcept -{ - return (Type*) -(pointer_sized_int) n; -} - - //============================================================================== /** A predefined value for Pi, at double-precision. diff --git a/modules/juce_core/memory/juce_Atomic.h b/modules/juce_core/memory/juce_Atomic.h index 56b0e72d98..7bc4dd6468 100644 --- a/modules/juce_core/memory/juce_Atomic.h +++ b/modules/juce_core/memory/juce_Atomic.h @@ -157,6 +157,23 @@ private: Type operator++ (int); // better to just use pre-increment with atomics.. Type operator-- (int); + + /** This templated negate function will negate pointers as well as integers */ + template + inline ValueType negateValue (ValueType n) noexcept + { + return sizeof (ValueType) == 1 ? (ValueType) -(signed char) n + : (sizeof (ValueType) == 2 ? (ValueType) -(short) n + : (sizeof (ValueType) == 4 ? (ValueType) -(int) n + : ((ValueType) -(int64) n))); + } + + /** This templated negate function will negate pointers as well as integers */ + template + inline PointerType* negateValue (PointerType* n) noexcept + { + return reinterpret_cast (-reinterpret_cast (n)); + } }; @@ -286,7 +303,7 @@ inline Type Atomic::operator+= (const Type amountToAdd) noexcept template inline Type Atomic::operator-= (const Type amountToSubtract) noexcept { - return operator+= (juce_negate (amountToSubtract)); + return operator+= (negateValue (amountToSubtract)); } template diff --git a/modules/juce_core/memory/juce_Memory.h b/modules/juce_core/memory/juce_Memory.h index df144c1005..7c21a63301 100644 --- a/modules/juce_core/memory/juce_Memory.h +++ b/modules/juce_core/memory/juce_Memory.h @@ -26,20 +26,6 @@ #ifndef __JUCE_MEMORY_JUCEHEADER__ #define __JUCE_MEMORY_JUCEHEADER__ -//============================================================================== -#if JUCE_MSVC || DOXYGEN - /** This is a compiler-independent way of declaring a variable as being thread-local. - - E.g. - @code - juce_ThreadLocal int myVariable; - @endcode - */ - #define juce_ThreadLocal __declspec(thread) -#else - #define juce_ThreadLocal __thread -#endif - //============================================================================== #if JUCE_MINGW /** This allocator is not defined in mingw gcc. */ diff --git a/modules/juce_core/text/juce_CharacterFunctions.h b/modules/juce_core/text/juce_CharacterFunctions.h index 89413faea7..b5e25c0fe1 100644 --- a/modules/juce_core/text/juce_CharacterFunctions.h +++ b/modules/juce_core/text/juce_CharacterFunctions.h @@ -48,8 +48,10 @@ typedef uint32 juce_wchar; #endif -/** This macro is deprecated, but preserved for compatibility with old code. */ -#define JUCE_T(stringLiteral) (L##stringLiteral) +#ifndef DOXYGEN + /** This macro is deprecated, but preserved for compatibility with old code. */ + #define JUCE_T(stringLiteral) (L##stringLiteral) +#endif #if JUCE_DEFINE_T_MACRO /** The 'T' macro is an alternative for using the "L" prefix in front of a string literal.