Skip to content

Commit

Permalink
TAR: Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Nov 28, 2023
1 parent 98abb20 commit 4293bff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rpcs3/Loader/TAR.cpp
Expand Up @@ -139,7 +139,7 @@ std::unique_ptr<utils::serial> tar_object::get_file(const std::string& path, std
}
else
{
tar_log.error("tar_object::get_file() failed to parse header: offset=0x%x, filesize=0x%x", offset, max_size);
tar_log.notice("tar_object::get_file() failed to parse header: offset=0x%x, filesize=0x%x, header_first16=0x%016x", offset, max_size, read_from_ptr<be_t<u128>>(&header));
}

return { size, {} };
Expand Down
6 changes: 3 additions & 3 deletions rpcs3/util/types.hpp
Expand Up @@ -1189,7 +1189,7 @@ template <typename T, typename U>
constexpr T read_from_ptr(U&& array, usz pos = 0)
{
// TODO: ensure array element types are trivial
static_assert(sizeof(T) % sizeof(array[0]) == 0);
static_assert(sizeof(T) % sizeof(array[0]) == 0 || sizeof(array[0]) > sizeof(T));
std::decay_t<decltype(array[0])> buf[sizeof(T) / sizeof(array[0])];
if (!std::is_constant_evaluated())
std::memcpy(+buf, &array[pos], sizeof(buf));
Expand All @@ -1201,7 +1201,7 @@ constexpr T read_from_ptr(U&& array, usz pos = 0)
template <typename T, typename U>
constexpr void write_to_ptr(U&& array, usz pos, const T& value)
{
static_assert(sizeof(T) % sizeof(array[0]) == 0);
static_assert(sizeof(T) % sizeof(array[0]) == 0 || sizeof(array[0]) > sizeof(T));
if (!std::is_constant_evaluated())
std::memcpy(&array[pos], &value, sizeof(value));
else
Expand All @@ -1211,7 +1211,7 @@ constexpr void write_to_ptr(U&& array, usz pos, const T& value)
template <typename T, typename U>
constexpr void write_to_ptr(U&& array, const T& value)
{
static_assert(sizeof(T) % sizeof(array[0]) == 0);
static_assert(sizeof(T) % sizeof(array[0]) == 0 || sizeof(array[0]) > sizeof(T));
if (!std::is_constant_evaluated())
std::memcpy(&array[0], &value, sizeof(value));
else
Expand Down

0 comments on commit 4293bff

Please sign in to comment.