From b91c49364df1683c7fe1191eb02b8d9c331874f6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 23 Apr 2021 16:46:57 +0200 Subject: AK: Rename adopt() to adopt_ref() This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.) --- Userland/Libraries/LibAudio/Buffer.h | 4 ++-- Userland/Libraries/LibAudio/Loader.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Userland/Libraries/LibAudio') diff --git a/Userland/Libraries/LibAudio/Buffer.h b/Userland/Libraries/LibAudio/Buffer.h index bf9f7bfa30..fda5e0ef9c 100644 --- a/Userland/Libraries/LibAudio/Buffer.h +++ b/Userland/Libraries/LibAudio/Buffer.h @@ -93,11 +93,11 @@ public: static RefPtr from_pcm_stream(InputMemoryStream& stream, ResampleHelper& resampler, int num_channels, int bits_per_sample, int num_samples); static NonnullRefPtr create_with_samples(Vector&& samples) { - return adopt(*new Buffer(move(samples))); + return adopt_ref(*new Buffer(move(samples))); } static NonnullRefPtr create_with_anonymous_buffer(Core::AnonymousBuffer buffer, i32 buffer_id, int sample_count) { - return adopt(*new Buffer(move(buffer), buffer_id, sample_count)); + return adopt_ref(*new Buffer(move(buffer), buffer_id, sample_count)); } const Frame* samples() const { return (const Frame*)data(); } diff --git a/Userland/Libraries/LibAudio/Loader.h b/Userland/Libraries/LibAudio/Loader.h index 1e92262079..5cd605934d 100644 --- a/Userland/Libraries/LibAudio/Loader.h +++ b/Userland/Libraries/LibAudio/Loader.h @@ -39,8 +39,8 @@ public: class Loader : public RefCounted { public: - static NonnullRefPtr create(const StringView& path) { return adopt(*new Loader(path)); } - static NonnullRefPtr create(const ByteBuffer& buffer) { return adopt(*new Loader(buffer)); } + static NonnullRefPtr create(const StringView& path) { return adopt_ref(*new Loader(path)); } + static NonnullRefPtr create(const ByteBuffer& buffer) { return adopt_ref(*new Loader(buffer)); } bool has_error() const { return m_plugin ? m_plugin->has_error() : true; } const char* error_string() const { return m_plugin ? m_plugin->error_string() : "No loader plugin available"; } -- cgit v1.2.3