зеркало из https://github.com/mozilla/gecko-dev.git
Bug 692342 - Introduce deprecated_IsPointer() to handle the cases that are too mucky to figure out right now. r=mrbkap
This commit is contained in:
Родитель
d3ba9f6532
Коммит
c93cd8301e
|
@ -1471,7 +1471,7 @@ pre_call_clean_up:
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const nsXPTType& type = param.GetType();
|
const nsXPTType& type = param.GetType();
|
||||||
if (!type.IsPointer())
|
if (!type.deprecated_IsPointer())
|
||||||
continue;
|
continue;
|
||||||
void* p;
|
void* p;
|
||||||
if (!(p = nativeParams[i].val.p))
|
if (!(p = nativeParams[i].val.p))
|
||||||
|
@ -1488,7 +1488,7 @@ pre_call_clean_up:
|
||||||
|
|
||||||
if (NS_SUCCEEDED(mInfo->GetTypeForParam(methodIndex, ¶m,
|
if (NS_SUCCEEDED(mInfo->GetTypeForParam(methodIndex, ¶m,
|
||||||
1, &datum_type)) &&
|
1, &datum_type)) &&
|
||||||
datum_type.IsPointer() &&
|
datum_type.deprecated_IsPointer() &&
|
||||||
GetArraySizeFromParam(cx, info, param, methodIndex,
|
GetArraySizeFromParam(cx, info, param, methodIndex,
|
||||||
i, nativeParams, &array_count) &&
|
i, nativeParams, &array_count) &&
|
||||||
array_count) {
|
array_count) {
|
||||||
|
@ -1700,7 +1700,7 @@ pre_call_clean_up:
|
||||||
if (!param.IsOut())
|
if (!param.IsOut())
|
||||||
continue;
|
continue;
|
||||||
const nsXPTType& type = param.GetType();
|
const nsXPTType& type = param.GetType();
|
||||||
if (!type.IsPointer())
|
if (!type.deprecated_IsPointer())
|
||||||
continue;
|
continue;
|
||||||
void* p;
|
void* p;
|
||||||
if (!(p = nativeParams[k].val.p))
|
if (!(p = nativeParams[k].val.p))
|
||||||
|
@ -1715,7 +1715,7 @@ pre_call_clean_up:
|
||||||
|
|
||||||
if (NS_SUCCEEDED(mInfo->GetTypeForParam(methodIndex, ¶m,
|
if (NS_SUCCEEDED(mInfo->GetTypeForParam(methodIndex, ¶m,
|
||||||
1, &datum_type)) &&
|
1, &datum_type)) &&
|
||||||
datum_type.IsPointer() &&
|
datum_type.deprecated_IsPointer() &&
|
||||||
GetArraySizeFromParam(cx, info, param, methodIndex,
|
GetArraySizeFromParam(cx, info, param, methodIndex,
|
||||||
k, nativeParams, &array_count) &&
|
k, nativeParams, &array_count) &&
|
||||||
array_count) {
|
array_count) {
|
||||||
|
|
|
@ -77,9 +77,24 @@ public:
|
||||||
bool IsReference() const
|
bool IsReference() const
|
||||||
{return 0 != (XPT_TDP_IS_REFERENCE(flags));}
|
{return 0 != (XPT_TDP_IS_REFERENCE(flags));}
|
||||||
|
|
||||||
bool IsArithmetic() const // terminology from Harbison/Steele
|
// 'Arithmetic' here roughly means that the value is self-contained and
|
||||||
|
// doesn't depend on anything else in memory (ie: not a pointer, not an
|
||||||
|
// XPCOM object, not a jsval, etc).
|
||||||
|
//
|
||||||
|
// Supposedly this terminology comes from Harbison/Steele, but it's still
|
||||||
|
// a rather crappy name. We'd change it if it wasn't used all over the
|
||||||
|
// place in xptcall. :-(
|
||||||
|
bool IsArithmetic() const
|
||||||
{return flags <= T_WCHAR;}
|
{return flags <= T_WCHAR;}
|
||||||
|
|
||||||
|
// We used to abuse 'pointer' flag bit in typelib format quite extensively.
|
||||||
|
// We've gotten rid of most of the cases, but there's still a fair amount
|
||||||
|
// of refactoring to be done in XPCWrappedJSClass before we can safely stop
|
||||||
|
// asking about this. In the mean time, we've got a temporary version of
|
||||||
|
// IsPointer() that should be equivalent to what's in the typelib.
|
||||||
|
bool deprecated_IsPointer() const
|
||||||
|
{return !IsArithmetic() && TagPart() != T_JSVAL;}
|
||||||
|
|
||||||
bool IsInterfacePointer() const
|
bool IsInterfacePointer() const
|
||||||
{ switch (TagPart()) {
|
{ switch (TagPart()) {
|
||||||
default:
|
default:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче