← Back to team overview

zorba-coders team mailing list archive

[Bug 855481] [NEW] Too small time types

 

Public bug reported:

In include/zorba/util/time.h the get_walltime_in_millis() function
returns a long.

In Windows, long has the range: –2,147,483,648 to 2,147,483,647
http://msdn.microsoft.com/en-us/library/s3f49ktz(v=VS.100).aspx

Now the computation get_walltime_in_millis() goes much beyond this range
because time is computed since 01.01.1970, that makes it already more
than 1,300,000,000 seconds. This is multiplied by 1000 and therefore
jump over the range of 4-byte numbers.

Hence, all the functions that compute time must be working with double
precision numbers like "long long".

** Affects: zorba
     Importance: Undecided
     Assignee: Chris Hillery (ceejatec)
         Status: New


** Tags: precision return time type

** Changed in: zorba
     Assignee: (unassigned) => Chris Hillery (ceejatec)

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/855481

Title:
  Too small time types

Status in Zorba - The XQuery Processor:
  New

Bug description:
  In include/zorba/util/time.h the get_walltime_in_millis() function
  returns a long.

  In Windows, long has the range: –2,147,483,648 to 2,147,483,647
  http://msdn.microsoft.com/en-us/library/s3f49ktz(v=VS.100).aspx

  Now the computation get_walltime_in_millis() goes much beyond this
  range because time is computed since 01.01.1970, that makes it already
  more than 1,300,000,000 seconds. This is multiplied by 1000 and
  therefore jump over the range of 4-byte numbers.

  Hence, all the functions that compute time must be working with double
  precision numbers like "long long".

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/855481/+subscriptions


Follow ups

References