From ef8c876c77fe7d3d2a509ea235629b62553dd82e Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Tue, 31 Jul 2018 11:35:35 +0300 Subject: Minor fixes in wordsplit * src/wordsplit.c (find_closing_paren): paren is char const * (wsplt_unquote_char, wsplt_quote_char): mark as static (exptab) : mark as const. --- src/wordsplit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/wordsplit.c b/src/wordsplit.c index 5468297..b4baeb3 100644 --- a/src/wordsplit.c +++ b/src/wordsplit.c @@ -66,7 +66,7 @@ _wsplt_alloc_die (struct wordsplit *wsp) abort (); } -static void +static void _wsplt_error (const char *fmt, ...) { va_list ap; @@ -922,7 +922,7 @@ node_split_prefix (struct wordsplit *wsp, static int find_closing_paren (const char *str, size_t i, size_t len, size_t *poff, - char *paren) + char const *paren) { enum { st_init, st_squote, st_dquote } state = st_init; size_t level = 1; @@ -2118,7 +2118,7 @@ wordsplit_c_quoted_length (const char *str, int quote_hex, int *quote) return len; } -int +static int wsplt_unquote_char (const char *transtab, int c) { while (*transtab && transtab[1]) @@ -2130,7 +2130,7 @@ wsplt_unquote_char (const char *transtab, int c) return 0; } -int +static int wsplt_quote_char (const char *transtab, int c) { for (; *transtab && transtab[1]; transtab += 2) @@ -2274,9 +2274,9 @@ wordsplit_c_quote_copy (char *dst, const char *src, int quote_hex) /* This structure describes a single expansion phase */ struct exptab { - char *descr; /* Textual description (for debugging) */ - int flag; /* WRDSF_ bit that controls this phase */ - int opt; /* Entry-specific options (see EXPOPT_ flags below */ + char const *descr; /* Textual description (for debugging) */ + int flag; /* WRDSF_ bit that controls this phase */ + int opt; /* Entry-specific options (see EXPOPT_ flags below */ int (*expansion) (struct wordsplit *wsp); /* expansion function */ }; -- cgit v1.2.1