mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-17 12:32:14 +02:00
CI: fixing the files to be complient with pre-commit hooks
This commit is contained in:
@ -1,16 +1,8 @@
|
||||
// Copyright 2022 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -22,15 +14,15 @@ namespace esp_modem {
|
||||
*/
|
||||
struct unique_buffer {
|
||||
explicit unique_buffer(size_t size);
|
||||
unique_buffer (unique_buffer const&) = delete;
|
||||
unique_buffer& operator=(unique_buffer const&) = delete;
|
||||
unique_buffer(unique_buffer&& other) noexcept
|
||||
unique_buffer (unique_buffer const &) = delete;
|
||||
unique_buffer &operator=(unique_buffer const &) = delete;
|
||||
unique_buffer(unique_buffer &&other) noexcept
|
||||
{
|
||||
data = std::move(other.data);
|
||||
size = other.size;
|
||||
consumed = 0;
|
||||
}
|
||||
unique_buffer& operator=(unique_buffer&& other) noexcept
|
||||
unique_buffer &operator=(unique_buffer &&other) noexcept
|
||||
{
|
||||
if (&other == this) {
|
||||
return *this;
|
||||
@ -40,7 +32,10 @@ struct unique_buffer {
|
||||
consumed = 0;
|
||||
return *this;
|
||||
}
|
||||
[[nodiscard]] uint8_t *get() const { return data.get(); }
|
||||
[[nodiscard]] uint8_t *get() const
|
||||
{
|
||||
return data.get();
|
||||
}
|
||||
|
||||
std::unique_ptr<uint8_t[]> data;
|
||||
size_t size{};
|
||||
|
Reference in New Issue
Block a user