Bug 782614 - Don't return nsresult from main() (rdf/); r=bsmedberg

This commit is contained in:
Aryeh Gregor 2012-08-07 20:17:27 +03:00
Родитель 063b3975db
Коммит 1dfc6b12e2
3 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -48,7 +48,7 @@ static NS_DEFINE_CID(kRDFXMLDataSourceCID, NS_RDFXMLDATASOURCE_CID);
PR_BEGIN_MACRO \
if (NS_FAILED(rv)) { \
printf(">>> %s failed: rv=%x\n", step, rv); \
return rv;\
return 1;\
} \
PR_END_MACRO
@ -134,7 +134,7 @@ main(int argc, char** argv)
nsCOMPtr<nsIThread> thread = do_GetCurrentThread();
bool done = false;
while (!done) {
NS_ENSURE_STATE(NS_ProcessNextEvent(thread));
NS_ENSURE_TRUE(NS_ProcessNextEvent(thread), 1);
remote->GetLoaded(&done);
}
@ -150,5 +150,5 @@ main(int argc, char** argv)
rv = source->Serialize(out);
RETURN_IF_FAILED(rv, "datasoure serialization");
return NS_OK;
return 0;
}

Просмотреть файл

@ -229,31 +229,31 @@ main(int argc, char** argv)
nsCOMPtr<nsIRDFDataSource> ds = do_CreateInstance(kRDFXMLDataSourceCID, &rv);
if (NS_FAILED(rv)) {
NS_ERROR("unable to create RDF/XML data source");
return rv;
return 1;
}
nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(ds);
if (! remote)
return NS_ERROR_UNEXPECTED;
return 1;
rv = remote->Init(argv[1]);
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to initialize data source");
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv)) return 1;
// The do_QI() on the pointer is a hack to make sure that the new
// object gets AddRef()-ed.
nsCOMPtr<nsIRDFObserver> observer = do_QueryInterface(new Observer);
if (! observer)
return NS_ERROR_OUT_OF_MEMORY;
return 1;
rv = ds->AddObserver(observer);
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv)) return 1;
while (1) {
// Okay, this should load the XML file...
rv = remote->Refresh(true);
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to open datasource");
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv)) return 1;
if (argc <= 2)
break;
@ -265,5 +265,5 @@ main(int argc, char** argv)
PR_Sleep(PR_SecondsToInterval(pollinterval));
}
return NS_OK;
return 0;
}

Просмотреть файл

@ -46,7 +46,7 @@
PR_BEGIN_MACRO \
if (NS_FAILED(rv)) { \
printf(">>> %s failed: rv=%x\n", step, rv); \
return rv;\
return 1;\
} \
PR_END_MACRO
@ -133,7 +133,7 @@ main(int argc, char** argv)
nsCOMPtr<nsIThread> thread = do_GetCurrentThread();
bool done = false;
while (!done) {
NS_ENSURE_STATE(NS_ProcessNextEvent(thread));
NS_ENSURE_TRUE(NS_ProcessNextEvent(thread), 1);
remote->GetLoaded(&done);
}
@ -149,5 +149,5 @@ main(int argc, char** argv)
out->Close();
}
return NS_OK;
return 0;
}