diff --git a/dlib/image_loader/jpeg_loader.cpp b/dlib/image_loader/jpeg_loader.cpp index b28bdf9ea..b1d44c7a4 100644 --- a/dlib/image_loader/jpeg_loader.cpp +++ b/dlib/image_loader/jpeg_loader.cpp @@ -182,7 +182,7 @@ namespace dlib data.resize(height_*width_*output_components_); // setup pointers to each row - for (unsigned long i = 0; i < rows.size(); ++i) + for (size_t i = 0; i < rows.size(); ++i) rows[i] = &data[i*width_*output_components_]; // read the data into the buffer diff --git a/dlib/image_loader/jpeg_loader.h b/dlib/image_loader/jpeg_loader.h index 3bf99c195..04c650dcc 100644 --- a/dlib/image_loader/jpeg_loader.h +++ b/dlib/image_loader/jpeg_loader.h @@ -43,10 +43,10 @@ namespace dlib #endif image_view t(t_); t.set_size( height_, width_ ); - for ( unsigned n = 0; n < height_;n++ ) + for (size_t n = 0; n < height_;n++ ) { const unsigned char* v = get_row( n ); - for ( unsigned m = 0; m < width_;m++ ) + for (size_t m = 0; m < width_;m++ ) { if ( is_gray() ) { @@ -74,16 +74,16 @@ namespace dlib } private: - const unsigned char* get_row( unsigned long i ) const + const unsigned char* get_row(size_t i) const { return &data[i*width_*output_components_]; } FILE * check_file(const char* filename ); void read_image( FILE *file, const unsigned char* imgbuffer, size_t imgbuffersize ); - unsigned long height_; - unsigned long width_; - unsigned long output_components_; + size_t long height_; + size_t long width_; + size_t long output_components_; std::vector data; };