Permalink
Browse files

Various cleanups noticed during merging of some of

David Cotter's CF-lite changes.
* Working directory reading for bundles.
* Working locale handling in string routines.



git-svn-id: https://opencflite.svn.sourceforge.net/svnroot/opencflite@92 949b7c4e-b822-e185-8c53-f993a654f32e
  • Loading branch information...
1 parent 097dede commit e866a760961d62539b4ec6c19f2b082739396adf bfulgham committed Feb 19, 2009
Showing with 496 additions and 212 deletions.
  1. +2 −1 CFBase.h
  2. +7 −5 CFBundle.c
  3. +137 −8 CFBundle_Resources.c
  4. +4 −5 CFCalendar.c
  5. +2 −2 CFDate.c
  6. +10 −1 CFDateFormatter.c
  7. +3 −3 CFDictionary.c
  8. +1 −1 CFFileUtilities.c
  9. +5 −5 CFInternal.h
  10. +42 −0 CFLite.sln
  11. +9 −11 CFLocale.c
  12. +5 −5 CFLocaleIdentifier.c
  13. +4 −4 CFNumberFormatter.c
  14. +2 −2 CFPlatform.c
  15. +1 −1 CFPropertyList.c
  16. +2 −2 CFRunLoop.c
  17. +1 −1 CFRuntime.c
  18. +3 −3 CFSet.c
  19. +4 −4 CFSocket.c
  20. +1 −1 CFSortFunctions.c
  21. +12 −8 CFString.c
  22. +9 −9 CFStringEncodingConverter.c
  23. +1 −1 CFStringScanner.c
  24. +5 −5 CFSystemDirectories.c
  25. +11 −10 CFTimeZone.c
  26. +3 −5 CFURL.c
  27. +2 −2 CFURLAccess.c
  28. +1 −1 CFUUID.c
  29. +0 −1 CFUtilities.c
  30. +1 −1 CFVersion.c
  31. +2 −2 CFWindowsMessageQueue.c
  32. +1 −1 CFWindowsMessageQueue.h
  33. +7 −0 ForFoundationOnly.h
  34. +1 −1 Info.plist
  35. +18 −24 examples/Allocator/Allocator.vcproj
  36. +5 −5 examples/Allocator/AllocatorExample.c
  37. +27 −2 examples/CFLocalServer/Client.c
  38. +4 −0 examples/CFLocalServer/Common.c
  39. +57 −3 examples/CFLocalServer/Server.c
  40. +3 −9 examples/CFRunLoopTimerExample/CFRunLoopTimerExample.vcproj
  41. +3 −9 examples/DNSServiceMetaQuery/DNSServiceMetaQuery.vcproj
  42. +0 −1 examples/DisplayURL/DisplayURL.c
  43. +3 −9 examples/DisplayURL/DisplayURL.vcproj
  44. +1 −1 examples/ReadPListExample/ReadPListExample.cpp
  45. +3 −9 examples/ReadPListExample/ReadPListExample.vcproj
  46. +53 −7 examples/SimpleWebServer/SimpleWebServer.c
  47. +12 −3 examples/StringExample/StringExample.c
  48. +3 −9 examples/StringExample/StringExample.vcproj
  49. +3 −9 examples/WritePListExample/WritePListExample.vcproj
