refactor: cleanup and sync
* Fix Jenkins scripts and sync with ndn-cxx
* Sync waf-tools
* Remove ChronoSync submodule
* Remove commented/dead code and includes
* Use ScopedEventId and ScopedRegisteredPrefixHandle
* Set setCanBePrefix to true explicitly everywhere
* Fix macOS build, add GHA CI
* Use NDN_THROW for throwing errors
* Other smaller fixes
Change-Id: I615e0e239511b97101852e1d7c620a2071a18ff8
diff --git a/src/contact-storage.cpp b/src/contact-storage.cpp
index d5e0fe2..76ae31d 100644
--- a/src/contact-storage.cpp
+++ b/src/contact-storage.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2013, Regents of the University of California
+ * Copyright (c) 2020, Regents of the University of California
* Yingdi Yu
*
* BSD license, See the LICENSE file for more information
@@ -10,10 +10,9 @@
*/
#include "contact-storage.hpp"
-
-#include <boost/filesystem.hpp>
#include "cryptopp.hpp"
+#include <boost/filesystem.hpp>
namespace chronochat {
@@ -167,7 +166,7 @@
int res = sqlite3_open((chronosDir / getDBName()).c_str(), &m_db);
if (res != SQLITE_OK)
- throw Error("chronochat DB cannot be open/created");
+ NDN_THROW(Error("chronochat DB cannot be open/created"));
initializeTable("SelfProfile", INIT_SP_TABLE);
initializeTable("SelfEndorse", INIT_SE_TABLE);
@@ -215,9 +214,9 @@
if (!tableExist) {
char *errmsg = 0;
- res = sqlite3_exec(m_db, sqlCreateStmt.c_str (), NULL, NULL, &errmsg);
+ res = sqlite3_exec(m_db, sqlCreateStmt.c_str (), nullptr, nullptr, &errmsg);
if (res != SQLITE_OK && errmsg != 0)
- throw Error("Init \"error\" in " + tableName);
+ NDN_THROW(Error("Init \"error\" in " + tableName));
}
}
@@ -396,7 +395,7 @@
ContactStorage::addContact(const Contact& contact)
{
if (doesContactExist(contact.getNameSpace()))
- throw Error("Normal Contact has already existed");
+ NDN_THROW(Error("Normal Contact has already existed"));
string identity = contact.getNameSpace().toUri();
bool isIntroducer = contact.isIntroducer();