From patchwork Tue Oct 16 19:20:46 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: 191865 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 AEA4C2C00A6 for ; Wed, 17 Oct 2012 06:21:02 +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 1TOChJ-0002Z4-IO; Tue, 16 Oct 2012 19:21:01 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TOChB-0002XO-SW for fwts-devel@lists.ubuntu.com; Tue, 16 Oct 2012 19:20:53 +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 1TOChB-0005ld-PR for fwts-devel@lists.ubuntu.com; Tue, 16 Oct 2012 19:20:53 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 09/11] lib: fwts_log: constify function arguments where appropriate Date: Tue, 16 Oct 2012 20:20:46 +0100 Message-Id: <1350415248-16965-10-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_log.h | 4 ++-- src/lib/src/fwts_log.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/include/fwts_log.h b/src/lib/include/fwts_log.h index 35f2801..5406897 100644 --- a/src/lib/include/fwts_log.h +++ b/src/lib/include/fwts_log.h @@ -121,7 +121,7 @@ extern fwts_log_ops fwts_log_html_ops; extern fwts_log_field fwts_log_filter; extern const char *fwts_log_format; -fwts_log *fwts_log_open(const char* owner, const char *name, const char *mode, fwts_log_type); +fwts_log *fwts_log_open(const char* owner, const char *name, const char *mode, const fwts_log_type); int fwts_log_close(fwts_log *log); int fwts_log_printf(fwts_log *log, const fwts_log_field field, const fwts_log_level level, const char *status, const char *label, const char *prefix, const char *fmt, ...) __attribute__((format(printf, 7, 8))); @@ -143,7 +143,7 @@ char *fwts_log_field_to_str_upper(const fwts_log_field field); void fwts_log_set_line_width(const int width); void fwts_log_section_begin(fwts_log *log, const char *name); void fwts_log_section_end(fwts_log *log); -char *fwts_log_get_filenames(const char *filename, fwts_log_type type); +char *fwts_log_get_filenames(const char *filename, const fwts_log_type type); fwts_log_filename_type fwts_log_get_filename_type(const char *name); static inline int fwts_log_type_count(fwts_log_type type) diff --git a/src/lib/src/fwts_log.c b/src/lib/src/fwts_log.c index 6ed32c1..63983d5 100644 --- a/src/lib/src/fwts_log.c +++ b/src/lib/src/fwts_log.c @@ -43,7 +43,7 @@ const char *fwts_log_format = ""; * fwts_log_set_line_width() * set width of a log */ -void fwts_log_set_line_width(int width) +void fwts_log_set_line_width(const int width) { if ((width >= 80) && (width <= 1024)) log_line_width = width; @@ -310,7 +310,7 @@ void fwts_log_set_format(const char *str) * fwts_log_type_filename_suffix() * return a filename suffix on a given log type */ -static char *fwts_log_type_filename_suffix(fwts_log_type type) +static char *fwts_log_type_filename_suffix(const fwts_log_type type) { switch (type) { case LOG_TYPE_JSON: @@ -330,7 +330,7 @@ static char *fwts_log_type_filename_suffix(fwts_log_type type) * fwts_log_filename_new_suffix() * return the log name with suffix based on log type */ -static char *fwts_log_filename(const char *filename, fwts_log_type type) +static char *fwts_log_filename(const char *filename, const fwts_log_type type) { char *ptr; char *new_name; @@ -534,7 +534,7 @@ void fwts_log_section_end(fwts_log *log) * fwts_log_get_ops() * return log ops basedon log type */ -static fwts_log_ops *fwts_log_get_ops(fwts_log_type type) +static fwts_log_ops *fwts_log_get_ops(const fwts_log_type type) { switch (type) { case LOG_TYPE_JSON: @@ -569,7 +569,7 @@ fwts_log_filename_type fwts_log_get_filename_type(const char *filename) * fwts_log_filenames() * return string of all the log filenames that will be used */ -char *fwts_log_get_filenames(const char *filename, fwts_log_type type) +char *fwts_log_get_filenames(const char *filename, const fwts_log_type type) { unsigned int i; char *filenames = NULL; @@ -614,7 +614,7 @@ fwts_log *fwts_log_open( const char *owner, /* Creator of the log */ const char *filename, /* Log file name */ const char *mode, /* open mode, see fopen() modes */ - fwts_log_type type) /* Log type */ + const fwts_log_type type) /* Log type */ { fwts_log *newlog; unsigned int i;