Bei ein paar ersten Interaktionen konnte ich keinen (spürbaren) Unterschied feststellen.
Im Code haben sich an einigen Stellen ein paar Typos eingeschlichen. Außerdem fände ich es günstiger, wenn in stringhelpers.h der Test auf Kontrollzeichen und Space ("remove all ASCII <= 32 from left and right") auch in den Schleifen einheitlich als Test auf 32 (bei Zeichencodes eigentlich bevorzugt in Hex-Notation, also 0x20) anstatt abwechselnd auf 32 und 33 ausgestaltet wäre.
Wenn du die genannten Korrekturen übernehmen möchtest:
Diff
diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp
index 3df376d..cf163d8 100644
--- a/pages/recordings.ecpp
+++ b/pages/recordings.ecpp
@@ -274,7 +274,7 @@ dsyslog("live, time recordings.ecpp: %f", timeNeeded.count());
<%include>page_exit.eh</%include>
<#
-param insted of args does not work. Seems to be a bug in ecpp:
+param instead of args does not work. Seems to be a bug in ecpp:
ecpp creates the macro TNT_PARAM(uintptr_t, iRecItem, recordings.ecpp, (0));
-> but this macro only takes 3 arguments, recordings.ecpp should be removed
<%param>
diff --git a/stringhelpers.h b/stringhelpers.h
index 757ece1..b4de684 100644
--- a/stringhelpers.h
+++ b/stringhelpers.h
@@ -655,14 +655,14 @@ inline wint_t getNextUtfCodepoint(const char *&p) {
// =========================================================
inline cSv trim(cSv s) {
- // remove all ASCII <= 32 from left and right
- // this is whitespace and special characters
+ // remove all ASCII <= 32 from left and right,
+ // which is whitespace and special characters
cSv::size_type left = 0;
- for (; left < s.length() && (unsigned char)s[left] < 33; ++left);
+ for (; left < s.length() && (unsigned char)s[left] <= 32; ++left);
cSv::size_type right = s.length();
- for (; right > left && (unsigned char)s[right-1] < 33; --right);
+ for (; right > left && (unsigned char)s[right-1] <= 32; --right);
return s.substr(left, right-left);
}
@@ -681,20 +681,20 @@ inline cSv remove_leading_whitespace(cSv s) {
// avoid changing sv: cSv &sv is much slower than cSv sv
cSv::size_type left = 0;
- for (; left < s.length() && (unsigned char)s[left] < 33; ++left);
+ for (; left < s.length() && (unsigned char)s[left] <= 32; ++left);
return s.substr(left);
}
inline void trim_string(std::string &s) {
- // remove all ASCII <= 32 from left and right
- // this is whitespace and special characters
+ // remove all ASCII <= 32 from left and right,
+ // which is whitespace and special characters
std::string::size_type left = 0;
- for (; left < s.length() && (unsigned char)s[left] < 33; ++left);
+ for (; left < s.length() && (unsigned char)s[left] <= 32; ++left);
s.erase(0, left);
cSv::size_type right = s.length();
- for (; right > 0 && (unsigned char)s[right-1] < 33; --right);
+ for (; right > 0 && (unsigned char)s[right-1] <= 32; --right);
s.erase(right);
}
// =========================================================
diff --git a/thread.cpp b/thread.cpp
index afc7c33..ac960cc 100644
--- a/thread.cpp
+++ b/thread.cpp
@@ -32,7 +32,7 @@ void ServerThread::Action()
try {
m_server.reset(new Tntnet());
TntConfig::Get().Configure(*m_server); // this calls live/tntconfig.cpp -> Configure(...)
-// TntConfig is vdrlive::TntConfig, und NOT tnt::TntConfig !!!!
+// TntConfig is vdrlive::TntConfig, but NOT tnt::TntConfig
m_server->run();
m_server.reset(0);
} catch (std::exception const& ex) {
diff --git a/tntconfig.cpp b/tntconfig.cpp
index e21939d..99b6da5 100644
--- a/tntconfig.cpp
+++ b/tntconfig.cpp
@@ -160,8 +160,8 @@ namespace vdrlive {
* - images
* - ...
*
- * lokking at man tntent, <target>static@tntnet</target> can be used for that
- * but: this requires the tntnet componet, which is not available here / deliverd with live
+ * looking at man tntnet, <target>static@tntnet</target> can be used for that
+ * but: this requires the tntnet component, which is not available here / delivered with live
* note: live is a standalone webserver, and NOT tntnet with some components
*
* live has an own component to deliver static files: content
Display More


