Fix 2 AbslSpanParams findings:

* This is a change required to migrate function parameters to absl::Span from const std::vector (2 times)

See go/vector2span for more information on why you've received this change and why it is important.

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/absl-span-params-bug for category AbslSpanParams if there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* For all other issues such as the formatting of the CL, please file a bug under
go/clrobot-bug.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/METADATA by
following go/clrobot#how-to-opt-in. Anything wrong with the signup? File a bug
at go/clrobot-bug.

#codehealth

Tested:
    Local presubmit tests passed.
PiperOrigin-RevId: 601411040
Change-Id: I4235e711867fde7cf3c9f27bb0cae3453853394d
This commit is contained in:
Googler
2024-01-25 04:45:44 -08:00
committed by Robert Shih
parent 8bf106f188
commit 6bf182af45
2 changed files with 5 additions and 3 deletions

View File

@@ -20,6 +20,7 @@
#include "odk_endian.h"
#include "odk_structs.h"
#include "odk_structs_priv.h"
#include "third_party/absl/types/span.h"
namespace wvodk_test {
@@ -670,7 +671,7 @@ OEMCryptoResult ODK_DumpSingleField(const uint8_t* buf,
*/
OEMCryptoResult ODK_IterFields(ODK_FieldMode mode, uint8_t* buf,
const size_t size_in, size_t* size_out,
const std::vector<ODK_Field>& fields) {
absl::Span<const ODK_Field> fields) {
if (buf == nullptr || size_out == nullptr) {
return ODK_ERROR_CORE_MESSAGE;
}
@@ -708,7 +709,7 @@ OEMCryptoResult ODK_IterFields(ODK_FieldMode mode, uint8_t* buf,
}
std::vector<ODK_Field> ODK_MakeTotalFields(
const std::vector<ODK_Field>& extra_fields, ODK_CoreMessage* core_message) {
absl::Span<const ODK_Field> extra_fields, ODK_CoreMessage* core_message) {
std::vector<ODK_Field> total_fields = {
{ODK_UINT32, &(core_message->message_type), "message_type"},
{ODK_UINT32, &(core_message->message_length), "message_size"},

View File

@@ -11,6 +11,7 @@
#include "odk_structs.h"
#include "odk_structs_priv.h"
#include "third_party/absl/types/span.h"
namespace wvodk_test {
@@ -115,7 +116,7 @@ OEMCryptoResult ODK_ReadSingleField(const uint8_t* buf, const ODK_Field* field);
OEMCryptoResult ODK_DumpSingleField(const uint8_t* buf, const ODK_Field* field);
OEMCryptoResult ODK_IterFields(ODK_FieldMode mode, uint8_t* buf, size_t size_in,
size_t* size_out,
const std::vector<ODK_Field>& fields);
absl::Span<const ODK_Field> fields);
void ODK_ExpectEqualBuf(const void* s1, const void* s2, size_t n,
const std::vector<ODK_Field>& fields);
void ODK_ResetOdkFields(std::vector<ODK_Field>* fields);