From: Randy Dunlap Date: Tue, 16 Oct 2007 00:38:22 +0000 (-0700) Subject: more: cleanup gcc warnings X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fa7180bcd256667ff5b45c681c2694400999111;p=util-linux more: cleanup gcc warnings Fix strict gcc warnings that come from using: ("-Wall -Wp,-D_FORTIFY_SOURCE=2") more.c:185: warning: passing argument 1 of 'setupterm' discards qualifiers from pointer target type more.c:205: warning: passing argument 1 of 'tparm' discards qualifiers from pointer target type more.c:812: warning: pointer targets in passing argument 2 of 'mbrtowc' differ in signedness more.c:931: warning: pointer targets in passing argument 2 of 'mbrtowc' differ in signedness more.c:1285: warning: pointer targets in passing argument 1 of 'ttyin' differ in signedness more.c:1486: warning: pointer targets in passing argument 1 of 'ttyin' differ in signedness more.c:1879: warning: pointer targets in passing argument 2 of 'mbrtowc' differ in signedness Signed-off-by: Randy Dunlap --- diff --git a/text-utils/more.c b/text-utils/more.c index 5dcae7b8..8266c058 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -99,7 +99,7 @@ void erasep (register int col); void show (register char ch); void set_tty(void); void reset_tty(void); -void ttyin (unsigned char buf[], register int nmax, char pchar); +void ttyin (char buf[], register int nmax, char pchar); int number(char *cmd); int readch (void); int get_line(register FILE *f, int *length); @@ -180,7 +180,7 @@ my_putstring(char *s) { } static void -my_setupterm(const char *term, int fildes, int *errret) { +my_setupterm(char *term, int fildes, int *errret) { setupterm(term, fildes, errret); } @@ -200,7 +200,7 @@ my_tgetstr(char *s, char *ss) { } static char * -my_tgoto(const char *cap, int col, int row) { +my_tgoto(char *cap, int col, int row) { return tparm(cap, col, row); } @@ -218,7 +218,7 @@ my_putstring(char *s) { } static void -my_setupterm(const char *term, int fildes, int *errret) { +my_setupterm(char *term, int fildes, int *errret) { *errret = tgetent(tcbuffer, term); } @@ -238,7 +238,7 @@ my_tgetstr(char *s, char *ss) { } static char * -my_tgoto(const char *cap, int col, int row) { +my_tgoto(char *cap, int col, int row) { return tgoto(cap, col, row); } @@ -784,7 +784,7 @@ int get_line(register FILE *f, int *length) wchar_t wc; int wc_width; mbstate_t state, state_bak; /* Current status of the stream. */ - unsigned char mbc[MB_LEN_MAX]; /* Buffer for one multibyte char. */ + char mbc[MB_LEN_MAX]; /* Buffer for one multibyte char. */ size_t mblength; /* Byte length of multibyte char. */ size_t mbc_pos = 0; /* Postion of the MBC. */ int use_mbc_buffer_flag = 0; /* If 1, mbc has data. */ @@ -1848,8 +1848,8 @@ static char *CARAT = "^"; else \ putserr(BS); -void ttyin (unsigned char buf[], register int nmax, char pchar) { - unsigned char *sp; +void ttyin (char buf[], register int nmax, char pchar) { + char *sp; int c; int slash = 0; int maxlen;