Skip to content

Commit

Permalink
fixed mingw failure to compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
val-antonescu committed Jul 19, 2014
1 parent c5b0d34 commit 1633758
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 50 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.0.1
2.0.0
11 changes: 0 additions & 11 deletions ref_read.h
Expand Up @@ -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);
Expand Down
38 changes: 0 additions & 38 deletions word_io.h
Expand Up @@ -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

Please sign in to comment.