[Webkit-unassigned] [Bug 79194] [EFL] Build warning: Fix warn_unused_result warnings

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 5 19:13:00 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=79194





--- Comment #3 from Raphael Kubo da Costa <kubo at profusion.mobi>  2012-03-05 19:13:00 PST ---
(From update of attachment 130263)
View in context: https://bugs.webkit.org/attachment.cgi?id=130263&action=review

> Source/WebCore/platform/efl/SharedBufferEfl.cpp:71
> -    fread(result->m_buffer.data(), 1, fileStat.st_size, file);
> +    if (static_cast<unsigned>(fileStat.st_size) != fread(result->m_buffer.data(), 1, fileStat.st_size, file)) {
> +        fclose(file);
> +        return 0;
> +    }
> +
>      fclose(file);
>  
>      return result.release();

How about

  const size_t freadResult = fread(...);
  fclose(file);

  const bool readSuccessful = (freadResult == static_cast<size_t>(fileStat.st_size));

  return readSucessful ? result.relase() : 0;

> Tools/DumpRenderTree/efl/ImageDiff.cpp:218
> +                } while ((bytesWritten += count) < bytesRead);

Personally, I find (bytesWritten += count) here weird to read (no pun intended :-). How about moving the increase operation inside the do-while loop?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list