Remove the time_t overload of UnknownElement and just cast to int64_t

Originally committed to SVN as r6508.
This commit is contained in:
Thomas Goyne 2012-02-23 19:27:42 +00:00
parent f54d381f94
commit 6cf122dea2
4 changed files with 6 additions and 15 deletions

View File

@ -256,7 +256,6 @@ AS_IF([test x$agi_cv_pragma_once = xno],
AC_CHECK_HEADER([wchar.h],,[AC_MSG_FAILURE([aegisub requires wide character support])]) AC_CHECK_HEADER([wchar.h],,[AC_MSG_FAILURE([aegisub requires wide character support])])
AC_CHECK_HEADERS([sys/time.h]) AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_SIZEOF([time_t])
############################## ##############################
# Program Support and Features # Program Support and Features

View File

@ -90,10 +90,6 @@ UnknownElement::UnknownElement() : m_pImp(new Imp_T
UnknownElement::UnknownElement(const UnknownElement& unknown) : m_pImp(unknown.m_pImp->Clone()) {} UnknownElement::UnknownElement(const UnknownElement& unknown) : m_pImp(unknown.m_pImp->Clone()) {}
UnknownElement::UnknownElement(int number) : m_pImp(new Imp_T<Integer>(number)) {} UnknownElement::UnknownElement(int number) : m_pImp(new Imp_T<Integer>(number)) {}
UnknownElement::UnknownElement(const char *string) : m_pImp(new Imp_T<String>(string)) {} UnknownElement::UnknownElement(const char *string) : m_pImp(new Imp_T<String>(string)) {}
#if SIZEOF_TIME_T+0 == 4
UnknownElement::UnknownElement(time_t number) : m_pImp(new Imp_T<Integer>(number)) {}
#endif
UnknownElement::~UnknownElement() { delete m_pImp; } UnknownElement::~UnknownElement() { delete m_pImp; }
#define DEFINE_UE_TYPE(Type) \ #define DEFINE_UE_TYPE(Type) \

View File

@ -132,8 +132,8 @@ JsonEmitter::~JsonEmitter() {
Sink const& sink = *log_sink->GetSink(); Sink const& sink = *log_sink->GetSink();
for (unsigned int i=0; i < sink.size(); i++) { for (unsigned int i=0; i < sink.size(); i++) {
json::Object entry; json::Object entry;
entry["sec"] = sink[i]->tv.tv_sec; entry["sec"] = (int64_t)sink[i]->tv.tv_sec;
entry["usec"] = sink[i]->tv.tv_usec; entry["usec"] = (int64_t)sink[i]->tv.tv_usec;
entry["severity"] = sink[i]->severity; entry["severity"] = sink[i]->severity;
entry["section"] = sink[i]->section; entry["section"] = sink[i]->section;
entry["file"] = sink[i]->file; entry["file"] = sink[i]->file;
@ -145,12 +145,12 @@ JsonEmitter::~JsonEmitter() {
} }
json::Array &timeval_open = root["timeval"]["open"]; json::Array &timeval_open = root["timeval"]["open"];
timeval_open.push_back(time_start.tv_sec); timeval_open.push_back((int64_t)time_start.tv_sec);
timeval_open.push_back(time_start.tv_usec); timeval_open.push_back((int64_t)time_start.tv_usec);
json::Array &timeval_close = root["timeval"]["close"]; json::Array &timeval_close = root["timeval"]["close"];
timeval_close.push_back(time_close.tv_sec); timeval_close.push_back((int64_t)time_close.tv_sec);
timeval_close.push_back(time_close.tv_usec); timeval_close.push_back((int64_t)time_close.tv_usec);
std::stringstream str; std::stringstream str;
str << directory << time_start.tv_sec << ".json"; str << directory << time_start.tv_sec << ".json";

View File

@ -77,10 +77,6 @@ public:
UnknownElement(const String& string); UnknownElement(const String& string);
UnknownElement(const Null& null); UnknownElement(const Null& null);
#if SIZEOF_TIME_T+0 == 4
UnknownElement(time_t number);
#endif
~UnknownElement(); ~UnknownElement();
UnknownElement& operator = (const UnknownElement& unknown); UnknownElement& operator = (const UnknownElement& unknown);