Mercurial > jwe > octave
changeset 30832:3e395f6fc03a
maint: Merge stable to default.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Sat, 12 Mar 2022 16:14:51 +0100 |
parents | 1bc5ea8aab94 (current diff) 243b51ec9ff0 (diff) |
children | cfb708de1fc9 |
files | build-aux/mk-octave-config-h.sh libinterp/corefcn/load-path.cc libinterp/corefcn/rand.cc oct-conf-post-public.in.h |
diffstat | 20 files changed, 44 insertions(+), 50 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/liboctgui-build-info.h Thu Mar 10 18:59:05 2022 +0100 +++ b/libgui/liboctgui-build-info.h Sat Mar 12 16:14:51 2022 +0100 @@ -28,8 +28,6 @@ #include "octave-config.h" -#include <ctime> - #include <string> extern OCTGUI_API std::string liboctgui_hg_id (void);
--- a/libinterp/corefcn/__ftp__.cc Thu Mar 10 18:59:05 2022 +0100 +++ b/libinterp/corefcn/__ftp__.cc Sat Mar 12 16:14:51 2022 +0100 @@ -167,14 +167,15 @@ for (octave_idx_type i = 0; i < n; i++) { - time_t ftime; + OCTAVE_TIME_T ftime; bool fisdir; double fsize; url_xfer.get_fileinfo (sv(i), fsize, ftime, fisdir); fileisdir(i) = fisdir; - filectime(i) = ctime (&ftime); + time_t ftime_t = ftime; + filectime(i) = ctime (&ftime_t); filesize(i) = fsize; filedatenum(i) = double (ftime); } @@ -439,7 +440,7 @@ { n++; - time_t ftime; + OCTAVE_TIME_T ftime; bool fisdir; double fsize;
--- a/libinterp/corefcn/fcn-info.cc Thu Mar 10 18:59:05 2022 +0100 +++ b/libinterp/corefcn/fcn-info.cc Sat Mar 12 16:14:51 2022 +0100 @@ -603,7 +603,7 @@ // Same file. If it is out of date, then reload it. sys::time ottp = fcn->time_parsed (); - time_t tp = ottp.unix_time (); + OCTAVE_TIME_T tp = ottp.unix_time (); fcn->mark_fcn_file_up_to_date (sys::time ());
--- a/libinterp/corefcn/load-path.cc Thu Mar 10 18:59:05 2022 +0100 +++ b/libinterp/corefcn/load-path.cc Sat Mar 12 16:14:51 2022 +0100 @@ -1488,7 +1488,7 @@ { is_relative = ! sys::env::absolute_pathname (dir_name); - dir_time_last_checked = sys::time (static_cast<time_t> (0)); + dir_time_last_checked = sys::time (static_cast<OCTAVE_TIME_T> (0)); sys::file_stat fs (dir_name);
--- a/libinterp/corefcn/rand.cc Thu Mar 10 18:59:05 2022 +0100 +++ b/libinterp/corefcn/rand.cc Sat Mar 12 16:14:51 2022 +0100 @@ -27,7 +27,6 @@ # include "config.h" #endif -#include <ctime> #include <unordered_map> #include <string>
--- a/libinterp/corefcn/syscalls.cc Thu Mar 10 18:59:05 2022 +0100 +++ b/libinterp/corefcn/syscalls.cc Sat Mar 12 16:14:51 2022 +0100 @@ -32,7 +32,6 @@ # include "config.h" #endif -#include <ctime> #include <cstdio> #include <cstring>
--- a/libinterp/liboctinterp-build-info.h Thu Mar 10 18:59:05 2022 +0100 +++ b/libinterp/liboctinterp-build-info.h Sat Mar 12 16:14:51 2022 +0100 @@ -28,8 +28,6 @@ #include "octave-config.h" -#include <ctime> - #include <string> extern OCTINTERP_API std::string liboctinterp_hg_id (void);
--- a/libinterp/octave-value/ov-fcn.h Thu Mar 10 18:59:05 2022 +0100 +++ b/libinterp/octave-value/ov-fcn.h Sat Mar 12 16:14:51 2022 +0100 @@ -95,10 +95,10 @@ virtual octave::symbol_scope scope (void) { return octave::symbol_scope (); } virtual octave::sys::time time_parsed (void) const - { return octave::sys::time (static_cast<time_t> (0)); } + { return octave::sys::time (static_cast<OCTAVE_TIME_T> (0)); } virtual octave::sys::time time_checked (void) const - { return octave::sys::time (static_cast<time_t> (0)); } + { return octave::sys::time (static_cast<OCTAVE_TIME_T> (0)); } virtual int call_depth (void) const { return 0; }
--- a/libinterp/octave-value/ov-usr-fcn.h Thu Mar 10 18:59:05 2022 +0100 +++ b/libinterp/octave-value/ov-usr-fcn.h Sat Mar 12 16:14:51 2022 +0100 @@ -28,8 +28,6 @@ #include "octave-config.h" -#include <ctime> - #include <string> #include "comment-list.h" @@ -64,8 +62,8 @@ octave::tree_statement_list *cmds = nullptr, const std::string& ds = "") : octave_function (nm, ds), m_scope (scope), m_file_name (fnm), - m_t_parsed (static_cast<time_t> (0)), - m_t_checked (static_cast<time_t> (0)), + m_t_parsed (static_cast<OCTAVE_TIME_T> (0)), + m_t_checked (static_cast<OCTAVE_TIME_T> (0)), m_file_info (nullptr), m_cmd_list (cmds) { if (m_scope)
--- a/liboctave/liboctave-build-info.h Thu Mar 10 18:59:05 2022 +0100 +++ b/liboctave/liboctave-build-info.h Sat Mar 12 16:14:51 2022 +0100 @@ -28,8 +28,6 @@ #include "octave-config.h" -#include <ctime> - #include <string> extern OCTAVE_API std::string liboctave_hg_id (void);
--- a/liboctave/system/file-stat.cc Thu Mar 10 18:59:05 2022 +0100 +++ b/liboctave/system/file-stat.cc Sat Mar 12 16:14:51 2022 +0100 @@ -235,9 +235,9 @@ } else { - m_atime = sys::time (sys_atime); - m_mtime = sys::time (sys_mtime); - m_ctime = sys::time (sys_ctime); + m_atime = sys::time (static_cast<OCTAVE_TIME_T> (sys_atime)); + m_mtime = sys::time (static_cast<OCTAVE_TIME_T> (sys_mtime)); + m_ctime = sys::time (static_cast<OCTAVE_TIME_T> (sys_ctime)); } m_initialized = true; @@ -267,9 +267,9 @@ } else { - m_atime = sys::time (sys_atime); - m_mtime = sys::time (sys_mtime); - m_ctime = sys::time (sys_ctime); + m_atime = sys::time (static_cast<OCTAVE_TIME_T> (sys_atime)); + m_mtime = sys::time (static_cast<OCTAVE_TIME_T> (sys_mtime)); + m_ctime = sys::time (static_cast<OCTAVE_TIME_T> (sys_ctime)); } m_initialized = true;
--- a/liboctave/system/oct-syscalls.cc Thu Mar 10 18:59:05 2022 +0100 +++ b/liboctave/system/oct-syscalls.cc Sat Mar 12 16:14:51 2022 +0100 @@ -27,7 +27,6 @@ # include "config.h" #endif -#include <ctime> #include <cerrno> #include <cstdlib> #include <cstring>
--- a/liboctave/system/oct-time.cc Thu Mar 10 18:59:05 2022 +0100 +++ b/liboctave/system/oct-time.cc Sat Mar 12 16:14:51 2022 +0100 @@ -53,7 +53,7 @@ namespace sys { time::time (double d) - : m_ot_unix_time (static_cast<time_t> (d)), m_ot_usec (0) + : m_ot_unix_time (static_cast<OCTAVE_TIME_T> (d)), m_ot_usec (0) { double ip; m_ot_usec = static_cast<int> (std::modf (d, &ip) * 1e6); @@ -113,7 +113,9 @@ void time::stamp (void) { - octave_gettimeofday_wrapper (&m_ot_unix_time, &m_ot_usec); + time_t ot_unix_time; + octave_gettimeofday_wrapper (&ot_unix_time, &m_ot_usec); + m_ot_unix_time = ot_unix_time; } // From the mktime() manual page: @@ -346,7 +348,10 @@ void cpu_time::stamp (void) { - octave_cpu_time (&m_usr_sec, &m_sys_sec, &m_usr_usec, &m_sys_usec); + time_t usr_sec, sys_sec; + octave_cpu_time (&usr_sec, &sys_sec, &m_usr_usec, &m_sys_usec); + m_usr_sec = usr_sec; + m_sys_sec = sys_sec; } void
--- a/liboctave/system/oct-time.h Thu Mar 10 18:59:05 2022 +0100 +++ b/liboctave/system/oct-time.h Sat Mar 12 16:14:51 2022 +0100 @@ -28,13 +28,11 @@ #include "octave-config.h" -#include <ctime> - #include <iosfwd> #include <string> static inline double -as_double (time_t sec, long usec) +as_double (OCTAVE_TIME_T sec, long usec) { // Unix time will be exactly representable as a double for more than // 100 million years, so no worry there, and microseconds has a @@ -57,10 +55,10 @@ time (void) : m_ot_unix_time (0), m_ot_usec (0) { stamp (); } - time (time_t t) + time (OCTAVE_TIME_T t) : m_ot_unix_time (t), m_ot_usec (0) { } - time (time_t t, long us) + time (OCTAVE_TIME_T t, long us) : m_ot_unix_time (t), m_ot_usec () { long rem, extra; @@ -109,7 +107,7 @@ return as_double (m_ot_unix_time, m_ot_usec); } - time_t unix_time (void) const { return m_ot_unix_time; } + OCTAVE_TIME_T unix_time (void) const { return m_ot_unix_time; } long usec (void) const { return m_ot_usec; } @@ -120,7 +118,7 @@ private: // Seconds since the epoch. - time_t m_ot_unix_time; + OCTAVE_TIME_T m_ot_unix_time; // Additional microseconds. long m_ot_usec; @@ -422,21 +420,21 @@ return as_double (m_sys_sec, m_sys_usec); } - time_t user_sec (void) const { return m_usr_sec; } + OCTAVE_TIME_T user_sec (void) const { return m_usr_sec; } long user_usec (void) const { return m_usr_usec; } - time_t system_sec (void) const { return m_sys_sec; } + OCTAVE_TIME_T system_sec (void) const { return m_sys_sec; } long system_usec (void) const { return m_sys_usec; } private: - time_t m_usr_sec; - time_t m_sys_sec; + OCTAVE_TIME_T m_usr_sec; + OCTAVE_TIME_T m_sys_sec; long m_usr_usec; long m_sys_usec; - cpu_time (time_t usr_sec, time_t sys_sec, long usr_usec, long sys_usec) + cpu_time (OCTAVE_TIME_T usr_sec, OCTAVE_TIME_T sys_sec, long usr_usec, long sys_usec) : m_usr_sec (usr_sec), m_sys_sec (sys_sec), m_usr_usec (usr_usec), m_sys_usec (sys_usec) { }
--- a/liboctave/util/file-info.h Thu Mar 10 18:59:05 2022 +0100 +++ b/liboctave/util/file-info.h Sat Mar 12 16:14:51 2022 +0100 @@ -42,7 +42,7 @@ public: file_info (void) - : m_file_buf (), m_offsets (), m_timestamp (static_cast<time_t> (0)) + : m_file_buf (), m_offsets (), m_timestamp (static_cast<OCTAVE_TIME_T> (0)) { } file_info (const std::string& text, const sys::time& timestamp)
--- a/liboctave/util/oct-shlib.h Thu Mar 10 18:59:05 2022 +0100 +++ b/liboctave/util/oct-shlib.h Sat Mar 12 16:14:51 2022 +0100 @@ -50,7 +50,7 @@ public: dynlib_rep (void) - : m_count (1), m_fcn_names (), m_file (), m_time_loaded (time_t ()), + : m_count (1), m_fcn_names (), m_file (), m_time_loaded (OCTAVE_TIME_T ()), m_search_all_loaded (false) { }
--- a/liboctave/util/url-transfer.cc Thu Mar 10 18:59:05 2022 +0100 +++ b/liboctave/util/url-transfer.cc Sat Mar 12 16:14:51 2022 +0100 @@ -101,7 +101,7 @@ for (octave_idx_type i = 0; i < sv.numel (); i++) { - time_t ftime; + OCTAVE_TIME_T ftime; bool fisdir; double fsize; @@ -547,7 +547,7 @@ } void get_fileinfo (const std::string& filename, double& filesize, - time_t& filetime, bool& fileisdir) + OCTAVE_TIME_T& filetime, bool& fileisdir) { std::string path = pwd (); @@ -573,7 +573,7 @@ } fileisdir = false; - time_t ft; + OCTAVE_TIME_T ft; curl_easy_getinfo (m_curl, CURLINFO_FILETIME, &ft); filetime = ft; double fs;
--- a/liboctave/util/url-transfer.h Thu Mar 10 18:59:05 2022 +0100 +++ b/liboctave/util/url-transfer.h Sat Mar 12 16:14:51 2022 +0100 @@ -131,7 +131,7 @@ virtual void get_fileinfo (const std::string& /* filename */, double& /* filesize */, - time_t& /* filetime */, + OCTAVE_TIME_T& /* filetime */, bool& /* fileisdir */) { } virtual std::string pwd (void) { return ""; } @@ -247,7 +247,7 @@ string_vector list (void) { return m_rep->list (); } void get_fileinfo (const std::string& filename, double& filesize, - time_t& filetime, bool& fileisdir) + OCTAVE_TIME_T& filetime, bool& fileisdir) { m_rep->get_fileinfo (filename, filesize, filetime, fileisdir); }
--- a/oct-conf-post-public.in.h Thu Mar 10 18:59:05 2022 +0100 +++ b/oct-conf-post-public.in.h Sat Mar 12 16:14:51 2022 +0100 @@ -183,6 +183,9 @@ #define OCTAVE_HAVE_F77_INT_TYPE 1 +/* time type in API is always 64 bits wide */ +#define OCTAVE_TIME_T int64_t + #if defined (__cplusplus) && ! defined (OCTAVE_THREAD_LOCAL) # define OCTAVE_THREAD_LOCAL #endif