mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1065111 - Remove obsolete SetCFDict helpers. r=jya
We use CFDictionaryCreate with array literals for the keys and values now instead.
This commit is contained in:
parent
a60e22203d
commit
091ee0e924
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include "AppleUtils.h"
|
#include "AppleUtils.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
#include "nsAutoPtr.h"
|
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
#ifdef PR_LOGGING
|
||||||
PRLogModuleInfo* GetAppleMediaLog() {
|
PRLogModuleInfo* GetAppleMediaLog() {
|
||||||
@ -26,42 +25,3 @@ PRLogModuleInfo* GetAppleMediaLog() {
|
|||||||
((x) >> 16) & 0xff, \
|
((x) >> 16) & 0xff, \
|
||||||
((x) >> 8) & 0xff, \
|
((x) >> 8) & 0xff, \
|
||||||
(x) & 0xff
|
(x) & 0xff
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
|
|
||||||
void
|
|
||||||
AppleUtils::SetCFDict(CFMutableDictionaryRef dict,
|
|
||||||
const char* key,
|
|
||||||
const char* value)
|
|
||||||
{
|
|
||||||
// We avoid using the CFSTR macros because there's no way to release those.
|
|
||||||
AutoCFRelease<CFStringRef> keyRef =
|
|
||||||
CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8);
|
|
||||||
AutoCFRelease<CFStringRef> valueRef =
|
|
||||||
CFStringCreateWithCString(NULL, value, kCFStringEncodingUTF8);
|
|
||||||
CFDictionarySetValue(dict, keyRef, valueRef);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
AppleUtils::SetCFDict(CFMutableDictionaryRef dict,
|
|
||||||
const char* key,
|
|
||||||
int32_t value)
|
|
||||||
{
|
|
||||||
AutoCFRelease<CFNumberRef> valueRef =
|
|
||||||
CFNumberCreate(NULL, kCFNumberSInt32Type, &value);
|
|
||||||
AutoCFRelease<CFStringRef> keyRef =
|
|
||||||
CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8);
|
|
||||||
CFDictionarySetValue(dict, keyRef, valueRef);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
AppleUtils::SetCFDict(CFMutableDictionaryRef dict,
|
|
||||||
const char* key,
|
|
||||||
bool value)
|
|
||||||
{
|
|
||||||
AutoCFRelease<CFStringRef> keyRef =
|
|
||||||
CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8);
|
|
||||||
CFDictionarySetValue(dict, keyRef, value ? kCFBooleanTrue : kCFBooleanFalse);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace mozilla
|
|
||||||
|
@ -13,21 +13,6 @@
|
|||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
struct AppleUtils {
|
|
||||||
// Helper to set a string, string pair on a CFMutableDictionaryRef.
|
|
||||||
static void SetCFDict(CFMutableDictionaryRef dict,
|
|
||||||
const char* key,
|
|
||||||
const char* value);
|
|
||||||
// Helper to set a string, int32_t pair on a CFMutableDictionaryRef.
|
|
||||||
static void SetCFDict(CFMutableDictionaryRef dict,
|
|
||||||
const char* key,
|
|
||||||
int32_t value);
|
|
||||||
// Helper to set a string, bool pair on a CFMutableDictionaryRef.
|
|
||||||
static void SetCFDict(CFMutableDictionaryRef dict,
|
|
||||||
const char* key,
|
|
||||||
bool value);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Wrapper class to call CFRelease on reference types
|
// Wrapper class to call CFRelease on reference types
|
||||||
// when they go out of scope.
|
// when they go out of scope.
|
||||||
template <class T>
|
template <class T>
|
||||||
|
Loading…
Reference in New Issue
Block a user