From: SourceForge.net <no...@so...> - 2005-07-08 18:22:43
|
Bugs item #1234097, was opened at 2005-07-07 05:34 Message generated for change (Comment added) made by patrickh You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108041&aid=1234097&group_id=8041 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: VPR >Group: v2.0 >Status: Closed >Resolution: Duplicate Priority: 5 Submitted By: tibur (tibur) Assigned to: Nobody/Anonymous (nobody) Summary: Bugs in vpr::DateTime arithmetics (with patch) Initial Comment: Current code for operators + and - leads to bad values of DateTime. old operators : DateTime operator+ (const DateTime& o) const{ return DateTime(mSeconds + o.mSeconds, mMicroSeconds + o.mMicroSeconds); } DateTime operator- (const DateTime& o) const{ return DateTime(mSeconds - o.mSeconds, mMicroSeconds - o.mMicroSeconds); } suggested operators: DateTime operator+ (const DateTime& o) const { vpr::Uint32 us = mMicroSeconds + o.mMicroSeconds; if(us>1000000) return DateTime(mSeconds + o.mSeconds + 1, us - 1000000); else return DateTime(mSeconds + o.mSeconds, us); } DateTime operator- (const DateTime& o) const { if(mMicroSeconds > o.mMicroSeconds) return DateTime(mSeconds - o.mSeconds, mMicroSeconds - o.mMicroSeconds); else return DateTime(mSeconds - o.mSeconds - 1, 1000000 + mMicroSeconds - o.mMicroSeconds); } ---------------------------------------------------------------------- >Comment By: Patrick Hartling (patrickh) Date: 2005-07-08 13:22 Message: Logged In: YES user_id=49856 As far as I can tell, this bug is a duplicate of #1234053. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108041&aid=1234097&group_id=8041 |