Hi
This Function works on Intel platforms but when compiled to Arm (Linux) the 
right side is 
calculated as a LongWord.

Const
  cSecondsPerDay=86400.0;
  cTimeDate2UnixFiledateStart=25569.0;
  cUnixFileDateDateTimeStart=cSecondsPerDay*cTimeDate2UnixFiledateStart;

Function UnPackUnixTime2DateTime(UnixTime:LongWord):TDateTime;
Begin
  UnPackUnixTime2DateTime:=(UnixTime+cUnixFileDateDateTimeStart)/cSecondsPerDay;
End;

---

If I change the line to

UnPackUnixTime2DateTime:=(UnixTime+Double(cUnixFileDateDateTimeStart))/Double(cSe
condsPerDay);

It works

I am not sure if this is an error or not, but al previous compilers I have 
worked with, change to 
real calculation on the right side when constants included, is defined as real 
constants.

---

What do you think?


The compiler used is
Free Pascal Compiler version 2.6.2 [2013/07/16] for arm
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Linux for ARM


Regards
Carsten

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to