fixes bug 328925 "Replace NS_WARN_IF_FALSE with NS_ASSERTION (where appropriate)" r=dbaron

git-svn-id: svn://10.0.0.236/trunk@193272 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%meer.net
2006-03-30 18:40:56 +00:00
parent 4abf2f1f94
commit 70deb5f58d
57 changed files with 112 additions and 112 deletions

View File

@@ -264,7 +264,7 @@ PyG_Base::MakeInterfaceParam(nsISupports *pis,
// But if it ever triggers, the poor Python code has no real hope
// of returning something useful, so we should at least do our
// best to provide the useful data.
NS_WARN_IF_FALSE( ((piid != NULL) ^ (d != NULL)) == 1, "No information on the interface available - Python's gunna have a hard time doing much with it!");
NS_ASSERTION( ((piid != NULL) ^ (d != NULL)) == 1, "No information on the interface available - Python's gunna have a hard time doing much with it!");
PyObject *obIID = NULL;
PyObject *obISupports = NULL;
PyObject *obParamDesc = NULL;
@@ -306,7 +306,7 @@ PyG_Base::MakeInterfaceParam(nsISupports *pis,
paramIndex);
done:
if (PyErr_Occurred()) {
NS_WARN_IF_FALSE(result==NULL, "Have an error, but also a result!");
NS_ASSERTION(result==NULL, "Have an error, but also a result!");
PyXPCOM_LogError("Wrapping an interface object for the gateway failed\n");
}
Py_XDECREF(obIID);
@@ -389,7 +389,7 @@ PyG_Base::QueryInterface(REFNSIID iid, void** ppv)
Py_DECREF(result);
} else {
NS_ABORT_IF_FALSE(PyErr_Occurred(), "Got NULL result, but no Python error flagged!");
NS_WARN_IF_FALSE(!supports, "Have failure with success flag set!");
NS_ASSERTION(!supports, "Have failure with success flag set!");
PyXPCOM_LogError("The _QueryInterface_ processing failed.\n");
// supports remains false.
// We have reported the error, and are returning to COM,

View File

@@ -1188,7 +1188,7 @@ PRBool PyXPCOM_InterfaceVariantHelper::FillInVariant(const PythonTypeDescriptor
NS_ABORT_IF_FALSE(!td.is_auto_in, "Param is 'auto-in', but we are filling it normally!");
PyObject *val_use = NULL; // a temp object converters can use, and will be DECREF'd
PyObject *val = PySequence_GetItem(m_pyparams, param_index);
NS_WARN_IF_FALSE(val, "Have an 'in' param, but no Python value!");
NS_ASSERTION(val, "Have an 'in' param, but no Python value!");
if (val==NULL) {
PyErr_Format(PyExc_ValueError, "Param %d is marked as 'in', but no value was given", value_index);
return PR_FALSE;
@@ -1397,7 +1397,7 @@ PRBool PyXPCOM_InterfaceVariantHelper::FillInVariant(const PythonTypeDescriptor
case nsXPTType::T_INTERFACE_IS: {
nsIID iid;
nsXPTCVariant &ns_viid = m_var_array[td.argnum];
NS_WARN_IF_FALSE(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!");
NS_ASSERTION(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!");
// This is a pretty serious problem, but not Python's fault!
// Just return an nsISupports and hope the caller does whatever
// QI they need before using it.
@@ -1718,7 +1718,7 @@ PyObject *PyXPCOM_InterfaceVariantHelper::MakeSinglePythonResult(int index)
case nsXPTType::T_INTERFACE_IS: {
nsIID iid;
nsXPTCVariant &ns_viid = m_var_array[td.argnum];
NS_WARN_IF_FALSE(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!");
NS_ASSERTION(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!");
if (XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID) {
nsIID *piid = (nsIID *)ns_viid.val.p;
if (piid==NULL)
@@ -2173,7 +2173,7 @@ PRBool PyXPCOM_GatewayVariantHelper::GetIIDForINTERFACE_ID(int index, const nsII
// in or out, so we will allow it.
nsXPTParamInfo *pi = (nsXPTParamInfo *)m_info->params+index;
nsXPTType typ = pi->GetType();
NS_WARN_IF_FALSE(XPT_TDP_TAG(typ) == nsXPTType::T_IID, "INTERFACE_IS IID param isn't an IID!");
NS_ASSERTION(XPT_TDP_TAG(typ) == nsXPTType::T_IID, "INTERFACE_IS IID param isn't an IID!");
NS_ABORT_IF_FALSE(typ.IsPointer(), "Expecting to re-fill a pointer value.");
if (XPT_TDP_TAG(typ) != nsXPTType::T_IID)
*ppret = &NS_GET_IID(nsISupports);

View File

@@ -234,7 +234,7 @@ void pyxpcom_construct(void)
#ifndef PYXPCOM_USE_PYGILSTATE
PRStatus status;
status = PR_NewThreadPrivateIndex( &tlsIndex, NULL );
NS_WARN_IF_FALSE(status==0, "Could not allocate TLS storage");
NS_ASSERTION(status==0, "Could not allocate TLS storage");
if (NS_FAILED(status)) {
PR_DestroyLock(g_lockMain);
return; // PR_FALSE;

View File

@@ -148,7 +148,7 @@ PyXPCOMMethod_XPTC_InvokeByIndex(PyObject *self, PyObject *args)
// We no longer rely on PyErr_Occurred() for our error state,
// but keeping this assertion can't hurt - it should still always be true!
NS_WARN_IF_FALSE(!PyErr_Occurred(), "Should be no pending Python error!");
NS_ASSERTION(!PyErr_Occurred(), "Should be no pending Python error!");
if (!PyArg_ParseTuple(args, "OiO", &obIS, &index, &obParams))
return NULL;