From f636acadfdb99f991aa335115498f12ae6e56375 Mon Sep 17 00:00:00 2001 From: Nicholas Frechette Date: Fri, 27 Oct 2023 21:59:41 -0400 Subject: [PATCH] style: clarify macro name --- .../compression/impl/convert_rotation.transform.h | 4 ++-- includes/acl/compression/impl/quantize.transform.h | 14 +++++++------- includes/acl/compression/impl/sample_streams.h | 12 ++++++------ includes/acl/compression/impl/track_stream.h | 2 +- includes/acl/core/error.h | 6 +++--- .../acl/decompression/impl/decompression.scalar.h | 2 +- .../decompression/impl/decompression.transform.h | 8 ++++---- includes/acl/math/vector4_packing.h | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/includes/acl/compression/impl/convert_rotation.transform.h b/includes/acl/compression/impl/convert_rotation.transform.h index d86606d2..64a926b7 100644 --- a/includes/acl/compression/impl/convert_rotation.transform.h +++ b/includes/acl/compression/impl/convert_rotation.transform.h @@ -60,7 +60,7 @@ namespace acl return rtm::quat_to_vector(rtm::quat_ensure_positive_w(rtm::vector_to_quat(rotation))); case rotation_format8::quatf_drop_w_variable: default: - ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_STRING_FORMAT_SPECIFIER, get_rotation_format_name(to)); + ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_rotation_format_name(to)); return rotation; } } @@ -94,7 +94,7 @@ namespace acl break; case rotation_format8::quatf_drop_w_variable: default: - ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_STRING_FORMAT_SPECIFIER, get_rotation_format_name(high_precision_format)); + ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_rotation_format_name(high_precision_format)); break; } diff --git a/includes/acl/compression/impl/quantize.transform.h b/includes/acl/compression/impl/quantize.transform.h index 28f3c2f6..a7da5c66 100644 --- a/includes/acl/compression/impl/quantize.transform.h +++ b/includes/acl/compression/impl/quantize.transform.h @@ -344,7 +344,7 @@ namespace acl break; case rotation_format8::quatf_drop_w_variable: default: - ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_STRING_FORMAT_SPECIFIER, get_rotation_format_name(rotation_format)); + ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_rotation_format_name(rotation_format)); break; } } @@ -439,7 +439,7 @@ namespace acl { // We expect all our samples to have the same width of sizeof(rtm::vector4f) ACL_ASSERT(raw_stream.get_sample_size() == sizeof(rtm::vector4f), "Unexpected translation sample size. %u != %zu", raw_stream.get_sample_size(), sizeof(rtm::vector4f)); - ACL_ASSERT(raw_stream.get_vector_format() == vector_format8::vector3f_full, "Expected a vector3f_full vector format, found: " ACL_STRING_FORMAT_SPECIFIER, get_vector_format_name(raw_stream.get_vector_format())); + ACL_ASSERT(raw_stream.get_vector_format() == vector_format8::vector3f_full, "Expected a vector3f_full vector format, found: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_vector_format_name(raw_stream.get_vector_format())); const uint32_t num_samples = raw_stream.get_num_samples(); const uint32_t sample_size = get_packed_vector_size(translation_format); @@ -458,7 +458,7 @@ namespace acl break; case vector_format8::vector3f_variable: default: - ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_STRING_FORMAT_SPECIFIER, get_vector_format_name(translation_format)); + ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_vector_format_name(translation_format)); break; } } @@ -489,7 +489,7 @@ namespace acl // We expect all our samples to have the same width of sizeof(rtm::vector4f) ACL_ASSERT(lossy_translations.get_sample_size() == sizeof(rtm::vector4f), "Unexpected translation sample size. %u != %zu", lossy_translations.get_sample_size(), sizeof(rtm::vector4f)); - ACL_ASSERT(lossy_translations.get_vector_format() == vector_format8::vector3f_full, "Expected a vector3f_full vector format, found: " ACL_STRING_FORMAT_SPECIFIER, get_vector_format_name(lossy_translations.get_vector_format())); + ACL_ASSERT(lossy_translations.get_vector_format() == vector_format8::vector3f_full, "Expected a vector3f_full vector format, found: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_vector_format_name(lossy_translations.get_vector_format())); const uint32_t num_samples = is_constant_bit_rate(bit_rate) ? 1 : lossy_translations.get_num_samples(); const uint32_t sample_size = sizeof(uint64_t) * 2; @@ -555,7 +555,7 @@ namespace acl { // We expect all our samples to have the same width of sizeof(rtm::vector4f) ACL_ASSERT(raw_stream.get_sample_size() == sizeof(rtm::vector4f), "Unexpected scale sample size. %u != %zu", raw_stream.get_sample_size(), sizeof(rtm::vector4f)); - ACL_ASSERT(raw_stream.get_vector_format() == vector_format8::vector3f_full, "Expected a vector3f_full vector format, found: " ACL_STRING_FORMAT_SPECIFIER, get_vector_format_name(raw_stream.get_vector_format())); + ACL_ASSERT(raw_stream.get_vector_format() == vector_format8::vector3f_full, "Expected a vector3f_full vector format, found: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_vector_format_name(raw_stream.get_vector_format())); const uint32_t num_samples = raw_stream.get_num_samples(); const uint32_t sample_size = get_packed_vector_size(scale_format); @@ -574,7 +574,7 @@ namespace acl break; case vector_format8::vector3f_variable: default: - ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_STRING_FORMAT_SPECIFIER, get_vector_format_name(scale_format)); + ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_vector_format_name(scale_format)); break; } } @@ -605,7 +605,7 @@ namespace acl // We expect all our samples to have the same width of sizeof(rtm::vector4f) ACL_ASSERT(lossy_scales.get_sample_size() == sizeof(rtm::vector4f), "Unexpected scale sample size. %u != %zu", lossy_scales.get_sample_size(), sizeof(rtm::vector4f)); - ACL_ASSERT(lossy_scales.get_vector_format() == vector_format8::vector3f_full, "Expected a vector3f_full vector format, found: " ACL_STRING_FORMAT_SPECIFIER, get_vector_format_name(lossy_scales.get_vector_format())); + ACL_ASSERT(lossy_scales.get_vector_format() == vector_format8::vector3f_full, "Expected a vector3f_full vector format, found: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_vector_format_name(lossy_scales.get_vector_format())); const uint32_t num_samples = is_constant_bit_rate(bit_rate) ? 1 : lossy_scales.get_num_samples(); const uint32_t sample_size = sizeof(uint64_t) * 2; diff --git a/includes/acl/compression/impl/sample_streams.h b/includes/acl/compression/impl/sample_streams.h index 7eda7ff0..d70b722a 100644 --- a/includes/acl/compression/impl/sample_streams.h +++ b/includes/acl/compression/impl/sample_streams.h @@ -75,7 +75,7 @@ namespace acl return unpack_vector3_uXX_unsafe(num_bits_at_bit_rate, ptr, 0); } default: - ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_STRING_FORMAT_SPECIFIER, get_rotation_format_name(format)); + ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_rotation_format_name(format)); return rtm::vector_zero(); } } @@ -98,7 +98,7 @@ namespace acl return unpack_vector3_uXX_unsafe(num_bits_at_bit_rate, ptr, 0); } default: - ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_STRING_FORMAT_SPECIFIER, get_vector_format_name(format)); + ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_vector_format_name(format)); return rtm::vector_zero(); } } @@ -115,7 +115,7 @@ namespace acl // isn't very accurate on small inputs, we need to normalize return rtm::quat_normalize(rtm::quat_from_positive_w(rotation)); default: - ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_STRING_FORMAT_SPECIFIER, get_rotation_format_name(format)); + ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_rotation_format_name(format)); return rtm::quat_identity(); } } @@ -233,7 +233,7 @@ namespace acl break; case rotation_format8::quatf_drop_w_variable: default: - ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_STRING_FORMAT_SPECIFIER, get_rotation_format_name(desired_format)); + ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_rotation_format_name(desired_format)); packed_rotation = rtm::vector_zero(); break; } @@ -375,7 +375,7 @@ namespace acl break; case vector_format8::vector3f_variable: default: - ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_STRING_FORMAT_SPECIFIER, get_vector_format_name(desired_format)); + ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_vector_format_name(desired_format)); packed_translation = rtm::vector_zero(); break; } @@ -515,7 +515,7 @@ namespace acl break; case vector_format8::vector3f_variable: default: - ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_STRING_FORMAT_SPECIFIER, get_vector_format_name(desired_format)); + ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_vector_format_name(desired_format)); packed_scale = scale; break; } diff --git a/includes/acl/compression/impl/track_stream.h b/includes/acl/compression/impl/track_stream.h index d2925d6b..85bd7025 100644 --- a/includes/acl/compression/impl/track_stream.h +++ b/includes/acl/compression/impl/track_stream.h @@ -251,7 +251,7 @@ namespace acl // isn't very accurate on small inputs, we need to normalize return rtm::quat_normalize(rtm::quat_from_positive_w(rotation)); default: - ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_STRING_FORMAT_SPECIFIER, get_rotation_format_name(m_format.rotation)); + ACL_ASSERT(false, "Invalid or unsupported rotation format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_rotation_format_name(m_format.rotation)); return rtm::vector_to_quat(rotation); } }; diff --git a/includes/acl/core/error.h b/includes/acl/core/error.h index 439914e3..3f624be8 100644 --- a/includes/acl/core/error.h +++ b/includes/acl/core/error.h @@ -63,7 +63,7 @@ ACL_IMPL_FILE_PRAGMA_PUSH // #define ACL_ASSERT(expression, format, ...) checkf(expression, ANSI_TO_TCHAR(format), #__VA_ARGS__) // // [Custom String Format Specifier] -// Note that if you use a custom function, you may need to override the ACL_STRING_FORMAT_SPECIFIER +// Note that if you use a custom function, you may need to override the ACL_ASSERT_STRING_FORMAT_SPECIFIER // to properly handle ANSI/Unicode support. The C++11 standard does not support a way to say that '%s' // always means an ANSI string (with 'const char*' as type). MSVC does support '%hs' but other compilers // do not. @@ -74,8 +74,8 @@ ACL_IMPL_FILE_PRAGMA_PUSH ////////////////////////////////////////////////////////////////////////// // See [Custom String Format Specifier] for details -#if !defined(ACL_STRING_FORMAT_SPECIFIER) - #define ACL_STRING_FORMAT_SPECIFIER "%s" +#if !defined(ACL_ASSERT_STRING_FORMAT_SPECIFIER) + #define ACL_ASSERT_STRING_FORMAT_SPECIFIER "%s" #endif #if defined(ACL_ON_ASSERT_ABORT) diff --git a/includes/acl/decompression/impl/decompression.scalar.h b/includes/acl/decompression/impl/decompression.scalar.h index 7caa5e24..acbf01c7 100644 --- a/includes/acl/decompression/impl/decompression.scalar.h +++ b/includes/acl/decompression/impl/decompression.scalar.h @@ -99,7 +99,7 @@ namespace acl template inline bool initialize_v0(persistent_scalar_decompression_context_v0& context, const compressed_tracks& tracks, const database_context* database) { - ACL_ASSERT(tracks.get_algorithm_type() == algorithm_type8::uniformly_sampled, "Invalid algorithm type [" ACL_STRING_FORMAT_SPECIFIER "], expected [" ACL_STRING_FORMAT_SPECIFIER "]", get_algorithm_name(tracks.get_algorithm_type()), get_algorithm_name(algorithm_type8::uniformly_sampled)); + ACL_ASSERT(tracks.get_algorithm_type() == algorithm_type8::uniformly_sampled, "Invalid algorithm type [" ACL_ASSERT_STRING_FORMAT_SPECIFIER "], expected [" ACL_ASSERT_STRING_FORMAT_SPECIFIER "]", get_algorithm_name(tracks.get_algorithm_type()), get_algorithm_name(algorithm_type8::uniformly_sampled)); if (database != nullptr) return false; // Database decompression is not supported for scalar tracks diff --git a/includes/acl/decompression/impl/decompression.transform.h b/includes/acl/decompression/impl/decompression.transform.h index 8cd32fab..b113c3f6 100644 --- a/includes/acl/decompression/impl/decompression.transform.h +++ b/includes/acl/decompression/impl/decompression.transform.h @@ -84,7 +84,7 @@ namespace acl template inline bool initialize_v0(persistent_transform_decompression_context_v0& context, const compressed_tracks& tracks, const database_context* database) { - ACL_ASSERT(tracks.get_algorithm_type() == algorithm_type8::uniformly_sampled, "Invalid algorithm type [" ACL_STRING_FORMAT_SPECIFIER "], expected [" ACL_STRING_FORMAT_SPECIFIER "]", get_algorithm_name(tracks.get_algorithm_type()), get_algorithm_name(algorithm_type8::uniformly_sampled)); + ACL_ASSERT(tracks.get_algorithm_type() == algorithm_type8::uniformly_sampled, "Invalid algorithm type [" ACL_ASSERT_STRING_FORMAT_SPECIFIER "], expected [" ACL_ASSERT_STRING_FORMAT_SPECIFIER "]", get_algorithm_name(tracks.get_algorithm_type()), get_algorithm_name(algorithm_type8::uniformly_sampled)); using translation_adapter = acl_impl::translation_decompression_settings_adapter; using scale_adapter = acl_impl::scale_decompression_settings_adapter; @@ -99,9 +99,9 @@ namespace acl const vector_format8 translation_format = get_vector_format(packed_translation_format); const vector_format8 scale_format = get_vector_format(packed_scale_format); - ACL_ASSERT(rotation_format == packed_rotation_format, "Statically compiled rotation format (" ACL_STRING_FORMAT_SPECIFIER ") differs from the compressed rotation format (" ACL_STRING_FORMAT_SPECIFIER ")!", get_rotation_format_name(rotation_format), get_rotation_format_name(packed_rotation_format)); - ACL_ASSERT(translation_format == packed_translation_format, "Statically compiled translation format (" ACL_STRING_FORMAT_SPECIFIER ") differs from the compressed translation format (" ACL_STRING_FORMAT_SPECIFIER ")!", get_vector_format_name(translation_format), get_vector_format_name(packed_translation_format)); - ACL_ASSERT(scale_format == packed_scale_format, "Statically compiled scale format (" ACL_STRING_FORMAT_SPECIFIER ") differs from the compressed scale format (" ACL_STRING_FORMAT_SPECIFIER ")!", get_vector_format_name(scale_format), get_vector_format_name(packed_scale_format)); + ACL_ASSERT(rotation_format == packed_rotation_format, "Statically compiled rotation format (" ACL_ASSERT_STRING_FORMAT_SPECIFIER ") differs from the compressed rotation format (" ACL_ASSERT_STRING_FORMAT_SPECIFIER ")!", get_rotation_format_name(rotation_format), get_rotation_format_name(packed_rotation_format)); + ACL_ASSERT(translation_format == packed_translation_format, "Statically compiled translation format (" ACL_ASSERT_STRING_FORMAT_SPECIFIER ") differs from the compressed translation format (" ACL_ASSERT_STRING_FORMAT_SPECIFIER ")!", get_vector_format_name(translation_format), get_vector_format_name(packed_translation_format)); + ACL_ASSERT(scale_format == packed_scale_format, "Statically compiled scale format (" ACL_ASSERT_STRING_FORMAT_SPECIFIER ") differs from the compressed scale format (" ACL_ASSERT_STRING_FORMAT_SPECIFIER ")!", get_vector_format_name(scale_format), get_vector_format_name(packed_scale_format)); // Context is always the first member and versions should always match const database_context_v0* db = bit_cast(database); diff --git a/includes/acl/math/vector4_packing.h b/includes/acl/math/vector4_packing.h index 26fbab4c..2de81d32 100644 --- a/includes/acl/math/vector4_packing.h +++ b/includes/acl/math/vector4_packing.h @@ -1162,7 +1162,7 @@ namespace acl case vector_format8::vector3f_full: return sizeof(float) * 3; case vector_format8::vector3f_variable: default: - ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_STRING_FORMAT_SPECIFIER, get_vector_format_name(format)); + ACL_ASSERT(false, "Invalid or unsupported vector format: " ACL_ASSERT_STRING_FORMAT_SPECIFIER, get_vector_format_name(format)); return 0; } }