From patchwork Sun Dec 16 23:22:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 206748 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 9AFB12C00A9 for ; Mon, 17 Dec 2012 10:22:32 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TkNXS-00089X-Hj; Sun, 16 Dec 2012 23:22:30 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TkNXQ-000893-HZ for fwts-devel@lists.ubuntu.com; Sun, 16 Dec 2012 23:22:28 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TkNXQ-0004qv-E7 for fwts-devel@lists.ubuntu.com; Sun, 16 Dec 2012 23:22:28 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] lib: fwts_guid: constify guid_str_len and guid_len parameters Date: Sun, 16 Dec 2012 23:22:25 +0000 Message-Id: <1355700145-5677-3-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1355700145-5677-1-git-send-email-colin.king@canonical.com> References: <1355700145-5677-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com 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",