Fix sign-compare warnings in PDPD FE (#15635)
* fix warnings in /paddle * fix bmp_reader.c * add -Wsign-compare * fix code style * fix sum.cpp * remove paddle sign-compare * fix return in input_model.cpp * fix bmp_reader.c
This commit is contained in:
@@ -96,7 +96,7 @@ int readBmpImage(const char* fileName, BitMap* image) {
|
||||
int i;
|
||||
int image_height = image->height;
|
||||
for (i = 0; i < image_height; i++) {
|
||||
unsigned int storeAt = image->infoHeader.height < 0 ? i : (unsigned int)image_height - 1 - i;
|
||||
int storeAt = image->infoHeader.height < 0 ? i : image_height - 1 - i;
|
||||
cnt = fread(image->data + row_size * storeAt, row_size, sizeof(unsigned char), input);
|
||||
if (cnt != sizeof(unsigned char)) {
|
||||
printf("[BMP] file read error\n");
|
||||
|
||||
@@ -150,7 +150,7 @@ size_t read_image_from_file(const char* img_path, unsigned char* img_data, size_
|
||||
|
||||
if (fp) {
|
||||
fseek(fp, 0, SEEK_END);
|
||||
if (ftell(fp) >= size) {
|
||||
if ((size_t)ftell(fp) >= size) {
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
read_size = fread(img_data, 1, size, fp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user