// Walk the directory for each extension separately so that we first get files with .ni.dll extension,
// then files with .dll extension, etc.
- for (int extIndex = 0; extIndex < sizeof(tpaExtensions) / sizeof(tpaExtensions[0]); extIndex++)
+ for (size_t extIndex = 0; extIndex < sizeof(tpaExtensions) / sizeof(tpaExtensions[0]); extIndex++)
{
const char* ext = tpaExtensions[extIndex];
int extLength = strlen(ext);
// Making something like: /proc/123/maps
char mapPath[128];
int chars = snprintf(mapPath, sizeof(mapPath), "/proc/%d/maps", m_pid);
- assert(chars > 0 && chars <= sizeof(mapPath));
+ assert(chars > 0 && (size_t)chars <= sizeof(mapPath));
FILE* mapsFile = fopen(mapPath, "r");
if (mapsFile == nullptr)
std::string coreclrPath;
coreclrPath.append(moduleName);
size_t last = coreclrPath.rfind(MAKEDLLNAME_A("coreclr"));
- if (last != -1) {
+ if (last != std::string::npos) {
m_coreclrPath = coreclrPath.substr(0, last);
}
}
// time to avoid the overlapping pages.
uint64_t numberPages = region.Size() / PAGE_SIZE;
- for (int p = 0; p < numberPages; p++, start += PAGE_SIZE)
+ for (uint64_t p = 0; p < numberPages; p++, start += PAGE_SIZE)
{
MemoryRegion memoryRegionPage(region.Flags(), start, start + PAGE_SIZE);
uint64_t start = region.StartAddress();
uint64_t numberPages = region.Size() / PAGE_SIZE;
- for (int p = 0; p < numberPages; p++, start += PAGE_SIZE)
+ for (uint64_t p = 0; p < numberPages; p++, start += PAGE_SIZE)
{
BYTE buffer[1];
uint32_t read;
{
assert(m_fd != -1);
size_t read = pread64(m_fd, buffer, size, (off64_t)(ULONG_PTR)address);
- if (read == -1)
+ if (read == (size_t)-1)
{
*done = 0;
return E_FAIL;
memset(context, 0, contextSize);
for (const ThreadInfo* thread : m_crashInfo->Threads())
{
- if (thread->Tid() == threadID)
+ if (thread->Tid() == (pid_t)threadID)
{
thread->GetThreadContext(contextFlags, reinterpret_cast<CONTEXT*>(context));
return S_OK;
while ((bytesRead = (int)read(m_inboundPipe, buffer, cb)) > 0)
{
totalBytesRead += bytesRead;
- _ASSERTE(totalBytesRead <= bufferSize);
- if (totalBytesRead >= bufferSize)
+ _ASSERTE(totalBytesRead <= (int)bufferSize);
+ if (totalBytesRead >= (int)bufferSize)
{
break;
}
while ((bytesWritten = (int)write(m_outboundPipe, data, cb)) > 0)
{
totalBytesWritten += bytesWritten;
- _ASSERTE(totalBytesWritten <= dataSize);
- if (totalBytesWritten >= dataSize)
+ _ASSERTE(totalBytesWritten <= (int)dataSize);
+ if (totalBytesWritten >= (int)dataSize)
{
break;
}
UCHAR operator[](int index)
{
int realIndex = m_offset + index;
- UNWINDER_ASSERT(realIndex < sizeof(m_buffer));
+ UNWINDER_ASSERT(realIndex < (int)sizeof(m_buffer));
return m_buffer[realIndex];
}
};
LIMITED_METHOD_CONTRACT;
#if defined(UNIX_AMD64_ABI)
- return offset >= sizeof(TransitionBlock);
+ return offset >= (int)sizeof(TransitionBlock);
#else
int ofsArgRegs = GetOffsetOfArgumentRegisters();
Synthetic
};
+ struct SyntheticStorage
+ {
+ PTR_MethodDesc m_pMethodDesc;
+ };
+
StorageKind m_storageKind;
union
{
PTR_NativeCodeVersionNode m_pVersionNode;
- struct SyntheticStorage
- {
- PTR_MethodDesc m_pMethodDesc;
- } m_synthetic;
+ SyntheticStorage m_synthetic;
};
#endif // FEATURE_CODE_VERSIONING
};
Synthetic
};
+ struct SyntheticStorage
+ {
+ PTR_Module m_pModule;
+ mdMethodDef m_methodDef;
+ };
+
StorageKind m_storageKind;
union
{
PTR_ILCodeVersionNode m_pVersionNode;
- struct SyntheticStorage
- {
- PTR_Module m_pModule;
- mdMethodDef m_methodDef;
- } m_synthetic;
+ SyntheticStorage m_synthetic;
};
};
/*static*/ inline INT32 GCHeapHashDependentHashTrackerHashTraits::Hash(PtrTypeKey *pValue)
{
LIMITED_METHOD_CONTRACT;
- return (INT32)*pValue;
+ return *(INT32*)pValue;
}
/*static*/ inline INT32 GCHeapHashDependentHashTrackerHashTraits::Hash(PTRARRAYREF arr, INT32 index)
static count_t Hash(key_t k)
{
LIMITED_METHOD_DAC_CONTRACT;
- return ((count_t)k.m_methodDef ^ (count_t)k.m_module);
+ return k.m_methodDef ^ *(count_t*)k.m_module;
}
static const element_t Null()
{
typedef CodeVersionManager * key_t;
static key_t GetKey(const element_t &e) { return e->m_pCodeVersionManager; }
static BOOL Equals(key_t k1, key_t k2) { return (k1 == k2); }
- static count_t Hash(key_t k) { return (count_t)k; }
+ static count_t Hash(key_t k) { return *(count_t*)k; }
static bool IsNull(const element_t &e) { return (e == NULL); }
};
#include <xplatform.h>
#include "platformdefines.h"
-DECIMAL g_DECIMAL_MaxValue = { 0, {{ 0, 0 }}, 0xffffffff, {{0xffffffff, 0xffffffff}} };
-DECIMAL g_DECIMAL_MinValue = { 0, {{ 0, DECIMAL_NEG }}, 0xffffffff, {{0xffffffff, 0xffffffff}} };
+DECIMAL g_DECIMAL_MaxValue = { 0, {{ 0, 0 }}, static_cast<int>(0xffffffff), {{static_cast<int>(0xffffffff), static_cast<int>(0xffffffff)}} };
+DECIMAL g_DECIMAL_MinValue = { 0, {{ 0, DECIMAL_NEG }}, static_cast<int>(0xffffffff), {{static_cast<int>(0xffffffff), static_cast<int>(0xffffffff)}} };
DECIMAL g_DECIMAL_Zero = { 0 };
-CY g_CY_MaxValue = { { 0xffffffff, 0x7fffffff } };
+CY g_CY_MaxValue = { { static_cast<int>(0xffffffff), static_cast<int>(0x7fffffff) } };
CY g_CY_MinValue = { { (LONG)0x00000000, (LONG)0x80000000 } };
CY g_CY_Zero = { { 0 } };
#include <xplatform.h>
#include "platformdefines.h"
-DECIMAL g_DECIMAL_MaxValue = { 0, {{ 0, 0 }}, 0xffffffff, {{0xffffffff, 0xffffffff}} };
-DECIMAL g_DECIMAL_MinValue = { 0, {{ 0, DECIMAL_NEG }}, 0xffffffff, {{0xffffffff, 0xffffffff }}};
+DECIMAL g_DECIMAL_MaxValue = { 0, {{ 0, 0 }}, static_cast<int>(0xffffffff), {{static_cast<int>(0xffffffff), static_cast<int>(0xffffffff)}} };
+DECIMAL g_DECIMAL_MinValue = { 0, {{ 0, DECIMAL_NEG }}, static_cast<int>(0xffffffff), {{static_cast<int>(0xffffffff), static_cast<int>(0xffffffff) }}};
DECIMAL g_DECIMAL_Zero = { 0 };
-CY g_CY_MaxValue = { {0xffffffff, 0x7fffffff} };
+CY g_CY_MaxValue = { {static_cast<int>(0xffffffff), static_cast<int>(0x7fffffff)} };
CY g_CY_MinValue = { {(LONG)0x00000000, (LONG)0x80000000} };
CY g_CY_Zero = { {0} };
bool IsCorrectNumberSequential(NumberSequential* p)
{
- if(p->i32 != (-0x7fffffff - 1) || p->ui32 != 0xffffffff || p->s1 != -0x8000 || p->us1 != 0xffff || p->b != 0 ||
- p->sb != 0x7f ||p->i16 != -0x8000 || p->ui16 != 0xffff || p->i64 != -1234567890 ||
+ if(p->i32 != (-0x7fffffff - 1) || p->ui32 != 0xffffffff || p->s1 != -0x8000 || p->us1 != 0xffff || p->b != 0 ||
+ p->sb != 0x7f ||p->i16 != -0x8000 || p->ui16 != 0xffff || p->i64 != (unsigned)-1234567890 ||
p->ui64 != 1234567890 || (p->sgl) != 32.0 || p->d != 3.2)
{
return false;
bool IsCorrectNumberSequential(NumberSequential* p)
{
- if(p->i32 != INT_MIN || p->ui32 != 0xffffffff || p->s1 != -0x8000 || p->us1 != 0xffff || p->b != 0 ||
- p->sb != 0x7f ||p->i16 != -0x8000 || p->ui16 != 0xffff || p->i64 != -1234567890 ||
+ if(p->i32 != INT_MIN || p->ui32 != 0xffffffff || p->s1 != -0x8000 || p->us1 != 0xffff || p->b != 0 ||
+ p->sb != 0x7f ||p->i16 != -0x8000 || p->ui16 != 0xffff || p->i64 != (unsigned)-1234567890 ||
p->ui64 != 1234567890 || (p->sgl) != 32.0 || p->d != 3.2)
{
return false;
bool IsCorrectNumberSequential(NumberSequential* p)
{
- if(p->i32 != INT_MIN || p->ui32 != 0xffffffff || p->s1 != -0x8000 || p->us1 != 0xffff || p->b != 0 ||
- p->sb != 0x7f ||p->i16 != -0x8000 || p->ui16 != 0xffff || p->i64 != -1234567890 ||
+ if(p->i32 != INT_MIN || p->ui32 != 0xffffffff || p->s1 != -0x8000 || p->us1 != 0xffff || p->b != 0 ||
+ p->sb != 0x7f ||p->i16 != -0x8000 || p->ui16 != 0xffff || p->i64 != (unsigned)-1234567890 ||
p->ui64 != 1234567890 || (p->sgl) != 32.0 || p->d != 3.2)
{
return false;
#include <stdarg.h>
#include "native.h"
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wvarargs"
-#endif
-
-MCC_API VType1 sum(float first, ...) {
+MCC_API VType1 sum(double first, ...) {
VType1 result;
int count = 0;
float sum = 0.0;
- float val = first;
+ float val = (float)first;
va_list args;
// initialize variable arguments.
while (val != (float)-1) {
sum += val;
count++;
- val = va_arg(args, float);
+ val = (float)va_arg(args, double);
}
// reset variable arguments.
va_end(args);
return result;
}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif