зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1442363, part 2 - Constify XPTHeader::interface_directory. r=njn
MozReview-Commit-ID: 3oLZFtXBsV8 --HG-- extra : rebase_source : 3a8ac38d09709e0aedaa4ddbf876f073ae9131c9
This commit is contained in:
Родитель
b458c8cf4e
Коммит
b58cc63048
|
@ -60,7 +60,7 @@ private:
|
|||
void RegisterXPTHeader(const XPTHeader* aHeader);
|
||||
|
||||
// idx is the index of this interface in the XPTHeader
|
||||
void VerifyAndAddEntryIfNew(XPTInterfaceDirectoryEntry* iface,
|
||||
void VerifyAndAddEntryIfNew(const XPTInterfaceDirectoryEntry* iface,
|
||||
uint16_t idx,
|
||||
xptiTypelibGuts* typelib);
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ XPTInterfaceInfoManager::RegisterXPTHeader(const XPTHeader* aHeader)
|
|||
}
|
||||
|
||||
void
|
||||
XPTInterfaceInfoManager::VerifyAndAddEntryIfNew(XPTInterfaceDirectoryEntry* iface,
|
||||
XPTInterfaceInfoManager::VerifyAndAddEntryIfNew(const XPTInterfaceDirectoryEntry* iface,
|
||||
uint16_t idx,
|
||||
xptiTypelibGuts* typelib)
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ xptiTypelibGuts::GetEntryAt(uint16_t i)
|
|||
if (r)
|
||||
return r;
|
||||
|
||||
XPTInterfaceDirectoryEntry* iface = mHeader->interface_directory + i;
|
||||
const XPTInterfaceDirectoryEntry* iface = mHeader->interface_directory + i;
|
||||
|
||||
XPTInterfaceInfoManager::xptiWorkingSet& set =
|
||||
XPTInterfaceInfoManager::GetSingleton()->mWorkingSet;
|
||||
|
@ -69,7 +69,7 @@ xptiTypelibGuts::GetEntryNameAt(uint16_t i)
|
|||
NS_ASSERTION(mHeader, "bad state");
|
||||
NS_ASSERTION(i < GetEntryCount(), "bad index");
|
||||
|
||||
XPTInterfaceDirectoryEntry* iface = mHeader->interface_directory + i;
|
||||
const XPTInterfaceDirectoryEntry* iface = mHeader->interface_directory + i;
|
||||
|
||||
return iface->name;
|
||||
}
|
||||
|
|
|
@ -146,11 +146,13 @@ XPT_DoHeader(XPTArena *arena, NotNull<XPTCursor*> cursor, XPTHeader **headerp)
|
|||
|
||||
XPT_SetDataOffset(cursor->state, data_pool);
|
||||
|
||||
XPTInterfaceDirectoryEntry* interface_directory = nullptr;
|
||||
|
||||
if (header->num_interfaces) {
|
||||
size_t n = header->num_interfaces * sizeof(XPTInterfaceDirectoryEntry);
|
||||
header->interface_directory =
|
||||
interface_directory =
|
||||
static_cast<XPTInterfaceDirectoryEntry*>(XPT_CALLOC8(arena, n));
|
||||
if (!header->interface_directory)
|
||||
if (!interface_directory)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -170,10 +172,12 @@ XPT_DoHeader(XPTArena *arena, NotNull<XPTCursor*> cursor, XPTHeader **headerp)
|
|||
|
||||
for (i = 0; i < header->num_interfaces; i++) {
|
||||
if (!DoInterfaceDirectoryEntry(arena, cursor,
|
||||
&header->interface_directory[i]))
|
||||
&interface_directory[i]))
|
||||
return false;
|
||||
}
|
||||
|
||||
header->interface_directory = interface_directory;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ struct XPTHeader {
|
|||
//uint8_t minor_version;
|
||||
uint16_t num_interfaces;
|
||||
//uint32_t file_length;
|
||||
XPTInterfaceDirectoryEntry* interface_directory;
|
||||
const XPTInterfaceDirectoryEntry* interface_directory;
|
||||
//uint32_t data_pool;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче