[Libreoffice-commits] online.git: 3 commits - common/Log.hpp common/Util.hpp kit/Kit.cpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Oct 17 08:49:20 UTC 2018
common/Log.hpp | 16 +++++++-------
common/Util.hpp | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
kit/Kit.cpp | 2 +
3 files changed, 71 insertions(+), 8 deletions(-)
New commits:
commit 017df44f89e4c4f0d68cecb881bd72f2a5350f51
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Oct 17 11:48:51 2018 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Oct 17 11:48:51 2018 +0300
Bypass bTraceStartup thing on MOBILEAPP
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 31531afbf..4caff9078 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -2478,11 +2478,13 @@ void lokit_main(
LOG_INF("New kit client websocket inserted.");
+#ifndef MOBILEAPP
if (bTraceStartup && LogLevel != "trace")
{
LOG_INF("Kit initialization complete: setting log-level to [" << LogLevel << "] as configured.");
Log::logger().setLevel(LogLevel);
}
+#endif
while (!TerminationFlag)
{
commit b90fafa54f80dbe41531b518030a3c3c4674e2ec
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Oct 17 11:48:22 2018 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Oct 17 11:48:22 2018 +0300
Adapt to change in LOG_BODY_ parameters
diff --git a/common/Log.hpp b/common/Log.hpp
index 9d6dae00d..7aaf4174d 100644
--- a/common/Log.hpp
+++ b/common/Log.hpp
@@ -249,14 +249,14 @@ namespace Log
} \
} while (false)
-#define LOG_TRC_NOFILE(X) \
- do \
- { \
- auto &l_ = Log::logger(); \
- if (l_.trace()) \
- { \
- LOG_BODY_(TRACE, "TRC", X, false); \
- } \
+#define LOG_TRC_NOFILE(X) \
+ do \
+ { \
+ auto &log_ = Log::logger(); \
+ if (log_.trace()) \
+ { \
+ LOG_BODY_(log_, TRACE, "TRC", X, false);\
+ } \
} while (false)
#define LOG_DBG(X) \
commit ccc7d2133deb9c2d466a0c0ed686b9676bb33d26
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Oct 17 11:22:03 2018 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Oct 17 11:46:56 2018 +0300
"The memrchr() function is a GNU extension, available since glibc 2.1.91."
Thus it doesn't exist on iOS, so add a trivial implementation. Include
an (ifdeffed out) unit test for it.
diff --git a/common/Util.hpp b/common/Util.hpp
index d3a5ba115..29258efdb 100644
--- a/common/Util.hpp
+++ b/common/Util.hpp
@@ -332,6 +332,67 @@ namespace Util
return false;
}
+#ifdef IOS
+
+ void *memrchr(const void *s, int c, size_t n)
+ {
+ char *p = (char*)s + n - 1;
+ while (p >= (char*)s)
+ {
+ if (*p == c)
+ return p;
+ p--;
+ }
+ return nullptr;
+ }
+
+#if 0
+
+// Unit test for the above memrchr()
+
+int main(int argc, char**argv)
+{
+ int success = 1;
+ char *s;
+ char *p;
+
+#define TEST(s_,c,n,e) \
+ s = s_; \
+ printf("memrchr(\"%s\",'%c',%d)=",s,c,n); \
+ p = memrchr(s, c, n); \
+ if (p) \
+ printf("\"%s\"", p); \
+ else \
+ printf("NULL"); \
+ if (p == e) \
+ printf(" OK\n"); \
+ else \
+ { \
+ printf(" FAIL\n"); \
+ success = 0; \
+ }
+
+ TEST("abc", 'x', 0, NULL);
+ TEST("abc", 'x', 1, NULL);
+ TEST("abc", 'x', 3, NULL);
+ TEST("abc", 'a', 0, NULL);
+ TEST("abc", 'a', 1, s);
+ TEST("abc", 'a', 3, s);
+ TEST("abc", 'b', 0, NULL);
+ TEST("abc", 'b', 1, NULL);
+ TEST("abc", 'b', 2, s+1);
+ TEST("abc", 'b', 3, s+1);
+
+ if (success)
+ return 0;
+ else
+ return 1;
+}
+
+#endif
+
+#endif
+
inline size_t getLastDelimiterPosition(const char* message, const int length, const char delim)
{
if (message && length > 0)
More information about the Libreoffice-commits
mailing list