billions of warnings

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@897 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
hieuhoang1972 2006-10-17 23:17:34 +00:00
parent fd6b4081cd
commit 3e79119d59

View File

@ -38,7 +38,7 @@ template<typename T> inline size_t fWrite(FILE* f,const T b,const T e) {
}
template<typename C> inline size_t fWriteVector(FILE* f,const C& v) {
unsigned s=v.size();
size_t s=v.size();
size_t rv=fWrite(f,s);
if(fwrite(&v[0],sizeof(typename C::value_type),s,f)!=s) {std::cerr<<"ERROR: fwrite!\n";abort();}
return rv+sizeof(typename C::value_type)*s;
@ -46,7 +46,7 @@ template<typename C> inline size_t fWriteVector(FILE* f,const C& v) {
template<typename C> inline void fReadVector(FILE* f, C& v) {
unsigned s;fRead(f,s);v.resize(s);
unsigned r=fread(&(*v.begin()),sizeof(typename C::value_type),s,f);
size_t r=fread(&(*v.begin()),sizeof(typename C::value_type),s,f);
if(r!=s) {
std::cerr<<"ERROR: freadVec! "<<r<<" "<<s<<"\n";abort();}
}