summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
authorGeoff Norton <grompf@gmail.com>2015-02-11 20:41:29 -0800
committerGeoff Norton <grompf@gmail.com>2015-02-11 20:41:29 -0800
commit7bed3b9c22df6a05a64dc88dbf3fd29cfe428c5c (patch)
tree0791fe48055c3bdf09eea7d329b6b607894def07 /src/pal
parent8f2495d2b769235d1c6c701eccf9d0f37dcd157c (diff)
downloadcoreclr-7bed3b9c22df6a05a64dc88dbf3fd29cfe428c5c.tar.gz
coreclr-7bed3b9c22df6a05a64dc88dbf3fd29cfe428c5c.tar.bz2
coreclr-7bed3b9c22df6a05a64dc88dbf3fd29cfe428c5c.zip
Clean up compiler warnings on the OSX build
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/inc/pal_mstypes.h2
-rw-r--r--src/pal/src/arch/i386/context.cpp2
-rw-r--r--src/pal/src/cruntime/finite.cpp2
-rw-r--r--src/pal/src/debug/debug.cpp2
-rw-r--r--src/pal/src/file/path.cpp89
-rw-r--r--src/pal/src/locale/locale.cpp4
-rw-r--r--src/pal/src/misc/version.cpp2
7 files changed, 9 insertions, 94 deletions
diff --git a/src/pal/inc/pal_mstypes.h b/src/pal/inc/pal_mstypes.h
index fa73f1176c..4b2ec49c59 100644
--- a/src/pal/inc/pal_mstypes.h
+++ b/src/pal/inc/pal_mstypes.h
@@ -322,7 +322,9 @@ typedef unsigned __int64 DWORD_PTR, *PDWORD_PTR;
/* maximum unsigned 64 bit value */
#define ULONG_PTR_MAX UI64(0xffffffffffffffff)
+#ifndef SIZE_MAX
#define SIZE_MAX _UI64_MAX
+#endif
#define __int3264 __int64
diff --git a/src/pal/src/arch/i386/context.cpp b/src/pal/src/arch/i386/context.cpp
index d52952e496..518539fffc 100644
--- a/src/pal/src/arch/i386/context.cpp
+++ b/src/pal/src/arch/i386/context.cpp
@@ -982,7 +982,7 @@ CONTEXT_GetThreadContextFromPort(
// so we can simply memcpy them across.
memcpy(lpContext->ExtendedRegisters + CONTEXT_EXREG_XMM_OFFSET, &State.fpu_xmm0, 8 * 16);
}
-#endif _X86_
+#endif
}
EXIT:
diff --git a/src/pal/src/cruntime/finite.cpp b/src/pal/src/cruntime/finite.cpp
index 8fdab72e14..115a20becb 100644
--- a/src/pal/src/cruntime/finite.cpp
+++ b/src/pal/src/cruntime/finite.cpp
@@ -63,7 +63,7 @@ _finite(
#if defined(_IA64_) && defined (_HPUX_)
ret = !isnan(x) && x != PAL_POSINF && x != PAL_NEGINF;
#else
- ret = finite(x);
+ ret = isfinite(x);
#endif
LOGEXIT("_finite returns int %d\n", ret);
PERF_EXIT(_finite);
diff --git a/src/pal/src/debug/debug.cpp b/src/pal/src/debug/debug.cpp
index 9b032c11fc..a9fa01978f 100644
--- a/src/pal/src/debug/debug.cpp
+++ b/src/pal/src/debug/debug.cpp
@@ -71,8 +71,10 @@ SET_DEFAULT_DEBUG_CHANNEL(DEBUG);
/* ------------------- Constant definitions ----------------------------------*/
+#if !HAVE_VM_READ && !HAVE_PROCFS_CTL
const BOOL DBG_ATTACH = TRUE;
const BOOL DBG_DETACH = FALSE;
+#endif
static const char PAL_OUTPUTDEBUGSTRING[] = "PAL_OUTPUTDEBUGSTRING";
#ifdef _DEBUG
diff --git a/src/pal/src/file/path.cpp b/src/pal/src/file/path.cpp
index c3dcfd8e49..81ee86abff 100644
--- a/src/pal/src/file/path.cpp
+++ b/src/pal/src/file/path.cpp
@@ -474,94 +474,6 @@ GetTempPathA(
return 0;
}
-#ifdef __APPLE__
- // Retrieve the Temporary Items folder.
- DWORD palError = ERROR_SUCCESS;
- FSRef tempFolderFSRef;
- OSErr err = FSFindFolder(kUserDomain, kTemporaryFolderType, true /* fCreate */,
- &tempFolderFSRef);
- if (err != noErr)
- palError = ERROR_INTERNAL_ERROR;
- else
- {
- CFURLRef tempFolderURLRef = CFURLCreateFromFSRef(kCFAllocatorDefault, &tempFolderFSRef);
- if (tempFolderURLRef == NULL)
- palError = ERROR_OUTOFMEMORY;
- else
- {
- CFStringRef tempFolderPathRef = CFURLCopyFileSystemPath(tempFolderURLRef, kCFURLPOSIXPathStyle);
- CFRelease(tempFolderURLRef);
- CFIndex tempFolderPathLenWide;
- if (tempFolderPathRef == NULL)
- palError = ERROR_OUTOFMEMORY;
- else if ((tempFolderPathLenWide = CFStringGetLength(tempFolderPathRef)) == 0)
- {
- palError = ERROR_INTERNAL_ERROR;
- CFRelease(tempFolderPathRef);
- }
- else
- {
- // String needs to terminate with a slash.
- if (CFStringGetCharacterAtIndex(tempFolderPathRef, tempFolderPathLenWide) != '/')
- {
- CFStringRef altTempFolderPathRef = CFStringCreateWithFormat(kCFAllocatorDefault,
- NULL, CFSTR("%@/"), tempFolderPathRef);
- if (altTempFolderPathRef == NULL)
- {
- palError = ERROR_OUTOFMEMORY;
- }
- else
- {
- CFRelease(tempFolderPathRef);
- tempFolderPathRef = altTempFolderPathRef;
- }
- }
- if (palError != ERROR_SUCCESS)
- {}
- else if (!CFStringGetFileSystemRepresentation(tempFolderPathRef, lpBuffer, nBufferLength))
- {
- // Too small or failed conversion.
- CFIndex tempFolderPathLenMax = CFStringGetMaximumSizeOfFileSystemRepresentation(tempFolderPathRef);
- char *lpBigBuffer = CorUnix::InternalNewArray<char>(CorUnix::InternalGetCurrentThread(), tempFolderPathLenMax);
- if (!lpBigBuffer)
- {
- palError = ERROR_OUTOFMEMORY;
- }
- else
- {
- if (!CFStringGetFileSystemRepresentation(tempFolderPathRef, lpBigBuffer, tempFolderPathLenMax))
- {
- // failed conversion.
- ERROR("Could not convert temp folder ref to 8-bit string.\n");
- palError = ERROR_INTERNAL_ERROR;
- }
- else
- {
- if (!ClrSafeInt<DWORD>::addition(strlen(lpBigBuffer), 1, dwPathLen))
- {
- ERROR("Integer overflow in buffer math.\n");
- palError = ERROR_INTERNAL_ERROR;
- }
- else
- {
- ERROR("Buffer is too small, need %d characters.\n", dwPathLen);
- palError = ERROR_INSUFFICIENT_BUFFER;
- }
- }
- CorUnix::InternalDeleteArray<char>(CorUnix::InternalGetCurrentThread(), lpBigBuffer);
- }
- }
- else
- {
- dwPathLen = strlen(lpBuffer);
- }
- CFRelease(tempFolderPathRef);
- }
- }
- }
- if (palError != ERROR_SUCCESS)
- SetLastError(palError);
-#else
// GetTempPath is supposed to include the trailing slash.
const char *defaultDir = "/tmp/";
@@ -582,7 +494,6 @@ GetTempPathA(
ERROR("Buffer is too small, need %d characters\n", dwPathLen);
SetLastError( ERROR_INSUFFICIENT_BUFFER );
}
-#endif // __APPLE__
LOGEXIT("GetTempPathA returns DWORD %u\n", dwPathLen);
PERF_EXIT(GetTempPathA);
diff --git a/src/pal/src/locale/locale.cpp b/src/pal/src/locale/locale.cpp
index 22db31a966..976903058b 100644
--- a/src/pal/src/locale/locale.cpp
+++ b/src/pal/src/locale/locale.cpp
@@ -323,8 +323,8 @@ static CFStringRef MapFormatPattern(CFStringRef cfStringFormat, const struct For
}
/* find the map entry corresponding to the count we have found (there must be one) */
- while (!((entry->count & ORMORE) != 0 && count >= (entry->count & ~ORMORE) ||
- (entry->count & ORMORE) == 0 && count == entry->count))
+ while (!(((entry->count & ORMORE) != 0 && count >= (entry->count & ~ORMORE)) ||
+ ((entry->count & ORMORE) == 0 && count == entry->count)))
{
entry++;
if (entry->uniChar != uniChar)
diff --git a/src/pal/src/misc/version.cpp b/src/pal/src/misc/version.cpp
index 04c5cd8e28..c9afc5ea4a 100644
--- a/src/pal/src/misc/version.cpp
+++ b/src/pal/src/misc/version.cpp
@@ -41,7 +41,7 @@ static DWORD /* PAL_ERROR */ CFStringToVers(CFStringRef versTupleStr, DWORD *pve
/* check to make sure it wasn't a failed conversion */
CFStringRef convertBackStr = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
- CFSTR("%lu"), vers);
+ CFSTR("%u"), vers);
if (!convertBackStr)
return ERROR_NOT_ENOUGH_MEMORY;