From a7001dfd139fbb9d5cf5434fc40370f8da0cf04c Mon Sep 17 00:00:00 2001
From: George Hazan <george.hazan@gmail.com>
Date: Sat, 28 Jul 2012 12:35:00 +0000
Subject: perversive error reporting schema in DATABASELINK removed

git-svn-id: http://svn.miranda-ng.org/main/trunk@1223 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 src/modules/database/database.cpp | 10 +++++-----
 src/modules/database/dbintf.cpp   |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

(limited to 'src/modules/database')

diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp
index 71ad7102ce..24b220cd44 100644
--- a/src/modules/database/database.cpp
+++ b/src/modules/database/database.cpp
@@ -359,7 +359,7 @@ int makeDatabase(TCHAR *profile, DATABASELINK * link, HWND hwndDlg)
 	}
 	// ask the database to create the profile
 	CreatePathToFileT(profile);
-	if (link->makeDatabase(profile, &err)) {
+	if ((err = link->makeDatabase(profile)) != ERROR_SUCCESS) {
 		mir_sntprintf(buf, SIZEOF(buf), TranslateT("Unable to create the profile '%s', the error was %x"), file, err);
 		MessageBox(hwndDlg, buf, TranslateT("Problem creating profile"), MB_ICONERROR|MB_OK);
 		return 0;
@@ -376,8 +376,8 @@ int tryOpenDatabase(const TCHAR* tszProfile)
 		DATABASELINK* p = arDbPlugins[i];
 
 		// liked the profile?
-		int err = 0;
-		if ( p->grokHeader(tszProfile, &err) == 0) {
+		int err = p->grokHeader(tszProfile);
+		if (err == ERROR_SUCCESS) {
 			// added APIs?
 			MIDatabase* pDb = p->Load(tszProfile);
 			if (pDb) {
@@ -413,8 +413,8 @@ static int tryCreateDatabase(const TCHAR* ptszProfile)
 	for (int i=0; i < arDbPlugins.getCount(); i++) {
 		DATABASELINK* p = arDbPlugins[i];
 
-		int err;
-		if (p->makeDatabase(tszProfile, &err) == 0) {
+		int err = p->makeDatabase(tszProfile);
+		if (err == ERROR_SUCCESS) {
 			if ( !p->Load(tszProfile)) {
 				fillProfileName(tszProfile);
 				return 0;
diff --git a/src/modules/database/dbintf.cpp b/src/modules/database/dbintf.cpp
index 4c5e19607c..62850c55da 100644
--- a/src/modules/database/dbintf.cpp
+++ b/src/modules/database/dbintf.cpp
@@ -178,8 +178,8 @@ static INT_PTR srvRegisterPlugin(WPARAM wParam,LPARAM lParam)
 static INT_PTR srvFindPlugin(WPARAM wParam,LPARAM lParam)
 {
 	for (int i=0; i < arDbPlugins.getCount(); i++) {
-		int error;
-		if (arDbPlugins[i]->grokHeader((TCHAR*)lParam, &error) == ERROR_SUCCESS)
+		int error = arDbPlugins[i]->grokHeader((TCHAR*)lParam);
+		if (error == ERROR_SUCCESS)
 			return (INT_PTR)arDbPlugins[i];
 	}
 
-- 
cgit v1.2.3