1 From 5b75dfa78b2c5e95296cee0201bc045ef7264ed0 Mon Sep 17 00:00:00 2001
2 From: Christian Grobmeier <grobmeier@apache.org>
3 Date: Tue, 27 Nov 2012 09:39:18 +0000
4 Subject: [PATCH] Applied patch for LOGCXX-400 LOGCXX-404 LOGCXX-402 LOGCXX-403
5 LOGCXX-401 thanks to Andrew Lazarus
7 git-svn-id: https://svn.apache.org/repos/asf/logging/log4cxx/trunk@1414037 13f79535-47bb-0310-9956-ffa450edef68
8 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
11 src/main/cpp/locationinfo.cpp | 4 ++--
12 src/main/cpp/loggingevent.cpp | 2 +-
13 src/main/cpp/ndc.cpp | 4 ++--
14 src/main/cpp/objectoutputstream.cpp | 4 ++--
15 src/main/cpp/transcoder.cpp | 2 +-
16 src/main/include/log4cxx/helpers/object.h | 6 +++---
17 src/main/include/log4cxx/helpers/simpledateformat.h | 4 +++-
18 src/main/include/log4cxx/logstring.h | 2 +-
19 9 files changed, 17 insertions(+), 13 deletions(-)
21 diff --git a/pom.xml b/pom.xml
22 index 3504c8a3..255907bd 100644
31 <artifactId>maven-antrun-plugin</artifactId>
39 <artifactId>maven-assembly-plugin</artifactId>
41 diff --git a/src/main/cpp/locationinfo.cpp b/src/main/cpp/locationinfo.cpp
42 index e76ea29c..1daa3a5f 100644
43 --- a/src/main/cpp/locationinfo.cpp
44 +++ b/src/main/cpp/locationinfo.cpp
45 @@ -153,8 +153,8 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
46 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E, 0x6C,
47 0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69,
48 0x2E, 0x4C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F,
49 - 0x6E, 0x49, 0x6E, 0x66, 0x6F, 0xED, 0x99, 0xBB,
50 - 0xE1, 0x4A, 0x91, 0xA5, 0x7C, 0x02, 0x00, 0x01,
51 + 0x6E, 0x49, 0x6E, 0x66, 0x6F, static_cast<char>(0xED), static_cast<char>(0x99), static_cast<char>(0xBB),
52 + static_cast<char>(0xE1), 0x4A, static_cast<char>(0x91), static_cast<char>(0xA5), 0x7C, 0x02, 0x00, 0x01,
53 0x4C, 0x00, 0x08, 0x66, 0x75, 0x6C, 0x6C, 0x49,
55 0x74, 0x00, 0x12, 0x4C, 0x6A,
56 diff --git a/src/main/cpp/loggingevent.cpp b/src/main/cpp/loggingevent.cpp
57 index 1c0d4be7..edbf40b6 100644
58 --- a/src/main/cpp/loggingevent.cpp
59 +++ b/src/main/cpp/loggingevent.cpp
60 @@ -242,7 +242,7 @@ void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) {
61 0x68, 0x65, 0x2E, 0x6C, 0x6F, 0x67, 0x34, 0x6A,
62 0x2E, 0x73, 0x70, 0x69, 0x2E, 0x4C, 0x6F, 0x67,
63 0x67, 0x69, 0x6E, 0x67, 0x45, 0x76, 0x65, 0x6E,
64 - 0x74, 0xF3, 0xF2, 0xB9, 0x23, 0x74, 0x0B, 0xB5,
65 + 0x74, static_cast<char>(0xF3), static_cast<char>(0xF2), static_cast<char>(0xB9), 0x23, 0x74, 0x0B, static_cast<char>(0xB5),
66 0x3F, 0x03, 0x00, 0x0A, 0x5A, 0x00, 0x15, 0x6D,
67 0x64, 0x63, 0x43, 0x6F, 0x70, 0x79, 0x4C, 0x6F,
68 0x6F, 0x6B, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75,
69 diff --git a/src/main/cpp/ndc.cpp b/src/main/cpp/ndc.cpp
70 index 4ab612dd..89788c16 100644
71 --- a/src/main/cpp/ndc.cpp
72 +++ b/src/main/cpp/ndc.cpp
73 @@ -309,7 +309,7 @@ bool NDC::pop(CFStringRef& dst)
74 Stack& stack = data->getStack();
77 - dst = Transcoder::encode(stack.top().message);
78 + dst = Transcoder::encode(getMessage(stack.top()));
82 @@ -326,7 +326,7 @@ bool NDC::peek(CFStringRef& dst)
83 Stack& stack = data->getStack();
86 - dst = Transcoder::encode(stack.top().message);
87 + dst = Transcoder::encode(getMessage(stack.top()));
91 diff --git a/src/main/cpp/objectoutputstream.cpp b/src/main/cpp/objectoutputstream.cpp
92 index 7cd696b8..9567a856 100644
93 --- a/src/main/cpp/objectoutputstream.cpp
94 +++ b/src/main/cpp/objectoutputstream.cpp
95 @@ -36,7 +36,7 @@ ObjectOutputStream::ObjectOutputStream(OutputStreamPtr outputStream, Pool& p)
96 objectHandle(0x7E0000),
97 classDescriptions(new ClassDescriptionMap())
99 - char start[] = { 0xAC, 0xED, 0x00, 0x05 };
100 + char start[] = { static_cast<char>(0xAC), static_cast<char>(0xED), 0x00, 0x05 };
101 ByteBuffer buf(start, sizeof(start));
104 @@ -85,7 +85,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
105 0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61,
106 0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61,
107 0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13,
108 - 0xBB, 0x0F, 0x25, 0x21, 0x4A, 0xE4, 0xB8, 0x03,
109 + static_cast<char>(0xBB), 0x0F, 0x25, 0x21, 0x4A, static_cast<char>(0xE4), static_cast<char>(0xB8), 0x03,
110 0x00, 0x02, 0x46, 0x00, 0x0A, 0x6C, 0x6F, 0x61,
111 0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49,
112 0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68,
113 diff --git a/src/main/cpp/transcoder.cpp b/src/main/cpp/transcoder.cpp
114 index d572ffce..32bed844 100644
115 --- a/src/main/cpp/transcoder.cpp
116 +++ b/src/main/cpp/transcoder.cpp
117 @@ -356,7 +356,7 @@ static void encodeUTF16(unsigned int sv, String& dst) {
118 unsigned char u = (unsigned char) (sv >> 16);
119 unsigned char w = (unsigned char) (u - 1);
120 unsigned short hs = (0xD800 + ((w & 0xF) << 6) + ((sv & 0xFFFF) >> 10));
121 - unsigned short ls = (0xDC00 + (sv && 0x3FF));
122 + unsigned short ls = (0xDC00 + (sv & 0x3FF));
126 diff --git a/src/main/include/log4cxx/helpers/object.h b/src/main/include/log4cxx/helpers/object.h
127 index 92d44c55..b9386c47 100644
128 --- a/src/main/include/log4cxx/helpers/object.h
129 +++ b/src/main/include/log4cxx/helpers/object.h
130 @@ -61,8 +61,8 @@ static const helpers::Class& getStaticClass();\
131 static const log4cxx::helpers::ClassRegistration& registerClass();
133 #define IMPLEMENT_LOG4CXX_OBJECT(object)\
134 -const log4cxx::helpers::Class& object::getClass() const { return getStaticClass(); }\
135 -const log4cxx::helpers::Class& object::getStaticClass() { \
136 +const ::log4cxx::helpers::Class& object::getClass() const { return getStaticClass(); }\
137 +const ::log4cxx::helpers::Class& object::getStaticClass() { \
138 static Clazz##object theClass; \
141 @@ -71,7 +71,7 @@ const log4cxx::helpers::ClassRegistration& object::registerClass() { \
144 namespace log4cxx { namespace classes { \
145 -const log4cxx::helpers::ClassRegistration& object##Registration = object::registerClass(); \
146 +const ::log4cxx::helpers::ClassRegistration& object##Registration = object::registerClass(); \
150 diff --git a/src/main/include/log4cxx/helpers/simpledateformat.h b/src/main/include/log4cxx/helpers/simpledateformat.h
151 index 9c27f685..76fb784c 100644
152 --- a/src/main/include/log4cxx/helpers/simpledateformat.h
153 +++ b/src/main/include/log4cxx/helpers/simpledateformat.h
158 -namespace std { class locale; }
165 diff --git a/src/main/include/log4cxx/logstring.h b/src/main/include/log4cxx/logstring.h
166 index 3bbcdf2d..19e8aec7 100644
167 --- a/src/main/include/log4cxx/logstring.h
168 +++ b/src/main/include/log4cxx/logstring.h
171 #include <log4cxx/log4cxx.h>
173 -#if LOG4CXX_LOGCHAR_IS_WCHAR && LOG4CXX_LOGCHAR_IS_UTF8 && LOG4CXX_LOGCHAR_IS_UNICHAR
174 +#if (LOG4CXX_LOGCHAR_IS_WCHAR + LOG4CXX_LOGCHAR_IS_UTF8 + LOG4CXX_LOGCHAR_IS_UNICHAR)>1
175 #error only one of LOG4CXX_LOGCHAR_IS_WCHAR, LOG4CXX_LOGCHAR_IS_UTF8 or LOG4CXX_LOGCHAR_IS_UNICHAR may be true