Skip to content

Commit

Permalink
Fix C4244
Browse files Browse the repository at this point in the history
```
warning C4244: 'argument' : conversion from 'intptr_t' to 'int32_t', possible loss of data
```
  • Loading branch information
fjeremic committed Jun 7, 2021
1 parent 5cefde1 commit 6e551ea
Show file tree
Hide file tree
Showing 64 changed files with 372 additions and 391 deletions.
14 changes: 7 additions & 7 deletions compiler/codegen/CodeGenGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ OMR::CodeGenerator::createStackAtlas()
//
TR::Compilation *comp = self()->comp();
TR::ResolvedMethodSymbol * methodSymbol = comp->getMethodSymbol();
intptr_t stackSlotSize = TR::Compiler->om.sizeofReferenceAddress();
int32_t stackSlotSize = static_cast<int32_t>(TR::Compiler->om.sizeofReferenceAddress());

int32_t slotIndex = 0;
int32_t numberOfParmSlots = 0;
Expand Down Expand Up @@ -341,8 +341,8 @@ OMR::CodeGenerator::remapGCIndicesInInternalPtrFormat()
localCursor->setGCMapIndex(index);
int32_t roundedSize = (localCursor->getSize()+3)&(~3);
if (roundedSize == 0)
roundedSize = TR::Compiler->om.sizeofReferenceAddress();
index += roundedSize / TR::Compiler->om.sizeofReferenceAddress();
roundedSize = static_cast<int32_t>(TR::Compiler->om.sizeofReferenceAddress());
index += roundedSize / static_cast<int32_t>(TR::Compiler->om.sizeofReferenceAddress());

if (!localCursor->isInitializedReference())
stackAtlas->setHasUninitializedPinningArrayPointer(true);
Expand All @@ -367,8 +367,8 @@ OMR::CodeGenerator::remapGCIndicesInInternalPtrFormat()
localCursor->setGCMapIndex(index);
int32_t roundedSize = (localCursor->getSize()+3)&(~3);
if (roundedSize == 0)
roundedSize = TR::Compiler->om.sizeofReferenceAddress();
index += roundedSize / TR::Compiler->om.sizeofReferenceAddress();
roundedSize = static_cast<int32_t>(TR::Compiler->om.sizeofReferenceAddress());
index += roundedSize / static_cast<int32_t>(TR::Compiler->om.sizeofReferenceAddress());

