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


Hello,

Last "git version" of cppcheck says this :
[sal/qa/osl/process/osl_Thread.cxx:1099]: (warning) Redundant assignment of "sPrioStr" in switch
Here is the switch :
                switch (_aPriority)
                {
                case osl_Thread_PriorityHighest:
                    sPrioStr = "Highest";
                    break;

                case osl_Thread_PriorityAboveNormal:
                    sPrioStr = "AboveNormal";

                case osl_Thread_PriorityNormal:
                    sPrioStr = "Normal";

                case osl_Thread_PriorityBelowNormal:
                    sPrioStr = "BelowNormal";
                    break;

                case osl_Thread_PriorityLowest:
                    sPrioStr = "Lowest";
                    break;
                default:
                    sPrioStr = "unknown";
                }

Do the break instructions lack for "AboveNormal" and "Normal" cases ?
If no, it could be better to have this :
                // we want to have the same treatment for these 3 cases
                case osl_Thread_PriorityAboveNormal:
                case osl_Thread_PriorityNormal:
                case osl_Thread_PriorityBelowNormal:
                    sPrioStr = "BelowNormal";
                    break;

Somebody to answer this ?

Julien.

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.