Fixed more size_t warnings

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@559 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2012-03-20 09:32:02 +00:00
parent 118202c476
commit 704fffc423
3 changed files with 11 additions and 6 deletions

View File

@@ -589,7 +589,7 @@ bool _OFFReader_::can_u_read(std::istream& _is) const
_is.getline(line, LINE_LEN);
p = line;
int remainingChars = _is.gcount();
size_t remainingChars = _is.gcount();
bool vertexDimensionTooHigh = false;
@@ -615,7 +615,12 @@ bool _OFFReader_::can_u_read(std::istream& _is) const
return false;
p += 4;
remainingChars -= 4;
// Detect possible garbage and make sure, we don't have an underflow
if ( remainingChars >= 4 )
remainingChars -= 4;
else
remainingChars = 0;
if ( ( remainingChars >= 6 ) && ( strncmp(p, "BINARY", 6) == 0 ) )
options_+= Options::Binary;

View File

@@ -892,7 +892,7 @@ bool _PLYReader_::can_u_read(std::istream& _is) const {
return false;
}
unsigned int streamPos = _is.tellg();
size_t streamPos = _is.tellg();
_is >> keyword;
while (keyword != "end_header") {

View File

@@ -365,15 +365,15 @@ check_stl_type(const std::string& _filename) const
// read number of triangles
char dummy[100];
fread(dummy, 1, 80, in);
unsigned int nT = read_int(in, swapFlag);
size_t nT = read_int(in, swapFlag);
// compute file size from nT
unsigned int binary_size = 84 + nT*50;
size_t binary_size = 84 + nT*50;
// get actual file size
unsigned int file_size(0);
size_t file_size(0);
rewind(in);
while (!feof(in))
file_size += fread(dummy, 1, 100, in);