← Back to team overview

zorba-coders team mailing list archive

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

 

Paul J. Lucas has proposed merging lp:~zorba-coders/zorba/bug-992037 into lp:zorba.

Requested reviews:
  David Graf (davidagraf)
Related bugs:
  Bug #992037 in Zorba: "Miscellaneous warnings on Windows"
  https://bugs.launchpad.net/zorba/+bug/992037

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-992037/+merge/104406

Fixed warnings and build error.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-992037/+merge/104406
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'include/zorba/transcode_stream.h'
--- include/zorba/transcode_stream.h	2012-04-24 12:39:38 +0000
+++ include/zorba/transcode_stream.h	2012-05-02 15:42:22 +0000
@@ -58,6 +58,7 @@
  *      os.ios::rdbuf( tbuf.orig_streambuf() );
  *      throw;
  *    }
+ *    os.ios::rdbuf( tbuf.orig_streambuf() );
  *  }
  * \endcode
  * Alternatively, you may wish to use either \c attach(), \c auto_attach, or
@@ -254,7 +255,14 @@
    * @throws std::invalid_argument if \a charset is not supported.
    */
   stream( char const *charset ) :
+#ifdef WIN32
+# pragma warning( push )
+# pragma warning( disable : 4355 )
+#endif /* WIN32 */
     tbuf_( charset, this->rdbuf() )
+#ifdef WIN32
+# pragma warning( pop )
+#endif /* WIN32 */
   {
     init();
   }
@@ -272,7 +280,14 @@
   template<typename StreamArgType>
   stream( char const *charset, StreamArgType stream_arg ) :
     StreamType( stream_arg ),
+#ifdef WIN32
+# pragma warning( push )
+# pragma warning( disable : 4355 )
+#endif /* WIN32 */
     tbuf_( charset, this->rdbuf() )
+#ifdef WIN32
+# pragma warning( pop )
+#endif /* WIN32 */
   {
     init();
   }
@@ -292,7 +307,14 @@
   stream( char const *charset, StreamArgType stream_arg,
           std::ios_base::openmode mode ) :
     StreamType( stream_arg, mode ),
+#ifdef WIN32
+# pragma warning( push )
+# pragma warning( disable : 4355 )
+#endif /* WIN32 */
     tbuf_( charset, this->rdbuf() )
+#ifdef WIN32
+# pragma warning( pop )
+#endif /* WIN32 */
   {
     init();
   }

=== modified file 'src/runtime/json/common.h'
--- src/runtime/json/common.h	2012-02-08 15:45:53 +0000
+++ src/runtime/json/common.h	2012-05-02 15:42:22 +0000
@@ -56,21 +56,26 @@
 
 typedef std::ostream& (*std_omanip_type)(std::ostream&);
 
-inline std::ostream& if_do( std::ostream &o, bool expr, std_omanip_type fn ) {
+inline std::ostream& if_do_impl( std::ostream &o, bool expr,
+                                 std_omanip_type fn ) {
   if ( expr )
     o << fn;
   return o;
 }
-DEF_OMANIP2( if_do, bool, std_omanip_type )
+DEF_OMANIP2( if_do_impl, bool, std_omanip_type )
+// A macro with a !! is used to supporess a warning from MSVC++.
+#define if_do(EXPR,FN) if_do_impl( !!(EXPR), (FN) )
 
 #define if_indent(WS,FN) if_do( (WS) == whitespace::indent, FN )
 
-inline std::ostream& if_emit( std::ostream &o, bool expr, char c ) {
+inline std::ostream& if_emit_impl( std::ostream &o, bool expr, char c ) {
   if ( expr )
     o << c;
   return o;
 }
-DEF_OMANIP2( if_emit, bool, char )
+DEF_OMANIP2( if_emit_impl, bool, char )
+// A macro with a !! is used to supporess a warning from MSVC++.
+#define if_emit(EXPR,C) if_emit_impl( !!(EXPR), (C) )
 
 ///////////////////////////////////////////////////////////////////////////////
 

=== modified file 'src/util/icu_streambuf.h'
--- src/util/icu_streambuf.h	2012-04-24 12:39:38 +0000
+++ src/util/icu_streambuf.h	2012-05-02 15:42:22 +0000
@@ -51,6 +51,7 @@
  *      os.ios::rdbuf( xbuf.original() );
  *      throw;
  *    }
+ *    os.ios::rdbuf( xbuf.original() );
  *  }
  * \endcode
  *

=== modified file 'src/zorbautils/locale.cpp'
--- src/zorbautils/locale.cpp	2012-04-24 18:22:23 +0000
+++ src/zorbautils/locale.cpp	2012-05-02 15:42:22 +0000
@@ -70,7 +70,7 @@
 static char* get_win32_locale_info( int constant ) {
   int bytes = ::GetLocaleInfoA( LOCALE_USER_DEFAULT, constant, NULL, 0 );
   ZORBA_FATAL( bytes, "GetLocaleInfoA() failed" );
-  unique_ptr<char[]> info = new char[ bytes ];
+  unique_ptr<char[]> info( new char[ bytes ] );
   bytes = ::GetLocaleInfoA( LOCALE_USER_DEFAULT, constant, info.get(), bytes );
   ZORBA_FATAL( bytes, "GetLocaleInfoA() failed" );
   return info.release();
@@ -589,7 +589,7 @@
   "ara",  // Arabic
   "arg",  // Aragonese
   "arm",  // Armenian
-  "asm",  // Assamese [without '_', it's a C++ keyword]
+  "asm",  // Assamese
   "ava",  // Avaric
   "ave",  // Avestan
   "aym",  // Aymara


Follow ups