Skip to content

Commit

Permalink
Remove remaining swap parameters
Browse files Browse the repository at this point in the history
Signed-off-by: root <root@bib.uni-mannheim.de>
  • Loading branch information
root authored and stweil committed Feb 5, 2017
1 parent 7d42526 commit 4fb5dfc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions ccstruct/fontinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ bool FontInfo::Serialize(FILE* fp) const {
}
// Reads from the given file. Returns false in case of error.
bool FontInfo::DeSerialize(FILE* fp) {
if (!read_info(fp, this, false)) return false;
if (!read_spacing_info(fp, this, false)) return false;
if (!read_info(fp, this)) return false;
if (!read_spacing_info(fp, this)) return false;
return true;
}

Expand Down Expand Up @@ -147,7 +147,7 @@ void FontSetDeleteCallback(FontSet fs) {

/*---------------------------------------------------------------------------*/
// Callbacks used by UnicityTable to read/write FontInfo/FontSet structures.
bool read_info(FILE* f, FontInfo* fi, bool) {
bool read_info(FILE* f, FontInfo* fi) {
uint32_t size;
if (!fread(&size, f)) return false;
char* font_name = new char[size + 1];
Expand All @@ -167,7 +167,7 @@ bool write_info(FILE* f, const FontInfo& fi) {
return true;
}

bool read_spacing_info(FILE *f, FontInfo* fi, bool) {
bool read_spacing_info(FILE *f, FontInfo* fi) {
inT32 vec_size, kern_size;
if (!fread(&vec_size, f)) return false;
ASSERT_HOST(vec_size >= 0);
Expand Down Expand Up @@ -224,7 +224,7 @@ bool write_spacing_info(FILE* f, const FontInfo& fi) {
return true;
}

bool read_set(FILE* f, FontSet* fs, bool) {
bool read_set(FILE* f, FontSet* fs) {
if (!fread(&fs->size, f)) return false;
fs->configs = new int[fs->size];
ASSERT_HOST(sizeof(int) == sizeof(int32_t));
Expand Down
6 changes: 3 additions & 3 deletions ccstruct/fontinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ void FontInfoDeleteCallback(FontInfo f);
void FontSetDeleteCallback(FontSet fs);

// Callbacks used by UnicityTable to read/write FontInfo/FontSet structures.
bool read_info(FILE* f, FontInfo* fi, bool swap);
bool read_info(FILE* f, FontInfo* fi);
bool write_info(FILE* f, const FontInfo& fi);
bool read_spacing_info(FILE *f, FontInfo* fi, bool swap);
bool read_spacing_info(FILE *f, FontInfo* fi);
bool write_spacing_info(FILE* f, const FontInfo& fi);
bool read_set(FILE* f, FontSet* fs, bool swap);
bool read_set(FILE* f, FontSet* fs);
bool write_set(FILE* f, const FontSet& fs);

} // namespace tesseract.
Expand Down
6 changes: 3 additions & 3 deletions ccutil/genericvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class GenericVector {
// Returns false on error or if the callback returns false.
// DEPRECATED. Use [De]Serialize[Classes] instead.
bool write(FILE* f, TessResultCallback2<bool, FILE*, T const &>* cb) const;
bool read(FILE* f, TessResultCallback3<bool, FILE*, T*, bool>* cb);
bool read(FILE* f, TessResultCallback2<bool, FILE*, T*>* cb);
// Writes a vector of simple types to the given file. Assumes that bitwise
// read/write of T will work. Returns false in case of error.
// TODO(rays) Change all callers to use TFile and remove deprecated methods.
Expand Down Expand Up @@ -881,14 +881,14 @@ bool GenericVector<T>::write(

template <typename T>
bool GenericVector<T>::read(FILE* f,
TessResultCallback3<bool, FILE*, T*, bool>* cb) {
TessResultCallback2<bool, FILE*, T*>* cb) {
inT32 reserved;
if (!fread(&reserved, f)) return false;
reserve(reserved);
if (!fread(&size_used_, f)) return false;
if (cb != NULL) {
for (int i = 0; i < size_used_; ++i) {
if (!cb->Run(f, data_ + i, false)) {
if (!cb->Run(f, data_ + i)) {
delete cb;
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions ccutil/unicity_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class UnicityTable {
/// once. The given callback will be deleted at the end.
/// Returns false on read/write error.
bool write(FILE* f, TessResultCallback2<bool, FILE*, T const &>* cb) const;
bool read(FILE* f, TessResultCallback3<bool, FILE*, T*, bool>* cb);
bool read(FILE* f, TessResultCallback2<bool, FILE*, T*>* cb);

private:
GenericVector<T> table_;
Expand Down Expand Up @@ -193,7 +193,7 @@ bool UnicityTable<T>::write(

template <typename T>
bool UnicityTable<T>::read(
FILE* f, TessResultCallback3<bool, FILE*, T*, bool>* cb) {
FILE* f, TessResultCallback2<bool, FILE*, T*>* cb) {
return table_.read(f, cb);
}

Expand Down

0 comments on commit 4fb5dfc

Please sign in to comment.