diff options
Diffstat (limited to 'JavaScriptCore/wtf')
-rw-r--r-- | JavaScriptCore/wtf/Assertions.h | 4 | ||||
-rw-r--r-- | JavaScriptCore/wtf/ByteArray.h | 4 | ||||
-rw-r--r-- | JavaScriptCore/wtf/DateMath.cpp | 3 | ||||
-rw-r--r-- | JavaScriptCore/wtf/Platform.h | 20 | ||||
-rw-r--r-- | JavaScriptCore/wtf/PlatformRefPtr.h | 9 | ||||
-rw-r--r-- | JavaScriptCore/wtf/StdLibExtras.h | 48 | ||||
-rw-r--r-- | JavaScriptCore/wtf/gobject/GTypedefs.h | 1 | ||||
-rw-r--r-- | JavaScriptCore/wtf/text/WTFString.h | 12 |
8 files changed, 57 insertions, 44 deletions
diff --git a/JavaScriptCore/wtf/Assertions.h b/JavaScriptCore/wtf/Assertions.h index c4e015d..2907d04 100644 --- a/JavaScriptCore/wtf/Assertions.h +++ b/JavaScriptCore/wtf/Assertions.h @@ -44,9 +44,9 @@ #include "Platform.h" -#if COMPILER(MSVC) #include <stddef.h> -#else + +#if !COMPILER(MSVC) #include <inttypes.h> #endif diff --git a/JavaScriptCore/wtf/ByteArray.h b/JavaScriptCore/wtf/ByteArray.h index f4d34a4..bdec630 100644 --- a/JavaScriptCore/wtf/ByteArray.h +++ b/JavaScriptCore/wtf/ByteArray.h @@ -97,6 +97,8 @@ namespace WTF { unsigned char m_data[]; #endif }; -} +} // namespace WTF + +using WTF::ByteArray; #endif diff --git a/JavaScriptCore/wtf/DateMath.cpp b/JavaScriptCore/wtf/DateMath.cpp index d005859..f3627e6 100644 --- a/JavaScriptCore/wtf/DateMath.cpp +++ b/JavaScriptCore/wtf/DateMath.cpp @@ -76,6 +76,7 @@ #include "ASCIICType.h" #include "CurrentTime.h" #include "MathExtras.h" +#include "StdLibExtras.h" #include "StringExtras.h" #include <algorithm> @@ -950,7 +951,7 @@ static double parseDateFromNullTerminatedCharacters(const char* dateString, bool } haveTZ = true; } else { - for (int i = 0; i < int(sizeof(known_zones) / sizeof(KnownZone)); i++) { + for (size_t i = 0; i < WTF_ARRAY_LENGTH(known_zones); ++i) { if (0 == strncasecmp(dateString, known_zones[i].tzName, strlen(known_zones[i].tzName))) { offset = known_zones[i].tzOffset; dateString += strlen(known_zones[i].tzName); diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h index 9895824..ac4ef5a 100644 --- a/JavaScriptCore/wtf/Platform.h +++ b/JavaScriptCore/wtf/Platform.h @@ -210,7 +210,7 @@ || defined(_ARM_) #define WTF_CPU_ARM 1 -#if defined(__ARMEB__) +#if defined(__ARMEB__) || (COMPILER(RVCT) && defined(__BIG_ENDIAN)) #define WTF_CPU_BIG_ENDIAN 1 #elif !defined(__ARM_EABI__) \ @@ -563,11 +563,6 @@ #define _INC_ASSERT /* disable "assert.h" */ #define assert(x) -/* _countof is only included in CE6; for CE5 we need to define it ourself */ -#ifndef _countof -#define _countof(x) (sizeof(x) / sizeof((x)[0])) -#endif - #endif /* OS(WINCE) && !PLATFORM(QT) */ #if PLATFORM(QT) @@ -1079,6 +1074,7 @@ #define WTF_USE_ATSUI 1 #define WTF_USE_CORE_TEXT 0 #endif +<<<<<<< HEAD /* Accelerated compositing */ #if !defined(BUILDING_ON_TIGER) @@ -1096,17 +1092,13 @@ #if PLATFORM(QT) #define WTF_USE_ACCELERATED_COMPOSITING 1 +======= +>>>>>>> webkit.org at r70949 #endif -/* FIXME: Defining ENABLE_3D_RENDERING here isn't really right, but it's always used with - with WTF_USE_ACCELERATED_COMPOSITING, and it allows the feature to be turned on and - off in one place. */ -#if PLATFORM(WIN) && !OS(WINCE) -#include "QuartzCorePresent.h" -#if QUARTZCORE_PRESENT +/* Accelerated compositing */ +#if (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER)) || PLATFORM(IOS) || PLATFORM(QT) || (PLATFORM(WIN) && !OS(WINCE) &&!defined(WIN_CAIRO)) #define WTF_USE_ACCELERATED_COMPOSITING 1 -#define ENABLE_3D_RENDERING 1 -#endif #endif #if (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) || PLATFORM(IOS) diff --git a/JavaScriptCore/wtf/PlatformRefPtr.h b/JavaScriptCore/wtf/PlatformRefPtr.h index 8ac16cb..f99ec9b 100644 --- a/JavaScriptCore/wtf/PlatformRefPtr.h +++ b/JavaScriptCore/wtf/PlatformRefPtr.h @@ -62,7 +62,8 @@ public: ~PlatformRefPtr() { - if (T* ptr = m_ptr) + T* ptr = m_ptr; + if (ptr && ptr != hashTableDeletedValue()) derefPlatformPtr(ptr); } @@ -70,7 +71,7 @@ public: { T* ptr = m_ptr; m_ptr = 0; - if (ptr) + if (ptr && ptr != hashTableDeletedValue()) derefPlatformPtr(ptr); } @@ -110,7 +111,7 @@ template <typename T> inline PlatformRefPtr<T>& PlatformRefPtr<T>::operator=(con refPlatformPtr(optr); T* ptr = m_ptr; m_ptr = optr; - if (ptr) + if (ptr && ptr != hashTableDeletedValue()) derefPlatformPtr(ptr); return *this; } @@ -121,7 +122,7 @@ template <typename T> inline PlatformRefPtr<T>& PlatformRefPtr<T>::operator=(T* if (optr) refPlatformPtr(optr); m_ptr = optr; - if (ptr) + if (ptr && ptr != hashTableDeletedValue()) derefPlatformPtr(ptr); return *this; } diff --git a/JavaScriptCore/wtf/StdLibExtras.h b/JavaScriptCore/wtf/StdLibExtras.h index d594c17..fd7ada2 100644 --- a/JavaScriptCore/wtf/StdLibExtras.h +++ b/JavaScriptCore/wtf/StdLibExtras.h @@ -87,29 +87,33 @@ TypePtr reinterpret_cast_ptr(const void* ptr) namespace WTF { - /* - * C++'s idea of a reinterpret_cast lacks sufficient cojones. - */ - template<typename TO, typename FROM> - TO bitwise_cast(FROM from) - { - COMPILE_ASSERT(sizeof(TO) == sizeof(FROM), WTF_bitwise_cast_sizeof_casted_types_is_equal); - union { - FROM from; - TO to; - } u; - u.from = from; - return u.to; - } +/* + * C++'s idea of a reinterpret_cast lacks sufficient cojones. + */ +template<typename TO, typename FROM> +inline TO bitwise_cast(FROM from) +{ + COMPILE_ASSERT(sizeof(TO) == sizeof(FROM), WTF_bitwise_cast_sizeof_casted_types_is_equal); + union { + FROM from; + TO to; + } u; + u.from = from; + return u.to; +} - // Returns a count of the number of bits set in 'bits'. - inline size_t bitCount(unsigned bits) - { - bits = bits - ((bits >> 1) & 0x55555555); - bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333); - return (((bits + (bits >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24; - } +// Returns a count of the number of bits set in 'bits'. +inline size_t bitCount(unsigned bits) +{ + bits = bits - ((bits >> 1) & 0x55555555); + bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333); + return (((bits + (bits >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24; +} + +// Macro that returns a compile time constant with the length of an array, but gives an error if passed a non-array. +template<typename T, size_t Size> char (&ArrayLengthHelperFunction(T (&)[Size]))[Size]; +#define WTF_ARRAY_LENGTH(array) sizeof(::WTF::ArrayLengthHelperFunction(array)) } // namespace WTF -#endif +#endif // WTF_StdLibExtras_h diff --git a/JavaScriptCore/wtf/gobject/GTypedefs.h b/JavaScriptCore/wtf/gobject/GTypedefs.h index b1600c2..76d1b1a 100644 --- a/JavaScriptCore/wtf/gobject/GTypedefs.h +++ b/JavaScriptCore/wtf/gobject/GTypedefs.h @@ -38,6 +38,7 @@ typedef void* gpointer; typedef struct _GAsyncResult GAsyncResult; typedef struct _GCancellable GCancellable; +typedef struct _GCharsetConverter GCharsetConverter; typedef struct _GCond GCond; typedef struct _GDir GDir; typedef struct _GdkAtom* GdkAtom; diff --git a/JavaScriptCore/wtf/text/WTFString.h b/JavaScriptCore/wtf/text/WTFString.h index 8a4a6c7..e9d6ae4 100644 --- a/JavaScriptCore/wtf/text/WTFString.h +++ b/JavaScriptCore/wtf/text/WTFString.h @@ -50,6 +50,14 @@ class wxString; class BString; #endif +#if PLATFORM(BREWMP) +// AECHAR is defined in AEEStdDef.h, but don't include it here to avoid conflicts. +#ifndef _AECHAR_DEFINED +typedef uint16 AECHAR; +#define _AECHAR_DEFINED +#endif +#endif + namespace WTF { class CString; @@ -297,6 +305,10 @@ public: operator BString() const; #endif +#if PLATFORM(BREWMP) + String(const AECHAR*); +#endif + static String fromUTF8(const char*, size_t); static String fromUTF8(const char*); |