Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-03

MSecsToTimeStamp patch

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Aritmetic Owerflow, for example MSecsToTimeStamp(63250588800000) //1.5.2005 Repaired bad typecasting.

Index: objpas/sysutils/dati.inc
===================================================================
--- objpas/sysutils/dati.inc    (revision 10368)
+++ objpas/sysutils/dati.inc    (working copy)
@@ -75,7 +75,7 @@
 function MSecsToTimeStamp(MSecs: comp): TTimeStamp;
 begin
   result.Date := Trunc(msecs / msecsperday);
-  msecs:= comp(msecs-result.date*msecsperday);
+  msecs:= msecs-comp(result.date)*msecsperday;
   result.Time := Round(MSecs);
 end ;
Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Michael Van Canneyt
to Unknown author
Aritmetic Owerflow, for example MSecsToTimeStamp(63250588800000) //1.5.2005 Repaired bad typecasting.

Thank you. Applied, rev. 10566.

Would it be possible to send patches as attachments ? That makes it easier to save. Thanks.

Michael.

Show quoted text 24 lines
Index: objpas/sysutils/dati.inc =================================================================== --- objpas/sysutils/dati.inc (revision 10368) +++ objpas/sysutils/dati.inc (working copy) @@ -75,7 +75,7 @@ function MSecsToTimeStamp(MSecs: comp): TTimeStamp; begin result.Date := Trunc(msecs / msecsperday); - msecs:= comp(msecs-result.date*msecsperday); + msecs:= msecs-comp(result.date)*msecsperday; result.Time := Round(MSecs); end ; -- Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709 _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Jonas Maebe
to Michael Van Canneyt
Michael Van Canneyt wrote 10 lines
On Wed, 26 Mar 2008, wrote: > Aritmetic Owerflow, for example MSecsToTimeStamp(63250588800000) // > 1.5.2005 > Repaired bad typecasting. Thank you. Applied, rev. 10566. Would it be possible to send patches as attachments ? That makes it easier to save. Thanks.

You don't have to save them: you can just do

patch -p0

and then copy/paste the patch from the mail into the console (ending with a double ctrl-d to close stdin).

Jonas

Reply by email

Michael Van Canneyt
to Jonas Maebe
Jonas Maebe wrote 18 lines
On 26 Mar 2008, at 16:36, Michael Van Canneyt wrote: >On Wed, 26 Mar 2008, wrote: > > >Aritmetic Owerflow, for example MSecsToTimeStamp(63250588800000) //1.5.2005 > >Repaired bad typecasting. > >Thank you. Applied, rev. 10566. > >Would it be possible to send patches as attachments ? >That makes it easier to save. Thanks. You don't have to save them: you can just do patch -p0 and then copy/paste the patch from the mail into the console (ending with a double ctrl-d to close stdin).

Aha. We learn every day. Again a useful tip...

Thank you, Jonas !

Michael.

Reply by email