if (!internalPtrMap)
{
Expand Down Expand Up @@ -459,7 +459,7 @@ TR_GCStackMap::addToAtlas(TR::Instruction * instruction, TR::CodeGenerator *code
// Fill in the code range and add this map to the atlas.
//
uint8_t * codeStart = codeGen->getCodeStart();
setLowestCodeOffset(instruction->getBinaryEncoding() - codeStart);
setLowestCodeOffset(static_cast<uint32_t>(instruction->getBinaryEncoding() - codeStart));
codeGen->getStackAtlas()->addStackMap(this);
bool osrEnabled = codeGen->comp()->getOption(TR_EnableOSR);
if (osrEnabled)
Expand All @@ -471,7 +471,7 @@ TR_GCStackMap::addToAtlas(uint8_t * callSiteAddress, TR::CodeGenerator *codeGen)
{
// Fill in the code range and add this map to the atlas.
//
uint32_t callSiteOffset = callSiteAddress - codeGen->getCodeStart();
uint32_t callSiteOffset = static_cast<uint32_t>(callSiteAddress - codeGen->getCodeStart());
setLowestCodeOffset(callSiteOffset - 1);
codeGen->getStackAtlas()->addStackMap(this);
bool osrEnabled = codeGen->comp()->getOption(TR_EnableOSR);
Expand Down
2 changes: 1 addition & 1 deletion compiler/codegen/CodeGenRA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ OMR::CodeGenerator::allocateInternalPointerSpill(TR::AutomaticSymbol *pinningArr
TR::AutomaticSymbol *spillSymbol =
TR::AutomaticSymbol::createInternalPointer(self()->trHeapMemory(),
TR::Address,
TR::Compiler->om.sizeofReferenceAddress(),
static_cast<uint32_t>(TR::Compiler->om.sizeofReferenceAddress()),
self()->fe());
spillSymbol->setSpillTempAuto();
spillSymbol->setPinningArrayPointer(pinningArrayPointer);
Expand Down
2 changes: 1 addition & 1 deletion compiler/codegen/OMRCodeGenPhase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ OMR::CodeGenPhase::performProcessRelocationsPhase(TR::CodeGenerator * cg, TR::Co
cg->trimCodeMemoryToActualSize();
cg->registerAssumptions();

cg->syncCode(cg->getBinaryBufferStart(), cg->getBinaryBufferCursor() - cg->getBinaryBufferStart());
cg->syncCode(cg->getBinaryBufferStart(), static_cast<uint32_t>(cg->getBinaryBufferCursor() - cg->getBinaryBufferStart()));

if (comp->getOption(TR_EnableOSR))
{
Expand Down
10 changes: 5 additions & 5 deletions compiler/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ OMR::CodeGenerator::initialize()
for (i = 0 ; i < TR_NumLinkages; ++i)
_linkages[i] = NULL;

_maxObjectSizeGuaranteedNotToOverflow = (maxSize > UINT_MAX) ? UINT_MAX : maxSize;
_maxObjectSizeGuaranteedNotToOverflow = static_cast<uint32_t>((maxSize > UINT_MAX) ? UINT_MAX : maxSize);

if (comp->getDebug())
{
Expand Down Expand Up @@ -2300,7 +2300,7 @@ OMR::CodeGenerator::alignBinaryBufferCursor()

alignedBinaryBufferCursor -= offset;
_binaryBufferCursor = alignedBinaryBufferCursor;
self()->setJitMethodEntryPaddingSize(_binaryBufferCursor - _binaryBufferStart);
self()->setJitMethodEntryPaddingSize(static_cast<uint32_t>(_binaryBufferCursor - _binaryBufferStart));
memset(_binaryBufferStart, 0, self()->getJitMethodEntryPaddingSize());
}

Expand Down Expand Up @@ -2349,10 +2349,10 @@ OMR::CodeGenerator::emitSnippets()
codeOffset = (*iterator)->emitSnippet();
if (codeOffset != NULL)
{
TR_ASSERT((*iterator)->getLength(self()->getBinaryBufferCursor()-self()->getBinaryBufferStart()) + self()->getBinaryBufferCursor() >= codeOffset,
TR_ASSERT((*iterator)->getLength(static_cast<int32_t>(self()->getBinaryBufferCursor()-self()->getBinaryBufferStart())) + self()->getBinaryBufferCursor() >= codeOffset,
"%s length estimate must be conservatively large (snippet @ " POINTER_PRINTF_FORMAT ", estimate=%d, actual=%d)",
self()->getDebug()->getName(*iterator), *iterator,
(*iterator)->getLength(self()->getBinaryBufferCursor()-self()->getBinaryBufferStart()),
(*iterator)->getLength(static_cast<int32_t>(self()->getBinaryBufferCursor()-self()->getBinaryBufferStart())),
codeOffset - self()->getBinaryBufferCursor());
self()->setBinaryBufferCursor(codeOffset);
}
Expand Down Expand Up @@ -2731,7 +2731,7 @@ int32_t leadingZeroes (int64_t inputWord)
testWord = inputWord & byteMask;
if (testWord != 0)
{
byteValue = testWord >> (56 - bitCount);
byteValue = static_cast<uint8_t>(testWord >> (56 - bitCount));
return bitCount + CS2::BitManipulator::LeadingZeroes(byteValue);
}
byteMask >>= 8;
Expand Down
12 changes: 6 additions & 6 deletions compiler/codegen/Relocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ uint8_t TR::ExternalRelocation::collectModifier()
uint8_t * relocatableMethodCodeStart = (uint8_t *)comp->getRelocatableMethodCodeStart();
uint8_t * updateLocation = getUpdateLocation();

int32_t distanceFromStartOfBuffer = updateLocation - relocatableMethodCodeStart;
int32_t distanceFromStartOfMethod = updateLocation - comp->cg()->getCodeStart();
int32_t distanceFromStartOfBuffer = static_cast<int32_t>(updateLocation - relocatableMethodCodeStart);
int32_t distanceFromStartOfMethod = static_cast<int32_t>(updateLocation - comp->cg()->getCodeStart());
AOTcgDiag2(comp, "TR::ExternalRelocation::collectModifier distance from start of buffer=%x, from start of method=%x\n", distanceFromStartOfBuffer, distanceFromStartOfMethod);

if (distanceFromStartOfBuffer < MIN_SHORT_OFFSET || distanceFromStartOfBuffer > MAX_SHORT_OFFSET)
Expand Down Expand Up @@ -344,8 +344,8 @@ uint8_t TR::ExternalOrderedPair32BitRelocation::collectModifier()
updateLocation2 = getLocation2();
}

int32_t iLoc = updateLocation - relocatableMethodCodeStart;
int32_t iLoc2 = updateLocation2 - relocatableMethodCodeStart;
int32_t iLoc = static_cast<int32_t>(updateLocation - relocatableMethodCodeStart);
int32_t iLoc2 = static_cast<int32_t>(updateLocation2 - relocatableMethodCodeStart);
AOTcgDiag0(comp, "TR::ExternalOrderedPair32BitRelocation::collectModifier\n");
if ( (iLoc < MIN_SHORT_OFFSET || iLoc > MAX_SHORT_OFFSET ) || (iLoc2 < MIN_SHORT_OFFSET || iLoc2 > MAX_SHORT_OFFSET ) )
return RELOCATION_TYPE_WIDE_OFFSET | RELOCATION_TYPE_ORDERED_PAIR;
Expand Down Expand Up @@ -373,8 +373,8 @@ void TR::ExternalOrderedPair32BitRelocation::apply(TR::CodeGenerator *codeGen)
}
else
{
rec->addRelocationEntry(getUpdateLocation() - codeStart);
rec->addRelocationEntry(getLocation2() - codeStart);
rec->addRelocationEntry(static_cast<uint32_t>(getUpdateLocation() - codeStart));
rec->addRelocationEntry(static_cast<uint32_t>(getLocation2() - codeStart));
}
}

Expand Down
34 changes: 17 additions & 17 deletions compiler/compile/OSRData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ TR_OSRCompilationData::addInstruction(TR::Instruction* instr)
&& node->getSymbolReference()->isOSRInductionHelper()))
return;

int32_t instructionPC = instr->getBinaryEncoding() - instr->cg()->getCodeStart();
int32_t instructionPC = static_cast<int32_t>(instr->getBinaryEncoding() - instr->cg()->getCodeStart());
TR_ByteCodeInfo& bcInfo = instr->getNode()->getByteCodeInfo();
addInstruction(instructionPC, bcInfo);
}
Expand Down Expand Up @@ -397,7 +397,7 @@ TR_OSRCompilationData::writeInstruction2SharedSlotMap(uint8_t* buffer) const
buffer += info.writeToBuffer(buffer);
}
}
uint32_t numberOfBytesWritten = buffer - initialBuffer;
uint32_t numberOfBytesWritten = static_cast<uint32_t>(buffer - initialBuffer);
TR_ASSERT(numberOfBytesWritten == sectionSize, "numberOfBytesWritten (%d) must match sectionSize (%d)", numberOfBytesWritten, sectionSize);
return numberOfBytesWritten;
}
Expand Down Expand Up @@ -428,7 +428,7 @@ TR_OSRCompilationData::writeCallerIndex2OSRCatchBlockMap(uint8_t* buffer) const
else
*((int32_t*)buffer) = osrMethodData->getOSRCatchBlock()->getInstructionBoundaries()._startPC; buffer += sizeof(int32_t);
}
uint32_t numberOfBytesWritten = buffer - initialBuffer;
uint32_t numberOfBytesWritten = static_cast<uint32_t>(buffer - initialBuffer);
TR_ASSERT(numberOfBytesWritten == sectionSize, "numberOfBytesWritten (%d) must match sectionSize (%d)", numberOfBytesWritten, sectionSize);
return numberOfBytesWritten;
}
Expand All @@ -448,7 +448,7 @@ void TR_OSRCompilationData::checkOSRLimits()

