Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libedit pass -Wconversion
details: https://anonhg.NetBSD.org/src/rev/9004925edcd7
branches: trunk
changeset: 767767:9004925edcd7
user: christos <christos%NetBSD.org@localhost>
date: Fri Jul 29 23:44:44 2011 +0000
description:
pass -Wconversion
diffstat:
lib/libedit/Makefile | 4 ++--
lib/libedit/chared.c | 6 +++---
lib/libedit/chartype.c | 21 +++++++++++----------
lib/libedit/chartype.h | 6 +++---
lib/libedit/el.h | 4 ++--
lib/libedit/filecomplete.c | 6 +++---
lib/libedit/history.c | 8 ++++----
lib/libedit/keymacro.c | 6 +++---
lib/libedit/read.c | 38 +++++++++++++++++++-------------------
lib/libedit/readline.c | 30 ++++++++++++++----------------
lib/libedit/refresh.c | 6 +++---
lib/libedit/search.c | 7 ++++---
lib/libedit/terminal.c | 14 +++++++-------
lib/libedit/terminal.h | 4 ++--
lib/libedit/vi.c | 6 +++---
15 files changed, 83 insertions(+), 83 deletions(-)
diffs (truncated from 661 to 300 lines):
diff -r e05019dcbb65 -r 9004925edcd7 lib/libedit/Makefile
--- a/lib/libedit/Makefile Fri Jul 29 22:18:56 2011 +0000
+++ b/lib/libedit/Makefile Fri Jul 29 23:44:44 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.45 2011/07/29 20:56:58 christos Exp $
+# $NetBSD: Makefile,v 1.46 2011/07/29 23:44:44 christos Exp $
# @(#)Makefile 8.1 (Berkeley) 6/4/93
USE_SHLIBDIR= yes
@@ -8,7 +8,7 @@
LIB= edit
LIBDPLIBS+= terminfo ${.CURDIR}/../libterminfo
-COPTS+=-Wunused-parameter
+COPTS+=-Wunused-parameter -Wconversion
OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \
hist.c keymacro.c map.c chartype.c \
diff -r e05019dcbb65 -r 9004925edcd7 lib/libedit/chared.c
--- a/lib/libedit/chared.c Fri Jul 29 22:18:56 2011 +0000
+++ b/lib/libedit/chared.c Fri Jul 29 23:44:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chared.c,v 1.33 2011/07/29 15:20:39 christos Exp $ */
+/* $NetBSD: chared.c,v 1.34 2011/07/29 23:44:44 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: chared.c,v 1.33 2011/07/29 15:20:39 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.34 2011/07/29 23:44:44 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -691,7 +691,7 @@
break;
default:
- if (len >= EL_BUFSIZ - 16)
+ if (len >= (ssize_t)(EL_BUFSIZ - 16))
terminal_beep(el);
else {
buf[len++] = ch;
diff -r e05019dcbb65 -r 9004925edcd7 lib/libedit/chartype.c
--- a/lib/libedit/chartype.c Fri Jul 29 22:18:56 2011 +0000
+++ b/lib/libedit/chartype.c Fri Jul 29 23:44:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chartype.c,v 1.8 2011/07/29 15:16:33 christos Exp $ */
+/* $NetBSD: chartype.c,v 1.9 2011/07/29 23:44:44 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -38,12 +38,12 @@
*/
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.8 2011/07/29 15:16:33 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.9 2011/07/29 23:44:44 christos Exp $");
#endif /* not lint && not SCCSID */
#include "el.h"
#include <stdlib.h>
-#define CT_BUFSIZ 1024
+#define CT_BUFSIZ ((size_t)1024)
#ifdef WIDECHAR
protected void
@@ -83,7 +83,7 @@
if (!s)
return NULL;
if (!conv->cbuff)
- ct_conv_buff_resize(conv, CT_BUFSIZ, 0);
+ ct_conv_buff_resize(conv, CT_BUFSIZ, (size_t)0);
if (!conv->cbuff)
return NULL;
@@ -92,12 +92,13 @@
used = conv->csize - (dst - conv->cbuff);
if (used < 5) {
used = dst - conv->cbuff;
- ct_conv_buff_resize(conv, conv->csize + CT_BUFSIZ, 0);
+ ct_conv_buff_resize(conv, conv->csize + CT_BUFSIZ,
+ (size_t)0);
if (!conv->cbuff)
return NULL;
dst = conv->cbuff + used;
}
- used = ct_encode_char(dst, 5, *s);
+ used = ct_encode_char(dst, (size_t)5, *s);
if (used == -1) /* failed to encode, need more buffer space */
abort();
++s;
@@ -115,15 +116,15 @@
if (!s)
return NULL;
if (!conv->wbuff)
- ct_conv_buff_resize(conv, 0, CT_BUFSIZ);
+ ct_conv_buff_resize(conv, (size_t)0, CT_BUFSIZ);
if (!conv->wbuff)
return NULL;
- len = ct_mbstowcs(NULL, s, 0);
+ len = ct_mbstowcs(NULL, s, (size_t)0);
if (len == (size_t)-1)
return NULL;
if (len > conv->wsize)
- ct_conv_buff_resize(conv, 0, len + 1);
+ ct_conv_buff_resize(conv, (size_t)0, len + 1);
if (!conv->wbuff)
return NULL;
ct_mbstowcs(conv->wbuff, s, conv->wsize);
@@ -144,7 +145,7 @@
* the argv strings. */
for (i = 0, bufspace = 0; i < argc; ++i)
bufspace += argv[i] ? strlen(argv[i]) + 1 : 0;
- ct_conv_buff_resize(conv, 0, bufspace);
+ ct_conv_buff_resize(conv, (size_t)0, bufspace);
if (!conv->wsize)
return NULL;
diff -r e05019dcbb65 -r 9004925edcd7 lib/libedit/chartype.h
--- a/lib/libedit/chartype.h Fri Jul 29 22:18:56 2011 +0000
+++ b/lib/libedit/chartype.h Fri Jul 29 23:44:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chartype.h,v 1.7 2010/12/16 17:42:28 wiz Exp $ */
+/* $NetBSD: chartype.h,v 1.8 2011/07/29 23:44:44 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
#endif
#define ct_mbtowc mbtowc
-#define ct_mbtowc_reset mbtowc(0,0,0)
+#define ct_mbtowc_reset mbtowc(0,0,(size_t)0)
#define ct_wctomb wctomb
#define ct_wctomb_reset wctomb(0,0)
#define ct_wcstombs wcstombs
@@ -206,7 +206,7 @@
/* The maximum buffer size to hold the most unwieldly visual representation,
* in this case \U+nnnnn. */
-#define VISUAL_WIDTH_MAX 8
+#define VISUAL_WIDTH_MAX ((size_t)8)
/* The terminal is thought of in terms of X columns by Y lines. In the cases
* where a wide character takes up more than one column, the adjacent
diff -r e05019dcbb65 -r 9004925edcd7 lib/libedit/el.h
--- a/lib/libedit/el.h Fri Jul 29 22:18:56 2011 +0000
+++ b/lib/libedit/el.h Fri Jul 29 23:44:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: el.h,v 1.24 2011/07/28 01:56:27 christos Exp $ */
+/* $NetBSD: el.h,v 1.25 2011/07/29 23:44:44 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -51,7 +51,7 @@
#include <stdio.h>
#include <sys/types.h>
-#define EL_BUFSIZ 1024 /* Maximum line size */
+#define EL_BUFSIZ ((size_t)1024) /* Maximum line size */
#define HANDLE_SIGNALS 0x01
#define NO_TTY 0x02
diff -r e05019dcbb65 -r 9004925edcd7 lib/libedit/filecomplete.c
--- a/lib/libedit/filecomplete.c Fri Jul 29 22:18:56 2011 +0000
+++ b/lib/libedit/filecomplete.c Fri Jul 29 23:44:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecomplete.c,v 1.28 2011/07/29 20:58:07 christos Exp $ */
+/* $NetBSD: filecomplete.c,v 1.29 2011/07/29 23:44:44 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: filecomplete.c,v 1.28 2011/07/29 20:58:07 christos Exp $");
+__RCSID("$NetBSD: filecomplete.c,v 1.29 2011/07/29 23:44:44 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@@ -572,6 +572,6 @@
_el_fn_complete(EditLine *el, int ch __attribute__((__unused__)))
{
return (unsigned char)fn_complete(el, NULL, NULL,
- break_chars, NULL, NULL, 100,
+ break_chars, NULL, NULL, (size_t)100,
NULL, NULL, NULL, NULL);
}
diff -r e05019dcbb65 -r 9004925edcd7 lib/libedit/history.c
--- a/lib/libedit/history.c Fri Jul 29 22:18:56 2011 +0000
+++ b/lib/libedit/history.c Fri Jul 29 23:44:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: history.c,v 1.44 2011/07/29 20:58:07 christos Exp $ */
+/* $NetBSD: history.c,v 1.45 2011/07/29 23:44:44 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: history.c,v 1.44 2011/07/29 20:58:07 christos Exp $");
+__RCSID("$NetBSD: history.c,v 1.45 2011/07/29 23:44:44 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -760,7 +760,7 @@
if (max_size < sz) {
char *nptr;
- max_size = (sz + 1024) & ~1023;
+ max_size = (sz + 1024) & (size_t)~1023;
nptr = h_realloc(ptr, max_size * sizeof(*ptr));
if (nptr == NULL) {
i = -1;
@@ -816,7 +816,7 @@
len = strlen(str) * 4;
if (len >= max_size) {
char *nptr;
- max_size = (len + 1024) & ~1023;
+ max_size = (len + 1024) & (size_t)~1023;
nptr = h_realloc(ptr, max_size * sizeof(*ptr));
if (nptr == NULL) {
i = -1;
diff -r e05019dcbb65 -r 9004925edcd7 lib/libedit/keymacro.c
--- a/lib/libedit/keymacro.c Fri Jul 29 22:18:56 2011 +0000
+++ b/lib/libedit/keymacro.c Fri Jul 29 23:44:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: keymacro.c,v 1.5 2011/07/29 15:16:33 christos Exp $ */
+/* $NetBSD: keymacro.c,v 1.6 2011/07/29 23:44:44 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: keymacro.c,v 1.5 2011/07/29 15:16:33 christos Exp $");
+__RCSID("$NetBSD: keymacro.c,v 1.6 2011/07/29 23:44:44 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -265,7 +265,7 @@
return;
el->el_keymacro.buf[0] = '"';
- if (node_lookup(el, key, el->el_keymacro.map, 1) <= -1)
+ if (node_lookup(el, key, el->el_keymacro.map, (size_t)1) <= -1)
/* key is not bound */
(void) fprintf(el->el_errfile, "Unbound extended key \"" FSTR
"\"\n", key);
diff -r e05019dcbb65 -r 9004925edcd7 lib/libedit/read.c
--- a/lib/libedit/read.c Fri Jul 29 22:18:56 2011 +0000
+++ b/lib/libedit/read.c Fri Jul 29 23:44:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.65 2011/07/29 15:16:33 christos Exp $ */
+/* $NetBSD: read.c,v 1.66 2011/07/29 23:44:44 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: read.c,v 1.65 2011/07/29 15:16:33 christos Exp $");
+__RCSID("$NetBSD: read.c,v 1.66 2011/07/29 23:44:44 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -52,7 +52,7 @@
#include <limits.h>
#include "el.h"
-#define OKCMD -1 /* must be -1! */
+#define OKCMD -1 /* must be -1! */
private int read__fixio(int, int);
private int read_preread(EditLine *);
@@ -133,7 +133,7 @@
#ifdef EWOULDBLOCK
case EWOULDBLOCK:
#ifndef TRY_AGAIN
-#define TRY_AGAIN
+#define TRY_AGAIN
#endif
#endif /* EWOULDBLOCK */
@@ -141,7 +141,7 @@
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EAGAIN:
#ifndef TRY_AGAIN
-#define TRY_AGAIN
+#define TRY_AGAIN
#endif
#endif /* EWOULDBLOCK && EWOULDBLOCK != EAGAIN */
Home |
Main Index |
Thread Index |
Old Index