Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96fa5df7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I2ee3c326,I42b88344 into main

* changes:
  Remove unused osi array library
  Inline fluoride_test_defaults in net_test_hci
parents 00204096 1e7091eb
Loading
Loading
Loading
Loading
+0 −23
Original line number Original line Diff line number Diff line
@@ -58,29 +58,6 @@ cc_defaults {
    min_sdk_version: "current",
    min_sdk_version: "current",
}
}


cc_defaults {
    name: "fluoride_test_defaults",
    defaults: ["fluoride_defaults"],
    host_supported: true,
    shared_libs: [
        "libcrypto",
        "liblog",
    ],
    static_libs: [
        "libbt-common",
        "libcutils",
        "libgmock",
        "libosi",
        "libosi-AlarmTestHarness",
        "libosi-AllocationTestHarness",
    ],
    sanitize: {
        address: true,
        cfi: true,
        misc_undefined: ["bounds"],
    },
}

cc_defaults {
cc_defaults {
    name: "fluoride_defaults",
    name: "fluoride_defaults",
    defaults: [
    defaults: [
+8 −2
Original line number Original line Diff line number Diff line
@@ -45,10 +45,8 @@ cc_test {
    defaults: [
    defaults: [
        "bluetooth_gtest_x86_asan_workaround",
        "bluetooth_gtest_x86_asan_workaround",
        "fluoride_defaults",
        "fluoride_defaults",
        "fluoride_test_defaults",
        "mts_defaults",
        "mts_defaults",
    ],
    ],
    host_supported: false,
    local_include_dirs: [
    local_include_dirs: [
        "include",
        "include",
    ],
    ],
@@ -67,11 +65,19 @@ cc_test {
        "android.hardware.bluetooth.audio@2.1",
        "android.hardware.bluetooth.audio@2.1",
        "libbase",
        "libbase",
        "libdl",
        "libdl",
        "liblog",
    ],
    ],
    static_libs: [
    static_libs: [
        "libbluetooth-for-tests",
        "libbluetooth-for-tests",
        "libbt-hci",
        "libbt-hci",
        "libbtcore",
        "libbtcore",
        "libchrome",
        "libchrome",
        "libosi",
        "libosi-AllocationTestHarness",
    ],
    ],
    sanitize: {
        address: true,
        cfi: true,
        misc_undefined: ["bounds"],
    },
}
}
+0 −2
Original line number Original line Diff line number Diff line
@@ -75,7 +75,6 @@ cc_library_static {
        "src/alarm.cc",
        "src/alarm.cc",
        "src/allocation_tracker.cc",
        "src/allocation_tracker.cc",
        "src/allocator.cc",
        "src/allocator.cc",
        "src/array.cc",
        "src/buffer.cc",
        "src/buffer.cc",
        "src/config.cc",
        "src/config.cc",
        "src/fixed_queue.cc",
        "src/fixed_queue.cc",
@@ -133,7 +132,6 @@ cc_test {
        "test/alarm_test.cc",
        "test/alarm_test.cc",
        "test/allocation_tracker_test.cc",
        "test/allocation_tracker_test.cc",
        "test/allocator_test.cc",
        "test/allocator_test.cc",
        "test/array_test.cc",
        "test/config_test.cc",
        "test/config_test.cc",
        "test/fixed_queue_test.cc",
        "test/fixed_queue_test.cc",
        "test/future_test.cc",
        "test/future_test.cc",
+0 −2
Original line number Original line Diff line number Diff line
@@ -19,7 +19,6 @@ static_library("osi") {
    "src/alarm.cc",
    "src/alarm.cc",
    "src/allocation_tracker.cc",
    "src/allocation_tracker.cc",
    "src/allocator.cc",
    "src/allocator.cc",
    "src/array.cc",
    "src/buffer.cc",
    "src/buffer.cc",
    "src/compat.cc",
    "src/compat.cc",
    "src/config.cc",
    "src/config.cc",
@@ -75,7 +74,6 @@ if (use.test) {
      "test/alarm_test.cc",
      "test/alarm_test.cc",
      "test/allocation_tracker_test.cc",
      "test/allocation_tracker_test.cc",
      "test/allocator_test.cc",
      "test/allocator_test.cc",
      "test/array_test.cc",
      "test/config_test.cc",
      "test/config_test.cc",
      "test/future_test.cc",
      "test/future_test.cc",
      "test/hash_map_utils_test.cc",
      "test/hash_map_utils_test.cc",

system/osi/include/array.h

deleted100644 → 0
+0 −58
Original line number Original line Diff line number Diff line
/******************************************************************************
 *
 *  Copyright 2014 Google, Inc.
 *
 *  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.
 *
 ******************************************************************************/

#pragma once

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

typedef struct array_t array_t;

// Returns a new array object that stores elements of size |element_size|. The
// returned object must be freed with |array_free|. |element_size| must be
// greater than 0. Returns NULL on failure.
array_t* array_new(size_t element_size);

// Frees an array that was allocated with |array_new|. |array| may be NULL.
void array_free(array_t* array);

// Returns a pointer to the first stored element in |array|. |array| must not be
// NULL.
void* array_ptr(const array_t* array);

// Returns a pointer to the |index|th element of |array|. |index| must be less
// than the array's length. |array| must not be NULL.
void* array_at(const array_t* array, size_t index);

// Returns the number of elements stored in |array|. |array| must not be NULL.
size_t array_length(const array_t* array);

// Inserts an element to the end of |array| by value. For example, a caller
// may simply call array_append_value(array, 5) instead of storing 5 into a
// variable and then inserting by pointer. Although |value| is a uint32_t,
// only the lowest |element_size| bytes will be stored. |array| must not be
// NULL. Returns true if the element could be inserted into the array, false
// on error.
bool array_append_value(array_t* array, uint32_t value);

// Inserts an element to the end of |array|. The value pointed to by |data| must
// be at least |element_size| bytes long and will be copied into the array.
// Neither |array| nor |data| may be NULL. Returns true if the element could be
// inserted into the array, false on error.
bool array_append_ptr(array_t* array, void* data);
Loading