From patchwork Sat Aug 23 16:42:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregor Jasny X-Patchwork-Id: 4769781 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B0F08C0338 for ; Sat, 23 Aug 2014 16:43:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C503F201BA for ; Sat, 23 Aug 2014 16:43:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB5DF201B4 for ; Sat, 23 Aug 2014 16:43:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751373AbaHWQnL (ORCPT ); Sat, 23 Aug 2014 12:43:11 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:47897 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbaHWQnJ (ORCPT ); Sat, 23 Aug 2014 12:43:09 -0400 Received: by mail-wi0-f181.google.com with SMTP id bs8so868666wib.14 for ; Sat, 23 Aug 2014 09:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YRfjbkovkLZTj7+jtBMnCon2zFgLs6ll2+XuTUQp0Cc=; b=yR+hT95n0su30LI47o3RGvZcqgb9E3920Ss/bMZ5MsLyJnuRnsMWyIaGxCTq2G9yU/ ciVjeFeHuLuAcEEWtJ4SuGY/XlQQ3Ig4qE4BGujp0D5qpNV9OFs7GbqHev9ZOJeQaIfL i8besiLnp4QvcgrOgio1E/V2qB2J5O8PdbnMEuXEksvP+2CWlqoFRJaBjQjApJUeN7FS Z7N/K1UDtTXc92B0GePLEx3jex6oEeiKsxQ77F4rs14lAnxJQE7L0VUdyxnpQFw3D4pg kS2Zx1dsS+SI7LyFq7bOTpW0D36QGfbMUjenxiZd2ttToEgVI0s8ebhYa2NinkuB4ijR NM6g== X-Received: by 10.194.118.201 with SMTP id ko9mr11419422wjb.26.1408812188467; Sat, 23 Aug 2014 09:43:08 -0700 (PDT) Received: from sid.home ([95.91.248.151]) by mx.google.com with ESMTPSA id cy9sm10879320wib.15.2014.08.23.09.43.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 23 Aug 2014 09:43:07 -0700 (PDT) From: Gregor Jasny To: linux-media@vger.kernel.org Cc: m.chehab@samsung.com, Gregor Jasny Subject: [PATCH 4/5] libdvbv5: Make dvb_xxx_charset const strings Date: Sat, 23 Aug 2014 18:42:42 +0200 Message-Id: <1408812163-18309-5-git-send-email-gjasny@googlemail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1408812163-18309-1-git-send-email-gjasny@googlemail.com> References: <1408812163-18309-1-git-send-email-gjasny@googlemail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Gregor Jasny --- lib/libdvbv5/parse_string.c | 13 +++++++------ lib/libdvbv5/parse_string.h | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/libdvbv5/parse_string.c b/lib/libdvbv5/parse_string.c index db47c3a..081b2f8 100644 --- a/lib/libdvbv5/parse_string.c +++ b/lib/libdvbv5/parse_string.c @@ -35,8 +35,8 @@ #define CS_OPTIONS "//TRANSLIT" -char *dvb_default_charset = "iso-8859-1"; -char *dvb_output_charset = "utf-8"; +const char *dvb_default_charset = "iso-8859-1"; +const char *dvb_output_charset = "utf-8"; struct charset_conv { unsigned len; @@ -308,7 +308,7 @@ void iconv_to_charset(struct dvb_v5_fe_parms *parms, size_t destlen, const unsigned char *src, size_t len, - char *type, char *output_charset) + const char *type, const char *output_charset) { char out_cs[strlen(output_charset) + 1 + sizeof(CS_OPTIONS)]; char *p = dest; @@ -331,7 +331,7 @@ void iconv_to_charset(struct dvb_v5_fe_parms *parms, static void charset_conversion(struct dvb_v5_fe_parms *parms, char **dest, const unsigned char *s, size_t len, - char *type, char *output_charset) + const char *type, const char *output_charset) { size_t destlen = len * 3; int need_conversion = 1; @@ -371,10 +371,11 @@ static void charset_conversion(struct dvb_v5_fe_parms *parms, char **dest, const void parse_string(struct dvb_v5_fe_parms *parms, char **dest, char **emph, const unsigned char *src, size_t len, - char *default_charset, char *output_charset) + const char *default_charset, const char *output_charset) { size_t destlen, i, len2 = 0; - char *p, *p2, *type = default_charset; + char *p, *p2; + const char *type = default_charset; unsigned char *tmp1 = NULL, *tmp2 = NULL; const unsigned char *s; int emphasis = 0; diff --git a/lib/libdvbv5/parse_string.h b/lib/libdvbv5/parse_string.h index e269ff3..48ae6ec 100644 --- a/lib/libdvbv5/parse_string.h +++ b/lib/libdvbv5/parse_string.h @@ -28,14 +28,14 @@ void iconv_to_charset(struct dvb_v5_fe_parms *parms, size_t destlen, const unsigned char *src, size_t len, - char *type, char *output_charset); + const char *type, const char *output_charset); void parse_string(struct dvb_v5_fe_parms *parms, char **dest, char **emph, const unsigned char *src, size_t len, - char *default_charset, char *output_charset); + const char *default_charset, const char *output_charset); -extern char *dvb_default_charset; -extern char *dvb_output_charset; +extern const char *dvb_default_charset; +extern const char *dvb_output_charset; #if HAVE_VISIBILITY #pragma GCC visibility pop