View
@@ -181,7 +181,8 @@ CF_EXTERN_C_BEGIN
#endif
-CF_EXPORT double kCFCoreFoundationVersionNumber;
+CF_EXPORT double kCFCoreFoundationVersionNumber;
+CF_EXPORT const unsigned char kCFCoreFoundationVersionString[];
#define kCFCoreFoundationVersionNumber10_0 196.40
#define kCFCoreFoundationVersionNumber10_0_3 196.50
View
@@ -862,7 +862,7 @@ CFBundleRef _CFBundleGetExistingBundleWithBundleURL(CFURLRef bundleURL) {
if (!CFURLGetFileSystemRepresentation(bundleURL, true, (uint8_t *)buff, CFMaxPathSize)) return NULL;
- newURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, (uint8_t *)buff, strlen(buff), true);
+ newURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, (uint8_t *)buff, (CFIndex)strlen(buff), true);
if (!newURL) newURL = (CFURLRef)CFRetain(bundleURL);
bundle = _CFBundleFindByURL(newURL, false);
CFRelease(newURL);
@@ -880,7 +880,7 @@ static CFBundleRef _CFBundleCreate(CFAllocatorRef allocator, CFURLRef bundleURL,
if (!CFURLGetFileSystemRepresentation(bundleURL, true, (uint8_t *)buff, CFMaxPathSize)) return NULL;
- newURL = CFURLCreateFromFileSystemRepresentation(allocator, (uint8_t *)buff, strlen(buff), true);
+ newURL = CFURLCreateFromFileSystemRepresentation(allocator, (uint8_t *)buff, (CFIndex)strlen(buff), true);
if (!newURL) newURL = (CFURLRef)CFRetain(bundleURL);
bundle = _CFBundleFindByURL(newURL, alreadyLocked);
if (bundle) {
@@ -1562,7 +1562,9 @@ static CFURLRef _CFBundleCopyExecutableURLInDirectoryWithAllocator(CFAllocatorRe
if (executablePath) {
#if DEPLOYMENT_TARGET_MACOSX
executableURL = CFURLCreateWithFileSystemPath(alloc, executablePath, kCFURLPOSIXPathStyle, false);
-#endif
+#else
+ executableURL = CFURLCreateWithFileSystemPath(alloc, executablePath, kCFURLWindowsPathStyle, false);
+#endif
if (executableURL) foundIt = true;
if (!foundIt) {
executablePath = NULL;
@@ -3146,7 +3148,7 @@ __private_extern__ Boolean _CFBundleCouldBeBundle(CFURLRef url) {
__private_extern__ CFURLRef _CFBundleCopyFrameworkURLForExecutablePath(CFAllocatorRef alloc, CFStringRef executablePath) {
// MF:!!! Implement me. We need to be able to find the bundle from the exe, dealing with old vs. new as well as the Executables dir business on Windows.
-#if defined(__WIN32__)
+#if DEPLOYMENT_TARGET_WINDOWS
UniChar executablesToFrameworksPathBuff[] = {'.', '.', '\\', 'F', 'r', 'a', 'm', 'e', 'w', 'o', 'r', 'k', 's'}; // length 16
UniChar executablesToPrivateFrameworksPathBuff[] = {'.', '.', '\\', 'P', 'r', 'i', 'v', 'a', 't', 'e', 'F', 'r', 'a', 'm', 'e', 'w', 'o', 'r', 'k', 's'}; // length 23
UniChar frameworksExtension[] = {'f', 'r', 'a', 'm', 'e', 'w', 'o', 'r', 'k'}; // length 9
@@ -3172,7 +3174,7 @@ __private_extern__ CFURLRef _CFBundleCopyFrameworkURLForExecutablePath(CFAllocat
length = _CFLengthAfterDeletingLastPathComponent(pathBuff, length);
savedLength = length;
-#if defined(__WIN32__)
+#if DEPLOYMENT_TARGET_WINDOWS
// * (Windows-only) First check the "Executables" directory parallel to the "Frameworks" directory case.
if (_CFAppendPathComponent(pathBuff, &length, CFMaxPathSize, executablesToFrameworksPathBuff, 16) && _CFAppendPathComponent(pathBuff, &length, CFMaxPathSize, nameBuff, nameLength) && _CFAppendPathExtension(pathBuff, &length, CFMaxPathSize, frameworksExtension, 9)) {
CFStringSetExternalCharactersNoCopy(cheapStr, pathBuff, length, CFMaxPathSize);
View
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2008-2009 Brent Fulgham <bfulgham@gmail.org>. All rights reserved.
+ * Copyright (c) 2009 David M. Cotter <me@davevcotter.com>. All rights reserved.
*
* This source code is a modified version of the CoreFoundation sources released by Apple Inc. under
* the terms of the APSL version 2.0 (see below).
@@ -63,6 +64,33 @@
#include <dirent.h>
#endif /* READ_DIRECTORIES */
+#if DEPLOYMENT_TARGET_WINDOWS && !defined(__GNUC__)
+#include <direct.h>
+#include <io.h>
+
+/* POSIX dirent interface */
+struct dirent {
+ char* d_name;
+ uint8_t d_type;
+ long d_fileno;
+};
+
+typedef struct DIR {
+ long handle;
+ struct _finddata_t info;
+ struct dirent result;
+ char* name;
+} DIR;
+
+static DIR* opendir (const char* name);
+static struct dirent* readdir (DIR* dir);
+static int closedir (DIR* dir);
+
+#define DT_UNKNOWN 0
+#define DT_DIR 4
+#define READ_DIRECTORIES 1
+#endif
+
// All new-style bundles will have these extensions.
@@ -195,7 +223,7 @@ static CFArrayRef _CFBundleCopyDirectoryContentsAtPath(CFStringRef path, _CFBund
cpathBuff[0] = '\0';
if (CFStringGetFileSystemRepresentation(path, cpathBuff, CFMaxPathSize)) {
tryToOpen = true;
- cpathLen = strlen(cpathBuff);
+ cpathLen = (CFIndex)strlen(cpathBuff);
// First see whether we already know that the directory doesn't exist
for (idx = cpathLen; lastSlashIdx == 0 && idx-- > 0;) {
@@ -230,7 +258,7 @@ static CFArrayRef _CFBundleCopyDirectoryContentsAtPath(CFStringRef path, _CFBund
}
if (tryToOpen && stat(cpathBuff, &statBuf) == 0 && (statBuf.st_mode & S_IFMT) == S_IFDIR && (dirp = opendir(cpathBuff))) {
while ((dent = readdir(dirp))) {
- CFIndex nameLen = strlen(dent->d_name);
+ CFIndex nameLen = (CFIndex)strlen(dent->d_name);
if (0 == nameLen || 0 == dent->d_fileno || ('.' == dent->d_name[0] && (1 == nameLen || (2 == nameLen && '.' == dent->d_name[1]) || '_' == dent->d_name[1]))) continue;
name = CFStringCreateWithFileSystemRepresentation(kCFAllocatorSystemDefault, dent->d_name);
if (name) {
@@ -522,7 +550,7 @@ static void _CFFindBundleResourcesInRawDir(CFAllocatorRef alloc, UniChar *workin
CFStringSetExternalCharactersNoCopy(tmpString, workingUniChars, workingLen, workingLen);
if (!CFStringGetFileSystemRepresentation(tmpString, cpathBuff, CFMaxPathSize)) return;
- cpathLen = strlen(cpathBuff);
+ cpathLen = (CFIndex)strlen(cpathBuff);
if (!resTypes) {
// ??? should this use _CFBundleCopyDirectoryContentsAtPath?
@@ -818,7 +846,7 @@ CF_EXPORT CFURLRef CFBundleCopyResourceURLInDirectory(CFURLRef bundleURL, CFStri
if (!CFURLGetFileSystemRepresentation(bundleURL, true, buff, CFMaxPathSize)) return NULL;
- newURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, buff, strlen((char *)buff), true);
+ newURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, buff, (CFIndex)strlen((char *)buff), true);
if (!newURL) newURL = (CFURLRef)CFRetain(bundleURL);
if (_CFBundleCouldBeBundle(newURL)) {
uint8_t version = 0;
@@ -846,7 +874,7 @@ CF_EXPORT CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory(CFURLRef bundleUR
if (!CFURLGetFileSystemRepresentation(bundleURL, true, buff, CFMaxPathSize)) return NULL;
- newURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, buff, strlen((char *)buff), true);
+ newURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, buff, (CFIndex)strlen((char *)buff), true);
if (!newURL) newURL = (CFURLRef)CFRetain(bundleURL);
if (_CFBundleCouldBeBundle(newURL)) {
uint8_t version = 0;
@@ -1190,7 +1218,7 @@ __private_extern__ CFArrayRef _CFBundleCopyUserLanguages(Boolean useBackstops) {
if (!didit) {
if (__CFAppleLanguages) {
CFDataRef data;
- CFIndex length = strlen((const char *)__CFAppleLanguages);
+ CFIndex length = (CFIndex)strlen((const char *)__CFAppleLanguages);
if (length > 0) {
data = CFDataCreateWithBytesNoCopy(kCFAllocatorSystemDefault, (const UInt8 *)__CFAppleLanguages, length, kCFAllocatorNull);
if (data) {
@@ -1725,7 +1753,7 @@ __private_extern__ CFDictionaryRef _CFBundleCopyInfoDictionaryInDirectory(CFAllo
uint8_t localVersion = 0;
if (CFURLGetFileSystemRepresentation(url, true, buff, CFMaxPathSize)) {
- CFURLRef newURL = CFURLCreateFromFileSystemRepresentation(alloc, buff, strlen((char *)buff), true);
+ CFURLRef newURL = CFURLCreateFromFileSystemRepresentation(alloc, buff, (CFIndex)strlen((char *)buff), true);
if (!newURL) newURL = (CFURLRef)CFRetain(url);
// version 3 is for flattened pseudo-bundles with no Contents, Support Files, or Resources directories
@@ -1795,7 +1823,7 @@ __private_extern__ CFDictionaryRef _CFBundleCopyInfoDictionaryInDirectoryWithVer
if (windowsPath) {
if (!(CFStringHasSuffix(windowsPath, _CFBundleSupportFilesDirectoryName1) || CFStringHasSuffix(windowsPath, _CFBundleSupportFilesDirectoryName2) || CFStringHasSuffix(windowsPath, _CFBundleResourcesDirectoryName))) {
#if READ_DIRECTORIES
- directoryURL = CFRetain(url);
+ directoryURL = (CFURLRef)CFRetain(url);
#endif /* READ_DIRECTORIES */
infoURLFromBaseNoExtension = _CFBundleInfoURLFromBaseNoExtension3;
infoURLFromBase = _CFBundleInfoURLFromBase3;
@@ -2205,3 +2233,104 @@ CFArrayRef CFBundleCopyLocalizationsForURL(CFURLRef url) {
return result;
}
+#if DEPLOYMENT_TARGET_WINDOWS
+/*
+ * The Windows directory handling logic is courtesy of the FreeBSD shttpd sources.
+ */
+/*
+ * Copyright (c) 2004-2005 Sergey Lyubka <valenok@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+DIR* opendir (const char *name)
+{
+ DIR* dir = NULL;
+ size_t base_length;
+ const char* all;
+
+ if (name && name[0]) {
+ base_length = strlen(name);
+ all = strchr("/\\", name[base_length - 1]) ? "*" : "/*";
+
+ if ((dir = (DIR*)malloc(sizeof *dir)) != NULL &&
+ (dir->name = (char*)malloc(base_length + strlen(all) + 1)) != 0) {
+ (void) strcat(strcpy(dir->name, name), all);
+
+ if ((dir->handle = (long) _findfirst(dir->name, &dir->info)) != -1) {
+ dir->result.d_name = 0;
+ } else {
+ free(dir->name);
+ free(dir);
+ dir = 0;
+ }
+ } else {
+ free(dir);
+ dir = NULL;
+ errno = ENOMEM;
+ }
+ } else {
+ errno = EINVAL;
+ }
+
+ return (dir);
+}
+
+int closedir (DIR* dir)
+{
+ int result = -1;
+
+ if (dir) {
+ if(dir->handle != -1)
+ result = _findclose(dir->handle);
+
+ free(dir->name);
+ free(dir);
+ }
+
+ if (result == -1)
+ errno = EBADF;
+
+ return (result);
+}
+
+struct dirent* readdir (DIR *dir)
+{
+ struct dirent* result = 0;
+
+ if (dir && dir->handle != -1) {
+ if (!dir->result.d_name ||
+ _findnext(dir->handle, &dir->info) != -1) {
+ result = &dir->result;
+ result->d_name = dir->info.name;
+ result->d_fileno = 1; // Not real!
+
+ if (dir->info.attrib & FILE_ATTRIBUTE_DIRECTORY)
+ result->d_type = DT_DIR;
+ else
+ result->d_type = DT_UNKNOWN;
+ }
+ } else {
+ errno = EBADF;
+ }
+
+ return (result);
+}
+
+#endif
View
@@ -972,7 +972,7 @@ Boolean CFCalendarComposeAbsoluteTime(CFCalendarRef calendar, /* out */ CFAbsolu
va_start(args, componentDesc);
CF_OBJC_FUNCDISPATCH3(CFCalendarGetTypeID(), Boolean, calendar, "_composeAbsoluteTime:::", atp, componentDesc, args);
__CFGenericValidateType(calendar, CFCalendarGetTypeID());
- int idx, cnt = strlen((char *)componentDesc);
+ int idx, cnt = (int)strlen((char *)componentDesc);
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_WINDOWS || DEPLOYMENT_TARGET_LINUX
STACK_BUFFER_DECL(int, vector, cnt);
#else
@@ -991,8 +991,7 @@ Boolean CFCalendarDecomposeAbsoluteTime(CFCalendarRef calendar, CFAbsoluteTime a
va_start(args, componentDesc);
CF_OBJC_FUNCDISPATCH3(CFCalendarGetTypeID(), Boolean, calendar, "_decomposeAbsoluteTime:::", at, componentDesc, args);
__CFGenericValidateType(calendar, CFCalendarGetTypeID());
- int idx, cnt = strlen((char *)componentDesc);
-
+ int idx, cnt = (int)strlen((char *)componentDesc);
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_WINDOWS || DEPLOYMENT_TARGET_LINUX
STACK_BUFFER_DECL(int *, vector, cnt);
#else
@@ -1011,7 +1010,7 @@ Boolean CFCalendarAddComponents(CFCalendarRef calendar, /* inout */ CFAbsoluteTi
va_start(args, componentDesc);
CF_OBJC_FUNCDISPATCH4(CFCalendarGetTypeID(), Boolean, calendar, "_addComponents::::", atp, options, componentDesc, args);
__CFGenericValidateType(calendar, CFCalendarGetTypeID());
- int idx, cnt = strlen((char *)componentDesc);
+ int idx, cnt = (int)strlen((char *)componentDesc);
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_WINDOWS || DEPLOYMENT_TARGET_LINUX
STACK_BUFFER_DECL(int, vector, cnt);
#else
@@ -1030,7 +1029,7 @@ Boolean CFCalendarGetComponentDifference(CFCalendarRef calendar, CFAbsoluteTime
va_start(args, componentDesc);
CF_OBJC_FUNCDISPATCH5(CFCalendarGetTypeID(), Boolean, calendar, "_diffComponents:::::", startingAT, resultAT, options, componentDesc, args);
__CFGenericValidateType(calendar, CFCalendarGetTypeID());
- int idx, cnt = strlen((char *)componentDesc);
+ int idx, cnt = (int)strlen((char *)componentDesc);
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_WINDOWS || DEPLOYMENT_TARGET_LINUX
STACK_BUFFER_DECL(int *, vector, cnt);
#else
View
@@ -60,7 +60,7 @@ const CFTimeInterval kCFAbsoluteTimeIntervalSince1904 = 3061152000.0L;
__private_extern__ double __CFTSRRate = 0.0;
static double __CF1_TSRRate = 0.0;
-#if defined(__WIN32__)
+#if DEPLOYMENT_TARGET_WINDOWS
// We should export this as SPI or API to clients - 3514284
CFAbsoluteTime _CFAbsoluteTimeFromFileTime(const FILETIME *ft) {
CFAbsoluteTime ret = (CFTimeInterval)ft->dwHighDateTime * 429.49672960;
@@ -137,7 +137,7 @@ __private_extern__ void __CFDateInitialize(void) {
if (!QueryPerformanceFrequency(&freq)) {
HALT;
}
- __CFTSRRate = freq.QuadPart;
+ __CFTSRRate = (double)freq.QuadPart;
__CF1_TSRRate = 1.0 / __CFTSRRate;
#endif
CFDateGetTypeID(); // cause side-effects
View
@@ -51,7 +51,7 @@ extern CFAbsoluteTime __CFDateWindowsSystemTimeToAbsoluteTime(SYSTEMTIME *time);
#endif // __WIN32__
static void __CFDateFormatterCustomize(CFDateFormatterRef formatter);
-extern const CFStringRef kCFDateFormatterCalendarIdentifier;
+CF_EXPORT const CFStringRef kCFDateFormatterCalendarIdentifier;
#define BUFFER_SIZE 768
@@ -165,7 +165,16 @@ CFDateFormatterRef CFDateFormatterCreate(CFAllocatorRef allocator, CFLocaleRef l
UChar ubuffer[BUFFER_SIZE];
memset(ubuffer, 0x00, sizeof(UChar) * BUFFER_SIZE);
memory->_tz = CFTimeZoneCopyDefault();
+#ifdef __WIN32__
+ // ICU doesn't know about Windows Time Zone names. It'll understand the abbreviation for the non-daylight saving time, though
+ TIME_ZONE_INFORMATION *tzi = (TIME_ZONE_INFORMATION *)CFDataGetBytePtr(CFTimeZoneGetData(memory->_tz));
+ CFAbsoluteTime at = __CFDateWindowsSystemTimeToAbsoluteTime(&tzi->DaylightDate);
+ // subtract a day to get us off the time change boundary
+ at -= (60 * 60 * 24);
+ CFStringRef tznam = CFTimeZoneCopyAbbreviation(memory->_tz, at);
+#else
CFStringRef tznam = CFTimeZoneGetName(memory->_tz);
+#endif
CFIndex cnt = CFStringGetLength(tznam);
if (BUFFER_SIZE < cnt) cnt = BUFFER_SIZE;
CFStringGetCharacters(tznam, CFRangeMake(0, cnt), (UniChar *)ubuffer);
View
@@ -373,7 +373,7 @@ CF_INLINE uintptr_t __CFDictionaryScrambleHash(uintptr_t k) {
static CFIndex __CFDictionaryFindBuckets1a(CFHashRef hc, any_t key) {
CFHashCode keyHash = (CFHashCode)key;
- keyHash = __CFDictionaryScrambleHash(keyHash);
+ keyHash = (CFHashCode)__CFDictionaryScrambleHash(keyHash);
any_t *keys = hc->_keys;
any_t marker = hc->_marker;
CFIndex probe = keyHash & (hc->_bucketsNum - 1);
@@ -404,7 +404,7 @@ static CFIndex __CFDictionaryFindBuckets1a(CFHashRef hc, any_t key) {
static CFIndex __CFDictionaryFindBuckets1b(CFHashRef hc, any_t key) {
const CFDictionaryKeyCallBacks *cb = __CFDictionaryGetKeyCallBacks(hc);
CFHashCode keyHash = cb->hash ? (CFHashCode)INVOKE_CALLBACK2(((CFHashCode (*)(any_t, any_pointer_t))cb->hash), key, hc->_context) : (CFHashCode)key;
- keyHash = __CFDictionaryScrambleHash(keyHash);
+ keyHash = (CFHashCode)__CFDictionaryScrambleHash(keyHash);
any_t *keys = hc->_keys;
any_t marker = hc->_marker;
CFIndex probe = keyHash & (hc->_bucketsNum - 1);
@@ -442,7 +442,7 @@ CF_INLINE CFIndex __CFDictionaryFindBuckets1(CFHashRef hc, any_t key) {
static void __CFDictionaryFindBuckets2(CFHashRef hc, any_t key, CFIndex *match, CFIndex *nomatch) {
const CFDictionaryKeyCallBacks *cb = __CFDictionaryGetKeyCallBacks(hc);
CFHashCode keyHash = cb->hash ? (CFHashCode)INVOKE_CALLBACK2(((CFHashCode (*)(any_t, any_pointer_t))cb->hash), key, hc->_context) : (CFHashCode)key;
- keyHash = __CFDictionaryScrambleHash(keyHash);
+ keyHash = (CFHashCode)__CFDictionaryScrambleHash(keyHash);
any_t *keys = hc->_keys;
any_t marker = hc->_marker;
CFIndex probe = keyHash & (hc->_bucketsNum - 1);
View
@@ -497,7 +497,7 @@ __private_extern__ SInt32 _CFGetFileProperties(CFAllocatorRef alloc, CFURLRef pa
if (modTime != NULL) {
if (fileExists) {
#if DEPLOYMENT_TARGET_WINDOWS
- CFAbsoluteTime theTime = (CFAbsoluteTime)statBuf.st_mtime - kCFAbsoluteTimeIntervalSince1970;
+ CFAbsoluteTime theTime = (CFAbsoluteTime)statBuf.st_mtime;
#elif DEPLOYMENT_TARGET_LINUX
#if defined _BSD_SOURCE || defined _SVID_SOURCE
CFAbsoluteTime theTime = (CFAbsoluteTime)statBuf.st_mtim.tv_sec - kCFAbsoluteTimeIntervalSince1970;
Oops, something went wrong.

0 comments on commit e866a76

Please sign in to comment.