RESOLVED FIXED 171850
[GTK] Fix compile warnings in PlatformImageCairo.cpp
https://bugs.webkit.org/show_bug.cgi?id=171850
Summary [GTK] Fix compile warnings in PlatformImageCairo.cpp
Hyungwook Lee
Reported 2017-05-09 00:09:16 PDT
../../Tools/ImageDiff/cairo/PlatformImageCairo.cpp:53:42: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(data, 1, length, stdin);
Attachments
Patch (1.96 KB, patch)
2017-05-09 00:19 PDT, Hyungwook Lee
no flags
Patch (1.96 KB, patch)
2017-05-09 17:05 PDT, Hyungwook Lee
no flags
Hyungwook Lee
Comment 1 2017-05-09 00:19:44 PDT
Michael Catanzaro
Comment 2 2017-05-09 06:45:40 PDT
Comment on attachment 309481 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=309481&action=review > Tools/ImageDiff/cairo/PlatformImageCairo.cpp:54 > + return readBytes ? CAIRO_STATUS_SUCCESS : CAIRO_STATUS_READ_ERROR; I would be stricter: return readBytes == length ? CAIRO_STATUS_SUCCESS : CAIRO_STATUS_READ_ERROR; Note that only works because the second parameter, size, is 1. > Tools/ImageDiff/cairo/PlatformImageCairo.cpp:129 > + return writtenBytes ? CAIRO_STATUS_SUCCESS : CAIRO_STATUS_WRITE_ERROR; Ditto: return writtenBytes == length ? CAIRO_STATUS_SUCCESS : CAIRO_STATUS_WRITE_ERROR;
Hyungwook Lee
Comment 3 2017-05-09 17:05:14 PDT
Hyungwook Lee
Comment 4 2017-05-09 17:06:58 PDT
(In reply to Michael Catanzaro from comment #2) > Comment on attachment 309481 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=309481&action=review > > > Tools/ImageDiff/cairo/PlatformImageCairo.cpp:54 > > + return readBytes ? CAIRO_STATUS_SUCCESS : CAIRO_STATUS_READ_ERROR; > > I would be stricter: > > return readBytes == length ? CAIRO_STATUS_SUCCESS : CAIRO_STATUS_READ_ERROR; > > Note that only works because the second parameter, size, is 1. > > > Tools/ImageDiff/cairo/PlatformImageCairo.cpp:129 > > + return writtenBytes ? CAIRO_STATUS_SUCCESS : CAIRO_STATUS_WRITE_ERROR; > > Ditto: > > return writtenBytes == length ? CAIRO_STATUS_SUCCESS : > CAIRO_STATUS_WRITE_ERROR; Nice point, I've update the patch as you mentioned.
Hyungwook Lee
Comment 5 2017-05-09 17:08:07 PDT
length
WebKit Commit Bot
Comment 6 2017-05-12 15:02:14 PDT
Comment on attachment 309563 [details] Patch Clearing flags on attachment: 309563 Committed r216795: <http://trac.webkit.org/changeset/216795>
WebKit Commit Bot
Comment 7 2017-05-12 15:02:16 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.