mirror of https://github.com/djcb/mu.git
parser/utils: enforce 64-bit times on 32-bit platforms
don't assume a 64-bit platform.
This commit is contained in:
parent
ec51f66da2
commit
6a0654c91b
|
@ -149,9 +149,6 @@ Mux::utf8_clean (const std::string& dirty)
|
||||||
return clean;
|
return clean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<std::string>
|
std::vector<std::string>
|
||||||
Mux::split (const std::string& str, const std::string& sepa)
|
Mux::split (const std::string& str, const std::string& sepa)
|
||||||
{
|
{
|
||||||
|
@ -213,7 +210,7 @@ date_boundary (bool is_first)
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
Mux::date_to_time_t_string (time_t t)
|
Mux::date_to_time_t_string (int64_t t)
|
||||||
{
|
{
|
||||||
char buf[sizeof(InternalDateMax)];
|
char buf[sizeof(InternalDateMax)];
|
||||||
snprintf (buf, sizeof(buf), InternalDateFormat, t);
|
snprintf (buf, sizeof(buf), InternalDateFormat, t);
|
||||||
|
@ -332,7 +329,7 @@ Mux::date_to_time_t_string (const std::string& dstr, bool is_first)
|
||||||
return date_boundary (is_first);
|
return date_boundary (is_first);
|
||||||
}
|
}
|
||||||
|
|
||||||
t = (gint64)g_date_time_to_unix (dtime);
|
t = g_date_time_to_unix (dtime);
|
||||||
g_date_time_unref (dtime);
|
g_date_time_unref (dtime);
|
||||||
|
|
||||||
if (t < 0 || t > 9999999999)
|
if (t < 0 || t > 9999999999)
|
||||||
|
|
|
@ -88,13 +88,14 @@ std::string format (const char *frm, ...)
|
||||||
std::string date_to_time_t_string (const std::string& date, bool first);
|
std::string date_to_time_t_string (const std::string& date, bool first);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* time_t expressed as a string with a 10-digit time_t
|
* 64-bit incarnation of time_t expressed as a 10-digit string. Uses 64-bit for the time-value,
|
||||||
|
* regardless of the size of time_t.
|
||||||
*
|
*
|
||||||
* @param t
|
* @param t some time value
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
std::string date_to_time_t_string (time_t t);
|
std::string date_to_time_t_string (int64_t t);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue