endptr1 = endptr2;
}
// if the hex number was specified as 000006fbf9b70f50, an overflow occurred
- else if (ULONG_MAX == value1 && errno == ERANGE)
+ else if ((INT_PTR)ULONG_MAX == value1 && errno == ERANGE)
{
if (!strncmp(ptr, "0x", 2))
ptr += 2;
DacpObjectData objData;
if (objData.Request(g_sos, invocationList) == S_OK &&
objData.ObjectType == OBJ_ARRAY &&
- invocationCount <= objData.dwNumComponents)
+ invocationCount <= (int)objData.dwNumComponents)
{
for (int i = 0; i < invocationCount; i++)
{
// Overload that mirrors the code above when the ExceptionObjectData was already retrieved from LS
BOOL IsAsyncException(const DacpExceptionObjectData & excData)
{
- if (excData.XCode != EXCEPTION_COMPLUS)
+ if ((DWORD)excData.XCode != EXCEPTION_COMPLUS)
return TRUE;
HRESULT ehr = excData.HResult;
DacpObjectData objData;
if (objData.Request(g_sos, TO_CDADDR(listItemsPtr)) == S_OK && objData.ObjectType == OBJ_ARRAY)
{
- for (int i = 0; i < objData.dwNumComponents; i++)
+ for (SIZE_T i = 0; i < objData.dwNumComponents; i++)
{
CLRDATA_ADDRESS elementPtr;
MOVE(elementPtr, TO_CDADDR(objData.ArrayDataPtr + (i * objData.dwComponentSize)));
if (FAILED(hr))
{
PDEBUG_STACK_FRAME frame = &g_Frames[0];
- for (int i = 0; i < numNativeFrames; i++, frame++) {
+ for (unsigned int i = 0; i < numNativeFrames; i++, frame++) {
if (frame->InstructionOffset == context->Rip)
{
if ((i + 1) >= numNativeFrames) {
if (dmtd.ParentMethodTable)
{
DWORD retVal = GetValueFieldOffset(dmtd.ParentMethodTable, wszFieldName, pDacpFieldDescData);
- if (retVal != NOT_FOUND)
+ if (retVal != (DWORD)NOT_FOUND)
{
// Return in case of error or success. Fall through for field-not-found.
return retVal;
const TOCElement* te = tf.GetElementPtr(i);
printf("%4u: %016llX ", te->Number, te->Offset);
- for (int j = 0; j < sizeof(te->Hash); j++)
+ for (size_t j = 0; j < sizeof(te->Hash); j++)
{
printf("%02x ", te->Hash[j]);
}
Agnostic_RecordCallSite value = RecordCallSite->Get(instrOffset);
- if (value.callSig.callConv == -1)
+ if (value.callSig.callConv == (DWORD)-1)
return false;
pCallSig->callConv = (CorInfoCallConv)value.callSig.callConv;
return false; // found it. return position /////
}
insert = first;
- if (insert != first)
+ if (insert != (unsigned int)first)
{
LogDebug("index = %u f %u mid = %u l %u***************************", insert, first, mid, last);
__debugbreak();
void MethodContext::dmpGetClassGClayout(DWORDLONG key, const Agnostic_GetClassGClayout& value)
{
printf("GetClassGCLayout key %016llX, value len %u cnt %u {", key, value.len, value.valCount);
- if (value.gcPtrs_Index != -1)
+ if (value.gcPtrs_Index != (DWORD)-1)
{
BYTE* ptr = (BYTE*)GetClassGClayout->GetBuffer(value.gcPtrs_Index);
for (unsigned int i = 0; i < value.len; i++)
unsigned int len = (unsigned int)value.len;
unsigned int index = (unsigned int)value.gcPtrs_Index;
- if (index != -1)
+ if (index != (unsigned int)-1)
{
BYTE* ptr = (BYTE*)GetClassGClayout->GetBuffer(index);
for (unsigned int i = 0; i < len; i++)
// Get the last 4 byte token (more abuse of LARGE_INTEGER)
if (!ReadFile(hIndex, &val.u.HighPart, sizeof(DWORD), &read, nullptr) || (read != sizeof(DWORD)) ||
- (val.u.LowPart != val.u.HighPart))
+ (val.u.LowPart != (DWORD)val.u.HighPart))
{
CloseHandle(hIndex);
this->Clear();
// VSD calling case.
size_t Offset1 = (ipRelOffset1 - 8);
- if (data->cr->CallTargetTypes->GetIndex((DWORDLONG)Offset1) != (DWORD)-1)
+ if (data->cr->CallTargetTypes->GetIndex((DWORDLONG)Offset1) != -1)
{
// This logging is too noisy, so disable it.
// LogVerbose("Found VSD callsite, did softer compare than ideal");
// x86 VSD calling cases.
size_t Offset1b = (size_t)offset1 - 4;
size_t Offset2b = (size_t)offset2;
- if (data->cr->CallTargetTypes->GetIndex((DWORDLONG)Offset1b) != (DWORD)-1)
+ if (data->cr->CallTargetTypes->GetIndex((DWORDLONG)Offset1b) != -1)
{
// This logging is too noisy, so disable it.
// LogVerbose("Found VSD callsite, did softer compare than ideal");
return true;
}
- if (data->cr->CallTargetTypes->GetIndex((DWORDLONG)Offset2b) != (DWORD)-1)
+ if (data->cr->CallTargetTypes->GetIndex((DWORDLONG)Offset2b) != -1)
{
// This logging is too noisy, so disable it.
// LogVerbose("Found VSD callsite, did softer compare than ideal");
return true;
realTargetAddr = (size_t)data->cr->searchAddressMap((void*)(gOffset2));
- if (realTargetAddr != -1) // we know this was passed out as a bbloc
+ if (realTargetAddr != (size_t)-1) // we know this was passed out as a bbloc
return true;
return false;
#ifdef FEATURE_PAL
uint32_t cpuLimit;
- if (PAL_GetCpuLimit(&cpuLimit) && cpuLimit < processorCount)
+ if (PAL_GetCpuLimit(&cpuLimit) && cpuLimit < (uint32_t)processorCount)
processorCount = cpuLimit;
#endif
FALSE); // don't fixup EnC (we can't, we're stopped)
PTR_FieldDesc pCurrentFD;
- int index = 0;
+ unsigned int index = 0;
while (((pCurrentFD = fdIterator.Next()) != NULL) && (index < pFieldList->Count()))
{
// fill in the pCurrentEntry structure
// convert the type information for each parameter to its corresponding type handle
// and store it in the list
- for (int i = 0; i < pArgInfo->Count(); i++)
+ for (unsigned int i = 0; i < pArgInfo->Count(); i++)
{
pInst[i] = BasicTypeInfoToTypeHandle(&((*pArgInfo)[i]));
}
pParams->Alloc(typeHandle.GetNumGenericArgs());
// collect type information for each type parameter
- for (int i = 0; i < pParams->Count(); ++i)
+ for (unsigned int i = 0; i < pParams->Count(); ++i)
{
VMPTR_TypeHandle thInst = VMPTR_TypeHandle::NullPtr();
thInst.SetDacTargetPtr(typeHandle.GetInstantiation()[i].AsTAddr());
{
pTypes->Alloc(iids.Count());
- for (int i = 0; i < iids.Count(); ++i)
+ for (unsigned int i = 0; i < iids.Count(); ++i)
{
// There is the possiblity that we'll get this far with a dump and not fail, but still
// not be able to get full info for a particular param.
{
unsigned idx = DacSigUncompressData(sig);
- _ASSERTE(idx >= 0 && idx < (int)m_numImports);
+ _ASSERTE(idx >= 0 && idx < m_numImports);
return OpenImport(idx)->dependency;
}
#if !defined(FEATURE_SVR_GC)
_ASSERTE(0);
#else // !defined(FEATURE_SVR_GC)
- int heapCount = GCHeapCount();
+ unsigned int heapCount = GCHeapCount();
if (pNeeded)
*pNeeded = heapCount;
const DacDbiArrayList<ICorDebugInfo::NativeVarInfo> *pOffsetInfoList = m_nativeVarData.GetOffsetInfoList();
_ASSERTE(pOffsetInfoList != NULL);
DWORD countHomes = 0;
- for (int i = 0; i < pOffsetInfoList->Count(); i++)
+ for (unsigned int i = 0; i < pOffsetInfoList->Count(); i++)
{
const ICorDebugInfo::NativeVarInfo *pNativeVarInfo = &((*pOffsetInfoList)[i]);
_ASSERTE(pNativeVarInfo != NULL);
rsHomes = new RSSmartPtr<CordbVariableHome>[countHomes];
DWORD varHomeInd = 0;
- for (int i = 0; i < pOffsetInfoList->Count(); i++)
+ for (unsigned int i = 0; i < pOffsetInfoList->Count(); i++)
{
const ICorDebugInfo::NativeVarInfo *pNativeVarInfo = &((*pOffsetInfoList)[i]);
BOOL CordbClass::GotUnallocatedStatic(DacDbiArrayList<FieldData> * pFieldList)
{
BOOL fGotUnallocatedStatic = FALSE;
- int count = 0;
+ unsigned int count = 0;
while ((count < pFieldList->Count()) && !fGotUnallocatedStatic )
{
if ((*pFieldList)[count].OkToGetOrSetStaticAddress() &&
FieldData **ppFieldData
)
{
- int i;
+ unsigned int i;
IMetaDataImport * pImport = pModule->GetMetaDataImporter(); // throws
// means it will simply assert IsNeutered.
DacDbiArrayList<CordbType *> typeList;
typeList.Alloc(params.Count());
- for (int i = 0; i < params.Count(); ++i)
+ for (unsigned int i = 0; i < params.Count(); ++i)
{
IfFailThrow(TypeDataToType(pAppDomain, &(params[i]), &(typeList[i])));
}
// returns the number of elements in the list
- int Count() const;
+ unsigned int Count() const;
// @dbgtodo Mac - cleaner way to expose this for serialization?
void PrepareForDeserialize()
// get the number of elements in the list
template<class T>
inline
-int DacDbiArrayList<T>::Count() const
+unsigned int DacDbiArrayList<T>::Count() const
{
return m_nEntries;
}
void SequencePoints::CopyAndSortSequencePoints(const ICorDebugInfo::OffsetMapping mapCopy[])
{
// copy information to pSeqPoint and set end offsets
- int i;
+ unsigned int i;
ULONG32 lastILOffset = 0;
if (i < m_map.Count() - 1)
{
// We need to not use CALL_INSTRUCTION's IL start offset.
- int j = i + 1;
+ unsigned int j = i + 1;
while ((mapCopy[j].source & call_inst) == call_inst && j < m_map.Count()-1)
j++;
if (DBG_TRANSPORT_SHOULD_INJECT_FAULT(Send))
fSuccess = false;
else
- fSuccess = (m_pipe.Write(pbBuffer, cbBuffer) == cbBuffer);
+ fSuccess = ((DWORD)m_pipe.Write(pbBuffer, cbBuffer) == cbBuffer);
if (!fSuccess)
{
if (DBG_TRANSPORT_SHOULD_INJECT_FAULT(Receive))
fSuccess = false;
else
- fSuccess = (m_pipe.Read(pbBuffer, cbBuffer) == cbBuffer);
+ fSuccess = ((DWORD)m_pipe.Read(pbBuffer, cbBuffer) == cbBuffer);
if (!fSuccess)
{
while (x < plug_end)
{
- if (check_short_obj_p && ((plug_end - x) < min_pre_pin_obj_size))
+ if (check_short_obj_p && ((plug_end - x) < (DWORD)min_pre_pin_obj_size))
{
dprintf (3, ("last obj %Ix is short", x));
{
uintptr_t processMask = 0;
- for (int i = 0; i < g_logicalCpuCount; i++)
+ for (unsigned int i = 0; i < g_logicalCpuCount; i++)
{
if (CPU_ISSET(i, &cpuSet))
{
pmask &= smask;
- int count = 0;
+ unsigned int count = 0;
while (pmask)
{
pmask &= (pmask - 1);
if (pState->fAnythingPrinted)
pState->pfnPrintf("\n");
- if ((CodeOffset == -2) && !pState->fAnythingPrinted)
+ if ((CodeOffset == (UINT32)-2) && !pState->fAnythingPrinted)
pState->pfnPrintf("Untracked:");
else
pState->pfnPrintf("%08x", CodeOffset);
if (cCPUs != 0)
return cCPUs;
- int count = 0;
+ unsigned int count = 0;
DWORD_PTR pmask, smask;
if (!GetProcessAffinityMask(GetCurrentProcess(), &pmask, &smask))
}
// if we're here we have an enregistered argument
- int regStructOfs = (argOffset - TransitionBlock::GetOffsetOfArgumentRegisters());
+ unsigned int regStructOfs = (argOffset - TransitionBlock::GetOffsetOfArgumentRegisters());
_ASSERTE(regStructOfs < ARGUMENTREGISTERS_SIZE);
CorElementType t = m_argIterator.GetArgType();
// This function is used rarely and so the overhead of reading the zeros from
// the stack is negligible.
long long zeros[CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS] = {};
- _ASSERTE(sizeof(zeros) >= fieldBytes);
+ _ASSERTE(sizeof(zeros) >= (size_t)fieldBytes);
CopyStructToRegisters(zeros, fieldBytes, 0);
}
TypeHandle thReturnValueType;
if (m_methodSig.GetReturnTypeNormalized(&thReturnValueType) == ELEMENT_TYPE_VALUETYPE)
{
- _ASSERTE(cbReturnValue >= thReturnValueType.GetSize());
+ _ASSERTE((DWORD)cbReturnValue >= thReturnValueType.GetSize());
}
}
#endif // UNIX_AMD64_ABI
if (pReturnValue != NULL)
{
- _ASSERTE(cbReturnValue <= sizeof(callDescrData.returnValue));
+ _ASSERTE((DWORD)cbReturnValue <= sizeof(callDescrData.returnValue));
memcpyNoGCRefs(pReturnValue, &callDescrData.returnValue, cbReturnValue);
#if !defined(_WIN64) && BIGENDIAN
// We could imagine being much more efficient for 'bulk' updates, but we don't try
// because we assume that this is rare and we want to keep the code simple
- int usedSpace = unwindInfo->cTableCurCount - unwindInfo->cDeletedEntries;
- int desiredSpace = usedSpace * 5 / 4 + 1; // Increase by 20%
+ ULONG usedSpace = unwindInfo->cTableCurCount - unwindInfo->cDeletedEntries;
+ ULONG desiredSpace = usedSpace * 5 / 4 + 1; // Increase by 20%
// Be more aggresive if we used all of our space;
if (usedSpace == unwindInfo->cTableMaxCount)
desiredSpace = usedSpace * 3 / 2 + 1; // Increase by 50%
// it is a bug. Corerror.xml has a comment in it reserving this value for our use but it doesn't
// appear in the public headers.
-#define CORPROF_E_RUNTIME_SUSPEND_REQUIRED 0x80131381
+#define CORPROF_E_RUNTIME_SUSPEND_REQUIRED _HRESULT_TYPEDEF_(0x80131381L)
#ifndef DACCESS_COMPILE
NativeCodeVersionNode::NativeCodeVersionNode(
// revert.
if (GetJumpStampState() == JumpStampNone)
{
- for (int i = 0; i < sizeof(m_rgSavedCode); i++)
+ for (unsigned int i = 0; i < sizeof(m_rgSavedCode); i++)
{
m_rgSavedCode[i] = *FirstCodeByteAddr(pbCode + i, DebuggerController::GetPatchTable()->GetPatch((CORDB_ADDRESS_TYPE *)(pbCode + i)));
}
// revert.
if (GetJumpStampState() == JumpStampNone)
{
- for (int i = 0; i < sizeof(m_rgSavedCode); i++)
+ for (unsigned int i = 0; i < sizeof(m_rgSavedCode); i++)
{
m_rgSavedCode[i] = *FirstCodeByteAddr(pbCode + i, DebuggerController::GetPatchTable()->GetPatch((CORDB_ADDRESS_TYPE *)(pbCode + i)));
}
// PERF: we might still want a faster path through here if we aren't debugging that doesn't do
// all the patch checks
- for (int i = 0; i < MethodDescVersioningState::JumpStubSize; i++)
+ for (unsigned int i = 0; i < MethodDescVersioningState::JumpStubSize; i++)
{
*FirstCodeByteAddr(pbCode + i, DebuggerController::GetPatchTable()->GetPatch(pbCode + i)) = ((BYTE*)&i64NewValue)[i];
}
// This HRESULT is only used as a private implementation detail. Corerror.xml has a comment in it
// reserving this value for our use but it doesn't appear in the public headers.
-#define CORPROF_E_RUNTIME_SUSPEND_REQUIRED 0x80131381
+#define CORPROF_E_RUNTIME_SUSPEND_REQUIRED _HRESULT_TYPEDEF_(0x80131381L)
#endif
{
filledSlots[i] = false;
}
- for (int i = 0; i < pShuffleEntryArray->GetCount(); i++)
+ for (unsigned int i = 0; i < pShuffleEntryArray->GetCount(); i++)
{
entry = (*pShuffleEntryArray)[i];
// of the entry that filled it in.
if (filledSlots[GetNormalizedArgumentSlotIndex(entry.srcofs)])
{
- int j;
+ unsigned int j;
for (j = i; (*pShuffleEntryArray)[j].dstofs != entry.srcofs; j--)
(*pShuffleEntryArray)[j] = (*pShuffleEntryArray)[j - 1];
// </NOTE>
#if defined(PROFILING_SUPPORTED)
- DWORD dwMethodDescLocalNum = -1;
+ DWORD dwMethodDescLocalNum = (DWORD)-1;
// Notify the profiler of call out of the runtime
if (!SF_IsReverseCOMStub(m_dwStubFlags) && (CORProfilerTrackTransitions() || SF_IsNGENedStubForProfiling(m_dwStubFlags)))
{
dwMethodDescLocalNum = m_slIL.EmitProfilerBeginTransitionCallback(pcsDispatch, m_dwStubFlags);
- _ASSERTE(dwMethodDescLocalNum != -1);
+ _ASSERTE(dwMethodDescLocalNum != (DWORD)-1);
}
#endif // PROFILING_SUPPORTED
#if defined(PROFILING_SUPPORTED)
// Notify the profiler of return back into the runtime
- if (dwMethodDescLocalNum != -1)
+ if (dwMethodDescLocalNum != (DWORD)-1)
{
m_slIL.EmitProfilerEndTransitionCallback(pcsDispatch, m_dwStubFlags, dwMethodDescLocalNum);
}
{
DWORD exceptionCode = pExceptionRecord->ExceptionCode;
- if (exceptionCode == STATUS_UNWIND)
+ if ((NTSTATUS)exceptionCode == STATUS_UNWIND)
// If exceptionCode is STATUS_UNWIND, RtlUnwind is called with a NULL ExceptionRecord,
// therefore OS uses a faked ExceptionRecord with STATUS_UNWIND code. Then we need to
// look at our saved exception code.
ULONG slotIndex;
if (isReadyToRunModule)
{
- _ASSERT(dictionaryIndexAndSlot != -1);
+ _ASSERT(dictionaryIndexAndSlot != (DWORD)-1);
slotIndex = (ULONG)(dictionaryIndexAndSlot & 0xFFFF);
}
else
// The offset can be expressed in a byte (can use the byte
// form of the push esp instruction)
- BYTE code[] = {0xff, 0x74, 0x24, (BYTE)(ofs8 & 0xFF)};
+ BYTE code[] = {0xff, 0x74, 0x24, (BYTE)ofs8};
EmitBytes(code, sizeof(code));
}
else
{
#ifdef _DEBUG
// Only in R2R mode are the module, dictionary index and dictionary slot provided as an input
- _ASSERTE(dictionaryIndexAndSlot != -1);
+ _ASSERTE(dictionaryIndexAndSlot != (DWORD)-1);
_ASSERT(ExecutionManager::FindReadyToRunModule(dac_cast<TADDR>(signature)) == pModule);
#endif
dictionaryIndex = (dictionaryIndexAndSlot >> 16);
// prepare for every possible derived type of the type containing the method). So instead we have to locate the exactly
// instantiated (non-shared) super-type of the class passed in.
- _ASSERTE(dictionaryIndexAndSlot == -1);
+ _ASSERTE(dictionaryIndexAndSlot == (DWORD)-1);
IfFailThrow(ptr.GetData(&dictionaryIndex));
}
WRAPPER_NO_CONTRACT;
// Translate JIT call into runtime configuration query
- CLRConfig::ConfigDWORDInfo info{ name, static_cast<DWORD>(defaultValue), CLRConfig::EEConfig_default };
+ CLRConfig::ConfigDWORDInfo info{ name, (DWORD)defaultValue, CLRConfig::EEConfig_default };
// Perform a CLRConfig look up on behalf of the JIT.
return CLRConfig::GetConfigValue(info);
// Call CompareTo method on the primitive type
int tokCompareTo = pCompareToMD->GetMemberDef();
- int index = (et - ELEMENT_TYPE_I1);
+ unsigned int index = (et - ELEMENT_TYPE_I1);
_ASSERTE(index < _countof(ilcode));
ilcode[index][0] = CEE_LDARGA_S;
// binary search later
for (DWORD i = 0; i < cSlots; i++)
{
- int min = i;
+ unsigned int min = i;
for (DWORD j = i + 1; j < cSlots; j++)
{
if (rgSlots[j] < rgSlots[min])
NativeHashtable::Enumerator lookup = m_instMethodEntryPoints.Lookup(GetVersionResilientMethodHashCode(pMD));
NativeParser entryParser;
- offset = -1;
+ offset = (uint)-1;
while (lookup.GetNext(entryParser))
{
PCCOR_SIGNATURE pBlob = (PCCOR_SIGNATURE)entryParser.GetBlob();
}
}
- if (offset == -1)
+ if (offset == (uint)-1)
return NULL;
}
else
// This HRESULT is only used as a private implementation detail. Corerror.xml has a comment in it
// reserving this value for our use but it doesn't appear in the public headers.
-#define CORPROF_E_RUNTIME_SUSPEND_REQUIRED 0x80131381
+#define CORPROF_E_RUNTIME_SUSPEND_REQUIRED _HRESULT_TYPEDEF_(0x80131381L)
// This is just used as a unique id. Overflow is OK. If we happen to have more than 4+Billion rejits
// and somehow manage to not run out of memory, we'll just have to redefine ReJITID as size_t.
{
yieldsPerNormalizedYield = 1;
}
- _ASSERTE(yieldsPerNormalizedYield <= MinNsPerNormalizedYield);
+ _ASSERTE(yieldsPerNormalizedYield <= (int)MinNsPerNormalizedYield);
// Calculate the maximum number of yields that would be optimal for a late spin iteration. Typically, we would not want to
// spend excessive amounts of time (thousands of cycles) doing only YieldProcessor, as SwitchToThread/Sleep would do a
PORTABILITY_ASSERT("ZapLazyHelperThunk::Save");
#endif
- _ASSERTE(p - buffer <= sizeof(buffer));
+ _ASSERTE((DWORD)(p - buffer) <= sizeof(buffer));
if (pZapWriter != NULL)
pZapWriter->Write(&buffer, (int)(p - buffer));
// We skip the compilation of such methods and we don't want to
// issue a warning or error
//
- if ((hrException == E_NOTIMPL) || (hrException == IDS_CLASSLOAD_GENERAL))
+ if ((hrException == E_NOTIMPL) || (hrException == (HRESULT)IDS_CLASSLOAD_GENERAL))
{
result = NOT_COMPILED;
level = CORZAP_LOGLEVEL_INFO;
PORTABILITY_ASSERT("ZapIndirectHelperThunk::SaveWorker");
#endif
- _ASSERTE(p - buffer <= sizeof(buffer));
+ _ASSERTE((DWORD)(p - buffer) <= sizeof(buffer));
if (pZapWriter != NULL)
pZapWriter->Write(&buffer, (int)(p - buffer));
if (k1 == k2)
return TRUE;
- for (int i = 0; i < _countof(equivalentNodes); i++)
+ for (unsigned int i = 0; i < _countof(equivalentNodes); i++)
{
if (k1 == equivalentNodes[i][0] && k2 == equivalentNodes[i][1])
return TRUE;