[ quantlib-Bugs-1859014 ] daycounters

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ quantlib-Bugs-1859014 ] daycounters

SourceForge.net
Bugs item #1859014, was opened at 2007-12-27 17:25
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1859014&group_id=12740

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: xinc (gigifaye29)
Assigned to: Nobody/Anonymous (nobody)
Summary: daycounters

Initial Comment:
Several daycounter functions under
\QuantLib-0.8.1\ql\time\daycounters
use "swith" without a "break;" under each condition.

For example, the following one:

    Thirty360::implementation(Thirty360::Convention c) {
        switch (c) {
          case USA:
          case BondBasis:
            return boost::shared_ptr<DayCounter::Impl>(new US_Impl);
          case European:
          case EurobondBasis:
            return boost::shared_ptr<DayCounter::Impl>(new EU_Impl);
          case Italian:
            return boost::shared_ptr<DayCounter::Impl>(new IT_Impl);
          default:
            QL_FAIL("unknown 30/360 convention");
        }
    }

I believe there should be a "break;" ending each case. Otherwise the code actually implements each line till the end(default:...) regardless what 'c' is.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1859014&group_id=12740

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev