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:
Haiqi Pan
2023-02-14 16:11:59 +08:00
committed by GitHub
parent 3d6474a4a3
commit 67fff4adcc
12 changed files with 19 additions and 22 deletions

View File

@@ -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");

View File

@@ -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);
}