Re: [Help-glpk] things I don't understand in src/env/time.c + bugs + suggested patch

2017-01-29 Thread Heinrich Schuchardt
On 01/29/2017 06:22 PM, Andrew Makhorin wrote: > Hi Chris, > >>> Not sure, but gmtime_s looks like a MSVC function. Could you point me >>> out where gmtime_s is standardized? Thanks. >> >> gmtime_s is included in the (optional) annex K of C11. However, the >> parameters are reversed compared to

Re: [Help-glpk] things I don't understand in src/env/time.c + bugs + suggested patch

2017-01-29 Thread Andrew Makhorin
Hi Chris, > > Not sure, but gmtime_s looks like a MSVC function. Could you point me > > out where gmtime_s is standardized? Thanks. > > gmtime_s is included in the (optional) annex K of C11. However, the > parameters are reversed compared to the MSVC version and the standard > one returns struct

Re: [Help-glpk] things I don't understand in src/env/time.c + bugs + suggested patch

2017-01-28 Thread Chris Matrakidis
Hi Andrew, > Not sure, but gmtime_s looks like a MSVC function. Could you point me > out where gmtime_s is standardized? Thanks. gmtime_s is included in the (optional) annex K of C11. However, the parameters are reversed compared to the MSVC version and the standard one returns struct tm * while

Re: [Help-glpk] things I don't understand in src/env/time.c + bugs + suggested patch

2017-01-28 Thread David Monniaux
On 01/28/2017 02:35 PM, Heinrich Schuchardt wrote: > > 1E3 * 1E-3 = 1. > You wouldn't add seconds and microseconds without scaling. Typo (silly copying and pasting). It should have read: return tv.tv_sec * 1E3 + tv.tv_usec * 1E-3; -- David Monniaux directeur de recherche au CNRS, laboratoire

Re: [Help-glpk] things I don't understand in src/env/time.c + bugs + suggested patch

2017-01-28 Thread Andrew Makhorin
> Over glpk-4.61 > > src/env/time.c contains: > > double glp_time(void) > { struct timeval tv; > struct tm *tm; > int j; > double t; > gettimeofday(, NULL); > tm = gmtime(_sec); > j = jday(tm->tm_mday, tm->tm_mon + 1, 1900 + tm->tm_year); > xassert(j

Re: [Help-glpk] things I don't understand in src/env/time.c + bugs + suggested patch

2017-01-28 Thread Heinrich Schuchardt
On 01/28/2017 01:31 PM, David Monniaux wrote: > Over glpk-4.61 > > src/env/time.c contains: > > double glp_time(void) > { struct timeval tv; > struct tm *tm; > int j; > double t; > gettimeofday(, NULL); > tm = gmtime(_sec); > j = jday(tm->tm_mday,