mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1442363, part 8 - Constify XPTMethodDescriptor::params. r=njn
MozReview-Commit-ID: 3PvMeJW2P50 --HG-- extra : rebase_source : a8a617e0fb58c27690bcb2cc9a3e256efaaedf07
This commit is contained in:
parent
9e8f62c285
commit
1a05744852
@ -353,18 +353,22 @@ DoMethodDescriptor(XPTArena *arena, NotNull<XPTCursor*> cursor,
|
||||
!XPT_Do8(cursor, &md->num_args))
|
||||
return false;
|
||||
|
||||
XPTParamDescriptor* params = nullptr;
|
||||
|
||||
if (md->num_args) {
|
||||
size_t n = md->num_args * sizeof(XPTParamDescriptor);
|
||||
md->params = static_cast<XPTParamDescriptor*>(XPT_CALLOC8(arena, n));
|
||||
if (!md->params)
|
||||
params = static_cast<XPTParamDescriptor*>(XPT_CALLOC8(arena, n));
|
||||
if (!params)
|
||||
return false;
|
||||
}
|
||||
|
||||
for(i = 0; i < md->num_args; i++) {
|
||||
if (!DoParamDescriptor(arena, cursor, &md->params[i], id))
|
||||
if (!DoParamDescriptor(arena, cursor, ¶ms[i], id))
|
||||
return false;
|
||||
}
|
||||
|
||||
md->params = params;
|
||||
|
||||
// |result| appears in the on-disk format but it isn't used,
|
||||
// because a method is either notxpcom, in which case it can't be
|
||||
// called from script so the XPT information is irrelevant, or the
|
||||
|
@ -267,7 +267,7 @@ struct XPTParamDescriptor {
|
||||
*/
|
||||
struct XPTMethodDescriptor {
|
||||
const char* name;
|
||||
XPTParamDescriptor* params;
|
||||
const XPTParamDescriptor* params;
|
||||
//XPTParamDescriptor result; // Present on disk, omitted here.
|
||||
uint8_t flags;
|
||||
uint8_t num_args;
|
||||
|
Loading…
Reference in New Issue
Block a user