<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From e72e879ea0cc2cc3019a1b698287509f03e49819 Mon Sep 17 00:00:00 2001
From: Florian Franzmann &lt;bwlf@bandrate.org&gt;
Date: Sun, 1 Dec 2019 17:43:40 +0100
Subject: [PATCH 04/35] Cleanup: use nullptr instead of NULL

---
 include/Registry_impl.hpp |  4 ++--
 include/bean_ptr_impl.hpp |  4 ++--
 include/shared_res.h      | 10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/Registry_impl.hpp b/include/Registry_impl.hpp
index d84234f..7fcc8fa 100644
--- a/include/Registry_impl.hpp
+++ b/include/Registry_impl.hpp
@@ -21,7 +21,7 @@ template&lt;class C&gt;
 bean_ptr&lt;C&gt; Registry&lt;C&gt;::createBeanPtr(bean_key key, C* obj)
 {
 	if(key.id==Database::NULL_ID)
-		return bean_ptr&lt;C&gt;(key,NULL);
+		return bean_ptr&lt;C&gt;(key,nullptr);
 
 	real_bean&lt;C&gt;* rb=new real_bean&lt;C&gt;(key,obj);
 	rb_pair&lt;C&gt;* para=new rb_pair&lt;C&gt;(rb);
@@ -41,7 +41,7 @@ bean_ptr&lt;C&gt; Registry&lt;C&gt;::get(const bean_key key)
 	typename std::map&lt;bean_key,rb_pair&lt;C&gt;* &gt;::iterator it;
 	it=rbpairs.find(key);
 	if(it==rbpairs.end())
-		return createBeanPtr(key,NULL);
+		return createBeanPtr(key,nullptr);
 	else
 		return bean_ptr&lt;C&gt;(key, it-&gt;second);
 }
diff --git a/include/bean_ptr_impl.hpp b/include/bean_ptr_impl.hpp
index 1bd55aa..02bd438 100644
--- a/include/bean_ptr_impl.hpp
+++ b/include/bean_ptr_impl.hpp
@@ -18,7 +18,7 @@ void real_bean&lt;C&gt;::destroy() {
 	Database::dbDelete(key, *obj);
 	delete obj;
 	forgotten=true;
-	obj=NULL;
+	obj=nullptr;
 	key.id=Database::NULL_ID;
 }
 
@@ -46,7 +46,7 @@ template&lt;class C&gt;
 C* real_bean&lt;C&gt;::get()
 {
 	if(forgotten)
-		return NULL;
+		return nullptr;
 	loadLazy();
 	if(!obj)
 		throw std::runtime_error("NULL pointer exception!");
diff --git a/include/shared_res.h b/include/shared_res.h
index 2f6bc0b..b5d2b83 100644
--- a/include/shared_res.h
+++ b/include/shared_res.h
@@ -55,16 +55,16 @@ protected:
 	}
 
 public:
-	inline explicit shared_res(C* tg) : res(NULL) {
+	inline explicit shared_res(C* tg) : res(nullptr) {
 		if(!tg)
 			throw std::logic_error("no reason to manage NULL object");
 		shared_cnt_obj_pair&lt;C&gt;* share=new shared_cnt_obj_pair&lt;C&gt;(tg);
 		takeRes(share);
 	}
 
-	inline shared_res() : res(NULL) {}
+	inline shared_res() : res(nullptr) {}
 
-	inline shared_res(const shared_res&lt;C&gt;&amp; x) : res(NULL) {
+	inline shared_res(const shared_res&lt;C&gt;&amp; x) : res(nullptr) {
 		takeRes(x.res);
 	}
 
@@ -82,7 +82,7 @@ public:
 
 	inline C* get_object(){
 		if(!res)
-			return NULL;
+			return nullptr;
 		return res-&gt;getRes();
 	}
 
@@ -103,7 +103,7 @@ public:
 		return res&lt;x.res;
 	}
 	inline operator bool() const{
-		return res!=NULL;
+		return res!=nullptr;
 	}
 };
 
-- 
2.24.0

</pre></body></html>