Bug 145759 - [GTK] Fix parentheses warning in TestWebKitWebView.cpp
Summary: [GTK] Fix parentheses warning in TestWebKitWebView.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Csaba Osztrogonác
URL:
Keywords:
Depends on:
Blocks: 145121
  Show dependency treegraph
 
Reported: 2015-06-08 08:54 PDT by Csaba Osztrogonác
Modified: 2015-06-08 09:49 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.45 KB, patch)
2015-06-08 08:55 PDT, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2015-06-08 08:54:45 PDT
clang build log:
-----------------
../../Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:478:22: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    while (readBytes = g_input_stream_read(test->m_inputStream.get(), &buffer, 512, 0, &error.outPtr())) {
           ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:478:22: note: place parentheses around the assignment to silence this warning
    while (readBytes = g_input_stream_read(test->m_inputStream.get(), &buffer, 512, 0, &error.outPtr())) {
                     ^
           (                                                                                           )
../../Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:478:22: note: use '==' to turn this assignment into an equality comparison
    while (readBytes = g_input_stream_read(test->m_inputStream.get(), &buffer, 512, 0, &error.outPtr())) {
                     ^
                     ==
1 warning generated.


It isn't a bug, but a valid assignment, so we should use double parentheses to silence this warning.
Comment 1 Csaba Osztrogonác 2015-06-08 08:55:50 PDT
Created attachment 254494 [details]
Patch
Comment 2 WebKit Commit Bot 2015-06-08 09:48:58 PDT
Comment on attachment 254494 [details]
Patch

Clearing flags on attachment: 254494

Committed r185321: <http://trac.webkit.org/changeset/185321>
Comment 3 WebKit Commit Bot 2015-06-08 09:49:02 PDT
All reviewed patches have been landed.  Closing bug.