[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Patch - no parameters validation, overly complex code

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Tue, 22 Feb 2011 20:20:29 +0100

On 22.02.2011 07:21, Dmitry wrote:
> Hey.
>
> 22.02.2011, 00:01, "Stefan Küng"<tortoisesvn_at_gmail.com>:
>>> Also there's a "switch(m_State)" that has no "default:" branch -
>>> what should happen there semantically? Should execution continue
>>> or should the code signal an error?
>> There are several such statements. But none of them really require
>> a default branch since the variable the non-default branches modify
>> has already been set to a default value.
> Okay, for example in CShellExt::GetOverlayInfo() the "default" branch
> will leave iconName empty and then this empty string will be passed
> into RegQueryValueEx. According to MSDN "If lpValueName is NULL or an
> empty string, "", the function retrieves the type and data for the
> key's unnamed or default value, if any." - is that the required
> behavior here?

Not really required, but it also doesn't really hurt. Since that key is
empty, nothing bad would happen.
But I've added default paths in r20911.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2706554
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-02-22 20:20:37 CET

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.