uint32_t *frameSizes = (uint32_t *) comp->trMemory()->allocateStackMemory(numOfInlinedCalls * sizeof(uint32_t));
uint32_t *stackFrameSizes = (uint32_t *) comp->trMemory()->allocateStackMemory(numOfInlinedCalls * sizeof(uint32_t));
uint32_t rootFrameSize = TR::Compiler->vm.OSRFrameSizeInBytes(comp, comp->getCurrentMethod()->getPersistentIdentifier());
uint32_t rootFrameSize = static_cast<uint32_t>(TR::Compiler->vm.OSRFrameSizeInBytes(comp, comp->getCurrentMethod()->getPersistentIdentifier()));
uint32_t rootStackFrameSize = getOSRStackFrameSize(0);
for (int i = 0; i < numOfInlinedCalls; ++i)
{
Expand All @@ -461,7 +461,7 @@ void TR_OSRCompilationData::checkOSRLimits()
TR_InlinedCallSite &callSite = comp->getInlinedCallSite(i);
TR_ByteCodeInfo &bcInfo = callSite._byteCodeInfo;

frameSizes[i] = TR::Compiler->vm.OSRFrameSizeInBytes(comp, callSite._methodInfo);
frameSizes[i] = static_cast<uint32_t>(TR::Compiler->vm.OSRFrameSizeInBytes(comp, callSite._methodInfo));
frameSizes[i] += (bcInfo.getCallerIndex() == -1) ? rootFrameSize : frameSizes[bcInfo.getCallerIndex()];
stackFrameSizes[i] = getOSRStackFrameSize(i + 1);
stackFrameSizes[i] = (bcInfo.getCallerIndex() == -1) ? rootStackFrameSize : stackFrameSizes[bcInfo.getCallerIndex()];
Expand Down Expand Up @@ -512,7 +512,7 @@ uint32_t TR_OSRCompilationData::getOSRStackFrameSize(uint32_t methodIndex)
TR_OSRMethodData* osrMethodData = getOSRMethodDataArray()[methodIndex];
if (osrMethodData != NULL)
return (1 + osrMethodData->getMethodSymbol()->getNumParameterSlots())
* TR::Compiler->om.sizeofReferenceAddress();
* static_cast<uint32_t>(TR::Compiler->om.sizeofReferenceAddress());
else
return 0;
}
Expand Down Expand Up @@ -569,7 +569,7 @@ void TR_OSRCompilationData::buildDefiningMap(TR::Region &region)
DefiningMaps definingMapAtOSRCodeBlocks(numOfMethods, static_cast<DefiningMap*>(NULL), comp->trMemory()->currentStackRegion());
DefiningMaps definingMapAtPrepareForOSRCalls(numOfMethods, static_cast<DefiningMap*>(NULL), comp->trMemory()->currentStackRegion());

