Permalink
Browse files
fixed mingw failure to compile.
- Loading branch information...
Showing
with
1 addition
and
50 deletions.
-
+1
−1
VERSION
-
+0
−11
ref_read.h
-
+0
−38
word_io.h
|
|
@@ -1 +1 @@ |
|
|
-1.0.1
|
|
|
+2.0.0
|
|
|
@@ -75,17 +75,6 @@ struct RefRecord { |
|
|
first = fgetc(in) ? true : false;
|
|
|
}
|
|
|
|
|
|
- RefRecord(int in, bool swap) {
|
|
|
- off = readU<TIndexOffU>(in, swap);
|
|
|
- len = readU<TIndexOffU>(in, swap);
|
|
|
- char c;
|
|
|
- if(!read(in, &c, 1)) {
|
|
|
- cerr << "Error reading RefRecord 'first' flag" << endl;
|
|
|
- throw 1;
|
|
|
- }
|
|
|
- first = (c ? true : false);
|
|
|
- }
|
|
|
-
|
|
|
void write(std::ostream& out, bool be) {
|
|
|
writeU<TIndexOffU>(out, off, be);
|
|
|
writeU<TIndexOffU>(out, len, be);
|
|
|
|
|
|
@@ -123,43 +123,5 @@ static inline T readI(FILE* in, bool swap) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
-template <typename T>
|
|
|
-static inline T readU(int in, bool swap) {
|
|
|
- T x;
|
|
|
- if(read(in, (void *)&x, sizeof(T)) != sizeof(T)) {
|
|
|
- assert(false);
|
|
|
- }
|
|
|
- if(swap) {
|
|
|
- if(sizeof(T) == 4) {
|
|
|
- return endianSwapU32(x);
|
|
|
- } else if(sizeof(T) == 8) {
|
|
|
- return endianSwapU64(x);
|
|
|
- } else {
|
|
|
- assert(false);
|
|
|
- }
|
|
|
- } else {
|
|
|
- return x;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-template <typename T>
|
|
|
-static inline T readI(int in, bool swap) {
|
|
|
- T x;
|
|
|
- if(read(in, (void *)&x, sizeof(T)) != sizeof(T)) {
|
|
|
- assert(false);
|
|
|
- }
|
|
|
- if(swap) {
|
|
|
- if(sizeof(T) == 4) {
|
|
|
- return endianSwapI32(x);
|
|
|
- } else if(sizeof(T) == 8) {
|
|
|
- return endianSwapI64(x);
|
|
|
- } else {
|
|
|
- assert(false);
|
|
|
- }
|
|
|
- } else {
|
|
|
- return x;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
#endif /*WORD_IO_H_*/
|
0 comments on commit
1633758