summaryrefslogtreecommitdiffstats
path: root/misc-utils/look.c
diff options
context:
space:
mode:
authorSami Kerola2017-02-12 01:19:33 +0100
committerKarel Zak2017-02-20 12:58:49 +0100
commit2ba641e5f3879593e36fa84872289872a4060d03 (patch)
tree4381e82a91b01343555d803c8afe772e1d15826d /misc-utils/look.c
parentmisc: do not use plain 0 as NULL [smatch scan] (diff)
downloadkernel-qcow2-util-linux-2ba641e5f3879593e36fa84872289872a4060d03.tar.gz
kernel-qcow2-util-linux-2ba641e5f3879593e36fa84872289872a4060d03.tar.xz
kernel-qcow2-util-linux-2ba641e5f3879593e36fa84872289872a4060d03.zip
misc: add static keyword to where needed [smatch scan]
text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be static? Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'misc-utils/look.c')
-rw-r--r--misc-utils/look.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/misc-utils/look.c b/misc-utils/look.c
index ae0d576dd..3f785a727 100644
--- a/misc-utils/look.c
+++ b/misc-utils/look.c
@@ -66,12 +66,12 @@
#define GREATER 1
#define LESS (-1)
-int dflag, fflag;
+static int dflag, fflag;
/* uglified the source a bit with globals, so that we only need
to allocate comparbuf once */
-int stringlen;
-char *string;
-char *comparbuf;
+static int stringlen;
+static char *string;
+static char *comparbuf;
static char *binary_search (char *, char *);
static int compare (char *, char *);
@@ -164,7 +164,7 @@ main(int argc, char *argv[])
return look(front, back);
}
-int
+static int
look(char *front, char *back)
{
int ch;
@@ -232,7 +232,7 @@ look(char *front, char *back)
#define SKIP_PAST_NEWLINE(p, back) \
while (p < back && *p++ != '\n')
-char *
+static char *
binary_search(char *front, char *back)
{
char *p;
@@ -266,7 +266,7 @@ binary_search(char *front, char *back)
* o front points at the first character in a line.
* o front is before or at the first line to be printed.
*/
-char *
+static char *
linear_search(char *front, char *back)
{
while (front < back) {
@@ -286,7 +286,7 @@ linear_search(char *front, char *back)
/*
* Print as many lines as match string, starting at front.
*/
-void
+static void
print_from(char *front, char *back)
{
int eol;
@@ -321,7 +321,7 @@ print_from(char *front, char *back)
* We use strcasecmp etc, since it knows how to ignore case also
* in other locales.
*/
-int
+static int
compare(char *s2, char *s2end) {
int i;
char *p;