mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-16 23:34:10 +02:00
Mac fixes
This commit is contained in:
parent
c84da66758
commit
8709c92f22
4 changed files with 23 additions and 2 deletions
|
@ -113,6 +113,16 @@ public:
|
|||
{
|
||||
return mPtr < val2.mPtr;
|
||||
}
|
||||
|
||||
bool operator>(const iterator& val2)
|
||||
{
|
||||
return mPtr > val2.mPtr;
|
||||
}
|
||||
|
||||
bool operator>=(const iterator& val2)
|
||||
{
|
||||
return mPtr >= val2.mPtr;
|
||||
}
|
||||
};
|
||||
|
||||
struct const_iterator
|
||||
|
|
|
@ -123,7 +123,7 @@ intptr StringView::LastIndexOf(char c) const
|
|||
return -1;
|
||||
}
|
||||
|
||||
intptr StringView::LastIndexOf(char c, intptr startCheck) const
|
||||
intptr StringView::LastIndexOf(char c, int startCheck) const
|
||||
{
|
||||
auto ptr = mPtr;
|
||||
for (intptr i = startCheck; i >= 0; i--)
|
||||
|
@ -132,6 +132,15 @@ intptr StringView::LastIndexOf(char c, intptr startCheck) const
|
|||
return -1;
|
||||
}
|
||||
|
||||
intptr StringView::LastIndexOf(char c, int64 startCheck) const
|
||||
{
|
||||
auto ptr = mPtr;
|
||||
for (intptr i = (intptr)startCheck; i >= 0; i--)
|
||||
if (ptr[i] == c)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
String StringView::ToString() const
|
||||
{
|
||||
return String(this->mPtr, this->mLength);
|
||||
|
|
|
@ -1831,7 +1831,7 @@ void BfIRBuilder::Write(const BfIRTypeData& type)
|
|||
{
|
||||
auto sizedArrayType = (BfConstantSizedArrayType*)GetConstantById(type.mId);
|
||||
Write(sizedArrayType->mType);
|
||||
WriteSLEB128(sizedArrayType->mLength);
|
||||
WriteSLEB128((int64)sizedArrayType->mLength);
|
||||
}
|
||||
else if (type.mKind != BfIRTypeData::TypeKind_None)
|
||||
WriteSLEB128(type.mId);
|
||||
|
|
|
@ -410,6 +410,8 @@ struct BfCodeGenOptions
|
|||
HashContext hashCtx;
|
||||
|
||||
hashCtx.Mixin(mWriteObj);
|
||||
hashCtx.Mixin(mWriteBitcode);
|
||||
hashCtx.Mixin(mAsmKind);
|
||||
hashCtx.Mixin(mWriteToLib);
|
||||
hashCtx.Mixin(mWriteLLVMIR);
|
||||
hashCtx.Mixin(mVirtualMethodOfs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue