From patchwork Tue Oct 16 19:20:41 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: 191858 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 AABBE2C00A7 for ; Wed, 17 Oct 2012 06:20:54 +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 1TOChB-0002XE-FN; Tue, 16 Oct 2012 19:20:53 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TOCh9-0002W3-EO for fwts-devel@lists.ubuntu.com; Tue, 16 Oct 2012 19:20:51 +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 1TOCh9-0005lI-BU for fwts-devel@lists.ubuntu.com; Tue, 16 Oct 2012 19:20:51 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 04/11] lib: fwts_args: constify func arguments where appropriate Date: Tue, 16 Oct 2012 20:20:41 +0100 Message-Id: <1350415248-16965-5-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1350415248-16965-1-git-send-email-colin.king@canonical.com> References: <1350415248-16965-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 Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Ivan Hu --- src/lib/include/fwts_args.h | 2 +- src/lib/src/fwts_args.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/lib/include/fwts_args.h b/src/lib/include/fwts_args.h index 8f55807..b3ef89a 100644 --- a/src/lib/include/fwts_args.h +++ b/src/lib/include/fwts_args.h @@ -39,7 +39,7 @@ typedef int (*fwts_args_optarg_check)(fwts_framework *framework); int fwts_args_init(void); int fwts_args_add_options(fwts_option *options, fwts_args_optarg_handler handler, fwts_args_optarg_check check); -int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[]); +int fwts_args_parse(fwts_framework *fw, const int argc, char * const argv[]); void fwts_args_show_options(void); int fwts_args_free(void); char *fwts_args_comma_list(const char *arg); diff --git a/src/lib/src/fwts_args.c b/src/lib/src/fwts_args.c index a0dc5af..f2038ac 100644 --- a/src/lib/src/fwts_args.c +++ b/src/lib/src/fwts_args.c @@ -32,7 +32,7 @@ * of how many options there are in each table. */ typedef struct { - fwts_option *options; /* options array */ + fwts_option *options; /* options array */ int num_options; /* number of options */ fwts_args_optarg_handler optarg_handler;/* options handler */ fwts_args_optarg_check optarg_check; /* options checker */ @@ -61,7 +61,10 @@ int fwts_args_init(void) * fwts_args_add_options() * add a table of options and handler for these options */ -int fwts_args_add_options(fwts_option *options, fwts_args_optarg_handler handler, fwts_args_optarg_check check) +int fwts_args_add_options( + fwts_option *options, + fwts_args_optarg_handler handler, + fwts_args_optarg_check check) { int n; fwts_options_table *options_table; @@ -90,7 +93,7 @@ int fwts_args_add_options(fwts_option *options, fwts_args_optarg_handler handler * fwts_args_parse() * parse options */ -int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[]) +int fwts_args_parse(fwts_framework *fw, const int argc, char * const argv[]) { fwts_list_link *item; fwts_options_table *options_table; @@ -219,7 +222,10 @@ static int fwts_args_compare_options(void *data1, void *data2) * fwts_args_show_option() * pretty print an option */ -void fwts_args_show_option(int width, char *option, char *explanation) +static void fwts_args_show_option( + const int width, + const char *option, + const char *explanation) { fwts_list *text; fwts_list_link *item;