From 70f7f10476311288049565573338a4a821cef8a5 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 27 Jan 2017 15:55:28 -0800 Subject: Add missing `static`s and remove an unused function. --- toys/posix/cp.c | 2 +- toys/posix/cpio.c | 2 +- toys/posix/ls.c | 11 +++-------- toys/posix/ps.c | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) (limited to 'toys/posix') diff --git a/toys/posix/cp.c b/toys/posix/cp.c index 0dd63a7d..d4475a02 100644 --- a/toys/posix/cp.c +++ b/toys/posix/cp.c @@ -123,7 +123,7 @@ struct cp_preserve { // Callback from dirtree_read() for each file/directory under a source dir. -int cp_node(struct dirtree *try) +static int cp_node(struct dirtree *try) { int fdout = -1, cfd = try->parent ? try->parent->extra : AT_FDCWD, tfd = dirtree_parentfd(try); diff --git a/toys/posix/cpio.c b/toys/posix/cpio.c index 3bd40f47..5524dba2 100644 --- a/toys/posix/cpio.c +++ b/toys/posix/cpio.c @@ -61,7 +61,7 @@ static char *strpad(int fd, unsigned len, unsigned align) } //convert hex to uint; mostly to allow using bits of non-terminated strings -unsigned x8u(char *hex) +static unsigned x8u(char *hex) { unsigned val, inpos = 8, outpos; char pattern[6]; diff --git a/toys/posix/ls.c b/toys/posix/ls.c index b306dc91..d2a2e466 100644 --- a/toys/posix/ls.c +++ b/toys/posix/ls.c @@ -65,7 +65,7 @@ GLOBALS( ) // Callback from crunch_str to represent unprintable chars -int crunch_qb(FILE *out, int cols, int wc) +static int crunch_qb(FILE *out, int cols, int wc) { unsigned len = 1; char buf[32]; @@ -98,16 +98,11 @@ int crunch_qb(FILE *out, int cols, int wc) } // Returns wcwidth(utf8) version of strlen with -qb escapes -int strwidth(char *s) +static int strwidth(char *s) { return crunch_str(&s, INT_MAX, 0, TT.escmore, crunch_qb); } -void qbstr(char *s, int width) -{ - draw_trim_esc(s, width, abs(width), TT.escmore, crunch_qb); -} - static char endtype(struct stat *st) { mode_t mode = st->st_mode; @@ -272,7 +267,7 @@ static unsigned long next_column(unsigned long ul, unsigned long dtlen, return (*xpos*height) + widecols + (ul/(columns-1)); } -int color_from_mode(mode_t mode) +static int color_from_mode(mode_t mode) { int color = 0; diff --git a/toys/posix/ps.c b/toys/posix/ps.c index 35763509..76bd2e48 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -975,7 +975,7 @@ static char *parse_ko(void *data, char *type, int length) return 0; } -long long get_headers(struct strawberry *fields, char *buf, int blen) +static long long get_headers(struct strawberry *fields, char *buf, int blen) { long long bits = 0; int len = 0; -- cgit v1.2.3