mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1175513 - Improve code style in nsXPCWrappedJSClass::CleanupOutparams; r=bholley
This commit is contained in:
parent
9343b89dde
commit
d287437ca1
@ -724,8 +724,8 @@ nsXPCWrappedJSClass::CleanupOutparams(JSContext* cx, uint16_t methodIndex,
|
||||
const nsXPTType& type = param.GetType();
|
||||
if (!type.deprecated_IsPointer())
|
||||
continue;
|
||||
void* p;
|
||||
if (!(p = nativeParams[i].val.p))
|
||||
void* p = nativeParams[i].val.p;
|
||||
if (!p)
|
||||
continue;
|
||||
|
||||
// The inOutOnly flag was introduced when consolidating two very
|
||||
@ -733,9 +733,8 @@ nsXPCWrappedJSClass::CleanupOutparams(JSContext* cx, uint16_t methodIndex,
|
||||
// if and why the difference is necessary.
|
||||
if (!inOutOnly || param.IsIn()) {
|
||||
if (type.IsArray()) {
|
||||
void** pp;
|
||||
if (nullptr != (pp = *((void***)p))) {
|
||||
|
||||
void** pp = *static_cast<void***>(p);
|
||||
if (pp) {
|
||||
// we need to get the array length and iterate the items
|
||||
uint32_t array_count;
|
||||
nsXPTType datum_type;
|
||||
@ -753,10 +752,11 @@ nsXPCWrappedJSClass::CleanupOutparams(JSContext* cx, uint16_t methodIndex,
|
||||
// always release the array if it is inout
|
||||
free(pp);
|
||||
}
|
||||
} else
|
||||
CleanupPointerTypeObject(type, (void**)p);
|
||||
} else {
|
||||
CleanupPointerTypeObject(type, static_cast<void**>(p));
|
||||
}
|
||||
}
|
||||
*((void**)p) = nullptr;
|
||||
*static_cast<void**>(p) = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user