mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 711491. Remove WriteTag. r=bgirard
Just use .TagToString() and fwrite that instead of having a separate function. --HG-- extra : rebase_source : 410d052883778de3db85d4573707b040760376ca
This commit is contained in:
parent
646eecefb9
commit
6dffa3a7cd
@ -116,7 +116,6 @@ public:
|
||||
{ }
|
||||
|
||||
string TagToString(Profile *profile);
|
||||
void WriteTag(Profile *profile, FILE* stream);
|
||||
|
||||
private:
|
||||
union {
|
||||
@ -186,7 +185,8 @@ public:
|
||||
|
||||
int oldReadPos = mReadPos;
|
||||
while (mReadPos != mWritePos) {
|
||||
mEntries[mReadPos].WriteTag(this, stream);
|
||||
string tag = mEntries[mReadPos].TagToString(this);
|
||||
fwrite(tag.data(), 1, tag.length(), stream);
|
||||
mReadPos = (mReadPos + 1) % mEntrySize;
|
||||
}
|
||||
mReadPos = oldReadPos;
|
||||
@ -377,33 +377,6 @@ string ProfileEntry::TagToString(Profile *profile)
|
||||
return tag;
|
||||
}
|
||||
|
||||
void ProfileEntry::WriteTag(Profile *profile, FILE *stream)
|
||||
{
|
||||
fprintf(stream, "%c-%s\n", mTagName, mTagData);
|
||||
|
||||
#ifdef ENABLE_SPS_LEAF_DATA
|
||||
if (mLeafAddress) {
|
||||
bool found = false;
|
||||
SharedLibraryInfo& shlibInfo = profile->getSharedLibraryInfo();
|
||||
unsigned long pc = (unsigned long)mLeafAddress;
|
||||
// TODO Use binary sort (STL)
|
||||
for (size_t i = 0; i < shlibInfo.GetSize(); i++) {
|
||||
SharedLibrary &e = shlibInfo.GetEntry(i);
|
||||
if (pc > e.GetStart() && pc < e.GetEnd()) {
|
||||
if (e.GetName()) {
|
||||
found = true;
|
||||
fprintf(stream, "l-%s@%li\n", e.GetName(), pc - e.GetStart());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
fprintf(stream, "l-???@%li\n", pc);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#define PROFILE_DEFAULT_ENTRY 100000
|
||||
#define PROFILE_DEFAULT_INTERVAL 10
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user