Skip to content

Commit

Permalink
style: clarify macro name
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrechette committed Oct 28, 2023
1 parent 51b6051 commit f636aca
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions includes/acl/compression/impl/convert_rotation.transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}

Expand Down
14 changes: 7 additions & 7 deletions includes/acl/compression/impl/quantize.transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions includes/acl/compression/impl/sample_streams.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand All @@ -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();
}
}
Expand All @@ -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();
}
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/acl/compression/impl/track_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down
6 changes: 3 additions & 3 deletions includes/acl/core/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion includes/acl/decompression/impl/decompression.scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace acl
template<class decompression_settings_type, class database_settings_type>
inline bool initialize_v0(persistent_scalar_decompression_context_v0& context, const compressed_tracks& tracks, const database_context<database_settings_type>* 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
Expand Down
8 changes: 4 additions & 4 deletions includes/acl/decompression/impl/decompression.transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace acl
template<class decompression_settings_type, class database_settings_type>
inline bool initialize_v0(persistent_transform_decompression_context_v0& context, const compressed_tracks& tracks, const database_context<database_settings_type>* 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<decompression_settings_type>;
using scale_adapter = acl_impl::scale_decompression_settings_adapter<decompression_settings_type>;
Expand All @@ -99,9 +99,9 @@ namespace acl
const vector_format8 translation_format = get_vector_format<translation_adapter>(packed_translation_format);
const vector_format8 scale_format = get_vector_format<scale_adapter>(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<const database_context_v0*>(database);
Expand Down
2 changes: 1 addition & 1 deletion includes/acl/math/vector4_packing.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit f636aca

Please sign in to comment.