fix some warnings

This commit is contained in:
Megamouse 2023-02-21 23:28:43 +01:00
parent c20aa2ad5f
commit 38d612e5ba
3 changed files with 5 additions and 15 deletions

View file

@ -1,9 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "overlay_home_menu.h" #include "overlay_home_menu.h"
#include "Emu/RSX/RSXThread.h" #include "Emu/RSX/RSXThread.h"
#include "Utilities/date_time.h"
#include <sstream>
#include <iomanip>
namespace rsx namespace rsx
{ {
@ -11,11 +9,7 @@ namespace rsx
{ {
std::string get_time_string() std::string get_time_string()
{ {
std::ostringstream ost; return date_time::fmt_time("%Y/%m/%d %H:%M:%S", time(nullptr));
const std::time_t dateTime = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
const std::tm tm = *std::localtime(&dateTime);
ost << std::put_time(&tm, "%Y/%m/%d %H:%M:%S");
return ost.str();
} }
home_menu_dialog::home_menu_dialog() home_menu_dialog::home_menu_dialog()

View file

@ -3,8 +3,6 @@
#include <iostream> #include <iostream>
#include <chrono> #include <chrono>
#include <sstream>
#include <iomanip>
#include <QApplication> #include <QApplication>
#include <QCommandLineParser> #include <QCommandLineParser>
@ -28,6 +26,7 @@
#include "headless_application.h" #include "headless_application.h"
#include "Utilities/sema.h" #include "Utilities/sema.h"
#include "Utilities/date_time.h"
#include "Crypto/decrypt_binaries.h" #include "Crypto/decrypt_binaries.h"
#ifdef _WIN32 #ifdef _WIN32
#include "module_verifier.hpp" #include "module_verifier.hpp"
@ -410,11 +409,8 @@ void log_q_debug(QtMsgType type, const QMessageLogContext& context, const QStrin
template <> template <>
void fmt_class_string<std::chrono::sys_time<typename std::chrono::system_clock::duration>>::format(std::string& out, u64 arg) void fmt_class_string<std::chrono::sys_time<typename std::chrono::system_clock::duration>>::format(std::string& out, u64 arg)
{ {
std::ostringstream ss;
const std::time_t dateTime = std::chrono::system_clock::to_time_t(get_object(arg)); const std::time_t dateTime = std::chrono::system_clock::to_time_t(get_object(arg));
const std::tm tm = *std::localtime(&dateTime); out += date_time::fmt_time("%Y-%m-%eT%H:%M:%S", dateTime);
ss << std::put_time(&tm, "%Y-%m-%eT%H:%M:%S");
out += ss.str();
} }
void run_platform_sanity_checks() void run_platform_sanity_checks()

View file

@ -442,7 +442,7 @@ namespace utils
memcpy(&data[m_size], buffer, buffer_size); memcpy(&data[m_size], buffer, buffer_size);
} }
const u32 timestamp_ms = stream->time_base.den ? (1000 * av.frame->best_effort_timestamp * stream->time_base.num) / stream->time_base.den : 0; const s64 timestamp_ms = stream->time_base.den ? (1000 * av.frame->best_effort_timestamp * stream->time_base.num) / stream->time_base.den : 0;
timestamps_ms.push_back({m_size, timestamp_ms}); timestamps_ms.push_back({m_size, timestamp_ms});
m_size += buffer_size; m_size += buffer_size;
} }