Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hello,

Cppcheck reports this :
core/connectivity/source/drivers/postgresql/pq_tools.cxx
520     redundantAssignInSwitch style   Redundant assignment of "ret" in switch

Here's the function :
static bool isOperator( char c )
{
    bool ret;
    switch(c)
    {
    case '+':
    case '-':
    case '*':
    case '/':
    case '<':
    case '>':
    case '=':
    case '~':
    case '!':
    case '@':
    case '#':
    case '%':
    case '^':
    case '&':
    case '|':
    case '`':
    case '?':
    case '$':
        ret = true;<--- Redundant assignment of "ret" in switch
    default:
        ret = false;
    }
    return ret;
}

I just added a break after true assignment (cf commit
4a8710409fbf69fb4c3e175c1a17d72ea06576ef)

Would it be ok to cherry-pick for 3.5 ?

Julien.


--
View this message in context: 
http://nabble.documentfoundation.org/REVIEW-redundantAssignInSwitch-in-connectivity-source-drivers-postgresql-pq-tools-cxx-tp3796908p3796908.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.