Skip to content
Browse files

Bug 801553 - Replace mdb_err by nsresult. r=standard8

  • Loading branch information...
1 parent 8a43504 commit c8822ed9f0b5d9fe0a0cb0b9c26e105f6d5730d9 Cykesiopka committed Feb 27, 2014
View
3 db/mork/public/mdb.h
@@ -80,9 +80,6 @@ typedef mdb_u4 mdb_percent; // 0..100, with values >100 same as 100
typedef mdb_u1 mdb_priority; // 0..9, for a total of ten different values
-// temporary substitute for NS_RESULT, for mdb.h standalone compilation:
-typedef nsresult mdb_err; // equivalent to NS_RESULT
-
// sequence position is signed; negative is useful to mean "before first":
typedef mdb_i4 mdb_pos; // signed zero-based ordinal collection position
View
16 db/mork/src/morkCellObject.cpp
@@ -216,7 +216,7 @@ morkCellObject::AcquireCellHandle(morkEnv* ev)
morkEnv*
morkCellObject::CanUseCell(nsIMdbEnv* mev, mork_bool inMutable,
- mdb_err* outErr, morkCell** outCell)
+ nsresult* outErr, morkCell** outCell)
{
morkEnv* outEnv = 0;
morkCell* cell = 0;
@@ -300,7 +300,7 @@ NS_IMETHODIMP morkCellObject::GetBlobFill(nsIMdbEnv* mev,
NS_IMETHODIMP morkCellObject::SetYarn(nsIMdbEnv* mev,
const mdbYarn* inYarn)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
@@ -330,7 +330,7 @@ NS_IMETHODIMP morkCellObject::SetYarn(nsIMdbEnv* mev,
NS_IMETHODIMP morkCellObject::GetYarn(nsIMdbEnv* mev,
mdbYarn* outYarn)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
@@ -348,7 +348,7 @@ NS_IMETHODIMP morkCellObject::GetYarn(nsIMdbEnv* mev,
NS_IMETHODIMP morkCellObject::AliasYarn(nsIMdbEnv* mev,
mdbYarn* outYarn)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
@@ -378,7 +378,7 @@ NS_IMETHODIMP morkCellObject::SetColumn(nsIMdbEnv* mev, mdb_column inColumn)
NS_IMETHODIMP morkCellObject::GetColumn(nsIMdbEnv* mev, mdb_column* outColumn)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_column col = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
@@ -410,7 +410,7 @@ NS_IMETHODIMP morkCellObject::GetCellInfo( // all cell metainfo except actual c
NS_IMETHODIMP morkCellObject::GetRow(nsIMdbEnv* mev, // parent row for this cell
nsIMdbRow** acqRow)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
@@ -429,7 +429,7 @@ NS_IMETHODIMP morkCellObject::GetRow(nsIMdbEnv* mev, // parent row for this cell
NS_IMETHODIMP morkCellObject::GetPort(nsIMdbEnv* mev, // port containing cell
nsIMdbPort** acqPort)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbPort* outPort = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
@@ -459,7 +459,7 @@ NS_IMETHODIMP morkCellObject::HasAnyChild( // does cell have a child instead of
mdbOid* outOid, // out id of row or table (or unbound if no child)
mdb_bool* outIsRow) // nonzero if child is a row (rather than a table)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_bool isRow = morkBool_kFalse;
outOid->mOid_Scope = 0;
outOid->mOid_Id = morkId_kMinusOne;
View
2 db/mork/src/morkCellObject.h
@@ -144,7 +144,7 @@ class morkCellObject : public morkObject, public nsIMdbCell { // blob attribute
public: // other cell node methods
morkEnv* CanUseCell(nsIMdbEnv* mev, mork_bool inMutable,
- mdb_err* outErr, morkCell** outCell) ;
+ nsresult* outErr, morkCell** outCell);
mork_bool ResyncWithRow(morkEnv* ev); // return ev->Good()
morkAtom* GetCellAtom(morkEnv* ev) const;
View
24 db/mork/src/morkFactory.cpp
@@ -140,7 +140,7 @@ morkFactory::CloseFactory(morkEnv* ev) /*i*/ // called by CloseMorkNode();
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
-morkEnv* morkFactory::GetInternalFactoryEnv(mdb_err* outErr)
+morkEnv* morkFactory::GetInternalFactoryEnv(nsresult* outErr)
{
morkEnv* outEnv = 0;
if (IsNode() && IsOpenNode() && IsFactory() )
@@ -179,7 +179,7 @@ morkFactory::OpenOldFile(nsIMdbEnv* mev, nsIMdbHeap* ioHeap,
// files must be opened is considered a subclass specific detail, and
// other portions or Mork source code don't want to know how it's done.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
morkFile* file = nullptr;
if ( ev )
@@ -208,7 +208,7 @@ morkFactory::CreateNewFile(nsIMdbEnv* mev, nsIMdbHeap* ioHeap,
// files must be opened is considered a subclass specific detail, and
// other portions or Mork source code don't want to know how it's done.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
morkFile* file = nullptr;
if ( ev )
@@ -234,7 +234,7 @@ NS_IMETHODIMP
morkFactory::MakeEnv(nsIMdbHeap* ioHeap, nsIMdbEnv** acqEnv)
// ioHeap can be nil, causing a MakeHeap() style heap instance to be used
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbEnv* outEnv = 0;
mork_bool ownsHeap = (ioHeap == 0);
if ( !ioHeap )
@@ -273,7 +273,7 @@ morkFactory::MakeEnv(nsIMdbHeap* ioHeap, nsIMdbEnv** acqEnv)
NS_IMETHODIMP
morkFactory::MakeHeap(nsIMdbEnv* mev, nsIMdbHeap** acqHeap)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbHeap* outHeap = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -310,7 +310,7 @@ morkFactory::CanOpenFilePort(
mdb_bool* outCanOpen, // whether OpenFilePort() might succeed
mdbYarn* outFormatVersion)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
if ( outFormatVersion )
{
outFormatVersion->mYarn_Fill = 0;
@@ -346,7 +346,7 @@ morkFactory::OpenFilePort(
{
NS_ASSERTION(false, "this doesn't look implemented");
MORK_USED_1(ioHeap);
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbThumb* outThumb = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -372,7 +372,7 @@ morkFactory::ThumbToOpenPort( // redeeming a completed thumb from OpenFilePort()
nsIMdbThumb* ioThumb, // thumb from OpenFilePort() with done status
nsIMdbPort** acqPort)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbPort* outPort = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -457,7 +457,7 @@ morkFactory::CanOpenFileStore(
{
outFormatVersion->mYarn_Fill = 0;
}
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -490,7 +490,7 @@ morkFactory::OpenFileStore( // open an existing database
const mdbOpenPolicy* inOpenPolicy, // runtime policies for using db
nsIMdbThumb** acqThumb)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbThumb* outThumb = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -536,7 +536,7 @@ morkFactory::ThumbToOpenStore( // redeem completed thumb from OpenFileStore()
nsIMdbThumb* ioThumb, // thumb from OpenFileStore() with done status
nsIMdbStore** acqStore)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbStore* outStore = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -574,7 +574,7 @@ morkFactory::CreateNewFileStore( // create a new db with minimal content
const mdbOpenPolicy* inOpenPolicy, // runtime policies for using db
nsIMdbStore** acqStore)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbStore* outStore = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
View
2 db/mork/src/morkFactory.h
@@ -185,7 +185,7 @@ class morkFactory : public morkObject, public nsIMdbFactory { // nsIMdbObject
public: // other factory methods
void NonFactoryTypeError(morkEnv* ev);
- morkEnv* GetInternalFactoryEnv(mdb_err* outErr);
+ morkEnv* GetInternalFactoryEnv(nsresult* outErr);
mork_bool CanOpenMorkTextFile(morkEnv* ev, nsIMdbFile* ioFile);
public: // typesafe refcounting inlines calling inherited morkNode methods
View
8 db/mork/src/morkFile.cpp
@@ -260,7 +260,7 @@ morkFile::WriteNewlines(morkEnv* ev, mork_count inNewlines)
NS_IMETHODIMP
morkFile::Eof(nsIMdbEnv* mev, mdb_pos* outPos)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_pos pos = -1;
morkEnv *ev = morkEnv::FromMdbEnv(mev);
pos = Length(ev);
@@ -290,7 +290,7 @@ NS_IMETHODIMP
morkFile::Put(nsIMdbEnv* mev, const void* inBuf, mdb_size inSize,
mdb_pos inPos, mdb_size* outActualSize)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
*outActualSize = 0;
morkEnv *ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -309,7 +309,7 @@ morkFile::Put(nsIMdbEnv* mev, const void* inBuf, mdb_size inSize,
NS_IMETHODIMP
morkFile::Path(nsIMdbEnv* mev, mdbYarn* outFilePath)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
if ( outFilePath )
outFilePath->mYarn_Fill = 0;
morkEnv *ev = morkEnv::FromMdbEnv(mev);
@@ -329,7 +329,7 @@ morkFile::Path(nsIMdbEnv* mev, mdbYarn* outFilePath)
NS_IMETHODIMP
morkFile::Thief(nsIMdbEnv* mev, nsIMdbFile** acqThief)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbFile* outThief = 0;
morkEnv *ev = morkEnv::FromMdbEnv(mev);
if ( ev )
View
52 db/mork/src/morkHandle.cpp
@@ -202,7 +202,7 @@ morkObject* morkHandle::GetGoodHandleObject(morkEnv* ev,
morkEnv*
morkHandle::CanUseHandle(nsIMdbEnv* mev, mork_bool inMutable,
- mork_bool inClosedOkay, mdb_err* outErr) const
+ mork_bool inClosedOkay, nsresult* outErr) const
{
morkEnv* outEnv = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
@@ -223,10 +223,10 @@ morkHandle::CanUseHandle(nsIMdbEnv* mev, mork_bool inMutable,
// { ===== begin nsIMdbObject methods =====
// { ----- begin attribute methods -----
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkHandle::Handle_IsFrozenMdbObject(nsIMdbEnv* mev, mdb_bool* outIsReadonly)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_bool readOnly = mdbBool_kTrue;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse,
@@ -247,10 +247,10 @@ morkHandle::Handle_IsFrozenMdbObject(nsIMdbEnv* mev, mdb_bool* outIsReadonly)
// } ----- end attribute methods -----
// { ----- begin factory methods -----
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkHandle::Handle_GetMdbFactory(nsIMdbEnv* mev, nsIMdbFactory** acqFactory)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbFactory* handle = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse,
@@ -278,11 +278,11 @@ morkHandle::Handle_GetMdbFactory(nsIMdbEnv* mev, nsIMdbFactory** acqFactory)
// } ----- end factory methods -----
// { ----- begin ref counting for well-behaved cyclic graphs -----
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkHandle::Handle_GetWeakRefCount(nsIMdbEnv* mev, // weak refs
mdb_count* outCount)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_count count = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse,
@@ -299,11 +299,11 @@ morkHandle::Handle_GetWeakRefCount(nsIMdbEnv* mev, // weak refs
return outErr;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkHandle::Handle_GetStrongRefCount(nsIMdbEnv* mev, // strong refs
mdb_count* outCount)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_count count = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse,
@@ -321,11 +321,11 @@ morkHandle::Handle_GetStrongRefCount(nsIMdbEnv* mev, // strong refs
return outErr;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkHandle::Handle_AddWeakRef(nsIMdbEnv* mev)
{
- mdb_err outErr = NS_OK;
-
+ nsresult outErr = NS_OK;
+
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse,
/*inClosedOkay*/ morkBool_kTrue, &outErr);
if ( ev )
@@ -336,11 +336,11 @@ morkHandle::Handle_AddWeakRef(nsIMdbEnv* mev)
return outErr;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkHandle::Handle_AddStrongRef(nsIMdbEnv* mev)
{
- mdb_err outErr = NS_OK;
-
+ nsresult outErr = NS_OK;
+
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse,
/*inClosedOkay*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -352,11 +352,11 @@ morkHandle::Handle_AddStrongRef(nsIMdbEnv* mev)
return outErr;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkHandle::Handle_CutWeakRef(nsIMdbEnv* mev)
{
- mdb_err outErr = NS_OK;
-
+ nsresult outErr = NS_OK;
+
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse,
/*inClosedOkay*/ morkBool_kTrue, &outErr);
if ( ev )
@@ -367,10 +367,10 @@ morkHandle::Handle_CutWeakRef(nsIMdbEnv* mev)
return outErr;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkHandle::Handle_CutStrongRef(nsIMdbEnv* mev)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse,
/*inClosedOkay*/ morkBool_kTrue, &outErr);
if ( ev )
@@ -381,16 +381,16 @@ morkHandle::Handle_CutStrongRef(nsIMdbEnv* mev)
return outErr;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkHandle::Handle_CloseMdbObject(nsIMdbEnv* mev)
// called at strong refs zero
{
// if only one ref, Handle_CutStrongRef will clean up better.
if (mNode_Uses == 1)
return Handle_CutStrongRef(mev);
- mdb_err outErr = NS_OK;
-
+ nsresult outErr = NS_OK;
+
if ( this->IsNode() && this->IsOpenNode() )
{
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse,
@@ -408,12 +408,12 @@ morkHandle::Handle_CloseMdbObject(nsIMdbEnv* mev)
return outErr;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkHandle::Handle_IsOpenMdbObject(nsIMdbEnv* mev, mdb_bool* outOpen)
{
MORK_USED_1(mev);
- mdb_err outErr = NS_OK;
-
+ nsresult outErr = NS_OK;
+
MORK_ASSERT(outOpen);
if ( outOpen )
*outOpen = this->IsOpenNode();
View
24 db/mork/src/morkHandle.h
@@ -110,23 +110,23 @@ class morkHandle : public morkNode {
public: // interface supporting mdbObject methods
morkEnv* CanUseHandle(nsIMdbEnv* mev, mork_bool inMutable,
- mork_bool inClosedOkay, mdb_err* outErr) const;
+ mork_bool inClosedOkay, nsresult* outErr) const;
// { ----- begin mdbObject style methods -----
- mdb_err Handle_IsFrozenMdbObject(nsIMdbEnv* ev, mdb_bool* outIsReadonly);
+ nsresult Handle_IsFrozenMdbObject(nsIMdbEnv* ev, mdb_bool* outIsReadonly);
- mdb_err Handle_GetMdbFactory(nsIMdbEnv* ev, nsIMdbFactory** acqFactory);
- mdb_err Handle_GetWeakRefCount(nsIMdbEnv* ev, mdb_count* outCount);
- mdb_err Handle_GetStrongRefCount(nsIMdbEnv* ev, mdb_count* outCount);
+ nsresult Handle_GetMdbFactory(nsIMdbEnv* ev, nsIMdbFactory** acqFactory);
+ nsresult Handle_GetWeakRefCount(nsIMdbEnv* ev, mdb_count* outCount);
+ nsresult Handle_GetStrongRefCount(nsIMdbEnv* ev, mdb_count* outCount);
- mdb_err Handle_AddWeakRef(nsIMdbEnv* ev);
- mdb_err Handle_AddStrongRef(nsIMdbEnv* ev);
+ nsresult Handle_AddWeakRef(nsIMdbEnv* ev);
+ nsresult Handle_AddStrongRef(nsIMdbEnv* ev);
- mdb_err Handle_CutWeakRef(nsIMdbEnv* ev);
- mdb_err Handle_CutStrongRef(nsIMdbEnv* ev);
-
- mdb_err Handle_CloseMdbObject(nsIMdbEnv* ev);
- mdb_err Handle_IsOpenMdbObject(nsIMdbEnv* ev, mdb_bool* outOpen);
+ nsresult Handle_CutWeakRef(nsIMdbEnv* ev);
+ nsresult Handle_CutStrongRef(nsIMdbEnv* ev);
+
+ nsresult Handle_CloseMdbObject(nsIMdbEnv* ev);
+ nsresult Handle_IsOpenMdbObject(nsIMdbEnv* ev, mdb_bool* outOpen);
// } ----- end mdbObject style methods -----
public: // typesafe refcounting inlines calling inherited morkNode methods
View
10 db/mork/src/morkNode.cpp
@@ -208,15 +208,15 @@ morkNode::CloseMdbObject(nsIMdbEnv* mev)
return morkNode::CloseMdbObject((morkEnv *) mev);
}
-mdb_err morkNode::CloseMdbObject(morkEnv *ev)
+nsresult morkNode::CloseMdbObject(morkEnv *ev)
{
// if only one ref, Handle_CutStrongRef will clean up better.
if (mNode_Uses == 1)
- // XXX Casting mork_uses to mdb_err
- return static_cast<mdb_err>(CutStrongRef(ev));
+ // XXX Casting mork_uses to nsresult
+ return static_cast<nsresult>(CutStrongRef(ev));
+
+ nsresult outErr = NS_OK;
- mdb_err outErr = NS_OK;
-
if ( IsNode() && IsOpenNode() )
{
if ( ev )
View
2 db/mork/src/morkNode.h
@@ -183,7 +183,7 @@ class morkNode /*: public nsISupports */ { // base class for constructing Mork o
public: // morkNode construction
morkNode(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap);
void CloseNode(morkEnv* ev); // called by CloseMorkNode();
- mdb_err CloseMdbObject(morkEnv *ev);
+ nsresult CloseMdbObject(morkEnv *ev);
NS_IMETHOD CloseMdbObject(nsIMdbEnv *ev);
private: // copying is not allowed
morkNode(const morkNode& other);
View
16 db/mork/src/morkPortTableCursor.cpp
@@ -89,8 +89,8 @@ morkPortTableCursor::morkPortTableCursor(morkEnv* ev,
NS_IMPL_ISUPPORTS_INHERITED1(morkPortTableCursor, morkCursor, nsIMdbPortTableCursor)
morkEnv*
-morkPortTableCursor::CanUsePortTableCursor(nsIMdbEnv* mev,
- mork_bool inMutable, mdb_err* outErr) const
+morkPortTableCursor::CanUsePortTableCursor(nsIMdbEnv* mev, mork_bool inMutable,
+ nsresult* outErr) const
{
morkEnv* outEnv = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
@@ -326,7 +326,7 @@ morkPortTableCursor::SetPort(nsIMdbEnv* mev, nsIMdbPort* ioPort)
NS_IMETHODIMP
morkPortTableCursor::GetPort(nsIMdbEnv* mev, nsIMdbPort** acqPort)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbPort* outPort = 0;
morkEnv* ev =
this->CanUsePortTableCursor(mev, /*inMutable*/ morkBool_kFalse, &outErr);
@@ -345,7 +345,7 @@ NS_IMETHODIMP
morkPortTableCursor::SetRowScope(nsIMdbEnv* mev, // sets pos to -1
mdb_scope inRowScope)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev =
this->CanUsePortTableCursor(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -361,7 +361,7 @@ morkPortTableCursor::SetRowScope(nsIMdbEnv* mev, // sets pos to -1
NS_IMETHODIMP
morkPortTableCursor::GetRowScope(nsIMdbEnv* mev, mdb_scope* outRowScope)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_scope rowScope = 0;
morkEnv* ev =
this->CanUsePortTableCursor(mev, /*inMutable*/ morkBool_kFalse, &outErr);
@@ -379,7 +379,7 @@ NS_IMETHODIMP
morkPortTableCursor::SetTableKind(nsIMdbEnv* mev, // sets pos to -1
mdb_kind inTableKind)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev =
this->CanUsePortTableCursor(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -396,7 +396,7 @@ NS_IMETHODIMP
morkPortTableCursor::GetTableKind(nsIMdbEnv* mev, mdb_kind* outTableKind)
// setting table kind to zero iterates over all table kinds in row scope
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_kind tableKind = 0;
morkEnv* ev =
this->CanUsePortTableCursor(mev, /*inMutable*/ morkBool_kFalse, &outErr);
@@ -416,7 +416,7 @@ morkPortTableCursor::NextTable( // get table at next position in the db
nsIMdbEnv* mev, // context
nsIMdbTable** acqTable)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbTable* outTable = 0;
morkEnv* ev =
CanUsePortTableCursor(mev, /*inMutable*/ morkBool_kFalse, &outErr);
View
6 db/mork/src/morkPortTableCursor.h
@@ -114,10 +114,10 @@ class morkPortTableCursor : public morkCursor, public nsIMdbPortTableCursor { //
static void NilCursorStoreError(morkEnv* ev);
static void NonPortTableCursorTypeError(morkEnv* ev);
- morkEnv* CanUsePortTableCursor(nsIMdbEnv* mev,
- mork_bool inMutable, mdb_err* outErr) const;
+ morkEnv* CanUsePortTableCursor(nsIMdbEnv* mev, mork_bool inMutable,
+ nsresult* outErr) const;
+
-
morkRowSpace* NextSpace(morkEnv* ev);
morkTable* NextTable(morkEnv* ev);
View
6 db/mork/src/morkRowCellCursor.cpp
@@ -142,7 +142,7 @@ morkRowCellCursor::NonRowCellCursorTypeError(morkEnv* ev)
NS_IMETHODIMP
morkRowCellCursor::SetRow(nsIMdbEnv* mev, nsIMdbRow* ioRow)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkRow* row = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -171,7 +171,7 @@ morkRowCellCursor::SetRow(nsIMdbEnv* mev, nsIMdbRow* ioRow)
NS_IMETHODIMP
morkRowCellCursor::GetRow(nsIMdbEnv* mev, nsIMdbRow** acqRow)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -196,7 +196,7 @@ morkRowCellCursor::MakeCell( // get cell at current pos in the row
mdb_pos* outPos, // position of cell in row sequence
nsIMdbCell** acqCell)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbCell* outCell = 0;
mdb_pos pos = 0;
mdb_column col = 0;
View
36 db/mork/src/morkRowObject.cpp
@@ -93,7 +93,7 @@ NS_IMETHODIMP
morkRowObject::GetSeed(nsIMdbEnv* mev,
mdb_seed* outSeed)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -106,7 +106,7 @@ NS_IMETHODIMP
morkRowObject::GetCount(nsIMdbEnv* mev,
mdb_count* outCount)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -120,7 +120,7 @@ NS_IMETHODIMP
morkRowObject::GetPort(nsIMdbEnv* mev,
nsIMdbPort** acqPort)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbPort* outPort = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -197,7 +197,7 @@ morkRowObject::GetRowCellCursor( // make a cursor starting iteration at inCellPo
mdb_pos inPos, // zero-based ordinal position of cell in row
nsIMdbRowCellCursor** acqCursor)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
nsIMdbRowCellCursor* outCursor = 0;
if ( ev )
@@ -227,7 +227,7 @@ morkRowObject::AddColumn( // make sure a particular column is inside row
mdb_column inColumn, // column to add
const mdbYarn* inYarn)
{
- mdb_err outErr = NS_ERROR_FAILURE;
+ nsresult outErr = NS_ERROR_FAILURE;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -244,7 +244,7 @@ morkRowObject::CutColumn( // make sure a column is absent from the row
nsIMdbEnv* mev, // context
mdb_column inColumn)
{
- mdb_err outErr = NS_ERROR_FAILURE;
+ nsresult outErr = NS_ERROR_FAILURE;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -258,7 +258,7 @@ NS_IMETHODIMP
morkRowObject::CutAllColumns( // remove all columns from the row
nsIMdbEnv* mev)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -276,7 +276,7 @@ morkRowObject::NewCell( // get cell for specified column, or add new one
mdb_column inColumn, // column to add
nsIMdbCell** acqCell)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -307,7 +307,7 @@ morkRowObject::AddCell( // copy a cell from another row to this row
nsIMdbEnv* mev, // context
const nsIMdbCell* inCell)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -354,7 +354,7 @@ morkRowObject::GetCell( // find a cell in this row
mdb_column inColumn, // column to find
nsIMdbCell** acqCell)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbCell* outCell = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
@@ -383,7 +383,7 @@ NS_IMETHODIMP
morkRowObject::EmptyAllCells( // make all cells in row empty of content
nsIMdbEnv* mev)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -400,7 +400,7 @@ morkRowObject::AddRow( // add all cells in another row to this one
nsIMdbEnv* mev, // context
nsIMdbRow* ioSourceRow)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -419,7 +419,7 @@ morkRowObject::SetRow( // make exact duplicate of another row
nsIMdbEnv* mev, // context
nsIMdbRow* ioSourceRow)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -442,7 +442,7 @@ morkRowObject::SetCellYarn( // synonym for AddColumn()
mdb_column inColumn, // column to add
const mdbYarn* inYarn)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -460,7 +460,7 @@ morkRowObject::GetCellYarn(
mdbYarn* outYarn) // writes some yarn slots
// copy content into the yarn buffer, and update mYarn_Fill and mYarn_Form
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -482,7 +482,7 @@ morkRowObject::AliasCellYarn(
mdb_column inColumn, // column to alias
mdbYarn* outYarn) // writes ALL yarn slots
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -514,7 +514,7 @@ morkRowObject::NextCellYarn(nsIMdbEnv* mev, // iterative version of GetCellYarn(
// and the iteration has ended, ioColumn will return a zero token again.
// So iterating over cells starts and ends with a zero column token.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -538,7 +538,7 @@ morkRowObject::SeekCellYarn( // resembles nsIMdbRowCellCursor::SeekCell()
// able to ignore outYarn when the pointer is nil; please do not crash.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
View
66 db/mork/src/morkStore.cpp
@@ -1358,7 +1358,7 @@ morkStore::IsOpenMdbObject(nsIMdbEnv* mev, mdb_bool* outOpen)
NS_IMETHODIMP
morkStore::GetIsPortReadonly(nsIMdbEnv* mev, mdb_bool* outBool)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_bool isReadOnly = morkBool_kFalse;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1372,8 +1372,8 @@ morkStore::GetIsPortReadonly(nsIMdbEnv* mev, mdb_bool* outBool)
}
morkEnv*
-morkStore::CanUseStore(nsIMdbEnv* mev,
- mork_bool inMutable, mdb_err* outErr) const
+morkStore::CanUseStore(nsIMdbEnv* mev, mork_bool inMutable,
+ nsresult* outErr) const
{
morkEnv* outEnv = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
@@ -1401,7 +1401,7 @@ morkStore::GetIsStore(nsIMdbEnv* mev, mdb_bool* outBool)
NS_IMETHODIMP
morkStore::GetIsStoreAndDirty(nsIMdbEnv* mev, mdb_bool* outBool)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_bool isStoreAndDirty = morkBool_kFalse;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1419,7 +1419,7 @@ morkStore::GetUsagePolicy(nsIMdbEnv* mev,
mdbUsagePolicy* ioUsagePolicy)
{
MORK_USED_1(ioUsagePolicy);
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
@@ -1434,7 +1434,7 @@ morkStore::SetUsagePolicy(nsIMdbEnv* mev,
const mdbUsagePolicy* inUsagePolicy)
{
MORK_USED_1(inUsagePolicy);
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
@@ -1451,7 +1451,7 @@ morkStore::IdleMemoryPurge( // do memory management already scheduled
nsIMdbEnv* mev, // context
mdb_size* outEstimatedBytesFreed) // approximate bytes actually freed
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_size estimatedBytesFreed = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1471,7 +1471,7 @@ morkStore::SessionMemoryPurge( // request specific footprint decrease
mdb_size* outEstimatedBytesFreed) // approximate bytes actually freed
{
MORK_USED_1(inDesiredBytesFreed);
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_size estimate = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1489,7 +1489,7 @@ morkStore::PanicMemoryPurge( // desperately free all possible memory
nsIMdbEnv* mev, // context
mdb_size* outEstimatedBytesFreed) // approximate bytes actually freed
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_size estimate = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1510,7 +1510,7 @@ morkStore::GetPortFilePath(
mdbYarn* outFilePath, // name of file holding port content
mdbYarn* outFormatVersion) // file format description
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
if ( outFormatVersion )
outFormatVersion->mYarn_Fill = 0;
if ( outFilePath )
@@ -1533,7 +1533,7 @@ morkStore::GetPortFile(
nsIMdbEnv* mev, // context
nsIMdbFile** acqFile) // acquire file used by port or store
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
if ( acqFile )
*acqFile = 0;
@@ -1565,7 +1565,7 @@ morkStore::BestExportFormat( // determine preferred export format
nsIMdbEnv* mev, // context
mdbYarn* outFormatVersion) // file format description
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
if ( outFormatVersion )
outFormatVersion->mYarn_Fill = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
@@ -1585,7 +1585,7 @@ morkStore::CanExportToFormat( // can export content in given specific format?
{
MORK_USED_1(inFormatVersion);
mdb_bool canExport = morkBool_kFalse;
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
@@ -1607,7 +1607,7 @@ morkStore::ExportToFormat( // export content in given specific format
// Call nsIMdbThumb::DoMore() until done, or until the thumb is broken, and
// then the export will be finished.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbThumb* outThumb = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1635,7 +1635,7 @@ morkStore::TokenToString( // return a string name for an integer token
mdb_token inToken, // token for inTokenName inside this port
mdbYarn* outTokenName) // the type of table to access
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
@@ -1655,7 +1655,7 @@ morkStore::StringToToken( // return an integer token for scope name
// association of inTokenName with a new integer token if possible.
// But a readonly port will return zero for an unknown scope name.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_token token = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1678,7 +1678,7 @@ morkStore::QueryToken( // like StringToToken(), but without adding
// but unlike StringToToken(), will not assign a new token if not
// already in use.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_token token = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1701,7 +1701,7 @@ morkStore::HasRow( // contains a row with the specified oid?
const mdbOid* inOid, // hypothetical row oid
mdb_bool* outHasRow) // whether GetRow() might succeed
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_bool hasRow = morkBool_kFalse;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1723,7 +1723,7 @@ morkStore::GetRow( // access one row with specific oid
const mdbOid* inOid, // hypothetical row oid
nsIMdbRow** acqRow) // acquire specific row (or null)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1745,7 +1745,7 @@ morkStore::GetRowRefCount( // get number of tables that contain a row
const mdbOid* inOid, // hypothetical row oid
mdb_count* outRefCount) // number of tables containing inRowKey
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_count count = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1800,7 +1800,7 @@ morkStore::FindRow(nsIMdbEnv* mev, // search for row with matching cell
// of a given key need be remembered. Implementors are not required to sort
// all rows by the specified column.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
mdbOid rowOid;
rowOid.mOid_Scope = 0;
@@ -1835,7 +1835,7 @@ morkStore::HasTable( // supports a table with the specified oid?
const mdbOid* inOid, // hypothetical table oid
mdb_bool* outHasTable) // whether GetTable() might succeed
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mork_bool hasTable = morkBool_kFalse;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1857,7 +1857,7 @@ morkStore::GetTable( // access one table with specific oid
const mdbOid* inOid, // hypothetical table oid
nsIMdbTable** acqTable) // acquire specific table (or null)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbTable* outTable = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1880,7 +1880,7 @@ morkStore::HasTableKind( // supports a table of the specified type?
mdb_count* outTableCount, // current number of such tables
mdb_bool* outSupportsTable) // whether GetTableKind() might succeed
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
@@ -1900,7 +1900,7 @@ morkStore::GetTableKind( // access one (random) table of specific type
mdb_bool* outMustBeUnique, // whether port can hold only one of these
nsIMdbTable** acqTable) // acquire scoped collection of rows
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbTable* outTable = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1923,7 +1923,7 @@ morkStore::GetPortTableCursor( // get cursor for all tables of specific type
mdb_kind inTableKind, // the type of table to access
nsIMdbPortTableCursor** acqCursor) // all such tables in the port
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbPortTableCursor* outCursor = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -1953,7 +1953,7 @@ morkStore::ShouldCompress( // store wastes at least inPercentWaste?
{
mdb_percent actualWaste = 0;
mdb_bool shouldCompress = morkBool_kFalse;
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
@@ -1982,7 +1982,7 @@ morkStore::NewTable( // make one new table of specific type
const mdbOid* inOptionalMetaRowOid, // can be nil to avoid specifying
nsIMdbTable** acqTable) // acquire scoped collection of rows
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbTable* outTable = 0;
morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -2007,7 +2007,7 @@ morkStore::NewTableWithOid( // make one new table of specific type
const mdbOid* inOptionalMetaRowOid, // can be nil to avoid specifying
nsIMdbTable** acqTable) // acquire scoped collection of rows
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbTable* outTable = 0;
morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -2067,7 +2067,7 @@ morkStore::NewRowWithOid(nsIMdbEnv* mev, // new row w/ caller assigned oid
const mdbOid* inOid, // caller assigned oid
nsIMdbRow** acqRow) // create new row
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -2090,7 +2090,7 @@ morkStore::NewRow(nsIMdbEnv* mev, // new row with db assigned oid
// Note this row must be added to some table or cell child before the
// store is closed in order to make this row persist across sesssions.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
@@ -2142,7 +2142,7 @@ morkStore::ShareAtomColumnsHint( // advise re shared col content atomizing
const mdbColumnSet* inColumnSet) // cols desired tokenized together
{
MORK_USED_2(inColumnSet,inScopeHint);
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
@@ -2158,7 +2158,7 @@ morkStore::AvoidAtomColumnsHint( // advise col w/ poor atomizing prospects
const mdbColumnSet* inColumnSet) // cols with poor atomizing prospects
{
MORK_USED_1(inColumnSet);
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
View
3 db/mork/src/morkStore.h
@@ -626,7 +626,8 @@ class morkStore : public morkObject, public nsIMdbStore {
morkStore& operator=(const morkStore& other);
public: // dynamic type identification
- morkEnv* CanUseStore(nsIMdbEnv* mev, mork_bool inMutable, mdb_err* outErr) const;
+ morkEnv* CanUseStore(nsIMdbEnv* mev, mork_bool inMutable,
+ nsresult* outErr) const;
mork_bool IsStore() const
{ return IsNode() && mNode_Derived == morkDerived_kStore; }
// } ===== end morkNode methods =====
View
40 db/mork/src/morkTable.cpp
@@ -176,7 +176,7 @@ NS_IMETHODIMP
morkTable::GetSeed(nsIMdbEnv* mev,
mdb_seed* outSeed) // member change count
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -259,7 +259,7 @@ morkTable::DropActivity( // tell collection usage no longer expected
NS_IMETHODIMP
morkTable::SetTablePriority(nsIMdbEnv* mev, mdb_priority inPrio)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -275,7 +275,7 @@ morkTable::SetTablePriority(nsIMdbEnv* mev, mdb_priority inPrio)
NS_IMETHODIMP
morkTable::GetTablePriority(nsIMdbEnv* mev, mdb_priority* outPrio)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mork_priority prio = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -305,7 +305,7 @@ morkTable:: GetTableBeVerbose(nsIMdbEnv* mev, mdb_bool* outBeVerbose)
NS_IMETHODIMP
morkTable::SetTableBeVerbose(nsIMdbEnv* mev, mdb_bool inBeVerbose)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -338,7 +338,7 @@ morkTable::GetTableKind(nsIMdbEnv* mev, mdb_kind* outTableKind)
NS_IMETHODIMP
morkTable::GetRowScope(nsIMdbEnv* mev, mdb_scope* outRowScope)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_scope rowScope = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -383,7 +383,7 @@ morkTable::GetMetaRow( nsIMdbEnv* mev,
// it will be different from inOptionalMetaRowOid when the meta row was
// already given a different oid earlier.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -418,7 +418,7 @@ morkTable::GetTableRowCursor( // make a cursor, starting iteration at inRowPos
mdb_pos inRowPos, // zero-based ordinal position of row in table
nsIMdbTableRowCursor** acqCursor) // acquire new cursor instance
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbTableRowCursor* outCursor = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -449,7 +449,7 @@ morkTable::PosToOid( // get row member for a table position
mdb_pos inRowPos, // zero-based ordinal position of row in table
mdbOid* outOid) // row oid at the specified position
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdbOid roid;
roid.mOid_Scope = 0;
roid.mOid_Id = (mork_id) -1;
@@ -474,7 +474,7 @@ morkTable::OidToPos( // test for the table position of a row member
const mdbOid* inOid, // row to find in table
mdb_pos* outPos) // zero-based ordinal position of row in table
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -492,7 +492,7 @@ morkTable::PosToRow( // get row member for a table position
mdb_pos inRowPos, // zero-based ordinal position of row in table
nsIMdbRow** acqRow) // acquire row at table position inRowPos
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -514,7 +514,7 @@ morkTable::RowToPos( // test for the table position of a row member
nsIMdbRow* ioRow, // row to find in table
mdb_pos* outPos) // zero-based ordinal position of row in table
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mork_pos pos = -1;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -547,7 +547,7 @@ morkTable::HasOid( // test for the table position of a row member
const mdbOid* inOid, // row to find in table
mdb_bool* outHasOid) // whether inOid is a member row
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -563,7 +563,7 @@ morkTable::CutOid( // make sure the row with inOid is not a member
nsIMdbEnv* mev, // context
const mdbOid* inOid) // row to remove from table
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -589,7 +589,7 @@ morkTable::NewRow( // create a new row instance in table
mdbOid* ioOid, // please use zero (unbound) rowId for db-assigned IDs
nsIMdbRow** acqRow) // create new row
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -620,7 +620,7 @@ morkTable::AddRow( // make sure the row with inOid is a table member
nsIMdbEnv* mev, // context
nsIMdbRow* ioRow) // row to ensure membership in table
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -638,7 +638,7 @@ morkTable::HasRow( // test for the table position of a row member
nsIMdbRow* ioRow, // row to find in table
mdb_bool* outBool) // zero-based ordinal position of row in table
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -657,7 +657,7 @@ morkTable::CutRow( // make sure the row with inOid is not a member
nsIMdbEnv* mev, // context
nsIMdbRow* ioRow) // row to remove from table
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -673,7 +673,7 @@ NS_IMETHODIMP
morkTable::CutAllRows( // remove all rows from the table
nsIMdbEnv* mev) // context
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -837,7 +837,7 @@ morkTable::MoveOid( // change position of row in unsorted table
mdb_pos inToPos, // desired new position for row inOid
mdb_pos* outActualPos) // actual new position of row in table
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_pos actualPos = -1; // meaning it was never found in table
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -867,7 +867,7 @@ morkTable::MoveRow( // change position of row in unsorted table
mdb_pos* outActualPos) // actual new position of row in table
{
mdb_pos actualPos = -1; // meaning it was never found in table
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
View
28 db/mork/src/morkTableRowCursor.cpp
@@ -108,10 +108,10 @@ morkTableRowCursor::CloseTableRowCursor(morkEnv* ev)
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
// { ----- begin attribute methods -----
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkTableRowCursor::GetCount(nsIMdbEnv* mev, mdb_count* outCount)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_count count = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -124,35 +124,35 @@ morkTableRowCursor::GetCount(nsIMdbEnv* mev, mdb_count* outCount)
return outErr;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkTableRowCursor::GetSeed(nsIMdbEnv* mev, mdb_seed* outSeed)
{
NS_ASSERTION(false, "not implemented");
return NS_ERROR_NOT_IMPLEMENTED;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkTableRowCursor::SetPos(nsIMdbEnv* mev, mdb_pos inPos)
{
mCursor_Pos = inPos;
return NS_OK;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkTableRowCursor::GetPos(nsIMdbEnv* mev, mdb_pos* outPos)
{
*outPos = mCursor_Pos;
return NS_OK;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkTableRowCursor::SetDoFailOnSeedOutOfSync(nsIMdbEnv* mev, mdb_bool inFail)
{
mCursor_DoFailOnSeedOutOfSync = inFail;
return NS_OK;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkTableRowCursor::GetDoFailOnSeedOutOfSync(nsIMdbEnv* mev, mdb_bool* outFail)
{
NS_ENSURE_ARG_POINTER(outFail);
@@ -169,7 +169,7 @@ morkTableRowCursor::GetDoFailOnSeedOutOfSync(nsIMdbEnv* mev, mdb_bool* outFail)
NS_IMETHODIMP
morkTableRowCursor::GetTable(nsIMdbEnv* mev, nsIMdbTable** acqTable)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbTable* outTable = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -192,7 +192,7 @@ morkTableRowCursor::NextRowOid( // get row id of next row in the table
mdbOid* outOid, // out row oid
mdb_pos* outRowPos)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mork_pos pos = -1;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -216,7 +216,7 @@ morkTableRowCursor::PrevRowOid( // get row id of previous row in the table
mdbOid* outOid, // out row oid
mdb_pos* outRowPos)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mork_pos pos = -1;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -242,7 +242,7 @@ morkTableRowCursor::NextRow( // get row cells from table for cells already in ro
nsIMdbRow** acqRow, // acquire next row in table
mdb_pos* outRowPos)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -269,7 +269,7 @@ morkTableRowCursor::PrevRow( // get row cells from table for cells already in ro
nsIMdbRow** acqRow, // acquire previous row in table
mdb_pos* outRowPos)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbRow* outRow = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -298,7 +298,7 @@ NS_IMETHODIMP
morkTableRowCursor::CanHaveDupRowMembers(nsIMdbEnv* mev, // cursor might hold dups?
mdb_bool* outCanHaveDups)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
mdb_bool canHaveDups = mdbBool_kFalse;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
@@ -338,7 +338,7 @@ morkTableRowCursor::MakeUniqueCursor( // clone cursor, removing duplicate rows
// delay calling MakeUniqueCursor() when possible, until a user interface
// element actually demands the creation of an explicit set representation.
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
nsIMdbTableRowCursor* outCursor = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
View
6 db/mork/src/morkThumb.cpp
@@ -136,7 +136,7 @@ NS_IMETHODIMP
morkThumb::GetProgress(nsIMdbEnv* mev, mdb_count* outTotal,
mdb_count* outCurrent, mdb_bool* outDone, mdb_bool* outBroken)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -150,7 +150,7 @@ NS_IMETHODIMP
morkThumb::DoMore(nsIMdbEnv* mev, mdb_count* outTotal,
mdb_count* outCurrent, mdb_bool* outDone, mdb_bool* outBroken)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
@@ -163,7 +163,7 @@ morkThumb::DoMore(nsIMdbEnv* mev, mdb_count* outTotal,
NS_IMETHODIMP
morkThumb::CancelAndBreakThumb(nsIMdbEnv* mev)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
View
17 db/mork/src/morkZone.cpp
@@ -485,12 +485,12 @@ void* morkZone::ZoneGrowRun(morkEnv* ev, void* ioRunBlock, mdb_size inSize)
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// { ===== begin nsIMdbHeap methods =====
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkZone::Alloc(nsIMdbEnv* mev, // allocate a piece of memory
mdb_size inSize, // requested size of new memory block
void** outBlock) // memory block of inSize bytes, or nil
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
void* block = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
@@ -499,20 +499,19 @@ morkZone::Alloc(nsIMdbEnv* mev, // allocate a piece of memory
outErr = ev->AsErr();
}
else
- // XXX 1 is not a valid mdb_err (= nsresult)
- outErr = static_cast<mdb_err>(1);
-
+ outErr = morkEnv_kOutOfMemoryError;
+
if ( outBlock )
*outBlock = block;
return outErr;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
morkZone::Free(nsIMdbEnv* mev, // free block allocated earlier by Alloc()
void* inBlock)
{
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
if ( inBlock )
{
morkEnv* ev = morkEnv::FromMdbEnv(mev);
@@ -522,8 +521,8 @@ morkZone::Free(nsIMdbEnv* mev, // free block allocated earlier by Alloc()
outErr = ev->AsErr();
}
else
- // XXX 1 is not a valid mdb_err (= nsresult)
- outErr = static_cast<mdb_err>(1);
+ // XXX 1 is not a valid nsresult
+ outErr = static_cast<nsresult>(1);
}
return outErr;
View
6 db/mork/src/orkinHeap.cpp
@@ -40,14 +40,14 @@ MOZ_DEFINE_MALLOC_SIZE_OF_ON_ALLOC(MorkSizeOfOnAlloc)
MOZ_DEFINE_MALLOC_SIZE_OF_ON_FREE(MorkSizeOfOnFree)
// { ===== begin nsIMdbHeap methods =====
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
orkinHeap::Alloc(nsIMdbEnv* mev, // allocate a piece of memory
mdb_size inSize, // requested size of new memory block
void** outBlock) // memory block of inSize bytes, or nil
{
MORK_USED_1(mev);
- mdb_err outErr = NS_OK;
+ nsresult outErr = NS_OK;
void* block = malloc(inSize);
if ( !block )
outErr = morkEnv_kOutOfMemoryError;
@@ -60,7 +60,7 @@ orkinHeap::Alloc(nsIMdbEnv* mev, // allocate a piece of memory
return outErr;
}
-/*virtual*/ mdb_err
+/*virtual*/ nsresult
orkinHeap::Free(nsIMdbEnv* mev, // free block allocated earlier by Alloc()
void* inBlock)
{
View
28 mailnews/addrbook/src/nsAddrDatabase.cpp
@@ -709,7 +709,7 @@ nsresult nsAddrDatabase::AddRowToDeletedCardsTable(nsIAbCard *card, nsIMdbRow **
nsCOMPtr<nsIMdbRow> cardRow;
rv = GetNewRow(getter_AddRefs(cardRow));
if (NS_SUCCEEDED(rv) && cardRow) {
- mdb_err merror = m_mdbDeletedCardsTable->AddRow(m_mdbEnv, cardRow);
+ nsresult merror = m_mdbDeletedCardsTable->AddRow(m_mdbEnv, cardRow);
NS_ENSURE_SUCCESS(merror, NS_ERROR_FAILURE);
nsString unicodeStr;
card->GetFirstName(unicodeStr);
@@ -755,7 +755,7 @@ nsresult nsAddrDatabase::DeleteRowFromDeletedCardsTable(nsIMdbRow *pCardRow)
if (!m_mdbEnv)
return NS_ERROR_NULL_POINTER;
- mdb_err merror = NS_OK;
+ nsresult merror = NS_OK;
if (m_mdbDeletedCardsTable) {
pCardRow->CutAllColumns(m_mdbEnv);
merror = m_mdbDeletedCardsTable->CutRow(m_mdbEnv, pCardRow);
@@ -907,7 +907,7 @@ nsresult nsAddrDatabase::CheckAndUpdateRecordKey()
nsIMdbRow* findRow = nullptr;
mdb_pos rowPos = 0;
- mdb_err merror = m_mdbPabTable->GetTableRowCursor(m_mdbEnv, -1, &rowCursor);
+ nsresult merror = m_mdbPabTable->GetTableRowCursor(m_mdbEnv, -1, &rowCursor);
NS_ENSURE_TRUE(NS_SUCCEEDED(merror) && rowCursor, NS_ERROR_FAILURE);
@@ -950,7 +950,7 @@ nsresult nsAddrDatabase::UpdateLowercaseEmailListName()
mdb_pos rowPos = 0;
bool commitRequired = false;
- mdb_err merror = m_mdbPabTable->GetTableRowCursor(m_mdbEnv, -1, &rowCursor);
+ nsresult merror = m_mdbPabTable->GetTableRowCursor(m_mdbEnv, -1, &rowCursor);
NS_ENSURE_TRUE(NS_SUCCEEDED(merror) && rowCursor, NS_ERROR_FAILURE);
@@ -1258,7 +1258,7 @@ NS_IMETHODIMP nsAddrDatabase::CreateNewCardAndAddToDB(nsIAbCard *aNewCard, bool
aNewCard->SetDirectoryId(id);
- mdb_err merror = m_mdbPabTable->AddRow(m_mdbEnv, cardRow);
+ nsresult merror = m_mdbPabTable->AddRow(m_mdbEnv, cardRow);
NS_ENSURE_SUCCESS(merror, NS_ERROR_FAILURE);
}
else
@@ -1555,7 +1555,7 @@ NS_IMETHODIMP nsAddrDatabase::CreateMailListAndAddToDB(nsIAbDirectory *aNewList,
{
AddListAttributeColumnsToRow(aNewList, listRow, aParent);
AddRecordKeyColumnToRow(listRow);
- mdb_err merror = m_mdbPabTable->AddRow(m_mdbEnv, listRow);
+ nsresult merror = m_mdbPabTable->AddRow(m_mdbEnv, listRow);
NS_ENSURE_SUCCESS(merror, NS_ERROR_FAILURE);
nsCOMPtr<nsIAbCard> listCard;
@@ -1583,7 +1583,7 @@ void nsAddrDatabase::DeleteCardFromAllMailLists(mdb_id cardRowID)
mdb_pos rowPos;
do
{
- mdb_err err = rowCursor->NextRow(m_mdbEnv, getter_AddRefs(pListRow), &rowPos);
+ nsresult err = rowCursor->NextRow(m_mdbEnv, getter_AddRefs(pListRow), &rowPos);
if (NS_SUCCEEDED(err) && pListRow)
{
@@ -2049,7 +2049,7 @@ NS_IMETHODIMP nsAddrDatabase::ContainsMailList(nsIAbDirectory *mailList, bool *h
if (!mailList || !m_mdbPabTable || !m_mdbEnv)
return NS_ERROR_NULL_POINTER;
- mdb_err err = NS_OK;
+ nsresult err = NS_OK;
mdb_bool hasOid;
mdbOid rowOid;
@@ -2171,7 +2171,7 @@ nsresult nsAddrDatabase::AddCharStringColumn(nsIMdbRow* cardRow, mdb_column inCo
struct mdbYarn yarn;
GetCharStringYarn((char *) str, &yarn);
- mdb_err err = cardRow->AddColumn(m_mdbEnv, inColumn, &yarn);
+ nsresult err = cardRow->AddColumn(m_mdbEnv, inColumn, &yarn);
return (NS_SUCCEEDED(err)) ? NS_OK : NS_ERROR_FAILURE;
}
@@ -2184,7 +2184,7 @@ nsresult nsAddrDatabase::AddStringColumn(nsIMdbRow* aCardRow, mdb_column aInColu
struct mdbYarn yarn;
GetStringYarn(aStr, &yarn);
- mdb_err err = aCardRow->AddColumn(m_mdbEnv, aInColumn, &yarn);
+ nsresult err = aCardRow->AddColumn(m_mdbEnv, aInColumn, &yarn);
return (NS_SUCCEEDED(err)) ? NS_OK : NS_ERROR_FAILURE;
}
@@ -2200,7 +2200,7 @@ nsresult nsAddrDatabase::AddIntColumn(nsIMdbRow* cardRow, mdb_column inColumn, u
yarn.mYarn_Buf = (void *) yarnBuf;
yarn.mYarn_Size = sizeof(yarnBuf);
GetIntYarn(nValue, &yarn);
- mdb_err err = cardRow->AddColumn(m_mdbEnv, inColumn, &yarn);
+ nsresult err = cardRow->AddColumn(m_mdbEnv, inColumn, &yarn);
return (NS_SUCCEEDED(err)) ? NS_OK : NS_ERROR_FAILURE;
}
@@ -2218,7 +2218,7 @@ nsresult nsAddrDatabase::AddBoolColumn(nsIMdbRow* cardRow, mdb_column inColumn,
GetIntYarn(bValue ? 1 : 0, &yarn);
- mdb_err err = cardRow->AddColumn(m_mdbEnv, inColumn, &yarn);
+ nsresult err = cardRow->AddColumn(m_mdbEnv, inColumn, &yarn);
return (NS_SUCCEEDED(err)) ? NS_OK : NS_ERROR_FAILURE;
}
@@ -3191,7 +3191,7 @@ NS_IMETHODIMP nsAddrDatabase::FindMailListbyUnicodeName(const char16_t *listName
NS_IMETHODIMP nsAddrDatabase::GetCardCount(uint32_t *count)
{
- mdb_err rv;
+ nsresult rv;
mdb_count c;
rv = m_mdbPabTable->GetCount(m_mdbEnv, &c);
if (NS_SUCCEEDED(rv))
@@ -3348,7 +3348,7 @@ nsresult nsAddrDatabase::DeleteRow(nsIMdbTable* dbTable, nsIMdbRow* dbRow)
if (!m_mdbEnv)
return NS_ERROR_NULL_POINTER;
- mdb_err err = dbRow->CutAllColumns(m_mdbEnv);
+ nsresult err = dbRow->CutAllColumns(m_mdbEnv);
err = dbTable->CutRow(m_mdbEnv, dbRow);
return (NS_SUCCEEDED(err)) ? NS_OK : NS_ERROR_FAILURE;
View
6 mailnews/base/src/nsMsgFolderCache.cpp
@@ -81,9 +81,9 @@ nsresult nsMsgFolderCache::InitNewDB()
{
nsIMdbStore *store = GetStore();
// create the unique table for the dbFolderInfo.
- mdb_err mdberr;
+ nsresult mdberr;
// TODO: this error assignment is suspicious and never checked.
- mdberr = (nsresult) store->NewTable(GetEnv(), m_folderRowScopeToken,
+ mdberr = store->NewTable(GetEnv(), m_folderRowScopeToken,
m_folderTableKindToken, false, nullptr, &m_mdbAllFoldersTable);
}
return err;
@@ -269,7 +269,7 @@ NS_IMETHODIMP nsMsgFolderCache::GetCacheElement(const nsACString& pathKey, bool
if (GetStore())
{
- mdb_err err = GetStore()->NewRow(GetEnv(), m_folderRowScopeToken, // row scope for row ids
+ nsresult err = GetStore()->NewRow(GetEnv(), m_folderRowScopeToken, // row scope for row ids
&hdrRow);
if (NS_SUCCEEDED(err) && hdrRow)
{
View
8 mailnews/db/msgdb/src/nsDBFolderInfo.cpp
@@ -210,7 +210,7 @@ nsDBFolderInfo::nsDBFolderInfo(nsMsgDatabase *mdb)
m_mdb = mdb;
if (mdb)
{
- mdb_err err;
+ nsresult err;
// mdb->AddRef();
err = m_mdb->GetStore()->StringToToken(mdb->GetEnv(), kDBFolderInfoScope, &m_rowScopeToken);
@@ -261,7 +261,7 @@ nsresult nsDBFolderInfo::AddToNewMDB()
{
nsIMdbStore *store = m_mdb->GetStore();
// create the unique table for the dbFolderInfo.
- mdb_err err = store->NewTable(m_mdb->GetEnv(), m_rowScopeToken,
+ nsresult err = store->NewTable(m_mdb->GetEnv(), m_rowScopeToken,
m_tableKindToken, true, nullptr, &m_mdbTable);
// create the singleton row for the dbFolderInfo.
@@ -272,7 +272,7 @@ nsresult nsDBFolderInfo::AddToNewMDB()
if (m_mdbRow && NS_SUCCEEDED(err))
err = m_mdbTable->AddRow(m_mdb->GetEnv(), m_mdbRow);
- ret = err; // what are we going to do about mdb_err's?
+ ret = err; // what are we going to do about nsresult's?
}
return ret;
}
@@ -930,7 +930,7 @@ NS_IMETHODIMP nsDBFolderInfo::GetTransferInfo(nsIDBFolderInfo **transferInfo)
// iterate over the cells in the dbfolderinfo remembering attribute names and values.
for (mdb_count cellIndex = 0; cellIndex < numCells; cellIndex++)
{
- mdb_err err = m_mdbRow->SeekCellYarn(m_mdb->GetEnv(), cellIndex, &cellColumn, nullptr);
+ nsresult err = m_mdbRow->SeekCellYarn(m_mdb->GetEnv(), cellIndex, &cellColumn, nullptr);
if (NS_SUCCEEDED(err))
{
err = m_mdbRow->AliasCellYarn(m_mdb->GetEnv(), cellColumn, &cellYarn);
View
2 mailnews/db/msgdb/src/nsImapMailDatabase.cpp
@@ -143,7 +143,7 @@ NS_IMETHODIMP nsImapMailDatabase::UpdatePendingAttributes(nsIMsgDBHdr* aNewHdr)
nsIMdbRow *row = msgHdr->GetMDBRow();
for (mdb_count cellIndex = 1; cellIndex < numCells; cellIndex++)
{
- mdb_err err = pendingRow->SeekCellYarn(GetEnv(), cellIndex, &cellColumn, nullptr);
+ nsresult err = pendingRow->SeekCellYarn(GetEnv(), cellIndex, &cellColumn, nullptr);
if (NS_SUCCEEDED(err))
{
err = pendingRow->AliasCellYarn(GetEnv(), cellColumn, &cellYarn);
View
4 mailnews/db/msgdb/src/nsMailDatabase.cpp
@@ -145,8 +145,8 @@ NS_IMETHODIMP nsMailDatabase::GetOfflineOpForKey(nsMsgKey msgKey, bool create, n
{
mdb_bool hasOid;
mdbOid rowObjectId;
- mdb_err err;
-
+ nsresult err;
+
if (!IMAPOffline)
IMAPOffline = PR_NewLogModule("IMAPOFFLINE");
nsresult rv = GetAllOfflineOpsTable();
View
22 mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -1626,7 +1626,7 @@ nsresult nsMsgDatabase::InitNewDB()
dbFolderInfo->SetBooleanProperty(kFixedBadRefThreadingProp, true);
nsIMdbStore *store = GetStore();
// create the unique table for the dbFolderInfo.
- mdb_err mdberr;
+ nsresult mdberr;
struct mdbOid allMsgHdrsTableOID;
struct mdbOid allThreadsTableOID;
if (!store)
@@ -1710,7 +1710,7 @@ nsresult nsMsgDatabase::InitExistingDB()
allMsgHdrsTableOID.mOid_Scope = m_hdrRowScopeToken;
allMsgHdrsTableOID.mOid_Id = kAllMsgHdrsTableKey;
- mdb_err mdberr = GetStore()->NewTableWithOid(GetEnv(), &allMsgHdrsTableOID, m_hdrTableKindToken,
+ nsresult mdberr = GetStore()->NewTableWithOid(GetEnv(), &allMsgHdrsTableOID, m_hdrTableKindToken,
false, nullptr, &m_mdbAllMsgHeadersTable);
if (NS_FAILED(mdberr) || !m_mdbAllMsgHeadersTable)
err = NS_ERROR_FAILURE;
@@ -1722,7 +1722,7 @@ nsresult nsMsgDatabase::InitExistingDB()
if (!m_mdbAllThreadsTable)
{
- mdb_err mdberr = GetStore()->NewTableWithOid(GetEnv(), &allThreadsTableOID, m_allThreadsTableKindToken,
+ nsresult mdberr = GetStore()->NewTableWithOid(GetEnv(), &allThreadsTableOID, m_allThreadsTableKindToken,
false, nullptr, &m_mdbAllThreadsTable);
if (NS_FAILED(mdberr) || !m_mdbAllThreadsTable)
err = NS_ERROR_FAILURE;
@@ -4294,7 +4294,7 @@ nsresult nsMsgDatabase::CreateNewThread(nsMsgKey threadId, const char *subject,
// Under some circumstances, mork seems to reuse an old table when we create one.
// Prevent problems from that by finding any old table first, and deleting its rows.
- mdb_err res = GetStore()->GetTable(GetEnv(), &threadTableOID, getter_AddRefs(threadTable));
+ nsresult res = GetStore()->GetTable(GetEnv(), &threadTableOID, getter_AddRefs(threadTable));
if (NS_SUCCEEDED(res) && threadTable)
threadTable->CutAllRows(GetEnv());
@@ -4393,7 +4393,7 @@ nsIMsgThread * nsMsgDatabase::GetThreadForSubject(nsCString &subject)
mdbOid outRowId;
if (m_mdbStore)
{
- mdb_err result = m_mdbStore->FindRow(GetEnv(), m_threadRowScopeToken,
+ nsresult result = m_mdbStore->FindRow(GetEnv(), m_threadRowScopeToken,
m_threadSubjectColumnToken, &subjectYarn, &outRowId, getter_AddRefs(threadRow));
if (NS_SUCCEEDED(result) && threadRow)
{
@@ -4592,7 +4592,7 @@ NS_IMETHODIMP nsMsgDatabase::GetMsgHdrForMessageID(const char *aMsgID, nsIMsgDBH
nsIMdbRow *hdrRow;
mdbOid outRowId;
- mdb_err result;
+ nsresult result;
if (m_mdbStore)
result = m_mdbStore->FindRow(GetEnv(), m_hdrRowScopeToken,
m_messageIdColumnToken, &messageIdYarn, &outRowId,
@@ -4630,7 +4630,7 @@ NS_IMETHODIMP nsMsgDatabase::GetMsgHdrForGMMsgID(const char *aGMMsgId, nsIMsgDBH
nsIMdbRow *hdrRow;
mdbOid outRowId;
- mdb_err result;
+ nsresult result;
mdb_token property_token;
NS_ENSURE_TRUE(m_mdbStore, NS_ERROR_NULL_POINTER);
result = m_mdbStore->StringToToken(GetEnv(), "X-GM-MSGID",
@@ -4668,7 +4668,7 @@ nsIMsgDBHdr *nsMsgDatabase::GetMsgHdrForSubject(nsCString &subject)
nsIMdbRow *hdrRow;
mdbOid outRowId;
- mdb_err result = GetStore()->FindRow(GetEnv(), m_hdrRowScopeToken,
+ nsresult result = GetStore()->FindRow(GetEnv(), m_hdrRowScopeToken,
m_subjectColumnToken, &subjectYarn, &outRowId,
&hdrRow);
if (NS_SUCCEEDED(result) && hdrRow)
@@ -4743,8 +4743,8 @@ nsIMsgThread * nsMsgDatabase::GetThreadForThreadId(nsMsgKey threadId)
tableId.mOid_Scope = m_hdrRowScopeToken;
nsCOMPtr<nsIMdbTable> threadTable;
- mdb_err res = m_mdbStore->GetTable(GetEnv(), &tableId,
- getter_AddRefs(threadTable));
+ nsresult res = m_mdbStore->GetTable(GetEnv(), &tableId,
+ getter_AddRefs(threadTable));
if (NS_SUCCEEDED(res) && threadTable)
{
@@ -5700,7 +5700,7 @@ nsresult nsMsgDatabase::GetSearchResultsTable(const char *searchFolderUri, bool
mdb_kind kindToken;
mdb_count numTables;
mdb_bool mustBeUnique;
- mdb_err err = m_mdbStore->StringToToken(GetEnv(), searchFolderUri, &kindToken);
+ nsresult err = m_mdbStore->StringToToken(GetEnv(), searchFolderUri, &kindToken);
err = m_mdbStore->GetTableKind(GetEnv(), m_hdrRowScopeToken, kindToken,
&numTables, &mustBeUnique, table);
if ((!*table || NS_FAILED(err)) && createIfMissing)

0 comments on commit c8822ed

Please sign in to comment.
Something went wrong with that request. Please try again.