picoporj: fix another -Wshorten-64-to-32 warning from clang
authorAntonio Ospite <ospite@studenti.unina.it>
Sat, 27 Jul 2013 21:01:16 +0000 (23:01 +0200)
committerAntonio Ospite <ospite@studenti.unina.it>
Sat, 27 Jul 2013 22:14:47 +0000 (00:14 +0200)
  ../examples/picoproj.c:196:8: error: implicit conversion loses integer precision: 'size_t'
        (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
          ret = fread(image, size, 1, image_fp);
              ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

examples/picoproj.c

index b5ce593..e1dc47a 100644 (file)
@@ -193,7 +193,7 @@ int main(int argc, char *argv[])
                goto out_close_image_fp;
        }
 
                goto out_close_image_fp;
        }
 
-       ret = fread(image, size, 1, image_fp);
+       ret = (int)fread(image, size, 1, image_fp);
        if (ret != 1) {
                if (feof(image_fp))
                        fprintf(stderr, "Unexpected end of file.\n");
        if (ret != 1) {
                if (feof(image_fp))
                        fprintf(stderr, "Unexpected end of file.\n");