From c369126ddd5f9827f97b5277ff5bd58404724a65 Mon Sep 17 00:00:00 2001 From: Eric Reinecke Date: Fri, 6 Oct 2023 15:48:35 -0700 Subject: [PATCH] Ran pre-release repo cleanup to prep for upcoming releases (#1666) Signed-off-by: Eric Reinecke --- CONTRIBUTORS.md | 6 +++++ maintainers/verify_license.py | 1 + src/opentime/rationalTime.h | 2 +- src/opentimelineio/deserialization.cpp | 15 ++++++++----- src/opentimelineio/externalReference.cpp | 6 ++--- src/opentimelineio/externalReference.h | 9 ++++---- src/opentimelineio/generatorReference.cpp | 10 ++++----- src/opentimelineio/generatorReference.h | 13 ++++++----- src/opentimelineio/imageSequenceReference.cpp | 20 ++++++++--------- src/opentimelineio/imageSequenceReference.h | 7 +++--- src/opentimelineio/mediaReference.cpp | 6 ++--- src/opentimelineio/mediaReference.h | 11 +++++----- src/opentimelineio/missingReference.cpp | 6 ++--- src/opentimelineio/missingReference.h | 9 ++++---- src/opentimelineio/safely_typed_any.h | 22 +++++++++---------- src/opentimelineio/serializableObject.h | 6 +++-- .../serializableObjectWithMetadata.h | 2 +- src/opentimelineio/serialization.cpp | 16 +++++++++----- src/opentimelineio/stack.cpp | 2 +- src/opentimelineio/timeline.cpp | 5 ++++- src/opentimelineio/track.cpp | 2 +- src/opentimelineio/track.h | 3 +-- .../bindings-common/casters.h | 3 +++ tests/test_core_utils.py | 3 +++ 24 files changed, 109 insertions(+), 76 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 0842825f9..d22caf37a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -14,6 +14,8 @@ If you know of anyone missing from this list, please contact us: https://lists.a * Darby Johnston ([darbyjohnston](https://github.com/darbyjohnston)) * Darwyn Peachey ([peachey](https://github.com/peachey)) * David Baraff ([davidbaraff](https://github.com/davidbaraff)) +* dgw ([dgw](https://github.com/dgw)) +* Doug Halley ([douglascomet](https://github.com/douglascomet)) * Ed Caspersen ([repsac](https://github.com/repsac)) * Emile Labrosse ([elabrosseRodeofx](https://github.com/elabrosseRodeofx)) * Eric ([eric-with-a-c](https://github.com/eric-with-a-c)) @@ -26,6 +28,7 @@ If you know of anyone missing from this list, please contact us: https://lists.a * FĂ©lix David ([Tilix4](https://github.com/Tilix4)) * Henry Wilkes ([hwilkes-igalia](https://github.com/hwilkes-igalia)) * Jean-Christophe Morin ([JeanChristopheMorinPerso](https://github.com/JeanChristopheMorinPerso)) +* Jeff Horrocks ([jhorrocks-tl](https://github.com/jhorrocks-tl)) * Jeffrey Barendse ([IOjeffrey](https://github.com/IOjeffrey)) * jlskuz ([jlskuz](https://github.com/jlskuz)) * John Mertic ([jmertic](https://github.com/jmertic)) @@ -36,14 +39,17 @@ If you know of anyone missing from this list, please contact us: https://lists.a * Julian Yu-Chung Chen ([jchen9](https://github.com/jchen9)) * Karthik Ramesh Iyer ([KarthikRIyer](https://github.com/KarthikRIyer)) * Laura Savidge ([lsavidge](https://github.com/lsavidge)) +* Mark Final ([foundry-markf](https://github.com/foundry-markf)) * Mark Reid ([markreidvfx](https://github.com/markreidvfx)) * Matt Johnson ([mattyjams](https://github.com/mattyjams)) +* MattKC ([itsmattkc](https://github.com/itsmattkc)) * Michael Dolan ([michdolan](https://github.com/michdolan)) * Michael Jefferies ([michaeljefferies](https://github.com/michaeljefferies)) * Mike Koetter ([mikekoetter](https://github.com/mikekoetter)) * Mike Mahony ([mikemahony](https://github.com/mikemahony)) * Nick Porcino ([meshula](https://github.com/meshula)) * Pedro Labonia ([pedrolabonia](https://github.com/pedrolabonia)) +* Peter Targett ([peter-targett](https://github.com/peter-targett)) * Robyn Rindge ([avrata](https://github.com/avrata)) * Roger Nelson ([rogernelson](https://github.com/rogernelson)) * Sasha Aleshchenko ([TheBigSasha](https://github.com/TheBigSasha)) diff --git a/maintainers/verify_license.py b/maintainers/verify_license.py index d325ca9f4..b4a814ea7 100755 --- a/maintainers/verify_license.py +++ b/maintainers/verify_license.py @@ -36,6 +36,7 @@ os.path.join("src", "deps"), "build", ".git", + ".venv", ] diff --git a/src/opentime/rationalTime.h b/src/opentime/rationalTime.h index fbdd02d4e..b095e0218 100644 --- a/src/opentime/rationalTime.h +++ b/src/opentime/rationalTime.h @@ -6,8 +6,8 @@ #include "opentime/errorStatus.h" #include "opentime/version.h" #include -#include #include +#include #include namespace opentime { namespace OPENTIME_VERSION { diff --git a/src/opentimelineio/deserialization.cpp b/src/opentimelineio/deserialization.cpp index 68cf28f26..a50c8ecfd 100644 --- a/src/opentimelineio/deserialization.cpp +++ b/src/opentimelineio/deserialization.cpp @@ -609,8 +609,9 @@ SerializableObject::Reader::_decode(_Resolver& resolver) else if (schema_name_and_version == "V2d.1") { double x, y; - return _fetch("x", &x) && _fetch("y", &y) ? any(IMATH_NAMESPACE::V2d(x, y)) - : any(); + return _fetch("x", &x) && _fetch("y", &y) + ? any(IMATH_NAMESPACE::V2d(x, y)) + : any(); } else if (schema_name_and_version == "Box2d.1") { @@ -743,13 +744,17 @@ SerializableObject::Reader::read(std::string const& key, AnyVector* value) } bool -SerializableObject::Reader::read(std::string const& key, IMATH_NAMESPACE::V2d* value) +SerializableObject::Reader::read( + std::string const& key, + IMATH_NAMESPACE::V2d* value) { return _fetch(key, value); } bool -SerializableObject::Reader::read(std::string const& key, IMATH_NAMESPACE::Box2d* value) +SerializableObject::Reader::read( + std::string const& key, + IMATH_NAMESPACE::Box2d* value) { return _fetch(key, value); } @@ -816,7 +821,7 @@ SerializableObject::Reader::read( bool SerializableObject::Reader::read( - std::string const& key, + std::string const& key, optional* value) { return _read_optional(key, value); diff --git a/src/opentimelineio/externalReference.cpp b/src/opentimelineio/externalReference.cpp index ba5cc6735..9b655f194 100644 --- a/src/opentimelineio/externalReference.cpp +++ b/src/opentimelineio/externalReference.cpp @@ -6,9 +6,9 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { ExternalReference::ExternalReference( - std::string const& target_url, - optional const& available_range, - AnyDictionary const& metadata, + std::string const& target_url, + optional const& available_range, + AnyDictionary const& metadata, optional const& available_image_bounds) : Parent(std::string(), available_range, metadata, available_image_bounds) , _target_url(target_url) diff --git a/src/opentimelineio/externalReference.h b/src/opentimelineio/externalReference.h index 15a98e756..bc4dadebf 100644 --- a/src/opentimelineio/externalReference.h +++ b/src/opentimelineio/externalReference.h @@ -20,10 +20,11 @@ class ExternalReference final : public MediaReference using Parent = MediaReference; ExternalReference( - std::string const& target_url = std::string(), - optional const& available_range = nullopt, - AnyDictionary const& metadata = AnyDictionary(), - optional const& available_image_bounds = nullopt); + std::string const& target_url = std::string(), + optional const& available_range = nullopt, + AnyDictionary const& metadata = AnyDictionary(), + optional const& available_image_bounds = + nullopt); std::string target_url() const noexcept { return _target_url; } diff --git a/src/opentimelineio/generatorReference.cpp b/src/opentimelineio/generatorReference.cpp index 696a3d229..a75448c83 100644 --- a/src/opentimelineio/generatorReference.cpp +++ b/src/opentimelineio/generatorReference.cpp @@ -6,11 +6,11 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { GeneratorReference::GeneratorReference( - std::string const& name, - std::string const& generator_kind, - optional const& available_range, - AnyDictionary const& parameters, - AnyDictionary const& metadata, + std::string const& name, + std::string const& generator_kind, + optional const& available_range, + AnyDictionary const& parameters, + AnyDictionary const& metadata, optional const& available_image_bounds) : Parent(name, available_range, metadata, available_image_bounds) , _generator_kind(generator_kind) diff --git a/src/opentimelineio/generatorReference.h b/src/opentimelineio/generatorReference.h index 0da3d1317..f06171116 100644 --- a/src/opentimelineio/generatorReference.h +++ b/src/opentimelineio/generatorReference.h @@ -20,12 +20,13 @@ class GeneratorReference final : public MediaReference using Parent = MediaReference; GeneratorReference( - std::string const& name = std::string(), - std::string const& generator_kind = std::string(), - optional const& available_range = nullopt, - AnyDictionary const& parameters = AnyDictionary(), - AnyDictionary const& metadata = AnyDictionary(), - optional const& available_image_bounds = nullopt); + std::string const& name = std::string(), + std::string const& generator_kind = std::string(), + optional const& available_range = nullopt, + AnyDictionary const& parameters = AnyDictionary(), + AnyDictionary const& metadata = AnyDictionary(), + optional const& available_image_bounds = + nullopt); std::string generator_kind() const noexcept { return _generator_kind; } diff --git a/src/opentimelineio/imageSequenceReference.cpp b/src/opentimelineio/imageSequenceReference.cpp index 16b590ed0..c4cdf57bc 100644 --- a/src/opentimelineio/imageSequenceReference.cpp +++ b/src/opentimelineio/imageSequenceReference.cpp @@ -6,16 +6,16 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { ImageSequenceReference::ImageSequenceReference( - std::string const& target_url_base, - std::string const& name_prefix, - std::string const& name_suffix, - int start_frame, - int frame_step, - double rate, - int frame_zero_padding, - MissingFramePolicy const missing_frame_policy, - optional const& available_range, - AnyDictionary const& metadata, + std::string const& target_url_base, + std::string const& name_prefix, + std::string const& name_suffix, + int start_frame, + int frame_step, + double rate, + int frame_zero_padding, + MissingFramePolicy const missing_frame_policy, + optional const& available_range, + AnyDictionary const& metadata, optional const& available_image_bounds) : Parent(std::string(), available_range, metadata, available_image_bounds) , _target_url_base(target_url_base) diff --git a/src/opentimelineio/imageSequenceReference.h b/src/opentimelineio/imageSequenceReference.h index 5694790ff..c2df5147d 100644 --- a/src/opentimelineio/imageSequenceReference.h +++ b/src/opentimelineio/imageSequenceReference.h @@ -36,9 +36,10 @@ class ImageSequenceReference final : public MediaReference int frame_zero_padding = 0, MissingFramePolicy const missing_frame_policy = MissingFramePolicy::error, - optional const& available_range = nullopt, - AnyDictionary const& metadata = AnyDictionary(), - optional const& available_image_bounds = nullopt); + optional const& available_range = nullopt, + AnyDictionary const& metadata = AnyDictionary(), + optional const& available_image_bounds = + nullopt); std::string target_url_base() const noexcept { return _target_url_base; } diff --git a/src/opentimelineio/mediaReference.cpp b/src/opentimelineio/mediaReference.cpp index 40d8c4e88..ed4baa94f 100644 --- a/src/opentimelineio/mediaReference.cpp +++ b/src/opentimelineio/mediaReference.cpp @@ -6,9 +6,9 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { MediaReference::MediaReference( - std::string const& name, - optional const& available_range, - AnyDictionary const& metadata, + std::string const& name, + optional const& available_range, + AnyDictionary const& metadata, optional const& available_image_bounds) : Parent(name, metadata) , _available_range(available_range) diff --git a/src/opentimelineio/mediaReference.h b/src/opentimelineio/mediaReference.h index 716795337..d062e3f5e 100644 --- a/src/opentimelineio/mediaReference.h +++ b/src/opentimelineio/mediaReference.h @@ -24,10 +24,11 @@ class MediaReference : public SerializableObjectWithMetadata using Parent = SerializableObjectWithMetadata; MediaReference( - std::string const& name = std::string(), - optional const& available_range = nullopt, - AnyDictionary const& metadata = AnyDictionary(), - optional const& available_image_bounds = nullopt); + std::string const& name = std::string(), + optional const& available_range = nullopt, + AnyDictionary const& metadata = AnyDictionary(), + optional const& available_image_bounds = + nullopt); optional available_range() const noexcept { @@ -59,7 +60,7 @@ class MediaReference : public SerializableObjectWithMetadata void write_to(Writer&) const override; private: - optional _available_range; + optional _available_range; optional _available_image_bounds; }; diff --git a/src/opentimelineio/missingReference.cpp b/src/opentimelineio/missingReference.cpp index 82396f5a8..3109ae9aa 100644 --- a/src/opentimelineio/missingReference.cpp +++ b/src/opentimelineio/missingReference.cpp @@ -6,9 +6,9 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { MissingReference::MissingReference( - std::string const& name, - optional const& available_range, - AnyDictionary const& metadata, + std::string const& name, + optional const& available_range, + AnyDictionary const& metadata, optional const& available_image_bounds) : Parent(name, available_range, metadata, available_image_bounds) {} diff --git a/src/opentimelineio/missingReference.h b/src/opentimelineio/missingReference.h index 2ad92e78e..ffc486a83 100644 --- a/src/opentimelineio/missingReference.h +++ b/src/opentimelineio/missingReference.h @@ -20,10 +20,11 @@ class MissingReference final : public MediaReference using Parent = MediaReference; MissingReference( - std::string const& name = std::string(), - optional const& available_range = nullopt, - AnyDictionary const& metadata = AnyDictionary(), - optional const& available_image_bounds = nullopt); + std::string const& name = std::string(), + optional const& available_range = nullopt, + AnyDictionary const& metadata = AnyDictionary(), + optional const& available_image_bounds = + nullopt); bool is_missing_reference() const override; diff --git a/src/opentimelineio/safely_typed_any.h b/src/opentimelineio/safely_typed_any.h index 535882acb..75ff1b1b2 100644 --- a/src/opentimelineio/safely_typed_any.h +++ b/src/opentimelineio/safely_typed_any.h @@ -42,17 +42,17 @@ any create_safely_typed_any(AnyVector&&); any create_safely_typed_any(AnyDictionary&&); any create_safely_typed_any(SerializableObject*); -bool safely_cast_bool_any(any const& a); -int safely_cast_int_any(any const& a); -int64_t safely_cast_int64_any(any const& a); -uint64_t safely_cast_uint64_any(any const& a); -double safely_cast_double_any(any const& a); -std::string safely_cast_string_any(any const& a); -RationalTime safely_cast_rational_time_any(any const& a); -TimeRange safely_cast_time_range_any(any const& a); -TimeTransform safely_cast_time_transform_any(any const& a); -IMATH_NAMESPACE::V2d safely_cast_point_any(any const& a); -IMATH_NAMESPACE::Box2d safely_cast_box_any(any const& a); +bool safely_cast_bool_any(any const& a); +int safely_cast_int_any(any const& a); +int64_t safely_cast_int64_any(any const& a); +uint64_t safely_cast_uint64_any(any const& a); +double safely_cast_double_any(any const& a); +std::string safely_cast_string_any(any const& a); +RationalTime safely_cast_rational_time_any(any const& a); +TimeRange safely_cast_time_range_any(any const& a); +TimeTransform safely_cast_time_transform_any(any const& a); +IMATH_NAMESPACE::V2d safely_cast_point_any(any const& a); +IMATH_NAMESPACE::Box2d safely_cast_box_any(any const& a); SerializableObject* safely_cast_retainer_any(any const& a); diff --git a/src/opentimelineio/serializableObject.h b/src/opentimelineio/serializableObject.h index 5d6f175bd..f54a6362b 100644 --- a/src/opentimelineio/serializableObject.h +++ b/src/opentimelineio/serializableObject.h @@ -109,7 +109,8 @@ class SerializableObject bool read(std::string const& key, optional* dest); bool read(std::string const& key, optional* dest); bool read(std::string const& key, optional* dest); - bool read(std::string const& key, optional* value); + bool + read(std::string const& key, optional* value); // skipping std::string because we translate null into the empty // string, so the conversion is somewhat ambiguous @@ -419,7 +420,8 @@ class SerializableObject void write(std::string const& key, IMATH_NAMESPACE::Box2d value); void write(std::string const& key, optional value); void write(std::string const& key, optional value); - void write(std::string const& key, optional value); + void + write(std::string const& key, optional value); void write(std::string const& key, class TimeTransform value); void write(std::string const& key, SerializableObject const* value); void write(std::string const& key, SerializableObject* value) diff --git a/src/opentimelineio/serializableObjectWithMetadata.h b/src/opentimelineio/serializableObjectWithMetadata.h index ddb33c128..3535aa02f 100644 --- a/src/opentimelineio/serializableObjectWithMetadata.h +++ b/src/opentimelineio/serializableObjectWithMetadata.h @@ -33,7 +33,7 @@ class SerializableObjectWithMetadata : public SerializableObject protected: virtual ~SerializableObjectWithMetadata(); - + bool read_from(Reader&) override; void write_to(Writer&) const override; diff --git a/src/opentimelineio/serialization.cpp b/src/opentimelineio/serialization.cpp index e61bff3d4..bb7051eea 100644 --- a/src/opentimelineio/serialization.cpp +++ b/src/opentimelineio/serialization.cpp @@ -733,8 +733,10 @@ SerializableObject::Writer::_build_dispatch_tables() et[&typeid(TimeTransform)] = &_simple_any_comparison; et[&typeid(SerializableObject::ReferenceId)] = &_simple_any_comparison; - et[&typeid(IMATH_NAMESPACE::V2d)] = &_simple_any_comparison; - et[&typeid(IMATH_NAMESPACE::Box2d)] = &_simple_any_comparison; + et[&typeid(IMATH_NAMESPACE::V2d)] = + &_simple_any_comparison; + et[&typeid(IMATH_NAMESPACE::Box2d)] = + &_simple_any_comparison; /* * These next recurse back through the Writer itself: @@ -897,7 +899,7 @@ SerializableObject::Writer::write( void SerializableObject::Writer::write( - std::string const& key, + std::string const& key, optional value) { _encoder_write_key(key); @@ -1058,14 +1060,18 @@ SerializableObject::Writer::write( } void -SerializableObject::Writer::write(std::string const& key, IMATH_NAMESPACE::V2d value) +SerializableObject::Writer::write( + std::string const& key, + IMATH_NAMESPACE::V2d value) { _encoder_write_key(key); _encoder.write_value(value); } void -SerializableObject::Writer::write(std::string const& key, IMATH_NAMESPACE::Box2d value) +SerializableObject::Writer::write( + std::string const& key, + IMATH_NAMESPACE::Box2d value) { _encoder_write_key(key); _encoder.write_value(value); diff --git a/src/opentimelineio/stack.cpp b/src/opentimelineio/stack.cpp index 4f92876a5..175ab2b46 100644 --- a/src/opentimelineio/stack.cpp +++ b/src/opentimelineio/stack.cpp @@ -126,7 +126,7 @@ optional Stack::available_image_bounds(ErrorStatus* error_status) const { optional box; - bool found_first_child = false; + bool found_first_child = false; for (auto clip: find_children(error_status)) { optional child_box; diff --git a/src/opentimelineio/timeline.cpp b/src/opentimelineio/timeline.cpp index 0f1496c96..251ae951e 100644 --- a/src/opentimelineio/timeline.cpp +++ b/src/opentimelineio/timeline.cpp @@ -80,7 +80,10 @@ Timeline::find_clips( optional const& search_range, bool shallow_search) const { - return _tracks.value->find_clips(error_status, search_range, shallow_search); + return _tracks.value->find_clips( + error_status, + search_range, + shallow_search); } }} // namespace opentimelineio::OPENTIMELINEIO_VERSION diff --git a/src/opentimelineio/track.cpp b/src/opentimelineio/track.cpp index 8488f036c..128776244 100644 --- a/src/opentimelineio/track.cpp +++ b/src/opentimelineio/track.cpp @@ -276,7 +276,7 @@ optional Track::available_image_bounds(ErrorStatus* error_status) const { optional box; - bool found_first_clip = false; + bool found_first_clip = false; for (const auto& child: children()) { if (auto clip = dynamic_cast(child.value)) diff --git a/src/opentimelineio/track.h b/src/opentimelineio/track.h index 17110ed61..7c8ef13f1 100644 --- a/src/opentimelineio/track.h +++ b/src/opentimelineio/track.h @@ -52,8 +52,7 @@ class Track : public Composition TimeRange available_range(ErrorStatus* error_status = nullptr) const override; - std::pair, optional> - handles_of_child( + std::pair, optional> handles_of_child( Composable const* child, ErrorStatus* error_status = nullptr) const override; diff --git a/src/py-opentimelineio/bindings-common/casters.h b/src/py-opentimelineio/bindings-common/casters.h index b395f4237..561c3b7a7 100644 --- a/src/py-opentimelineio/bindings-common/casters.h +++ b/src/py-opentimelineio/bindings-common/casters.h @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Contributors to the OpenTimelineIO project + #include #include #include "nonstd/optional.hpp" diff --git a/tests/test_core_utils.py b/tests/test_core_utils.py index a0a7b9425..3c93330fb 100644 --- a/tests/test_core_utils.py +++ b/tests/test_core_utils.py @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Contributors to the OpenTimelineIO project + import copy import unittest