ncurses 5.9 - patch 20110521

+ fix warnings from clang 2.7 "--analyze"
This commit is contained in:
Thomas E. Dickey 2011-05-22 00:54:42 +00:00
parent 3f20704179
commit c120fddebe
16 changed files with 70 additions and 46 deletions

5
NEWS
View File

@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.1703 2011/05/14 21:49:54 tom Exp $
-- $Id: NEWS,v 1.1704 2011/05/21 19:01:38 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -45,6 +45,9 @@ See the AUTHORS file for the corresponding full names.
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
20110521
+ fix warnings from clang 2.7 "--analyze"
20110514
+ compiler-warning fixes in panel and progs.
+ modify CF_PKG_CONFIG macro, from changes to tin -TD

View File

@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.816 2011/05/14 17:22:21 tom Exp $
# $Id: dist.mk,v 1.817 2011/05/21 17:35:14 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@ -37,7 +37,7 @@ SHELL = /bin/sh
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 9
NCURSES_PATCH = 20110514
NCURSES_PATCH = 20110521
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -37,7 +37,7 @@
#include "menu.priv.h"
MODULE_ID("$Id: m_driver.c,v 1.29 2010/01/23 21:20:10 tom Exp $")
MODULE_ID("$Id: m_driver.c,v 1.30 2011/05/21 18:56:41 tom Exp $")
/* Macros */
@ -537,7 +537,11 @@ menu_driver(MENU * menu, int c)
result = E_UNKNOWN_COMMAND;
}
if (E_OK == result)
if (item == 0)
{
result = E_BAD_STATE;
}
else if (E_OK == result)
{
/* Adjust the top row if it turns out that the current item unfortunately
doesn't appear in the menu window */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -33,7 +33,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: wresize.c,v 1.34 2010/06/05 22:36:26 tom Exp $")
MODULE_ID("$Id: wresize.c,v 1.35 2011/05/21 18:55:07 tom Exp $")
static int
cleanup_lines(struct ldat *data, int length)
@ -175,9 +175,10 @@ wresize(WINDOW *win, int ToLines, int ToCols)
for (col = 0; col <= ToCols; ++col)
s[col] = win->_nc_bkgd;
}
} else {
assert(pline != 0);
} else if (pline != 0 && pline[win->_pary + row].text != 0) {
s = &pline[win->_pary + row].text[win->_parx];
} else {
s = 0;
}
if_USE_SCROLL_HINTS(new_lines[row].oldindex = row);

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -35,7 +35,7 @@
#include <ctype.h>
#include <tic.h>
MODULE_ID("$Id: comp_expand.c,v 1.21 2010/01/16 17:11:23 tom Exp $")
MODULE_ID("$Id: comp_expand.c,v 1.22 2011/05/21 18:55:07 tom Exp $")
static int
trailing_spaces(const char *src)
@ -61,15 +61,15 @@ _nc_tic_expand(const char *srcp, bool tic_format, int numbers)
size_t need = (2 + strlen(str)) * 4;
int ch;
#if NO_LEAKS
if (srcp == 0) {
#if NO_LEAKS
if (buffer != 0) {
FreeAndNull(buffer);
length = 0;
}
#endif
return 0;
}
#endif
if (buffer == 0 || need > length) {
if ((buffer = typeRealloc(char, length = need, buffer)) == 0)
return 0;

View File

@ -47,7 +47,7 @@
#include <locale.h>
#endif
MODULE_ID("$Id: lib_setup.c,v 1.136 2011/04/16 15:32:45 tom Exp $")
MODULE_ID("$Id: lib_setup.c,v 1.137 2011/05/21 17:35:14 tom Exp $")
/****************************************************************************
*
@ -547,7 +547,7 @@ _nc_locale_breaks_acs(TERMINAL * termp)
int value;
int result = 0;
if ((env = getenv(env_name)) != 0) {
if (getenv(env_name) != 0) {
result = _nc_getenv_num(env_name);
} else if ((value = tigetnum("U8")) >= 0) {
result = value; /* use extension feature */

View File

@ -42,7 +42,7 @@
#include <ctype.h>
#include <tic.h>
MODULE_ID("$Id: lib_tparm.c,v 1.82 2011/01/15 22:19:12 tom Exp $")
MODULE_ID("$Id: lib_tparm.c,v 1.83 2011/05/21 18:11:56 tom Exp $")
/*
* char *
@ -522,7 +522,7 @@ tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap)
}
#ifdef TRACE
if (USE_TRACEF(TRACE_CALLS)) {
for (i = 0; i < popcount; i++) {
for (i = 0; i < num_args; i++) {
if (p_is_s[i] != 0)
save_text(", %s", _nc_visbuf(p_is_s[i]), 0);
else

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
* Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/* $Id: panel.priv.h,v 1.23 2009/04/11 20:33:55 tom Exp $ */
/* $Id: panel.priv.h,v 1.24 2011/05/21 18:55:07 tom Exp $ */
#ifndef NCURSES_PANEL_PRIV_H
#define NCURSES_PANEL_PRIV_H 1
@ -160,7 +160,7 @@ struct screen; /* forward declaration */
---------------------------------------------------------------------------*/
#define PANEL_UPDATE(pan,panstart)\
{ PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\
while(pan2) {\
while(pan2 && pan2->win) {\
if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\
int y, ix1, ix2, iy1, iy2;\
COMPUTE_INTERSECTION(pan, pan2, ix1, ix2, iy1, iy2);\

View File

@ -37,7 +37,7 @@
#define USE_LIBTINFO
#include <progs.priv.h>
MODULE_ID("$Id: tabs.c,v 1.20 2011/05/14 22:34:36 tom Exp $")
MODULE_ID("$Id: tabs.c,v 1.21 2011/05/21 18:31:21 tom Exp $")
static void usage(void) GCC_NORETURN;
@ -353,7 +353,6 @@ main(int argc, char *argv[])
bool no_op = FALSE;
int n, ch;
NCURSES_CONST char *term_name = 0;
const char *mar_list = 0; /* ignored */
char *append = 0;
const char *tab_list = 0;
@ -446,7 +445,11 @@ main(int argc, char *argv[])
while ((ch = *++option) != '\0') {
switch (ch) {
case 'm':
mar_list = option;
/*
* The "+mXXX" option is unimplemented because only the long-obsolete
* att510d implements smgl, which is needed to support
* this option.
*/
break;
default:
/* special case of relative stops separated by spaces? */

View File

@ -44,7 +44,7 @@
#include <dump_entry.h>
#include <transform.h>
MODULE_ID("$Id: tic.c,v 1.149 2011/05/14 23:24:57 tom Exp $")
MODULE_ID("$Id: tic.c,v 1.150 2011/05/21 18:15:45 tom Exp $")
const char *_nc_progname = "tic";
@ -339,23 +339,23 @@ put_translate(int c)
static char *
stripped(char *src)
{
char *dst = 0;
while (isspace(UChar(*src)))
src++;
if (*src != '\0') {
char *dst;
size_t len;
if ((dst = strdup(src)) == NULL)
if ((dst = strdup(src)) == NULL) {
failed("strdup");
assert(dst != 0);
} else {
len = strlen(dst);
while (--len != 0 && isspace(UChar(dst[len])))
dst[len] = '\0';
return dst;
}
return 0;
}
return dst;
}
static FILE *

View File

@ -44,7 +44,7 @@
#include <hashed_db.h>
#endif
MODULE_ID("$Id: toe.c,v 1.53 2011/05/14 22:35:49 tom Exp $")
MODULE_ID("$Id: toe.c,v 1.54 2011/05/21 18:32:13 tom Exp $")
#define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
@ -61,6 +61,8 @@ ExitProgram(int code)
}
#endif
static void failed(const char *) GCC_NORETURN;
static void
failed(const char *msg)
{

View File

@ -119,7 +119,7 @@ char *ttyname(int fd);
#include <dump_entry.h>
#include <transform.h>
MODULE_ID("$Id: tset.c,v 1.83 2011/05/14 22:50:45 tom Exp $")
MODULE_ID("$Id: tset.c,v 1.84 2011/05/21 18:55:32 tom Exp $")
/*
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
@ -148,6 +148,10 @@ extern char **environ;
#undef CTRL
#define CTRL(x) ((x) & 0x1f)
static void failed(const char *) GCC_NORETURN;
static void exit_error(void) GCC_NORETURN;
static void err(const char *,...) GCC_NORETURN;
const char *_nc_progname = "tset";
static TTY mode, oldmode, original;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -29,7 +29,7 @@
/*
* Author: Thomas E. Dickey (1998-on)
*
* $Id: ditto.c,v 1.40 2010/11/14 01:06:47 tom Exp $
* $Id: ditto.c,v 1.41 2011/05/21 18:55:07 tom Exp $
*
* The program illustrates how to set up multiple screens from a single
* program.
@ -98,6 +98,9 @@ typedef struct {
DITTO *ditto; /* data for all screens */
} DDATA;
static void failed(const char *) GCC_NORETURN;
static void usage(void) GCC_NORETURN;
static void
failed(const char *s)
{

View File

@ -40,7 +40,7 @@ AUTHOR
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
$Id: ncurses.c,v 1.367 2011/04/23 21:16:43 tom Exp $
$Id: ncurses.c,v 1.368 2011/05/21 18:50:56 tom Exp $
***************************************************************************/
@ -1394,7 +1394,7 @@ show_attr(int row, int skip, bool arrow, chtype attr, const char *name)
if (!(termattrs() & test)) {
printw(" (N/A)");
} else {
if (ncv > 0 && (getbkgd(stdscr) & A_COLOR)) {
if (ncv > 0 && stdscr && (getbkgd(stdscr) & A_COLOR)) {
static const chtype table[] =
{
A_STANDOUT,
@ -4269,7 +4269,9 @@ acs_and_scroll(void)
neww->next = current ? current->next : 0;
neww->last = current;
if (neww->last != 0)
neww->last->next = neww;
if (neww->next != 0)
neww->next->last = neww;
neww->wind = getwin(fp);

View File

@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
* $Id: redraw.c,v 1.6 2011/04/23 20:13:21 tom Exp $
* $Id: redraw.c,v 1.7 2011/05/21 18:38:35 tom Exp $
*
* Demonstrate the redrawwin() and wredrawln() functions.
* Thomas Dickey - 2006/11/4
@ -71,7 +71,7 @@ test_redraw(WINDOW *win)
keypad(win, TRUE);
getmaxyx(win, max_y, max_x);
getbegyx(win, beg_y, beg_x);
while (!done) {
while (!done && win != 0) {
ch = wgetch(win);
getyx(win, y, x);
switch (ch) {

View File

@ -50,7 +50,7 @@
* scroll operation worked, and the refresh() code only had to do a
* partial repaint.
*
* $Id: view.c,v 1.82 2011/05/14 17:43:12 tom Exp $
* $Id: view.c,v 1.83 2011/05/21 18:40:49 tom Exp $
*/
#include <test.priv.h>
@ -121,6 +121,8 @@ static NCURSES_CH_T **vec_lines;
static NCURSES_CH_T **lptr;
static int num_lines;
static void usage(void) GCC_NORETURN;
static void
usage(void)
{