diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-09 10:02:56 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:42 -0400 |
commit | 8e20c378d6ee6eb36f8c6866f8c9ec52f8600c58 (patch) | |
tree | f610a289a997487d89f6b24dc48f5e1ffce35628 /src/binary.h | |
parent | 623e6e024cf43fc855c889314b8da8802c2f0449 (diff) | |
download | fork-ledger-8e20c378d6ee6eb36f8c6866f8c9ec52f8600c58.tar.gz fork-ledger-8e20c378d6ee6eb36f8c6866f8c9ec52f8600c58.tar.bz2 fork-ledger-8e20c378d6ee6eb36f8c6866f8c9ec52f8600c58.zip |
The unit tests for amount.cc now cover every part of the code except
for two: those concerning annotated commodities (which will be covered
in the t_commodity.cc tests) and reading of optimized amounts in the
binary journal reader.
Diffstat (limited to 'src/binary.h')
-rw-r--r-- | src/binary.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/binary.h b/src/binary.h index 194c675e..5d699f7b 100644 --- a/src/binary.h +++ b/src/binary.h @@ -55,7 +55,7 @@ inline void read_binary_number_nocheck(std::istream& in, T& num) { } template <typename T> -inline void read_binary_number_nocheck(char *& data, T& num) { +inline void read_binary_number_nocheck(const char *& data, T& num) { num = *((T *) data); data += sizeof(T); } @@ -68,7 +68,7 @@ inline T read_binary_number_nocheck(std::istream& in) { } template <typename T> -inline T read_binary_number_nocheck(char *& data) { +inline T read_binary_number_nocheck(const char *& data) { T num; read_binary_number_nocheck(data, num); return num; @@ -90,7 +90,7 @@ inline void read_binary_number(std::istream& in, T& num) { } template <typename T> -inline void read_binary_number(char *& data, T& num) { +inline void read_binary_number(const char *& data, T& num) { read_binary_guard(data, 0x2003); num = *((T *) data); data += sizeof(T); @@ -105,14 +105,14 @@ inline T read_binary_number(std::istream& in) { } template <typename T> -inline T read_binary_number(char *& data) { +inline T read_binary_number(const char *& data) { T num; read_binary_number(data, num); return num; } void read_binary_bool(std::istream& in, bool& num); -void read_binary_bool(char *& data, bool& num); +void read_binary_bool(const char *& data, bool& num); inline bool read_binary_bool(std::istream& in) { bool num; @@ -120,7 +120,7 @@ inline bool read_binary_bool(std::istream& in) { return num; } -inline bool read_binary_bool(char *& data) { +inline bool read_binary_bool(const char *& data) { bool num; read_binary_bool(data, num); return num; @@ -156,7 +156,7 @@ void read_binary_long(std::istream& in, T& num) } template <typename T> -void read_binary_long(char *& data, T& num) +void read_binary_long(const char *& data, T& num) { read_binary_guard(data, 0x2001); @@ -192,15 +192,15 @@ inline T read_binary_long(std::istream& in) { } template <typename T> -inline T read_binary_long(char *& data) { +inline T read_binary_long(const char *& data) { T num; read_binary_long(data, num); return num; } void read_binary_string(std::istream& in, string& str); -void read_binary_string(char *& data, string& str); -void read_binary_string(char *& data, string * str); +void read_binary_string(const char *& data, string& str); +void read_binary_string(const char *& data, string * str); inline string read_binary_string(std::istream& in) { string temp; @@ -208,7 +208,7 @@ inline string read_binary_string(std::istream& in) { return temp; } -inline string read_binary_string(char *& data) { +inline string read_binary_string(const char *& data) { string temp; read_binary_string(data, temp); return temp; |