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

Commit 06fa05e1 authored by Ting-Yuan Huang's avatar Ting-Yuan Huang
Browse files

Suppress false compiler warnings

In theory, static analyzer can't be 100% acurate for certain types of
analysis.

Bug: 38178471
Test: Built without seeing these warnings.
Change-Id: I63d2d02565cc040189ed70813eb42e06dd8c9f2a
parent 1ad4c569
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -399,7 +399,9 @@ void read_char_cb(uint16_t conn_id, tGATT_STATUS status, uint16_t handle,
  CHECK(len <= BTGATT_MAX_ATTR_LEN);
  if (len > 0) memcpy(params->value.value, value, len);

  CLI_CBACK_IN_JNI(read_characteristic_cb, conn_id, status,
  // clang-tidy analyzer complains about |params| is leaked.  It doesn't know
  // that |param| will be freed by the callback function.
  CLI_CBACK_IN_JNI(read_characteristic_cb, conn_id, status, /* NOLINT */
                   base::Owned(params));
}

@@ -420,7 +422,9 @@ void read_using_char_uuid_cb(uint16_t conn_id, tGATT_STATUS status,
  CHECK(len <= BTGATT_MAX_ATTR_LEN);
  if (len > 0) memcpy(params->value.value, value, len);

  CLI_CBACK_IN_JNI(read_characteristic_cb, conn_id, status,
  // clang-tidy analyzer complains about |params| is leaked.  It doesn't know
  // that |param| will be freed by the callback function.
  CLI_CBACK_IN_JNI(read_characteristic_cb, conn_id, status, /* NOLINT */
                   base::Owned(params));
}

@@ -445,7 +449,10 @@ void read_desc_cb(uint16_t conn_id, tGATT_STATUS status, uint16_t handle,
  CHECK(len <= BTGATT_MAX_ATTR_LEN);
  if (len > 0) memcpy(params->value.value, value, len);

  CLI_CBACK_IN_JNI(read_descriptor_cb, conn_id, status, base::Owned(params));
  // clang-tidy analyzer complains about |params| is leaked.  It doesn't know
  // that |param| will be freed by the callback function.
  CLI_CBACK_IN_JNI(read_descriptor_cb, conn_id, status,
                   base::Owned(params)); /* NOLINT */
}

bt_status_t btif_gattc_read_char_descr(int conn_id, uint16_t handle,