Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78385 - trunk/libs/iostreams/test
From: dnljms_at_[hidden]
Date: 2012-05-08 16:06:40


Author: danieljames
Date: 2012-05-08 16:06:39 EDT (Tue, 08 May 2012)
New Revision: 78385
URL: http://svn.boost.org/trac/boost/changeset/78385

Log:
Iostreams: Fix gzip test failures in C++0x gcc 4.4.

Was getting this error:

{{{
gzip_test.cpp: In function 'void header_test()':
gzip_test.cpp:134: error: narrowing conversion of '139' from 'const int' to 'const char' inside { }
gzip_test.cpp:134: error: narrowing conversion of '156' from 'int' to 'const char' inside { }
gzip_test.cpp:134: error: narrowing conversion of '243' from 'int' to 'const char' inside { }
}}}

Although it's only a warning in later versions of gcc.
Text files modified:
   trunk/libs/iostreams/test/gzip_test.cpp | 6 +++---
   1 files changed, 3 insertions(+), 3 deletions(-)

Modified: trunk/libs/iostreams/test/gzip_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/gzip_test.cpp (original)
+++ trunk/libs/iostreams/test/gzip_test.cpp 2012-05-08 16:06:39 EDT (Tue, 08 May 2012)
@@ -120,11 +120,11 @@
     // The extra field data used here is characteristic of the tabix file
     // format (http://samtools.sourceforge.net/tabix.shtml).
     const char header_bytes[] = {
- gzip::magic::id1,
- gzip::magic::id2,
+ static_cast<char>(gzip::magic::id1),
+ static_cast<char>(gzip::magic::id2),
         gzip::method::deflate, // Compression Method: deflate
         gzip::flags::extra | gzip::flags::name | gzip::flags::comment, // flags
- 0x22, 0x9c, 0xf3, 0x4e, // 4 byte modification time (little endian)
+ '\x22', '\x9c', '\xf3', '\x4e', // 4 byte modification time (little endian)
         gzip::extra_flags::best_compression, // XFL
         gzip::os_unix, // OS
         6, 0, // 2 byte length of extra field (little endian, 6 bytes)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk