From 31909b814c505fa4ad5fbb37414d23eb0679d600 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Fri, 12 Jun 2026 17:17:02 +0900 Subject: [PATCH] Remove redundant structs --- bindings/ruby/ext/ruby_whisper.h | 9 +-------- bindings/ruby/ext/ruby_whisper_context.c | 4 ++-- bindings/ruby/ext/ruby_whisper_parakeet_context.c | 4 ++-- bindings/ruby/ext/ruby_whisper_parakeet_transcribe.cpp | 2 +- bindings/ruby/ext/ruby_whisper_transcribe.cpp | 2 +- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/bindings/ruby/ext/ruby_whisper.h b/bindings/ruby/ext/ruby_whisper.h index 7f643209a..29ce6c47c 100644 --- a/bindings/ruby/ext/ruby_whisper.h +++ b/bindings/ruby/ext/ruby_whisper.h @@ -103,19 +103,12 @@ typedef struct parsed_samples_t { bool memview_exported; } parsed_samples_t; -typedef struct full_args { - VALUE *context; - VALUE *params; - float *samples; - int n_samples; -} full_args; - typedef struct { VALUE *context; VALUE *params; float *samples; int n_samples; -} ruby_whisper_parakeet_context_full_args; +} ruby_whisper_full_args; typedef struct { struct parakeet_full_params params; diff --git a/bindings/ruby/ext/ruby_whisper_context.c b/bindings/ruby/ext/ruby_whisper_context.c index c44f210a0..2335741c3 100644 --- a/bindings/ruby/ext/ruby_whisper_context.c +++ b/bindings/ruby/ext/ruby_whisper_context.c @@ -479,7 +479,7 @@ full_ubf(void *rb_args) VALUE full_body(VALUE rb_args) { - full_args *args = (full_args *)rb_args; + ruby_whisper_full_args *args = (ruby_whisper_full_args *)rb_args; ruby_whisper *rw; ruby_whisper_params *rwp; @@ -526,7 +526,7 @@ VALUE ruby_whisper_full(int argc, VALUE *argv, VALUE self) VALUE n_samples = argc == 2 ? Qnil : argv[2]; struct parsed_samples_t parsed = parse_samples(&argv[1], &n_samples); - full_args args = { + ruby_whisper_full_args args = { &self, &argv[0], parsed.samples, diff --git a/bindings/ruby/ext/ruby_whisper_parakeet_context.c b/bindings/ruby/ext/ruby_whisper_parakeet_context.c index bc39e9a55..b4a2fc5c4 100644 --- a/bindings/ruby/ext/ruby_whisper_parakeet_context.c +++ b/bindings/ruby/ext/ruby_whisper_parakeet_context.c @@ -217,7 +217,7 @@ parakeet_full_ubf(void *rb_args) VALUE ruby_whisper_parakeet_context_full_body(VALUE rb_args) { - ruby_whisper_parakeet_context_full_args *args = (ruby_whisper_parakeet_context_full_args *)rb_args; + ruby_whisper_full_args *args = (ruby_whisper_full_args *)rb_args; ruby_whisper_parakeet_context *rwpc; GetParakeetContext(*args->context, rwpc); ruby_whisper_parakeet_params *rwpp; @@ -254,7 +254,7 @@ ruby_whisper_parakeet_context_full(int argc, VALUE *argv, VALUE self) VALUE n_samples = argc == 2 ? Qnil : argv[2]; struct parsed_samples_t parsed = parse_samples(&argv[1], &n_samples); - ruby_whisper_parakeet_context_full_args args = { + ruby_whisper_full_args args = { &self, &argv[0], parsed.samples, diff --git a/bindings/ruby/ext/ruby_whisper_parakeet_transcribe.cpp b/bindings/ruby/ext/ruby_whisper_parakeet_transcribe.cpp index f287d20b8..c4deccce8 100644 --- a/bindings/ruby/ext/ruby_whisper_parakeet_transcribe.cpp +++ b/bindings/ruby/ext/ruby_whisper_parakeet_transcribe.cpp @@ -38,7 +38,7 @@ ruby_whisper_parakeet_transcribe(VALUE self, VALUE audio_path, VALUE params) GetParakeetContext(self, rwpc); GetParakeetParams(params, rwpp); - ruby_whisper_parakeet_context_full_args args = { + ruby_whisper_full_args args = { &self, ¶ms, pcmf32.data(), diff --git a/bindings/ruby/ext/ruby_whisper_transcribe.cpp b/bindings/ruby/ext/ruby_whisper_transcribe.cpp index 9bd5dfbe4..ecd27d3a3 100644 --- a/bindings/ruby/ext/ruby_whisper_transcribe.cpp +++ b/bindings/ruby/ext/ruby_whisper_transcribe.cpp @@ -81,7 +81,7 @@ ruby_whisper_transcribe(int argc, VALUE *argv, VALUE self) { return self; } - full_args args = { + ruby_whisper_full_args args = { &self, ¶ms, pcmf32.data(),