diff options
author | John Wiegley <johnw@newartisans.com> | 2007-06-08 04:13:20 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:39:08 -0400 |
commit | b7b4c079266e0e9ef18dbe006a4a135643cf890b (patch) | |
tree | c1196c1e39dc97024f9b306d564f7b1e0dac84d3 /src/utility/binary.cc | |
parent | ec850814fdd6424db791ef79cab82eb2a2e5afbe (diff) | |
download | fork-ledger-b7b4c079266e0e9ef18dbe006a4a135643cf890b.tar.gz fork-ledger-b7b4c079266e0e9ef18dbe006a4a135643cf890b.tar.bz2 fork-ledger-b7b4c079266e0e9ef18dbe006a4a135643cf890b.zip |
r384@user1022: johnw | 2007-06-08 00:08:53 -0400
Corrected several minor warnings
Diffstat (limited to 'src/utility/binary.cc')
-rw-r--r-- | src/utility/binary.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utility/binary.cc b/src/utility/binary.cc index 5802c3bd..52d5f196 100644 --- a/src/utility/binary.cc +++ b/src/utility/binary.cc @@ -38,7 +38,7 @@ void read_bool(std::istream& in, bool& num) { read_guard(in, 0x2005); unsigned char val; - in.read((char *)&val, sizeof(val)); + in.read(reinterpret_cast<char *>(&val), sizeof(val)); num = val == 1; read_guard(in, 0x2006); } @@ -46,7 +46,7 @@ void read_bool(std::istream& in, bool& num) void read_bool(const char *& data, bool& num) { read_guard(data, 0x2005); - unsigned char val = *((unsigned char *) data); + const unsigned char val = *reinterpret_cast<const unsigned char *>(data); data += sizeof(unsigned char); num = val == 1; read_guard(data, 0x2006); @@ -130,7 +130,7 @@ void write_bool(std::ostream& out, bool num) { write_guard(out, 0x2005); unsigned char val = num ? 1 : 0; - out.write((char *)&val, sizeof(val)); + out.write(reinterpret_cast<char *>(&val), sizeof(val)); write_guard(out, 0x2006); } |