Merge lp:~zorba-coders/zorba/bug-992037 into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Paul J. Lucas
Approved revision: 10814
Merged at revision: 10819
Proposed branch: lp:~zorba-coders/zorba/bug-992037
Merge into: lp:zorba
Diff against target: 125 lines (+34/-6)
4 files modified
include/zorba/transcode_stream.h (+22/-0)
src/runtime/json/common.h (+9/-4)
src/util/icu_streambuf.h (+1/-0)
src/zorbautils/locale.cpp (+2/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-992037
Reviewer Review Type Date Requested Status
David Graf (community) Approve
Paul J. Lucas Approve
Review via email: mp+104406@code.launchpad.net

Commit message

Fixed warnings and build error.

Description of the change

Fixed warnings and build error.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
David Graf (davidagraf) wrote :

Changes do work on Windows.

review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-992037-2012-05-03T14-01-36.651Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/zorba/transcode_stream.h'
2--- include/zorba/transcode_stream.h 2012-04-24 12:39:38 +0000
3+++ include/zorba/transcode_stream.h 2012-05-02 15:42:22 +0000
4@@ -58,6 +58,7 @@
5 * os.ios::rdbuf( tbuf.orig_streambuf() );
6 * throw;
7 * }
8+ * os.ios::rdbuf( tbuf.orig_streambuf() );
9 * }
10 * \endcode
11 * Alternatively, you may wish to use either \c attach(), \c auto_attach, or
12@@ -254,7 +255,14 @@
13 * @throws std::invalid_argument if \a charset is not supported.
14 */
15 stream( char const *charset ) :
16+#ifdef WIN32
17+# pragma warning( push )
18+# pragma warning( disable : 4355 )
19+#endif /* WIN32 */
20 tbuf_( charset, this->rdbuf() )
21+#ifdef WIN32
22+# pragma warning( pop )
23+#endif /* WIN32 */
24 {
25 init();
26 }
27@@ -272,7 +280,14 @@
28 template<typename StreamArgType>
29 stream( char const *charset, StreamArgType stream_arg ) :
30 StreamType( stream_arg ),
31+#ifdef WIN32
32+# pragma warning( push )
33+# pragma warning( disable : 4355 )
34+#endif /* WIN32 */
35 tbuf_( charset, this->rdbuf() )
36+#ifdef WIN32
37+# pragma warning( pop )
38+#endif /* WIN32 */
39 {
40 init();
41 }
42@@ -292,7 +307,14 @@
43 stream( char const *charset, StreamArgType stream_arg,
44 std::ios_base::openmode mode ) :
45 StreamType( stream_arg, mode ),
46+#ifdef WIN32
47+# pragma warning( push )
48+# pragma warning( disable : 4355 )
49+#endif /* WIN32 */
50 tbuf_( charset, this->rdbuf() )
51+#ifdef WIN32
52+# pragma warning( pop )
53+#endif /* WIN32 */
54 {
55 init();
56 }
57
58=== modified file 'src/runtime/json/common.h'
59--- src/runtime/json/common.h 2012-02-08 15:45:53 +0000
60+++ src/runtime/json/common.h 2012-05-02 15:42:22 +0000
61@@ -56,21 +56,26 @@
62
63 typedef std::ostream& (*std_omanip_type)(std::ostream&);
64
65-inline std::ostream& if_do( std::ostream &o, bool expr, std_omanip_type fn ) {
66+inline std::ostream& if_do_impl( std::ostream &o, bool expr,
67+ std_omanip_type fn ) {
68 if ( expr )
69 o << fn;
70 return o;
71 }
72-DEF_OMANIP2( if_do, bool, std_omanip_type )
73+DEF_OMANIP2( if_do_impl, bool, std_omanip_type )
74+// A macro with a !! is used to supporess a warning from MSVC++.
75+#define if_do(EXPR,FN) if_do_impl( !!(EXPR), (FN) )
76
77 #define if_indent(WS,FN) if_do( (WS) == whitespace::indent, FN )
78
79-inline std::ostream& if_emit( std::ostream &o, bool expr, char c ) {
80+inline std::ostream& if_emit_impl( std::ostream &o, bool expr, char c ) {
81 if ( expr )
82 o << c;
83 return o;
84 }
85-DEF_OMANIP2( if_emit, bool, char )
86+DEF_OMANIP2( if_emit_impl, bool, char )
87+// A macro with a !! is used to supporess a warning from MSVC++.
88+#define if_emit(EXPR,C) if_emit_impl( !!(EXPR), (C) )
89
90 ///////////////////////////////////////////////////////////////////////////////
91
92
93=== modified file 'src/util/icu_streambuf.h'
94--- src/util/icu_streambuf.h 2012-04-24 12:39:38 +0000
95+++ src/util/icu_streambuf.h 2012-05-02 15:42:22 +0000
96@@ -51,6 +51,7 @@
97 * os.ios::rdbuf( xbuf.original() );
98 * throw;
99 * }
100+ * os.ios::rdbuf( xbuf.original() );
101 * }
102 * \endcode
103 *
104
105=== modified file 'src/zorbautils/locale.cpp'
106--- src/zorbautils/locale.cpp 2012-04-24 18:22:23 +0000
107+++ src/zorbautils/locale.cpp 2012-05-02 15:42:22 +0000
108@@ -70,7 +70,7 @@
109 static char* get_win32_locale_info( int constant ) {
110 int bytes = ::GetLocaleInfoA( LOCALE_USER_DEFAULT, constant, NULL, 0 );
111 ZORBA_FATAL( bytes, "GetLocaleInfoA() failed" );
112- unique_ptr<char[]> info = new char[ bytes ];
113+ unique_ptr<char[]> info( new char[ bytes ] );
114 bytes = ::GetLocaleInfoA( LOCALE_USER_DEFAULT, constant, info.get(), bytes );
115 ZORBA_FATAL( bytes, "GetLocaleInfoA() failed" );
116 return info.release();
117@@ -589,7 +589,7 @@
118 "ara", // Arabic
119 "arg", // Aragonese
120 "arm", // Armenian
121- "asm", // Assamese [without '_', it's a C++ keyword]
122+ "asm", // Assamese
123 "ava", // Avaric
124 "ave", // Avestan
125 "aym", // Aymara

Subscribers

People subscribed via source and target branches