From 85aab233eec0ffde4d65bf30c7fa344f54afd46c Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Fri, 25 Jul 2025 22:02:43 +0200 Subject: [PATCH] [c] Constructor nullability. --- spine-c/src/extensions.cpp | 8 ++++---- spine-c/src/generated/animation_state.cpp | 13 ++++++------- spine-c/src/generated/animation_state.h | 10 +++++----- spine-c/src/generated/animation_state_data.cpp | 4 ++-- spine-c/src/generated/animation_state_data.h | 2 +- spine-c/src/generated/atlas_attachment_loader.cpp | 4 ++-- spine-c/src/generated/atlas_attachment_loader.h | 2 +- spine-c/src/generated/deform_timeline.cpp | 5 ++--- spine-c/src/generated/deform_timeline.h | 2 +- spine-c/src/generated/linked_mesh.cpp | 9 +++++---- spine-c/src/generated/linked_mesh.h | 6 +++--- spine-c/src/generated/sequence_timeline.cpp | 4 ++-- spine-c/src/generated/sequence_timeline.h | 2 +- spine-c/src/generated/skeleton_binary.cpp | 8 ++++---- spine-c/src/generated/skeleton_binary.h | 4 ++-- spine-c/src/generated/skeleton_json.cpp | 8 ++++---- spine-c/src/generated/skeleton_json.h | 4 ++-- 17 files changed, 47 insertions(+), 48 deletions(-) diff --git a/spine-c/src/extensions.cpp b/spine-c/src/extensions.cpp index 55e047f0e..0a955b58d 100644 --- a/spine-c/src/extensions.cpp +++ b/spine-c/src/extensions.cpp @@ -251,7 +251,7 @@ void spine_atlas_result_dispose(spine_atlas_result result) { spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, const char *skeletonData, const char *path) { if (!atlas || !skeletonData) return nullptr; _spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__); - SkeletonJson json((Atlas *) atlas); + SkeletonJson json(*(Atlas *) atlas); json.setScale(1); SkeletonData *data = json.readSkeletonData(skeletonData); @@ -287,7 +287,7 @@ spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, cons spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas atlas, const uint8_t *skeletonData, int32_t length, const char *path) { if (!atlas || !skeletonData) return nullptr; _spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__); - SkeletonBinary binary((Atlas *) atlas); + SkeletonBinary binary(*(Atlas *) atlas); binary.setScale(1); SkeletonData *data = binary.readSkeletonData((const unsigned char *) skeletonData, length); @@ -345,8 +345,8 @@ spine_skeleton_drawable spine_skeleton_drawable_create(spine_skeleton_data skele _spine_skeleton_drawable *drawable = new (__FILE__, __LINE__) _spine_skeleton_drawable(); Skeleton *skeleton = new (__FILE__, __LINE__) Skeleton(*((SkeletonData *) skeletonData)); - AnimationStateData *stateData = new (__FILE__, __LINE__) AnimationStateData((SkeletonData *) skeletonData); - AnimationState *state = new (__FILE__, __LINE__) AnimationState(stateData); + AnimationStateData *stateData = new (__FILE__, __LINE__) AnimationStateData(*(SkeletonData *) skeletonData); + AnimationState *state = new (__FILE__, __LINE__) AnimationState(*stateData); EventListener *listener = new (__FILE__, __LINE__) EventListener(); state->setListener(listener); diff --git a/spine-c/src/generated/animation_state.cpp b/spine-c/src/generated/animation_state.cpp index 8ae95a364..ad2d6b5ef 100644 --- a/spine-c/src/generated/animation_state.cpp +++ b/spine-c/src/generated/animation_state.cpp @@ -3,8 +3,8 @@ using namespace spine; -spine_animation_state spine_animation_state_create(/*@null*/ spine_animation_state_data data) { - return (spine_animation_state) new (__FILE__, __LINE__) AnimationState((AnimationStateData *) data); +spine_animation_state spine_animation_state_create(spine_animation_state_data data) { + return (spine_animation_state) new (__FILE__, __LINE__) AnimationState(*((AnimationStateData *) data)); } void spine_animation_state_dispose(spine_animation_state self) { @@ -36,10 +36,9 @@ spine_track_entry spine_animation_state_set_animation_1(spine_animation_state se return (spine_track_entry) &_self->setAnimation(trackIndex, String(animationName), loop); } -spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, /*@null*/ spine_animation animation, - bool loop) { +spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop) { AnimationState *_self = (AnimationState *) self; - return (spine_track_entry) &_self->setAnimation(trackIndex, (Animation *) animation, loop); + return (spine_track_entry) &_self->setAnimation(trackIndex, *((Animation *) animation), loop); } spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName, bool loop, @@ -48,10 +47,10 @@ spine_track_entry spine_animation_state_add_animation_1(spine_animation_state se return (spine_track_entry) &_self->addAnimation(trackIndex, String(animationName), loop, delay); } -spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, /*@null*/ spine_animation animation, bool loop, +spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop, float delay) { AnimationState *_self = (AnimationState *) self; - return (spine_track_entry) &_self->addAnimation(trackIndex, (Animation *) animation, loop, delay); + return (spine_track_entry) &_self->addAnimation(trackIndex, *((Animation *) animation), loop, delay); } spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration) { diff --git a/spine-c/src/generated/animation_state.h b/spine-c/src/generated/animation_state.h index 3e63ca4c0..3da19d1cc 100644 --- a/spine-c/src/generated/animation_state.h +++ b/spine-c/src/generated/animation_state.h @@ -9,7 +9,7 @@ extern "C" { #endif -SPINE_C_API spine_animation_state spine_animation_state_create(/*@null*/ spine_animation_state_data data); +SPINE_C_API spine_animation_state spine_animation_state_create(spine_animation_state_data data); SPINE_C_API void spine_animation_state_dispose(spine_animation_state self); @@ -19,12 +19,12 @@ SPINE_C_API void spine_animation_state_clear_tracks(spine_animation_state self); SPINE_C_API void spine_animation_state_clear_track(spine_animation_state self, size_t trackIndex); SPINE_C_API spine_track_entry spine_animation_state_set_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName, bool loop); -SPINE_C_API spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, - /*@null*/ spine_animation animation, bool loop); +SPINE_C_API spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, + bool loop); SPINE_C_API spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName, bool loop, float delay); -SPINE_C_API spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, - /*@null*/ spine_animation animation, bool loop, float delay); +SPINE_C_API spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, + bool loop, float delay); SPINE_C_API spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration); SPINE_C_API spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration, float delay); diff --git a/spine-c/src/generated/animation_state_data.cpp b/spine-c/src/generated/animation_state_data.cpp index 453ac0b1e..ce2d8483e 100644 --- a/spine-c/src/generated/animation_state_data.cpp +++ b/spine-c/src/generated/animation_state_data.cpp @@ -3,8 +3,8 @@ using namespace spine; -spine_animation_state_data spine_animation_state_data_create(/*@null*/ spine_skeleton_data skeletonData) { - return (spine_animation_state_data) new (__FILE__, __LINE__) AnimationStateData((SkeletonData *) skeletonData); +spine_animation_state_data spine_animation_state_data_create(spine_skeleton_data skeletonData) { + return (spine_animation_state_data) new (__FILE__, __LINE__) AnimationStateData(*((SkeletonData *) skeletonData)); } void spine_animation_state_data_dispose(spine_animation_state_data self) { diff --git a/spine-c/src/generated/animation_state_data.h b/spine-c/src/generated/animation_state_data.h index 87e548e3f..58b64ced8 100644 --- a/spine-c/src/generated/animation_state_data.h +++ b/spine-c/src/generated/animation_state_data.h @@ -9,7 +9,7 @@ extern "C" { #endif -SPINE_C_API spine_animation_state_data spine_animation_state_data_create(/*@null*/ spine_skeleton_data skeletonData); +SPINE_C_API spine_animation_state_data spine_animation_state_data_create(spine_skeleton_data skeletonData); SPINE_C_API void spine_animation_state_data_dispose(spine_animation_state_data self); diff --git a/spine-c/src/generated/atlas_attachment_loader.cpp b/spine-c/src/generated/atlas_attachment_loader.cpp index 544302198..e7d3e33cb 100644 --- a/spine-c/src/generated/atlas_attachment_loader.cpp +++ b/spine-c/src/generated/atlas_attachment_loader.cpp @@ -3,8 +3,8 @@ using namespace spine; -spine_atlas_attachment_loader spine_atlas_attachment_loader_create(/*@null*/ spine_atlas atlas) { - return (spine_atlas_attachment_loader) new (__FILE__, __LINE__) AtlasAttachmentLoader((Atlas *) atlas); +spine_atlas_attachment_loader spine_atlas_attachment_loader_create(spine_atlas atlas) { + return (spine_atlas_attachment_loader) new (__FILE__, __LINE__) AtlasAttachmentLoader(*((Atlas *) atlas)); } void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader self) { diff --git a/spine-c/src/generated/atlas_attachment_loader.h b/spine-c/src/generated/atlas_attachment_loader.h index 089156111..482787369 100644 --- a/spine-c/src/generated/atlas_attachment_loader.h +++ b/spine-c/src/generated/atlas_attachment_loader.h @@ -9,7 +9,7 @@ extern "C" { #endif -SPINE_C_API spine_atlas_attachment_loader spine_atlas_attachment_loader_create(/*@null*/ spine_atlas atlas); +SPINE_C_API spine_atlas_attachment_loader spine_atlas_attachment_loader_create(spine_atlas atlas); SPINE_C_API void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader self); diff --git a/spine-c/src/generated/deform_timeline.cpp b/spine-c/src/generated/deform_timeline.cpp index 47099764d..135d0de27 100644 --- a/spine-c/src/generated/deform_timeline.cpp +++ b/spine-c/src/generated/deform_timeline.cpp @@ -3,9 +3,8 @@ using namespace spine; -spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex, - /*@null*/ spine_vertex_attachment attachment) { - return (spine_deform_timeline) new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex, (VertexAttachment *) attachment); +spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex, spine_vertex_attachment attachment) { + return (spine_deform_timeline) new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex, *((VertexAttachment *) attachment)); } void spine_deform_timeline_dispose(spine_deform_timeline self) { diff --git a/spine-c/src/generated/deform_timeline.h b/spine-c/src/generated/deform_timeline.h index 5e962ff5f..63b86593b 100644 --- a/spine-c/src/generated/deform_timeline.h +++ b/spine-c/src/generated/deform_timeline.h @@ -10,7 +10,7 @@ extern "C" { #endif SPINE_C_API spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex, - /*@null*/ spine_vertex_attachment attachment); + spine_vertex_attachment attachment); SPINE_C_API void spine_deform_timeline_dispose(spine_deform_timeline self); diff --git a/spine-c/src/generated/linked_mesh.cpp b/spine-c/src/generated/linked_mesh.cpp index 2c39f134d..1b8ab4907 100644 --- a/spine-c/src/generated/linked_mesh.cpp +++ b/spine-c/src/generated/linked_mesh.cpp @@ -3,15 +3,16 @@ using namespace spine; -spine_linked_mesh spine_linked_mesh_create(/*@null*/ spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, const char *parent, +spine_linked_mesh spine_linked_mesh_create(spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, const char *parent, bool inheritTimelines) { - return (spine_linked_mesh) new (__FILE__, __LINE__) LinkedMesh((MeshAttachment *) mesh, skinIndex, slotIndex, String(parent), inheritTimelines); + return (spine_linked_mesh) new (__FILE__, __LINE__) + LinkedMesh(*((MeshAttachment *) mesh), skinIndex, slotIndex, String(parent), inheritTimelines); } -spine_linked_mesh spine_linked_mesh_create2(/*@null*/ spine_mesh_attachment mesh, const char *skin, size_t slotIndex, const char *parent, +spine_linked_mesh spine_linked_mesh_create2(spine_mesh_attachment mesh, const char *skin, size_t slotIndex, const char *parent, bool inheritTimelines) { return (spine_linked_mesh) new (__FILE__, __LINE__) - LinkedMesh((MeshAttachment *) mesh, String(skin), slotIndex, String(parent), inheritTimelines); + LinkedMesh(*((MeshAttachment *) mesh), String(skin), slotIndex, String(parent), inheritTimelines); } void spine_linked_mesh_dispose(spine_linked_mesh self) { diff --git a/spine-c/src/generated/linked_mesh.h b/spine-c/src/generated/linked_mesh.h index b1eb76c67..d4acb933c 100644 --- a/spine-c/src/generated/linked_mesh.h +++ b/spine-c/src/generated/linked_mesh.h @@ -9,9 +9,9 @@ extern "C" { #endif -SPINE_C_API spine_linked_mesh spine_linked_mesh_create(/*@null*/ spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, - const char *parent, bool inheritTimelines); -SPINE_C_API spine_linked_mesh spine_linked_mesh_create2(/*@null*/ spine_mesh_attachment mesh, const char *skin, size_t slotIndex, const char *parent, +SPINE_C_API spine_linked_mesh spine_linked_mesh_create(spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, const char *parent, + bool inheritTimelines); +SPINE_C_API spine_linked_mesh spine_linked_mesh_create2(spine_mesh_attachment mesh, const char *skin, size_t slotIndex, const char *parent, bool inheritTimelines); SPINE_C_API void spine_linked_mesh_dispose(spine_linked_mesh self); diff --git a/spine-c/src/generated/sequence_timeline.cpp b/spine-c/src/generated/sequence_timeline.cpp index c2b2bfbf3..bd42c1629 100644 --- a/spine-c/src/generated/sequence_timeline.cpp +++ b/spine-c/src/generated/sequence_timeline.cpp @@ -3,8 +3,8 @@ using namespace spine; -spine_sequence_timeline spine_sequence_timeline_create(size_t frameCount, int slotIndex, /*@null*/ spine_attachment attachment) { - return (spine_sequence_timeline) new (__FILE__, __LINE__) SequenceTimeline(frameCount, slotIndex, (Attachment *) attachment); +spine_sequence_timeline spine_sequence_timeline_create(size_t frameCount, int slotIndex, spine_attachment attachment) { + return (spine_sequence_timeline) new (__FILE__, __LINE__) SequenceTimeline(frameCount, slotIndex, *((Attachment *) attachment)); } void spine_sequence_timeline_dispose(spine_sequence_timeline self) { diff --git a/spine-c/src/generated/sequence_timeline.h b/spine-c/src/generated/sequence_timeline.h index 8a4245065..1e81dfb28 100644 --- a/spine-c/src/generated/sequence_timeline.h +++ b/spine-c/src/generated/sequence_timeline.h @@ -9,7 +9,7 @@ extern "C" { #endif -SPINE_C_API spine_sequence_timeline spine_sequence_timeline_create(size_t frameCount, int slotIndex, /*@null*/ spine_attachment attachment); +SPINE_C_API spine_sequence_timeline spine_sequence_timeline_create(size_t frameCount, int slotIndex, spine_attachment attachment); SPINE_C_API void spine_sequence_timeline_dispose(spine_sequence_timeline self); diff --git a/spine-c/src/generated/skeleton_binary.cpp b/spine-c/src/generated/skeleton_binary.cpp index 79d664e28..016469d0e 100644 --- a/spine-c/src/generated/skeleton_binary.cpp +++ b/spine-c/src/generated/skeleton_binary.cpp @@ -3,12 +3,12 @@ using namespace spine; -spine_skeleton_binary spine_skeleton_binary_create(/*@null*/ spine_atlas atlas) { - return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary((Atlas *) atlas); +spine_skeleton_binary spine_skeleton_binary_create(spine_atlas atlas) { + return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary(*((Atlas *) atlas)); } -spine_skeleton_binary spine_skeleton_binary_create2(/*@null*/ spine_attachment_loader attachmentLoader, bool ownsLoader) { - return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary((AttachmentLoader *) attachmentLoader, ownsLoader); +spine_skeleton_binary spine_skeleton_binary_create2(spine_attachment_loader attachmentLoader, bool ownsLoader) { + return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary(*((AttachmentLoader *) attachmentLoader), ownsLoader); } void spine_skeleton_binary_dispose(spine_skeleton_binary self) { diff --git a/spine-c/src/generated/skeleton_binary.h b/spine-c/src/generated/skeleton_binary.h index db1f9b7f1..8e56ade19 100644 --- a/spine-c/src/generated/skeleton_binary.h +++ b/spine-c/src/generated/skeleton_binary.h @@ -9,8 +9,8 @@ extern "C" { #endif -SPINE_C_API spine_skeleton_binary spine_skeleton_binary_create(/*@null*/ spine_atlas atlas); -SPINE_C_API spine_skeleton_binary spine_skeleton_binary_create2(/*@null*/ spine_attachment_loader attachmentLoader, bool ownsLoader); +SPINE_C_API spine_skeleton_binary spine_skeleton_binary_create(spine_atlas atlas); +SPINE_C_API spine_skeleton_binary spine_skeleton_binary_create2(spine_attachment_loader attachmentLoader, bool ownsLoader); SPINE_C_API void spine_skeleton_binary_dispose(spine_skeleton_binary self); diff --git a/spine-c/src/generated/skeleton_json.cpp b/spine-c/src/generated/skeleton_json.cpp index d9d0b961c..e71eaa6d7 100644 --- a/spine-c/src/generated/skeleton_json.cpp +++ b/spine-c/src/generated/skeleton_json.cpp @@ -3,12 +3,12 @@ using namespace spine; -spine_skeleton_json spine_skeleton_json_create(/*@null*/ spine_atlas atlas) { - return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson((Atlas *) atlas); +spine_skeleton_json spine_skeleton_json_create(spine_atlas atlas) { + return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson(*((Atlas *) atlas)); } -spine_skeleton_json spine_skeleton_json_create2(/*@null*/ spine_attachment_loader attachmentLoader, bool ownsLoader) { - return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson((AttachmentLoader *) attachmentLoader, ownsLoader); +spine_skeleton_json spine_skeleton_json_create2(spine_attachment_loader attachmentLoader, bool ownsLoader) { + return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson(*((AttachmentLoader *) attachmentLoader), ownsLoader); } void spine_skeleton_json_dispose(spine_skeleton_json self) { diff --git a/spine-c/src/generated/skeleton_json.h b/spine-c/src/generated/skeleton_json.h index 46c09db39..8bc56d2dc 100644 --- a/spine-c/src/generated/skeleton_json.h +++ b/spine-c/src/generated/skeleton_json.h @@ -9,8 +9,8 @@ extern "C" { #endif -SPINE_C_API spine_skeleton_json spine_skeleton_json_create(/*@null*/ spine_atlas atlas); -SPINE_C_API spine_skeleton_json spine_skeleton_json_create2(/*@null*/ spine_attachment_loader attachmentLoader, bool ownsLoader); +SPINE_C_API spine_skeleton_json spine_skeleton_json_create(spine_atlas atlas); +SPINE_C_API spine_skeleton_json spine_skeleton_json_create2(spine_attachment_loader attachmentLoader, bool ownsLoader); SPINE_C_API void spine_skeleton_json_dispose(spine_skeleton_json self);