for (intptr_t i = 0; i < methodDataArray.size(); ++i)
for (auto i = 0; i < methodDataArray.size(); ++i)
{
TR_OSRMethodData *osrMethodData = methodDataArray[i];
if (!osrMethodData)
Expand Down Expand Up @@ -600,14 +600,14 @@ void TR_OSRCompilationData::buildDefiningMap(TR::Region &region)
if (!osrCatchBlockRemoved && !osrCodeBlockRemoved )
{
DefiningMap *finalMap = new (region) DefiningMap(DefiningMapComparator(), DefiningMapAllocator(region));
buildFinalMap(i-1, finalMap, definingMapAtOSRCatchBlocks[i], definingMapAtOSRCodeBlocks, definingMapAtPrepareForOSRCalls);
buildFinalMap(static_cast<int32_t>(i-1), finalMap, definingMapAtOSRCatchBlocks[i], definingMapAtOSRCodeBlocks, definingMapAtPrepareForOSRCalls);
osrMethodData->setDefiningMap(finalMap);
}
}

if (comp->getOption(TR_TraceOSR))
{
for (intptr_t i = 0; i < methodDataArray.size(); ++i)
for (auto i = 0; i < methodDataArray.size(); ++i)
{
TR_OSRMethodData *osrMethodData = methodDataArray[i];
if (!osrMethodData)
Expand All @@ -625,7 +625,7 @@ void TR_OSRCompilationData::buildDefiningMap(TR::Region &region)
void TR_OSRCompilationData::clearDefiningMap()
{
const TR_Array<TR_OSRMethodData *>& methodDataArray = getOSRMethodDataArray();
for (intptr_t i = 0; i < methodDataArray.size(); ++i)
for (auto i = 0; i < methodDataArray.size(); ++i)
{
TR_OSRMethodData *osrMethodData = methodDataArray[i];
if (osrMethodData)
Expand Down Expand Up @@ -953,7 +953,7 @@ void TR_OSRCompilationData::buildSymRefOrderMapAux( TR_Array<List<TR::SymbolRefe
if (symListArray == NULL)
return;

for (intptr_t j = 0; j < symListArray->size(); j++)
for (auto j = 0; j < symListArray->size(); j++)
{
List<TR::SymbolReference>& symList = (*symListArray)[j];
bool sharedSlot = symList.getSize() > 1;
Expand Down Expand Up @@ -1074,7 +1074,7 @@ TR_OSRMethodData::createOSRBlocks(TR::Node* n)
osrCatchBlock->setIsCold();
osrCatchBlock->setDoNotProfile();
osrCatchBlock->setIsOSRCatchBlock();
osrCatchBlock->setHandlerInfoWithOutBCInfo(TR::Block::CanCatchOSR, comp()->getInlineDepth(), -1, getMethodSymbol()->getResolvedMethod(), comp());
osrCatchBlock->setHandlerInfoWithOutBCInfo(TR::Block::CanCatchOSR, static_cast<uint8_t>(comp()->getInlineDepth()), -1, getMethodSymbol()->getResolvedMethod(), comp());

TR::CFG * cfg = getMethodSymbol()->getFlowGraph();
cfg->addNode(osrCatchBlock);
Expand Down Expand Up @@ -1351,7 +1351,7 @@ TR::Compilation* TR_OSRMethodData::comp() const
int32_t
TR_OSRMethodData::getHeaderSize() const
{
return TR::Compiler->vm.OSRFrameHeaderSizeInBytes(comp());
return static_cast<int32_t>(TR::Compiler->vm.OSRFrameHeaderSizeInBytes(comp()));
}

int32_t
Expand All @@ -1363,14 +1363,14 @@ TR_OSRMethodData::slotIndex2OSRBufferIndex(int32_t slotIndex, int symSize, bool
if (slotIndex < 0)
return
headerSize
+ (getMethodSymbol()->getNumPPSlots() + slotIndex + (takesTwoSlots ? -1 : 0)) * TR::Compiler->om.sizeofReferenceAddress();
+ (getMethodSymbol()->getNumPPSlots() + slotIndex + (takesTwoSlots ? -1 : 0)) * static_cast<int32_t>(TR::Compiler->om.sizeofReferenceAddress());
else
return
headerSize + (getMethodSymbol()->getNumPPSlots() +
getMethodSymbol()->getResolvedMethod()->numberOfTemps() +
numOfSyncObjects +
getMethodSymbol()->getNumParameterSlots()
- slotIndex - 1 + (takesTwoSlots ? -1 : 0))* TR::Compiler->om.sizeofReferenceAddress();
- slotIndex - 1 + (takesTwoSlots ? -1 : 0))* static_cast<int32_t>(TR::Compiler->om.sizeofReferenceAddress());
}

int32_t
Expand All @@ -1388,7 +1388,7 @@ int32_t
TR_OSRMethodData::getTotalDataSize() const
{
int32_t numOfSyncObjects = (getMethodSymbol()->getSyncObjectTemp() != NULL)?1:0;
return getHeaderSize() + getTotalNumOfSlots() * TR::Compiler->om.sizeofReferenceAddress();
return getHeaderSize() + getTotalNumOfSlots() * static_cast<int32_t>(TR::Compiler->om.sizeofReferenceAddress());
}


Expand Down Expand Up @@ -1538,5 +1538,5 @@ int32_t TR_OSRCompilationData::TR_ScratchBufferInfo::writeToBuffer(uint8_t* buff
*((int32_t*)buffer) = osrBufferOffset; buffer += sizeof(int32_t);
*((int32_t*)buffer) = scratchBufferOffset; buffer += sizeof(int32_t);
*((int32_t*)buffer) = symSize; buffer += sizeof(int32_t);
return buffer - bufferStart;
return static_cast<int32_t>(buffer - bufferStart);
}
2 changes: 1 addition & 1 deletion compiler/control/CompileMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ generatePerfToolEntry(uint8_t *startPC, uint8_t *endPC, const char *sig, const c
else
name = "(compiled code)";

writePerfToolEntry(startPC, endPC - startPC, name);
writePerfToolEntry(startPC, static_cast<uint32_t>(endPC - startPC), name);
}

#if defined(TR_TARGET_POWER)
Expand Down
14 changes: 7 additions & 7 deletions compiler/control/OMROptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ OMR::Options::set64BitSignedNumeric(char *option, void *base, TR::OptionTable *e
char *
OMR::Options::set32BitHexadecimal(char *option, void *base, TR::OptionTable *entry)
{
*((int32_t*)((char*)base+entry->parm1)) = getHexadecimalValue(option);
*((int32_t*)((char*)base+entry->parm1)) = static_cast<int32_t>(getHexadecimalValue(option));
return option;
}

Expand All @@ -1384,7 +1384,7 @@ OMR::Options::set32BitSignedNumeric(char *option, void *base, TR::OptionTable *e
sign = -1;
option++;
}
*((int32_t*)((char*)base+entry->parm1)) = sign * TR::Options::getNumericValue(option);
*((int32_t*)((char*)base+entry->parm1)) = sign * static_cast<int32_t>(TR::Options::getNumericValue(option));
return option;
}

Expand Down Expand Up @@ -1440,7 +1440,7 @@ OMR::Options::setString(char *option, void *base, TR::OptionTable *entry)
break;
}
}
int32_t len = p - option;
int32_t len = static_cast<int32_t>(p - option);
p = (char *)TR::Options::jitPersistentAlloc(len+1);
if (p)
{
Expand Down Expand Up @@ -1504,7 +1504,7 @@ OMR::Options::setDebug(char *option, void *base, TR::OptionTable *entry)
}
}
}
int32_t len = position - option-2;
int32_t len = static_cast<int32_t>(position - option-2);
if(len > 0)
{
entry->parm1 = (intptr_t)TR::Options::jitPersistentAlloc(len+1);
Expand Down Expand Up @@ -4401,7 +4401,7 @@ OMR::Options::getDefaultCountString()
char *
OMR::Options::setCount(char *option, void *base, TR::OptionTable *entry)
{
int32_t offset = entry->parm1;
int32_t offset = static_cast<int32_t>(entry->parm1);
int32_t countValue = (int32_t)TR::Options::getNumericValue(option);

*((int32_t*)((char*)base+offset)) = countValue;
Expand Down Expand Up @@ -4616,7 +4616,7 @@ OMR::Options::setBitsFromStringSet(char *option, void *base, TR::OptionTable *en

if (entry->parm2 != 0)
{
*((int32_t*)((char*)base+entry->parm1)) = (intptr_t)entry->parm2;
*((int32_t*)((char*)base+entry->parm1)) = static_cast<int32_t>(entry->parm2);
}
else
{
Expand Down Expand Up @@ -4649,7 +4649,7 @@ char *OMR::Options::clearBitsFromStringSet(char *option, void *base, TR::OptionT

if (entry->parm2 != 0)
{
*((int32_t*)((char*)base+entry->parm1)) = (intptr_t)entry->parm2;
*((int32_t*)((char*)base+entry->parm1)) = static_cast<int32_t>(entry->parm2);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion compiler/control/OMROptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ class OMR_EXTENSIBLE Options
if (splitPoint)
{
// Replace "~" in the name with "~:{format}"
int splitIndex = splitPoint - name + 1;
int32_t splitIndex = static_cast<int32_t>(splitPoint - name + 1);
strncpy(result, name, splitIndex);
result[splitIndex] = ':';
strcpy(result + splitIndex + 1, format);
Expand Down
6 changes: 3 additions & 3 deletions compiler/cs2/bitvectr.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ class ABitVector : private Allocator {
for (wordIndex=(fIndex+kBitWordSize-1)/kBitWordSize;
wordIndex < fWordCount;
wordIndex+=1) {
word = fVector.WordAt(wordIndex);
word = fVector.WordAt(static_cast<uint32_t>(wordIndex));
if (word) {
fIndex = wordIndex * kBitWordSize;
fIndex = static_cast<BitIndex>(wordIndex * kBitWordSize);
goto find_bit;
}
}
fIndex = wordIndex * kBitWordSize;
fIndex = static_cast<BitIndex>(wordIndex * kBitWordSize);
return false;
}
find_bit:
Expand Down
Loading

0 comments on commit 6e551ea

Please sign in to comment.