Signed-off-by: Rosen Penev <rosenp@gmail.com>lilik-openwrt-22.03
@ -1,23 +0,0 @@ | |||
From 199c86591edc7e82b92903efecadc4f69ea63370 Mon Sep 17 00:00:00 2001 | |||
From: Johannes Morgenroth <jm@m-network.de> | |||
Date: Tue, 1 Jan 2019 11:25:50 +0100 | |||
Subject: [PATCH] Add operator!=() to Bundle::block_elem | |||
Alternative implementations of libstdcpp as uclibc++ use it in | |||
the algorithm implemenetations. | |||
--- | |||
ibrdtn/data/Bundle.h | 3 +++ | |||
1 file changed, 3 insertions(+) | |||
--- a/ibrdtn/data/Bundle.h | |||
+++ b/ibrdtn/data/Bundle.h | |||
@@ -69,6 +69,9 @@ namespace dtn | |||
bool operator==(const dtn::data::block_t &type) const { | |||
return (**this) == type; | |||
} | |||
+ bool operator!=(const dtn::data::block_t &type) const { | |||
+ return !((**this) == type); | |||
+ } | |||
}; | |||
typedef std::list<block_elem> block_list; |
@ -1,20 +0,0 @@ | |||
From 6945698778caf7cdaace9ce8dae82162dbe2ee9f Mon Sep 17 00:00:00 2001 | |||
From: Johannes Morgenroth <jm@m-network.de> | |||
Date: Thu, 3 Jan 2019 07:26:51 +0100 | |||
Subject: [PATCH] Use const iterator in const function of MemoryBundleSet | |||
--- | |||
ibrdtn/data/MemoryBundleSet.cpp | 2 +- | |||
1 file changed, 1 insertion(+), 1 deletion(-) | |||
--- a/ibrdtn/data/MemoryBundleSet.cpp | |||
+++ b/ibrdtn/data/MemoryBundleSet.cpp | |||
@@ -134,7 +134,7 @@ namespace dtn | |||
// the bundles set. This happen if the MemoryBundleSet gets deserialized. | |||
if (!_consistent) return true; | |||
- bundle_set::iterator iter = _bundles.find(dtn::data::MetaBundle::create(bundle)); | |||
+ bundle_set::const_iterator iter = _bundles.find(dtn::data::MetaBundle::create(bundle)); | |||
return (iter != _bundles.end()); | |||
} | |||
@ -1,37 +0,0 @@ | |||
From 1395d849d73147319ee422d2ce34de0bcb90e6f8 Mon Sep 17 00:00:00 2001 | |||
From: Johannes Morgenroth <jm@m-network.de> | |||
Date: Thu, 3 Jan 2019 07:34:14 +0100 | |||
Subject: [PATCH] Use std::streamoff instead of std::streampos | |||
--- | |||
ibrdtn/data/BundleMerger.cpp | 2 +- | |||
ibrdtn/data/Dictionary.cpp | 4 ++-- | |||
2 files changed, 3 insertions(+), 3 deletions(-) | |||
--- a/ibrdtn/data/BundleMerger.cpp | |||
+++ b/ibrdtn/data/BundleMerger.cpp | |||
@@ -119,7 +119,7 @@ namespace dtn | |||
} | |||
ibrcommon::BLOB::iostream stream = c._blob.iostream(); | |||
- (*stream).seekp(obj.fragmentoffset.get<std::streampos>()); | |||
+ (*stream).seekp(obj.fragmentoffset.get<std::streamoff>()); | |||
const dtn::data::PayloadBlock &p = obj.find<dtn::data::PayloadBlock>(); | |||
const Length plength = p.getLength(); | |||
--- a/ibrdtn/data/Dictionary.cpp | |||
+++ b/ibrdtn/data/Dictionary.cpp | |||
@@ -154,11 +154,11 @@ namespace dtn | |||
{ | |||
char buffer[1024]; | |||
- _bytestream.seekg(scheme.get<std::streampos>()); | |||
+ _bytestream.seekg(scheme.get<std::streamoff>()); | |||
_bytestream.get(buffer, 1024, '\0'); | |||
std::string scheme_str(buffer); | |||
- _bytestream.seekg(ssp.get<std::streampos>()); | |||
+ _bytestream.seekg(ssp.get<std::streamoff>()); | |||
_bytestream.get(buffer, 1024, '\0'); | |||
std::string ssp_str(buffer); | |||
@ -1,49 +0,0 @@ | |||
From a5b9c2feeaabbd90c9734c5d865d471eed0d5e3a Mon Sep 17 00:00:00 2001 | |||
From: Rosen Penev <rosenp@gmail.com> | |||
Date: Thu, 28 Mar 2019 01:55:15 -0700 | |||
Subject: [PATCH] Add operator!=() to BundleID and MetaBundle | |||
Needed for uClibc++. | |||
Signed-off-by: Rosen Penev <rosenp@gmail.com> | |||
--- | |||
ibrdtn/data/Bundle.cpp | 10 ++++++++++ | |||
ibrdtn/data/Bundle.h | 2 ++ | |||
2 files changed, 12 insertions(+) | |||
--- a/ibrdtn/data/Bundle.cpp | |||
+++ b/ibrdtn/data/Bundle.cpp | |||
@@ -71,11 +71,21 @@ namespace dtn | |||
return other == (const PrimaryBlock&)(*this); | |||
} | |||
+ bool Bundle::operator!=(const BundleID& other) const | |||
+ { | |||
+ return other != (const PrimaryBlock&)(*this); | |||
+ } | |||
+ | |||
bool Bundle::operator==(const MetaBundle& other) const | |||
{ | |||
return other == (const PrimaryBlock&)(*this); | |||
} | |||
+ bool Bundle::operator!=(const MetaBundle& other) const | |||
+ { | |||
+ return other != (const PrimaryBlock&)(*this); | |||
+ } | |||
+ | |||
bool Bundle::operator!=(const Bundle& other) const | |||
{ | |||
return (const PrimaryBlock&)(*this) != (const PrimaryBlock&)other; | |||
--- a/ibrdtn/data/Bundle.h | |||
+++ b/ibrdtn/data/Bundle.h | |||
@@ -97,7 +97,9 @@ namespace dtn | |||
virtual ~Bundle(); | |||
bool operator==(const BundleID& other) const; | |||
+ bool operator!=(const BundleID& other) const; | |||
bool operator==(const MetaBundle& other) const; | |||
+ bool operator!=(const MetaBundle& other) const; | |||
bool operator==(const Bundle& other) const; | |||
bool operator!=(const Bundle& other) const; |
@ -1,33 +0,0 @@ | |||
--- a/src/routing/SchedulingBundleIndex.cpp | |||
+++ b/src/routing/SchedulingBundleIndex.cpp | |||
@@ -28,7 +28,7 @@ namespace dtn | |||
void SchedulingBundleIndex::remove(const dtn::data::BundleID &id) | |||
{ | |||
ibrcommon::MutexLock l(_index_mutex); | |||
- for (priority_index::const_iterator iter = _priority_index.begin(); iter != _priority_index.end(); ++iter) | |||
+ for (priority_index::iterator iter = _priority_index.begin(); iter != _priority_index.end(); ++iter) | |||
{ | |||
const dtn::data::MetaBundle &b = (*iter); | |||
if (id == (const dtn::data::BundleID&)b) { | |||
--- a/src/storage/MemoryBundleStorage.cpp | |||
+++ b/src/storage/MemoryBundleStorage.cpp | |||
@@ -217,7 +217,7 @@ namespace dtn | |||
ibrcommon::MutexLock l(_bundleslock); | |||
// search for the bundle in the bundle list | |||
- const bundle_list::const_iterator iter = find(_bundles.begin(), _bundles.end(), id); | |||
+ const bundle_list::iterator iter = find(_bundles.begin(), _bundles.end(), id); | |||
// if no bundle was found throw an exception | |||
if (iter == _bundles.end()) throw NoBundleFoundException(); | |||
--- a/src/storage/MetaStorage.cpp | |||
+++ b/src/storage/MetaStorage.cpp | |||
@@ -66,7 +66,7 @@ namespace dtn | |||
{ | |||
std::set<dtn::data::EID> ret; | |||
- for (dtn::data::BundleList::const_iterator iter = begin(); iter != end(); ++iter) | |||
+ for (const_iterator iter = begin(); iter != end(); ++iter) | |||
{ | |||
const dtn::data::MetaBundle &bundle = (*iter); | |||
@ -0,0 +1,24 @@ | |||
--- a/src/pdfs.c | |||
+++ b/src/pdfs.c | |||
@@ -80,7 +80,7 @@ float box_muller(void) { | |||
fprintf(stderr, "pdf box_muller() rand() error\n"); | |||
return 0; | |||
} else { | |||
- w = sqrt( (-2.0 * log( w ) ) / w ); | |||
+ w = sqrt( (-2.0 * logf( w ) ) / w ); | |||
y1 = x1 * w; | |||
y2 = x2 * w; | |||
} | |||
@@ -93,8 +93,8 @@ float normal(float mean, float variance) | |||
} | |||
float lognormal(float mu, float sigma) { | |||
- float phi = sqrt((mu * mu) + (sigma * sigma)); | |||
- float mu_prime = log(((mu * mu)/phi)); | |||
- float sigma_prime = sqrt(log((phi * phi)/(mu * mu))); | |||
- return (exp(normal(mu_prime,sigma_prime))); | |||
+ float phi = sqrtf((mu * mu) + (sigma * sigma)); | |||
+ float mu_prime = logf(((mu * mu)/phi)); | |||
+ float sigma_prime = sqrtf(logf((phi * phi)/(mu * mu))); | |||
+ return (expf(normal(mu_prime,sigma_prime))); | |||
} |