Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcurses de-lint:
details: https://anonhg.NetBSD.org/src/rev/d57084ca614e
branches: trunk
changeset: 501704:d57084ca614e
user: christos <christos%NetBSD.org@localhost>
date: Fri Jan 05 22:57:56 2001 +0000
description:
de-lint:
- bad arithmetic shift
- const castaways.
diffstat:
lib/libcurses/color.c | 6 +++---
lib/libcurses/curses.h | 6 +++---
lib/libcurses/initscr.c | 11 ++++++-----
3 files changed, 12 insertions(+), 11 deletions(-)
diffs (86 lines):
diff -r 62335178cd2a -r d57084ca614e lib/libcurses/color.c
--- a/lib/libcurses/color.c Fri Jan 05 22:51:21 2001 +0000
+++ b/lib/libcurses/color.c Fri Jan 05 22:57:56 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: color.c,v 1.13 2000/12/19 21:34:24 jdc Exp $ */
+/* $NetBSD: color.c,v 1.14 2001/01/05 22:57:56 christos Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: color.c,v 1.13 2000/12/19 21:34:24 jdc Exp $");
+__RCSID("$NetBSD: color.c,v 1.14 2001/01/05 22:57:56 christos Exp $");
#endif /* not lint */
#include "curses.h"
@@ -343,7 +343,7 @@
{
short pair;
- pair = PAIR_NUMBER(attr);
+ pair = PAIR_NUMBER((u_int32_t)attr);
#ifdef DEBUG
__CTRACE("__set_color: %d, %d, %d\n", pair, pairs[pair].fore,
pairs[pair].back);
diff -r 62335178cd2a -r d57084ca614e lib/libcurses/curses.h
--- a/lib/libcurses/curses.h Fri Jan 05 22:51:21 2001 +0000
+++ b/lib/libcurses/curses.h Fri Jan 05 22:57:56 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: curses.h,v 1.53 2001/01/05 22:51:21 christos Exp $ */
+/* $NetBSD: curses.h,v 1.54 2001/01/05 22:57:56 christos Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -418,8 +418,8 @@
#define COLOR_CYAN 0x06
#define COLOR_WHITE 0x07
-#define COLOR_PAIR(n) (((n) << 25) & A_COLOR)
-#define PAIR_NUMBER(n) (((n) & A_COLOR) >> 25)
+#define COLOR_PAIR(n) ((((u_int32_t)n) << 25) & A_COLOR)
+#define PAIR_NUMBER(n) ((((u_int32_t)n) & A_COLOR) >> 25)
/* Curses external declarations. */
extern WINDOW *curscr; /* Current screen. */
diff -r 62335178cd2a -r d57084ca614e lib/libcurses/initscr.c
--- a/lib/libcurses/initscr.c Fri Jan 05 22:51:21 2001 +0000
+++ b/lib/libcurses/initscr.c Fri Jan 05 22:57:56 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: initscr.c,v 1.20 2000/12/19 21:34:24 jdc Exp $ */
+/* $NetBSD: initscr.c,v 1.21 2001/01/05 22:57:56 christos Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)initscr.c 8.2 (Berkeley) 5/4/94";
#else
-__RCSID("$NetBSD: initscr.c,v 1.20 2000/12/19 21:34:24 jdc Exp $");
+__RCSID("$NetBSD: initscr.c,v 1.21 2001/01/05 22:57:56 christos Exp $");
#endif
#endif /* not lint */
@@ -58,7 +58,7 @@
WINDOW *
initscr(void)
{
- char *sp;
+ const char *sp;
#ifdef DEBUG
__CTRACE("initscr\n");
@@ -75,8 +75,9 @@
* use Def_term.
*/
if (My_term || (sp = getenv("TERM")) == NULL)
- sp = (char *)Def_term;
- if (setterm(sp) == ERR)
+ sp = Def_term;
+ /* LINTED const castaway; setterm does not modify sp! */
+ if (setterm((char *)sp) == ERR)
return (NULL);
/* Need either homing or cursor motion for refreshes */
Home |
Main Index |
Thread Index |
Old Index