- From: r.britten at auckland.ac.nz (Randall Britten)
- Subject: [cellml-dev] FW: r1791 - simple_interface_generators/trunk/glue/xpcom
- Date: Wed, 26 Sep 2007 19:27:50 +1200
To Andrew
I think #include <cstdio> is preferred style, since then printf etc are in
namespace std.
Also, wouldn't exit(EXIT_FAILURE) or abort() be preferable?
Regards,
Randall
-----Original Message-----
Subject: r1791 - simple_interface_generators/trunk/glue/xpcom
Modified: simple_interface_generators/trunk/glue/xpcom/P2XFactory.hxx
===================================================================
--- simple_interface_generators/trunk/glue/xpcom/P2XFactory.hxx 2007-09-24
22:56:55 UTC (rev 1790)
+++ simple_interface_generators/trunk/glue/xpcom/P2XFactory.hxx 2007-09-26
01:51:51 UTC (rev 1791)
@@ -5,6 +5,7 @@
#define XPCOMSUPPORT_PRE CDA_IMPORT_PRE
#define XPCOMSUPPORT_POST CDA_IMPORT_POST
#endif
+#include <stdio.h>
class P2XFactory
{
@@ -25,10 +26,30 @@
{
nsCString cs(aName);
if (mEntries == nsnull)
+ {
+ printf("Serious problem with XPCOM bridge: P2XFactory::FindFactory "
+ "called but mEntries is null.\n");
+ char* x = NULL;
+ // Deliberate null deref to ensure we crash here even in production
mode
+ // because we will crash later in any case and this will result in a
more
+ // useful error report.
+ x[0] = 0;
return nsnull;
+ }
Etc.
- [cellml-dev] FW: r1791 - simple_interface_generators/trunk/glue/xpcom, Randall Britten, 09/26/2007
Archive powered by MHonArc 2.6.18.