redpony/cdec — pull request #6 by neubig (2012-05-28 08:03:13+00:00)
Title: Changed implicit casts (from void* to gzFile_s*) in klm

With the current version I get a compile error in klm/util/file_piece.cc

file_piece.cc: In constructor ‘util::GZException::GZException(void*)’:
file_piece.cc:34: error: invalid conversion from ‘void*’ to ‘gzFile_s*’
file_piece.cc:34: error: initializing argument 1 of ‘const char* gzerror(gzFile_s*, int*)’
file_piece.cc: In destructor ‘util::FilePiece::~FilePiece()’:
file_piece.cc:59: error: invalid conversion from ‘void*’ to ‘gzFile_s*’
file_piece.cc:59: error: initializing argument 1 of ‘int gzclose(gzFile_s*)’
file_piece.cc: In member function ‘void util::FilePiece::ReadShift()’:
file_piece.cc:299: error: invalid conversion from ‘void*’ to ‘gzFile_s*’
file_piece.cc:299: error: initializing argument 1 of ‘int gzread(gzFile_s*, void*, unsigned int)’

The compiler (g++ (Debian 4.4.5-8) 4.4.5) is getting mad at me for doing an implicit cast, so this pull request fixes this by adding explicit casts. The strange thing is, the same compiler works fine when compiling the kenlm I pulled directly from git, and I wasn't immediately able to debug why... Feel free to deny the request and fix it upstream, whatever works best.