scottdraves / electricsheep

infinite evolving crowdsourced artwork
http://electricsheep.org
553 stars 70 forks source link

Compiler warnings #81

Open yurivict opened 5 years ago

yurivict commented 5 years ago

Clang-60 complains, and this code looks questionable:

electricsheepguiMyDialog2.cpp:425:11: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if (code = curl_easy_perform(pCurl) == CURLE_OK)
            ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
electricsheepguiMyDialog2.cpp:425:11: note: place parentheses around the assignment to silence this warning
        if (code = curl_easy_perform(pCurl) == CURLE_OK)
                 ^
            (                                          )
electricsheepguiMyDialog2.cpp:425:11: note: use '==' to turn this assignment into an equality comparison
        if (code = curl_easy_perform(pCurl) == CURLE_OK)
                 ^
                 ==
electricsheepguiMyDialog2.cpp:422:9: warning: equality comparison result unused [-Wunused-comparison]
        m_Role == "error";
        ~~~~~~~^~~~~~~~~~
electricsheepguiMyDialog2.cpp:422:9: note: use '=' to turn this equality comparison into an assignment
        m_Role == "error";
               ^~
               =