From 9a3b64bd552278563f3314f99f61755c7d6a52a0 Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Tue, 28 Aug 2018 17:45:05 +0100 Subject: [PATCH] NFC: Add const qualifier to append_as_record function of ndef common types. --- features/nfc/nfc/ndef/common/Mime.h | 2 +- features/nfc/nfc/ndef/common/Text.h | 2 +- features/nfc/nfc/ndef/common/URI.h | 2 +- features/nfc/source/nfc/ndef/common/Mime.cpp | 2 +- features/nfc/source/nfc/ndef/common/Text.cpp | 2 +- features/nfc/source/nfc/ndef/common/URI.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/features/nfc/nfc/ndef/common/Mime.h b/features/nfc/nfc/ndef/common/Mime.h index 0128e573de..ebf66e38bd 100644 --- a/features/nfc/nfc/ndef/common/Mime.h +++ b/features/nfc/nfc/ndef/common/Mime.h @@ -110,7 +110,7 @@ public: bool append_as_record( MessageBuilder &message_builder, bool is_last_record = false - ); + ) const; /** * Compute the size of this Mime object in a ndef record. diff --git a/features/nfc/nfc/ndef/common/Text.h b/features/nfc/nfc/ndef/common/Text.h index 99bd968563..e9d62d99f4 100644 --- a/features/nfc/nfc/ndef/common/Text.h +++ b/features/nfc/nfc/ndef/common/Text.h @@ -126,7 +126,7 @@ public: bool append_as_record( MessageBuilder &message_builder, bool is_last_record = false - ); + ) const; /** * Compute the size of this object in a ndef record. diff --git a/features/nfc/nfc/ndef/common/URI.h b/features/nfc/nfc/ndef/common/URI.h index 8570de60e6..683cdaa764 100644 --- a/features/nfc/nfc/ndef/common/URI.h +++ b/features/nfc/nfc/ndef/common/URI.h @@ -148,7 +148,7 @@ public: bool append_as_record( MessageBuilder &message_builder, bool is_last_record = false - ); + ) const; /** * Compute the size of this object in a ndef record. diff --git a/features/nfc/source/nfc/ndef/common/Mime.cpp b/features/nfc/source/nfc/ndef/common/Mime.cpp index 06a969e97e..eb7907a81a 100644 --- a/features/nfc/source/nfc/ndef/common/Mime.cpp +++ b/features/nfc/source/nfc/ndef/common/Mime.cpp @@ -96,7 +96,7 @@ Span Mime::get_mime_content() const bool Mime::append_as_record( MessageBuilder &message_builder, bool is_last_record -) +) const { return message_builder.append_record( RecordType( diff --git a/features/nfc/source/nfc/ndef/common/Text.cpp b/features/nfc/source/nfc/ndef/common/Text.cpp index f8870291c2..8814c753f9 100644 --- a/features/nfc/source/nfc/ndef/common/Text.cpp +++ b/features/nfc/source/nfc/ndef/common/Text.cpp @@ -136,7 +136,7 @@ void Text::move_data(uint8_t *text, size_t size) bool Text::append_as_record( MessageBuilder &message_builder, bool is_last_record -) +) const { // Build the record type RecordType type( diff --git a/features/nfc/source/nfc/ndef/common/URI.cpp b/features/nfc/source/nfc/ndef/common/URI.cpp index adf8489c4f..e3fb0a298e 100644 --- a/features/nfc/source/nfc/ndef/common/URI.cpp +++ b/features/nfc/source/nfc/ndef/common/URI.cpp @@ -111,7 +111,7 @@ Span URI::get_uri_field() const ); } -bool URI::append_as_record(MessageBuilder &message_builder, bool is_last_record) +bool URI::append_as_record(MessageBuilder &message_builder, bool is_last_record) const { if (!_uri) { return false;