bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: commconcpp2 changes to date.cpp (copy)


From: Federico Montesino Pouzols
Subject: Re: commconcpp2 changes to date.cpp (copy)
Date: Thu, 9 Jan 2003 10:41:27 +0100
User-agent: Mutt/1.4i

        It seems that the list has been frozen for two or three days,
but I now see all the posts that you have reposted with '(copy)'
appended. In the meantime, the mail archives are working again, now
based on MHonArc. By the way, this new interface allows for searching
through the archives.

On Tue, Jan 07, 2003 at 12:25:31PM -0800, Chad Yates wrote:
> I just started recieving list messages again today.  It appears that my
> previous messages were lost, so I'm forwarding them again...
> 
> The recent changes to date.cpp broke the library under MSVC 6.0 on the
> following:
> 
>   nyear = int(trunc(i));
>   nmonth = int(trunc(j));
>   nday = int(trunc(k));
> 
> I removed the trunc() function, and wondered if it was redundant anyway?
> since the int() should suffice.
> 
> I also wrote a test suite for the date class (figured what better way to
> determine if trunc() was necessary, and it needed to be done anyway) The
> following are the test cases, and I'll save the code fore release with the
> test suite:
> 
>   DateTest.testSimpleGets ...
>   DateTest.testSimpleSets ...
>   DateTest.testIsValid ...
>   DateTest.testGetDate_String ...
>   DateTest.testGetDate_time_t ...
>   DateTest.testGeteDate_struct_tm ...
>   DateTest.testOperations ...
> 
> and implemented a functions that were defined in the class but not
> implemented (linker errors).  I also re-arranged some of the related methods
> to avoid duplicate code.  I've attached diffs showing what was changed. here
> is a summary:
> 
> date.cpp
> - added test fixture for the Date class and fixed/enhanced.
> - implemented missing tm* Date::getDate(tm*) function declared in
>   class but not in implementation. took the liberty to make it
>   also return a time_t instead of tm* in addition to filling the
>   provided tm structure.
> - simplified time_t Date::getDate(void) to use the above function.
> - changed setDate parameter to const and placed (char*) in calls to Number.
> setDate's use of Number seems to guarantee constness, but I don't know if
> Number itself does. hopefully these casts can be removed someday.
> 
> email me with questions and comments.
> 
> ,Chad



> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp





reply via email to

[Prev in Thread] Current Thread [Next in Thread]