Compare commits

...

2 Commits

Author SHA1 Message Date
Michael Scire
7557b7eb92 util: prevent optimizer from removing endian-swapped writes 2022-05-08 15:32:59 -07:00
Michael Scire
187745abd5 ams: address some warnings when building with gcc-12 2022-05-07 17:09:22 -07:00
5 changed files with 8 additions and 6 deletions

View File

@@ -843,7 +843,7 @@ namespace ams::ncm {
R_SUCCEED_IF(m_header.has_value());
/* Get our header. */
PatchMetaExtendedDataHeader header;
PatchMetaExtendedDataHeader header{};
R_TRY(this->GetHeader(std::addressof(header)));
/* Set our header. */

View File

@@ -148,6 +148,8 @@ init_libnx_shim.os.horizon.o: CXXFLAGS += -fno-lto
result_get_name.o: CXXFLAGS += -fno-lto
crypto_sha256_generator.o: CXXFLAGS += -fno-lto
spl_secure_monitor_api.os.generic.o: CXXFLAGS += -I$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/include
fs_id_string_impl.os.generic.o: CXXFLAGS += -I$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/include

View File

@@ -47,9 +47,9 @@ namespace ams::crypto {
};
static constexpr size_t Asn1IdentifierSize = util::size(Asn1Identifier);
private:
Impl m_impl;
Impl m_impl{};
public:
Sha256Generator() { /* ... */ }
Sha256Generator() = default;
void Initialize() {
m_impl.Initialize();

View File

@@ -144,12 +144,12 @@ namespace ams::util {
template<std::integral T>
constexpr ALWAYS_INLINE void StoreBigEndian(T *ptr, T val) {
*ptr = ConvertToBigEndian<T>(val);
*static_cast<volatile T *>(ptr) = ConvertToBigEndian<T>(val);
}
template<std::integral T>
constexpr ALWAYS_INLINE void StoreLittleEndian(T *ptr, T val) {
*ptr = ConvertToLittleEndian<T>(val);
*static_cast<volatile T *>(ptr) = ConvertToLittleEndian<T>(val);
}
}

View File

@@ -18,7 +18,7 @@
namespace ams::crypto {
void GenerateSha256(void *dst, size_t dst_size, const void *src, size_t src_size) {
Sha256Generator gen;
Sha256Generator gen{};
gen.Initialize();
gen.Update(src, src_size);