From patchwork Sun Dec 16 23:22:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/2] lib: fwts_guid: constify guid_str_len and guid_len parameters X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 206748 Message-Id: <1355700145-5677-3-git-send-email-colin.king@canonical.com> To: fwts-devel@lists.ubuntu.com Date: Sun, 16 Dec 2012 23:22:25 +0000 From: Colin King List-Id: Firmware Test Suite Development From: Colin Ian King Constify the length parameters. Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Alex Hung --- src/lib/include/fwts_guid.h | 4 ++-- src/lib/src/fwts_guid.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/include/fwts_guid.h b/src/lib/include/fwts_guid.h index ba5ee6c..cb13137 100644 --- a/src/lib/include/fwts_guid.h +++ b/src/lib/include/fwts_guid.h @@ -23,7 +23,7 @@ #include #include -void fwts_guid_buf_to_str(uint8_t *guid, char *guid_str, size_t guid_str_len); -void fwts_guid_str_to_buf(const char *guid_str, uint8_t *guid, size_t guid_len); +void fwts_guid_buf_to_str(uint8_t *guid, char *guid_str, const size_t guid_str_len); +void fwts_guid_str_to_buf(const char *guid_str, uint8_t *guid, const size_t guid_len); #endif diff --git a/src/lib/src/fwts_guid.c b/src/lib/src/fwts_guid.c index b4e9b07..ebb5d4d 100644 --- a/src/lib/src/fwts_guid.c +++ b/src/lib/src/fwts_guid.c @@ -26,7 +26,7 @@ * format given GUID 'guid' into a string guid_str. * guid_str needs to be at least 37 chars long */ -void fwts_guid_buf_to_str(uint8_t *guid, char *guid_str, size_t guid_str_len) +void fwts_guid_buf_to_str(uint8_t *guid, char *guid_str, const size_t guid_str_len) { if (guid_str && guid_str_len > 36) snprintf(guid_str, guid_str_len, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", @@ -39,7 +39,7 @@ void fwts_guid_buf_to_str(uint8_t *guid, char *guid_str, size_t guid_str_len) * convert a GUID string back to a 16 byte GUID * guid needs to be at least 16 chars long */ -void fwts_guid_str_to_buf(const char *guid_str, uint8_t *guid, size_t guid_len) +void fwts_guid_str_to_buf(const char *guid_str, uint8_t *guid, const size_t guid_len) { if (guid && guid_len >= 16) { sscanf(guid_str, "%2hhx%2hhx%2hhx%2hhx-%2hhx%2hhx-%2hhx%2hhx-%2hhx%2hhx-%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx",