-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1873 2012/03/01 09:53:21 tom Exp $
+-- $Id: NEWS,v 1.1876 2012/03/11 00:35:40 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20120310
+ + fix some strict compiler warnings for abi6 and 64-bits.
+ + use begin_va_copy/end_va_copy macros in lib_printw.c (cf: 20120303).
+ + improve a limit-check in infocmp.c (Werner Fink):
+
20120303
+ minor tidying of terminfo.tail, clarify reason for limitation
regarding mapping of \0 to \200
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.862 2012/02/29 10:02:11 tom Exp $
+# $Id: dist.mk,v 1.863 2012/03/10 19:42:38 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 9
-NCURSES_PATCH = 20120303
+NCURSES_PATCH = 20120310
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2011,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: fld_def.c,v 1.39 2011/07/16 22:26:11 tom Exp $")
+MODULE_ID("$Id: fld_def.c,v 1.40 2012/03/11 00:37:16 tom Exp $")
/* this can't be readonly */
static FIELD default_field =
{
T((T_CREATE("field %p"), (void *)New_Field));
*New_Field = default_field;
- New_Field->rows = rows;
- New_Field->cols = cols;
+ New_Field->rows = (short) rows;
+ New_Field->cols = (short) cols;
New_Field->drows = rows + nrow;
New_Field->dcols = cols;
- New_Field->frow = frow;
- New_Field->fcol = fcol;
+ New_Field->frow = (short) frow;
+ New_Field->fcol = (short) fcol;
New_Field->nrow = nrow;
- New_Field->nbuf = nbuf;
+ New_Field->nbuf = (short) nbuf;
New_Field->link = New_Field;
#if USE_WIDEC_SUPPORT
/****************************************************************************
- * Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: fld_dup.c,v 1.13 2010/01/23 21:14:35 tom Exp $")
+MODULE_ID("$Id: fld_dup.c,v 1.14 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
{
T((T_CREATE("field %p"), (void *)New_Field));
*New_Field = *_nc_Default_Field;
- New_Field->frow = frow;
- New_Field->fcol = fcol;
+ New_Field->frow = (short) frow;
+ New_Field->fcol = (short) fcol;
New_Field->link = New_Field;
New_Field->rows = field->rows;
New_Field->cols = field->cols;
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: fld_just.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
+MODULE_ID("$Id: fld_just.c,v 1.13 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
Normalize_Field(field);
if (field->just != just)
{
- field->just = just;
+ field->just = (short) just;
res = _nc_Synchronize_Attributes(field);
}
else
/****************************************************************************
- * Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: fld_link.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
+MODULE_ID("$Id: fld_link.c,v 1.13 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
{
T((T_CREATE("field %p"), (void *)New_Field));
*New_Field = *_nc_Default_Field;
- New_Field->frow = frow;
- New_Field->fcol = fcol;
+ New_Field->frow = (short) frow;
+ New_Field->fcol = (short) fcol;
New_Field->link = field->link;
field->link = New_Field;
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: fld_max.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: fld_max.c,v 1.11 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
RETURN(E_BAD_ARGUMENT);
}
field->maxgrow = maxgrow;
- field->status &= ~_MAY_GROW;
+ field->status &= (unsigned short) (~_MAY_GROW);
if (!(field->opts & O_STATIC))
{
if ((maxgrow == 0) ||
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: fld_move.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: fld_move.c,v 1.11 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
if (field->form)
RETURN(E_CONNECTED);
- field->frow = frow;
- field->fcol = fcol;
+ field->frow = (short) frow;
+ field->fcol = (short) fcol;
RETURN(E_OK);
}
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: fld_page.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: fld_page.c,v 1.11 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
if (new_page_flag)
field->status |= _NEWPAGE;
else
- field->status &= ~_NEWPAGE;
+ field->status &= (unsigned short) (~_NEWPAGE);
RETURN(E_OK);
}
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: fld_stat.c,v 1.12 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: fld_stat.c,v 1.13 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
if (status)
field->status |= _CHANGED;
else
- field->status &= ~_CHANGED;
+ field->status &= (unsigned short)(~_CHANGED);
RETURN(E_OK);
}
/****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2012 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 *
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: form.priv.h,v 0.32 2009/11/07 21:26:43 tom Exp $ */
+/* $Id: form.priv.h,v 0.33 2012/03/11 00:37:46 tom Exp $ */
#ifndef FORM_PRIV_H
#define FORM_PRIV_H 1
-
+/* *INDENT-OFF*/
#include "curses.priv.h"
#include "mf_common.h"
/* Calculate the total size of all buffers for this field */
#define Total_Buffer_Size(field) \
- ( (Buffer_Length(field) + 1) * (1+(field)->nbuf) * sizeof(FIELD_CELL) )
+ ( (size_t)(Buffer_Length(field) + 1) * (size_t)(1+(field)->nbuf) * sizeof(FIELD_CELL) )
/* Logic to determine whether or not a field is single lined */
#define Single_Line_Field(field) \
result = ((*buffer || (l < width)) ? FALSE : TRUE); \
}
#endif
+/* *INDENT-ON*/
#endif /* FORM_PRIV_H */
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: frm_def.c,v 1.25 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.26 2012/03/11 00:37:16 tom Exp $")
/* this can't be readonly */
static FORM default_form =
for (j = 0; j < field_cnt; j++)
{
if (j == 0)
- pg->pmin = j;
+ pg->pmin = (short) j;
else
{
if (fields[j]->status & _NEWPAGE)
{
- pg->pmax = j - 1;
+ pg->pmax = (short) (j - 1);
pg++;
- pg->pmin = j;
+ pg->pmin = (short) j;
}
}
maximum_col_in_field = fields[j]->fcol + fields[j]->cols;
if (form->rows < maximum_row_in_field)
- form->rows = maximum_row_in_field;
+ form->rows = (short) maximum_row_in_field;
if (form->cols < maximum_col_in_field)
- form->cols = maximum_col_in_field;
+ form->cols = (short) maximum_col_in_field;
}
- pg->pmax = field_cnt - 1;
- form->maxfield = field_cnt;
- form->maxpage = page_nr;
+ pg->pmax = (short) (field_cnt - 1);
+ form->maxfield = (short) field_cnt;
+ form->maxpage = (short) page_nr;
/* Sort fields on form pages */
for (page_nr = 0; page_nr < form->maxpage; page_nr++)
for (j = form->page[page_nr].pmin; j <= form->page[page_nr].pmax; j++)
{
- fields[j]->index = j;
- fields[j]->page = page_nr;
+ fields[j]->index = (short) j;
+ fields[j]->page = (short) page_nr;
fld = Insert_Field_By_Position(fields[j], fld);
}
if (fld)
/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2011,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: frm_driver.c,v 1.99 2011/09/17 22:12:10 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.100 2012/03/11 00:37:16 tom Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
instead of a derived window because it contains invisible parts.
This is true for non-public fields and for scrollable fields. */
#define Has_Invisible_Parts(field) \
- (!((field)->opts & O_PUBLIC) || \
+ (!((unsigned)(field)->opts & O_PUBLIC) || \
Is_Scroll_Field(field))
/* Logic to decide whether or not a field needs justification */
(((field)->just != NO_JUSTIFICATION) && \
(Single_Line_Field(field)) && \
(((field)->dcols == (field)->cols) && \
- ((field)->opts & O_STATIC)) )
+ ((unsigned)(field)->opts & O_STATIC)))
/* Logic to determine whether or not a dynamic field may still grow */
#define Growable(field) ((field)->status & _MAY_GROW)
/* Macro to set the attributes for a fields window */
#define Set_Field_Window_Attributes(field,win) \
( wbkgdset((win),(chtype)((field)->pad | (field)->back)), \
- (void) wattrset((win),(field)->fore) )
+ (void) wattrset((win), (int)(field)->fore) )
/* Logic to decide whether or not a field really appears on the form */
#define Field_Really_Appears(field) \
((field->form) &&\
(field->form->status & _POSTED) &&\
- (field->opts & O_VISIBLE) &&\
+ ((unsigned)field->opts & O_VISIBLE) &&\
(field->page == field->form->curpage))
/* Logic to determine whether or not we are on the first position in the
{
if (form->status & _WINDOW_MODIFIED)
{
- form->status &= ~_WINDOW_MODIFIED;
+ form->status &= (unsigned short) (~_WINDOW_MODIFIED);
form->status |= _FCHECK_REQUIRED;
Window_To_Buffer(form, form->current);
wmove(form->w, form->currow, form->curcol);
growth = Minimum(field->maxgrow - field->dcols, growth);
field->dcols += growth;
if (field->dcols == field->maxgrow)
- field->status &= ~_MAY_GROW;
+ field->status &= (unsigned short) (~_MAY_GROW);
}
else
{
growth = Minimum(field->maxgrow - field->drows, growth);
field->drows += growth;
if (field->drows == field->maxgrow)
- field->status &= ~_MAY_GROW;
+ field->status &= (unsigned short) (~_MAY_GROW);
}
/* drows, dcols changed, so we get really the new buffer length */
new_buflen = Buffer_Length(field);
field = form->current;
formwin = Get_Form_Window(form);
- if (field->opts & O_PUBLIC)
+ if ((unsigned)field->opts & O_PUBLIC)
{
if (Is_Scroll_Field(field))
{
/* means we have to copy whole range */
first_modified_row = form->toprow;
first_unmodified_row = first_modified_row + field->rows;
- field->status &= ~_NEWTOP;
+ field->status &= (unsigned short)(~_NEWTOP);
}
else
{
return E_SYSTEM_ERROR;
else
{
- if (field->opts & O_VISIBLE)
+ if ((unsigned)field->opts & O_VISIBLE)
{
Set_Field_Window_Attributes(field, win);
}
else
{
- (void)wattrset(win, WINDOW_ATTRS(fwin));
+ (void)wattrset(win, (int)WINDOW_ATTRS(fwin));
}
werase(win);
}
if (!bEraseFlag)
{
- if (field->opts & O_PUBLIC)
+ if ((unsigned)field->opts & O_PUBLIC)
{
if (Justification_Allowed(field))
Perform_Justification(field, win);
else
Buffer_To_Window(field, win);
}
- field->status &= ~_NEWTOP;
+ field->status &= (unsigned short)(~_NEWTOP);
}
wsyncup(win);
delwin(win);
form->currow = form->curcol = form->toprow = form->begincol = 0;
werase(form->w);
- if ((field->opts & O_PUBLIC) && Justification_Allowed(field))
+ if (((unsigned)field->opts & O_PUBLIC) && Justification_Allowed(field))
Undo_Justification(field, form->w);
else
Buffer_To_Window(field, form->w);
werase(form->w);
wmove(form->w, form->currow, form->curcol);
- if (field->opts & O_PUBLIC)
+ if ((unsigned)field->opts & O_PUBLIC)
{
if (Justification_Allowed(field))
Undo_Justification(field, form->w);
}
if (form->curpage == field->page)
{
- if (changed_opts & O_VISIBLE)
+ if ((unsigned) changed_opts & O_VISIBLE)
{
- if (newopts & O_VISIBLE)
+ if ((unsigned) newopts & O_VISIBLE)
res = Display_Field(field);
else
res = Erase_Field(field);
}
else
{
- if ((changed_opts & O_PUBLIC) &&
- (newopts & O_VISIBLE))
+ if (((unsigned) changed_opts & O_PUBLIC) &&
+ ((unsigned) newopts & O_VISIBLE))
res = Display_Field(field);
}
}
}
}
- if (changed_opts & O_STATIC)
+ if ((unsigned) changed_opts & O_STATIC)
{
bool single_line_field = Single_Line_Field(field);
int res2 = E_OK;
- if (newopts & O_STATIC)
+ if ((unsigned) newopts & O_STATIC)
{
/* the field becomes now static */
- field->status &= ~_MAY_GROW;
+ field->status &= (unsigned short)(~_MAY_GROW);
/* if actually we have no hidden columns, justification may
occur again */
if (single_line_field &&
!(form->status & _POSTED))
{
if ((form->w) &&
- (field->opts & O_VISIBLE) &&
+ ((unsigned)field->opts & O_VISIBLE) &&
(field->form->curpage == field->page))
{
_nc_Refresh_Current_Field(form);
- if (field->opts & O_PUBLIC)
+ if ((unsigned)field->opts & O_PUBLIC)
{
if (field->drows > field->rows)
{
if (form->toprow == 0)
- field->status &= ~_NEWTOP;
+ field->status &= (unsigned short)(~_NEWTOP);
else
field->status |= _NEWTOP;
}
delwin(form->w);
form->w = new_window;
- form->status &= ~_WINDOW_MODIFIED;
+ form->status &= (unsigned short)(~_WINDOW_MODIFIED);
Set_Field_Window_Attributes(field, form->w);
if (Has_Invisible_Parts(field))
int result = E_REQUEST_DENIED;
bool Last_Row = ((field->drows - 1) == form->currow);
- if ((field->opts & O_WRAP) && /* wrapping wanted */
+ if (((unsigned)field->opts & O_WRAP) && /* wrapping wanted */
(!Single_Line_Field(field)) && /* must be multi-line */
(There_Is_No_Room_For_A_Char_In_Line(form)) && /* line is full */
(!Last_Row || Growable(field))) /* there are more lines */
editable fields.
*/
if ((fct == FE_Delete_Previous) &&
- (form->opts & O_BS_OVERLOAD) &&
+ ((unsigned)form->opts & O_BS_OVERLOAD) &&
First_Position_In_Current_Field(form))
{
res = Inter_Field_Navigation(FN_Previous_Field, form);
{
if (fct == FE_New_Line)
{
- if ((form->opts & O_NL_OVERLOAD) &&
+ if (((unsigned)form->opts & O_NL_OVERLOAD) &&
First_Position_In_Current_Field(form))
{
res = Inter_Field_Navigation(FN_Next_Field, form);
else
{
/* From now on, everything must be editable */
- if (form->current->opts & O_EDIT)
+ if ((unsigned)form->current->opts & O_EDIT)
{
res = fct(form);
if (res == E_OK)
if (Last_Row &&
(!(Growable(field) && !Single_Line_Field(field))))
{
- if (!(form->opts & O_NL_OVERLOAD))
+ if (!((unsigned)form->opts & O_NL_OVERLOAD))
returnCode(E_REQUEST_DENIED);
wmove(form->w, form->currow, form->curcol);
wclrtoeol(form->w);
if (Last_Row &&
!(Growable(field) && !Single_Line_Field(field)))
{
- if (!(form->opts & O_NL_OVERLOAD))
+ if (!((unsigned)form->opts & O_NL_OVERLOAD))
returnCode(E_REQUEST_DENIED);
returnCode(Inter_Field_Navigation(FN_Next_Field, form));
}
EM_Insert_Mode(FORM *form)
{
T((T_CALLED("EM_Insert_Mode(%p)"), (void *)form));
- form->status &= ~_OVLMODE;
+ form->status &= (unsigned short)(~_OVLMODE);
returnCode(E_OK);
}
{
if (typ)
{
- if (field->opts & O_NULLOK)
+ if ((unsigned)field->opts & O_NULLOK)
{
FIELD_CELL *bp = field->buf;
Synchronize_Buffer(form);
if ((form->status & _FCHECK_REQUIRED) ||
- (!(field->opts & O_PASSOK)))
+ (!((unsigned)field->opts & O_PASSOK)))
{
if (!Check_Field(form, field->type, field, (TypeArgument *)(field->arg)))
return FALSE;
- form->status &= ~_FCHECK_REQUIRED;
+ form->status &= (unsigned short)(~_FCHECK_REQUIRED);
field->status |= _CHANGED;
Synchronize_Linked_Fields(field);
}
do
{
field = (field == last_on_page) ? first : field + 1;
- if (((*field)->opts & O_VISIBLE))
+ if (((unsigned)(*field)->opts & O_VISIBLE))
break;
}
while (proposed != (*field));
proposed = *field;
- if ((proposed == *last_on_page) && !(proposed->opts & O_VISIBLE))
+ if ((proposed == *last_on_page) &&
+ !((unsigned)proposed->opts & O_VISIBLE))
{
/* This means, there is also no visible field on the page.
So we propose the first one and hope the very best...
FIELD *last_field, *field_on_page;
werase(Get_Form_Window(form));
- form->curpage = page;
+ form->curpage = (short)page;
last_field = field_on_page = form->field[form->page[page].smin];
do
{
- if (field_on_page->opts & O_VISIBLE)
+ if ((unsigned)field_on_page->opts & O_VISIBLE)
if ((res = Display_Field(field_on_page)) != E_OK)
return (res);
field_on_page = field_on_page->snext;
int result = E_REQUEST_DENIED;
T((T_CALLED("Data_Entry(%p,%s)"), (void *)form, _tracechtype((chtype)c)));
- if ((field->opts & O_EDIT)
+ if (((unsigned) field->opts & O_EDIT)
#if FIX_FORM_INACTIVE_BUG
- && (field->opts & O_ACTIVE)
+ && ((unsigned) field->opts & O_ACTIVE)
#endif
)
{
- if ((field->opts & O_BLANK) &&
+ if (((unsigned) field->opts & O_BLANK) &&
First_Position_In_Current_Field(form) &&
!(form->status & _FCHECK_REQUIRED) &&
!(form->status & _WINDOW_MODIFIED))
((field->dcols - 1) == form->curcol));
form->status |= _WINDOW_MODIFIED;
- if (End_Of_Field && !Growable(field) && (field->opts & O_AUTOSKIP))
+ if (End_Of_Field && !Growable(field) && ((unsigned) field->opts & O_AUTOSKIP))
result = Inter_Field_Navigation(FN_Next_Field, form);
else
{
NULL /* Choice Request is generic */
};
size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
- size_t method = (BI->keycode >> ID_Shft) & 0xffff; /* see ID_Mask */
+ size_t method = (size_t)((BI->keycode >> ID_Shft) & 0xffff); /* see ID_Mask */
if ((method >= nMethods) || !(BI->cmd))
res = E_SYSTEM_ERROR;
if (!field || !value || ((buffer < 0) || (buffer > field->nbuf)))
RETURN(E_BAD_ARGUMENT);
- len = Buffer_Length(field);
+ len = (unsigned) Buffer_Length(field);
if (Growable(field))
{
/* for a growable field we must assume zero terminated strings, because
somehow we have to detect the length of what should be copied.
*/
- unsigned int vlen = strlen(value);
+ unsigned vlen = (unsigned) strlen(value);
if (vlen > len)
{
delwin(field->working);
field->working = newpad(1, Buffer_Length(field) + 1);
}
- len = Buffer_Length(field);
+ len = (unsigned)Buffer_Length(field);
wclear(field->working);
(void)mvwaddstr(field->working, 0, 0, value);
{
for (i = 0; i < (unsigned)field->drows; ++i)
{
- (void)mvwin_wchnstr(field->working, 0, i * field->dcols,
- widevalue + (i * field->dcols),
+ (void)mvwin_wchnstr(field->working, 0, (int)i * field->dcols,
+ widevalue + ((int)i * field->dcols),
field->dcols);
}
for (i = 0; i < len; ++i)
{
#if USE_WIDEC_SUPPORT
FIELD_CELL *data = Address_Of_Nth_Buffer(field, buffer);
- unsigned need = 0;
+ size_t need = 0;
int size = Buffer_Length(field);
int n;
{
result[need] = wch;
}
- passed += status;
+ passed += (size_t) status;
++need;
}
else
break;
result = typeCalloc(wchar_t, need);
- *lengthp = need;
+ *lengthp = (int) need;
if (result == 0)
break;
}
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "form.priv.h"
-MODULE_ID("$Id: frm_hook.c,v 1.15 2010/01/23 21:12:08 tom Exp $")
+MODULE_ID("$Id: frm_hook.c,v 1.16 2012/03/11 00:37:16 tom Exp $")
/* "Template" macro to generate function to set application specific hook */
#define GEN_HOOK_SET_FUNCTION( typ, name ) \
NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\
{\
- T((T_CALLED("set_" #typ"_"#name"(%p,%p)"), form, func));\
+ T((T_CALLED("set_" #typ"_"#name"(%p,%p)"), (void *) form, func));\
(Normalize_Form( form ) -> typ ## name) = func ;\
RETURN(E_OK);\
}
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "menu.priv.h"
-MODULE_ID("$Id: m_attribs.c,v 1.16 2010/01/23 21:16:54 tom Exp $")
+MODULE_ID("$Id: m_attribs.c,v 1.17 2012/03/10 23:43:41 tom Exp $")
/* Macro to redraw menu if it is posted and changed */
#define Refresh_Menu(menu) \
#define GEN_MENU_ATTR_SET_FCT( name ) \
NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
{\
- T((T_CALLED("set_menu_" #name "(%p,%s)"), menu, _traceattr(attr))); \
+ T((T_CALLED("set_menu_" #name "(%p,%s)"), (void *) menu, _traceattr(attr))); \
if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
RETURN(E_BAD_ARGUMENT);\
if (menu && ( menu -> name != attr))\
/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2011,2012 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 *
#include "menu.priv.h"
-MODULE_ID("$Id: m_driver.c,v 1.30 2011/05/21 18:56:41 tom Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.31 2012/03/10 23:43:41 tom Exp $")
/* Macros */
/* Add a new character to the match pattern buffer */
#define Add_Character_To_Pattern(menu,ch) \
- { (menu)->pattern[((menu)->pindex)++] = (ch);\
+ { (menu)->pattern[((menu)->pindex)++] = (char) (ch);\
(menu)->pattern[(menu)->pindex] = '\0'; }
/*---------------------------------------------------------------------------
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "menu.priv.h"
-MODULE_ID("$Id: m_format.c,v 1.16 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_format.c,v 1.17 2012/03/10 23:43:41 tom Exp $")
#define minimum(a,b) ((a)<(b) ? (a): (b))
if (menu->pattern)
Reset_Pattern(menu);
- menu->frows = rows;
- menu->fcols = cols;
+ menu->frows = (short)rows;
+ menu->fcols = (short)cols;
assert(rows > 0 && cols > 0);
total_rows = (menu->nitems - 1) / cols + 1;
minimum(menu->nitems, cols) :
(menu->nitems - 1) / total_rows + 1;
- menu->rows = total_rows;
- menu->cols = total_cols;
- menu->arows = minimum(total_rows, rows);
+ menu->rows = (short)total_rows;
+ menu->cols = (short)total_cols;
+ menu->arows = (short)minimum(total_rows, rows);
menu->toprow = 0;
menu->curitem = *(menu->items);
assert(menu->curitem);
else
{
if (rows > 0)
- _nc_Default_Menu.frows = rows;
+ _nc_Default_Menu.frows = (short)rows;
if (cols > 0)
- _nc_Default_Menu.fcols = cols;
+ _nc_Default_Menu.fcols = (short)cols;
}
RETURN(E_OK);
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "menu.priv.h"
-MODULE_ID("$Id: m_global.c,v 1.25 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.26 2012/03/10 23:43:41 tom Exp $")
static char mark[] = "-";
/* *INDENT-OFF* */
assert(menu && menu->items);
for (items = menu->items; *items; items++)
{
- check = _nc_Calculate_Text_Width(&((*items)->name));
+ check = (unsigned) _nc_Calculate_Text_Width(&((*items)->name));
if (check > MaximumNameLength)
MaximumNameLength = check;
- check = _nc_Calculate_Text_Width(&((*items)->description));
+ check = (unsigned) _nc_Calculate_Text_Width(&((*items)->description));
if (check > MaximumDescriptionLength)
MaximumDescriptionLength = check;
}
- menu->namelen = MaximumNameLength;
- menu->desclen = MaximumDescriptionLength;
+ menu->namelen = (short) MaximumNameLength;
+ menu->desclen = (short) MaximumDescriptionLength;
T(("ComputeMaximum_NameDesc_Lengths %d,%d", menu->namelen, menu->desclen));
}
{
(*item)->value = FALSE;
}
- (*item)->index = ItemCount++;
+ (*item)->index = (short) ItemCount++;
(*item)->imenu = menu;
}
}
if (ItemCount != 0)
{
menu->items = items;
- menu->nitems = ItemCount;
+ menu->nitems = (short) ItemCount;
ComputeMaximum_NameDesc_Lengths(menu);
if ((menu->pattern = typeMalloc(char, (unsigned)(1 + menu->namelen))))
{
T((T_CALLED("_nc_menu_text_width(%p)"), (const void *)item));
if (result != 0 && item->str != 0)
{
- int count = mbstowcs(0, item->str, 0);
+ int count = (int) mbstowcs(0, item->str, 0);
wchar_t *temp = 0;
if (count > 0
assert(menu);
- menu->height = 1 + menu->spc_rows * (menu->arows - 1);
+ menu->height = (short) (1 + menu->spc_rows * (menu->arows - 1));
l = calculate_actual_width(menu, TRUE);
l += menu->marklen;
l += menu->spc_desc;
}
- menu->itemlen = l;
+ menu->itemlen = (short) l;
l *= menu->cols;
l += (menu->cols - 1) * menu->spc_cols; /* for the padding between the columns */
- menu->width = l;
+ menu->width = (short) l;
T(("_nc_CalculateItem_Length_and_Width columns %d, item %d, width %d",
menu->cols,
int Last_in_Column;
bool cycle = (menu->opt & O_NONCYCLIC) ? FALSE : TRUE;
- menu->status &= ~_LINK_NEEDED;
+ menu->status &= (unsigned short) (~_LINK_NEEDED);
if (menu->opt & O_ROWMAJOR)
{
(cycle ? menu->items[(row + 1) < menu->rows ?
Number_Of_Items - 1 : col] :
(ITEM *) 0);
- item->x = col;
- item->y = row;
+ item->x = (short) col;
+ item->y = (short) row;
if (++col == Number_Of_Columns)
{
row++;
(ITEM *) 0
);
- item->x = col;
- item->y = row;
+ item->x = (short) col;
+ item->y = (short) row;
if ((++row) == Number_Of_Rows)
{
col++;
cur_item = menu->curitem;
assert(cur_item);
- menu->toprow = new_toprow;
+ menu->toprow = (short) new_toprow;
menu->curitem = new_current_item;
if (mterm_called)
}
else
{ /* if we are not posted, this is quite simple */
- menu->toprow = new_toprow;
+ menu->toprow = (short) new_toprow;
menu->curitem = new_current_item;
}
}
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "menu.priv.h"
-MODULE_ID("$Id: m_hook.c,v 1.15 2010/01/23 21:16:54 tom Exp $")
+MODULE_ID("$Id: m_hook.c,v 1.16 2012/03/10 23:43:41 tom Exp $")
/* "Template" macro to generate function to set application specific hook */
#define GEN_HOOK_SET_FUNCTION( typ, name ) \
NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\
{\
- T((T_CALLED("set_" #typ "_" #name "(%p,%p)"), menu, func));\
+ T((T_CALLED("set_" #typ "_" #name "(%p,%p)"), (void *) menu, func));\
(Normalize_Menu(menu) -> typ ## name = func );\
RETURN(E_OK);\
}
#endif
#endif
-MODULE_ID("$Id: m_item_new.c,v 1.31 2012/02/23 10:02:15 tom Exp $")
+MODULE_ID("$Id: m_item_new.c,v 1.32 2012/03/10 23:41:36 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
int result = TRUE;
#if USE_WIDEC_SUPPORT
- int count = mbstowcs(0, s, 0);
+ int count = (int)mbstowcs(0, s, 0);
wchar_t *temp = 0;
assert(s);
{
*item = _nc_Default_Item; /* hope we have struct assignment */
- item->name.length = strlen(name);
+ item->name.length = (unsigned short)strlen(name);
item->name.str = name;
if (description && (*description != '\0') &&
Is_Printable_String(description))
{
- item->description.length = strlen(description);
+ item->description.length = (unsigned short)strlen(description);
item->description.str = description;
}
else
NCURSES_EXPORT(int)
set_menu_mark(MENU * menu, const char *mark)
{
- unsigned l;
+ short l;
T((T_CALLED("set_menu_mark(%p,%s)"), (void *)menu, _nc_visbuf(mark)));
if (mark && (*mark != '\0') && Is_Printable_String(mark))
- l = strlen(mark);
+ l = (short)strlen(mark);
else
l = 0;
{
/* If the menu is already posted, the geometry is fixed. Then
we can only accept a mark with exactly the same length */
- if (menu->marklen != (int)l)
+ if (menu->marklen != l)
RETURN(E_BAD_ARGUMENT);
}
menu->marklen = l;
else
{
menu->mark = old_mark;
- menu->marklen = (old_mark != 0) ? strlen(old_mark) : 0;
+ menu->marklen = (short)((old_mark != 0) ? strlen(old_mark) : 0);
RETURN(E_SYSTEM_ERROR);
}
}
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "menu.priv.h"
-MODULE_ID("$Id: m_pad.c,v 1.12 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_pad.c,v 1.13 2012/03/10 23:43:41 tom Exp $")
/* Macro to redraw menu if it is posted and changed */
#define Refresh_Menu(menu) \
RETURN(E_BAD_ARGUMENT);
Normalize_Menu(menu);
- menu->pad = pad;
+ menu->pad = (unsigned char)pad;
if (do_refresh)
Refresh_Menu(menu);
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "menu.priv.h"
-MODULE_ID("$Id: m_post.c,v 1.29 2010/05/01 19:18:27 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.30 2012/03/10 23:43:41 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
- it is a onevalued menu and it is the current item
- or it has a selection value
*/
- wattron(menu->win, menu->back);
+ wattron(menu->win, (int)menu->back);
if (item->value || (item == menu->curitem))
{
if (menu->marklen)
item. */
if (!(menu->opt & O_ONEVALUE) && item->value && item != menu->curitem)
{
- wattron(menu->win, menu->fore);
+ wattron(menu->win, (int)menu->fore);
isfore = TRUE;
}
waddstr(menu->win, menu->mark);
if (isfore)
{
- wattron(menu->win, menu->fore);
+ wattron(menu->win, (int)menu->fore);
isfore = FALSE;
}
}
else /* otherwise we have to wipe out the marker area */
for (ch = ' ', i = menu->marklen; i > 0; i--)
waddch(menu->win, ch);
- wattroff(menu->win, menu->back);
+ wattroff(menu->win, (int)menu->back);
count += menu->marklen;
/* First we have to calculate the attribute depending on selectability
*/
if (!(item->opt & O_SELECTABLE))
{
- wattron(menu->win, menu->grey);
+ wattron(menu->win, (int)menu->grey);
isgrey = TRUE;
}
else
{
if (item->value || item == menu->curitem)
{
- wattron(menu->win, menu->fore);
+ wattron(menu->win, (int)menu->fore);
isfore = TRUE;
}
else
{
- wattron(menu->win, menu->back);
+ wattron(menu->win, (int)menu->back);
isback = TRUE;
}
}
assert(cx >= 0 && cy >= 0);
getyx(menu->win, ncy, ncx);
if (isgrey)
- wattroff(menu->win, menu->grey);
+ wattroff(menu->win, (int)menu->grey);
else if (isfore)
- wattroff(menu->win, menu->fore);
- wattron(menu->win, menu->back);
+ wattroff(menu->win, (int)menu->fore);
+ wattron(menu->win, (int)menu->back);
for (j = 1; j < menu->spc_rows; j++)
{
if ((item_y + j) < getmaxy(menu->win))
}
wmove(menu->win, ncy, ncx);
if (!isback)
- wattroff(menu->win, menu->back);
+ wattroff(menu->win, (int)menu->back);
}
}
/* Remove attributes */
if (isfore)
- wattroff(menu->win, menu->fore);
+ wattroff(menu->win, (int)menu->fore);
if (isback)
- wattroff(menu->win, menu->back);
+ wattroff(menu->win, (int)menu->back);
if (isgrey)
- wattroff(menu->win, menu->grey);
+ wattroff(menu->win, (int)menu->grey);
}
/*---------------------------------------------------------------------------
{
_nc_Post_Item(menu, hitem);
- wattron(menu->win, menu->back);
+ wattron(menu->win, (int)menu->back);
if (((hitem = hitem->right) != lasthor) && hitem)
{
int i, j, cy, cx;
}
}
while (hitem && (hitem != lasthor));
- wattroff(menu->win, menu->back);
+ wattroff(menu->win, (int)menu->back);
item = item->down;
y += menu->spc_rows;
delwin(menu->win);
menu->win = (WINDOW *)0;
- menu->status &= ~_POSTED;
+ menu->status &= (unsigned short)(~_POSTED);
RETURN(E_OK);
}
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
#include "menu.priv.h"
-MODULE_ID("$Id: m_spacing.c,v 1.18 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_spacing.c,v 1.19 2012/03/10 23:43:41 tom Exp $")
#define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8)
#define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8)
((s_col < 0) || (s_col > MAX_SPC_COLS)))
RETURN(E_BAD_ARGUMENT);
- m->spc_desc = s_desc ? s_desc : 1;
- m->spc_rows = s_row ? s_row : 1;
- m->spc_cols = s_col ? s_col : 1;
+ m->spc_desc = (short)(s_desc ? s_desc : 1);
+ m->spc_rows = (short)(s_row ? s_row : 1);
+ m->spc_cols = (short)(s_col ? s_col : 1);
_nc_Calculate_Item_Length_and_Width(m);
RETURN(E_OK);
/****************************************************************************
- * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2012 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 *
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: menu.priv.h,v 1.23 2009/02/28 21:02:57 juergen Exp $ */
+/* $Id: menu.priv.h,v 1.24 2012/03/10 23:43:41 tom Exp $ */
/***************************************************************************
* Module menu.priv.h *
#ifndef MENU_PRIV_H_incl
#define MENU_PRIV_H_incl 1
+/* *INDENT-OFF* */
#include "curses.priv.h"
#include "mf_common.h"
*/
#define Adjust_Current_Item(menu,row,item) \
{ if ((item)->y < row) \
- row = (item)->y;\
- if ( (item)->y >= (row + (menu)->arows) )\
- row = ( (item)->y < ((menu)->rows - row) ) ? \
- (item)->y : (menu)->rows - (menu)->arows;\
+ row = (short) (item)->y; \
+ if ( (item)->y >= (row + (menu)->arows) ) \
+ row = (short) (( (item)->y < ((menu)->rows - row) ) \
+ ? (item)->y \
+ : (menu)->rows - (menu)->arows); \
_nc_New_TopRow_and_CurrentItem(menu,row,item); }
/* Reset the match pattern buffer */
#define returnMenuOpts(code) return code
#endif /* TRACE/!TRACE */
+/* *INDENT-ON* */
#endif /* MENU_PRIV_H_incl */
/****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2004,2012 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 *
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: mf_common.h,v 0.22 2005/11/26 15:26:52 tom Exp $ */
+/* $Id: mf_common.h,v 0.23 2012/03/10 23:43:41 tom Exp $ */
/* Common internal header for menu and form library */
#if USE_RCS_IDS
#define MODULE_ID(id) static const char Ident[] = id;
#else
-#define MODULE_ID(id) /*nothing*/
+#define MODULE_ID(id) /*nothing */
#endif
-
/* Maximum regular 8-bit character code */
#define MAX_REGULAR_CHARACTER (0xff)
#endif
/* The few common values in the status fields for menus and forms */
-#define _POSTED (0x01U) /* menu or form is posted */
-#define _IN_DRIVER (0x02U) /* menu or form is processing hook routine */
+#define _POSTED (0x01U) /* menu or form is posted */
+#define _IN_DRIVER (0x02U) /* menu or form is processing hook routine */
/* Call object hook */
#define Call_Hook( object, handler ) \
if ( (object) != 0 && ((object)->handler) != (void *) 0 )\
{\
- (object)->status |= _IN_DRIVER;\
+ (object)->status |= (unsigned short) (_IN_DRIVER);\
(object)->handler(object);\
- (object)->status &= ~_IN_DRIVER;\
+ (object)->status &= (unsigned short) (~_IN_DRIVER);\
}
#endif /* MF_COMMON_H_incl */
/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2011,2012 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 *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_bkgd.c,v 1.44 2011/05/28 20:44:22 tom Exp $")
+MODULE_ID("$Id: lib_bkgd.c,v 1.45 2012/03/10 21:20:18 tom Exp $")
/*
* Set the window's background information.
wgetbkgrnd(win, &old_bkgrnd);
(void) wbkgrndset(win, CHREF(new_bkgd));
- (void) wattrset(win, AttrOf(win->_nc_bkgd));
+ (void) wattrset(win, (int) AttrOf(win->_nc_bkgd));
for (y = 0; y <= win->_maxy; y++) {
for (x = 0; x <= win->_maxx; x++) {
#include <curses.priv.h>
-MODULE_ID("$Id: lib_printw.c,v 1.21 2012/02/29 10:11:53 Werner.Fink Exp $")
+MODULE_ID("$Id: lib_printw.c,v 1.22 2012/03/10 20:47:33 tom Exp $")
NCURSES_EXPORT(int)
printw(const char *fmt,...)
#ifdef TRACE
va_list argq;
- va_copy(argq, argp);
+ begin_va_copy(argq, argp);
va_start(argq, fmt);
T((T_CALLED("printw(%s%s)"),
_nc_visbuf(fmt), _nc_varargs(fmt, argq)));
- va_end(argq);
+ end_va_copy(argq);
#endif
va_start(argp, fmt);
#ifdef TRACE
va_list argq;
- va_copy(argq, argp);
+ begin_va_copy(argq, argp);
va_start(argq, fmt);
T((T_CALLED("wprintw(%p,%s%s)"),
(void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
- va_end(argq);
+ end_va_copy(argq);
#endif
va_start(argp, fmt);
#ifdef TRACE
va_list argq;
- va_copy(argq, argp);
+ begin_va_copy(argq, argp);
va_start(argq, fmt);
T((T_CALLED("mvprintw(%d,%d,%s%s)"),
y, x, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
- va_end(argq);
+ end_va_copy(argq);
#endif
if ((code = move(y, x)) != ERR) {
#ifdef TRACE
va_list argq;
- va_copy(argq, argp);
+ begin_va_copy(argq, argp);
va_start(argq, fmt);
T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"),
y, x, (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
- va_end(argq);
+ end_va_copy(argq);
#endif
if ((code = wmove(win, y, x)) != ERR) {
****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.498 2012/02/29 10:38:18 tom Exp $
+ * $Id: curses.priv.h,v 1.499 2012/03/10 21:16:32 tom Exp $
*
* curses.priv.h
*
#define if_EXT_COLORS(stmt) stmt
#define SetPair(value,p) SetPair2((value).ext_color, AttrOf(value), p)
#define SetPair2(c,a,p) c = (p), \
- a = (unColor2(a) | (A_COLOR & ColorPair(oldColor(c))))
+ a = (unColor2(a) | (A_COLOR & (unsigned) ColorPair(oldColor(c))))
#define GetPair(value) GetPair2((value).ext_color, AttrOf(value))
#define GetPair2(c,a) ((c) ? (c) : PairNumber(a))
#define oldColor(p) (((p) > 255) ? 255 : (p))
#define SameAttrOf(a,b) (AttrOf(a) == AttrOf(b) && GetPair(a) == GetPair(b))
#if NCURSES_SP_FUNCS
-#define VIDATTR(sp,attr,pair) NCURSES_SP_NAME(vid_attr)(sp, attr, pair, 0)
+#define VIDATTR(sp,attr,pair) NCURSES_SP_NAME(vid_attr)(sp, attr, (short) pair, 0)
#else
-#define VIDATTR(sp,attr,pair) vid_attr(attr, pair, 0)
+#define VIDATTR(sp,attr,pair) vid_attr(attr, (short) pair, 0)
#endif
#else /* !NCURSES_EXT_COLORS */
#include <curses.priv.h>
-MODULE_ID("$Id: lib_cchar.c,v 1.24 2011/10/22 15:52:36 tom Exp $")
+MODULE_ID("$Id: lib_cchar.c,v 1.25 2012/03/10 20:52:21 tom Exp $")
/*
* The SuSv2 description leaves some room for interpretation. We'll assume wch
if (opts != NULL
|| wch == NULL
- || ((len = wcslen(wch)) > 1 && wcwidth(wch[0]) < 0)) {
+ || ((len = (unsigned) wcslen(wch)) > 1 && wcwidth(wch[0]) < 0)) {
code = ERR;
} else {
if (len > CCHARW_MAX)
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
*/
#include "panel.priv.h"
-MODULE_ID("$Id: p_above.c,v 1.8 2010/01/23 21:22:15 tom Exp $")
+MODULE_ID("$Id: p_above.c,v 1.9 2012/03/10 23:43:41 tom Exp $")
#if NCURSES_SP_FUNCS
NCURSES_EXPORT(PANEL *)
ground_panel(SCREEN * sp)
{
- T((T_CALLED("ground_panel(%p)"), sp));
+ T((T_CALLED("ground_panel(%p)"), (void *)sp));
if (sp)
{
struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 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 *
*/
#include "panel.priv.h"
-MODULE_ID("$Id: p_below.c,v 1.8 2010/01/23 21:22:15 tom Exp $")
+MODULE_ID("$Id: p_below.c,v 1.9 2012/03/10 23:43:41 tom Exp $")
#if NCURSES_SP_FUNCS
NCURSES_EXPORT(PANEL *)
ceiling_panel(SCREEN * sp)
{
- T((T_CALLED("ceiling_panel(%p)"), sp));
+ T((T_CALLED("ceiling_panel(%p)"), (void *)sp));
if (sp)
{
struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
#include "termsort.c" /* this C file is generated */
#include <parametrized.h> /* so is this */
-MODULE_ID("$Id: dump_entry.c,v 1.98 2012/02/29 01:04:17 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.99 2012/03/10 23:20:35 tom Exp $")
#define INDENT 8
#define DISCARD(string) string = ABSENT_STRING
if (ch == '\n') {
;
} else if (isspace(UChar(ch))) {
- outbuf.used = j;
+ outbuf.used = (size_t) j;
} else if (!infodump && ch == '\\') {
- outbuf.used = j;
+ outbuf.used = (size_t) j;
} else if (ch == delim && (j == 0 || outbuf.text[j - 1] != '\\')) {
- outbuf.used = (j + 1);
+ outbuf.used = (size_t) (j + 1);
} else {
break;
}
#include <dump_entry.h>
-MODULE_ID("$Id: infocmp.c,v 1.112 2012/02/22 23:59:53 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.114 2012/03/11 00:10:57 tom Exp $")
#define L_CURL "{"
#define R_CURL "}"
if (VALID_STRING(term->Strings[n])) {
tp = buf;
+#define TP_LIMIT ((MAX_STRING - 5) - (size_t)(tp - buf))
*tp++ = '"';
for (sp = term->Strings[n];
- *sp != 0 && (tp - buf) < MAX_STRING - 6;
+ *sp != 0 && TP_LIMIT > 2;
sp++) {
if (isascii(UChar(*sp))
&& isprint(UChar(*sp))
&& *sp != '"')
*tp++ = *sp;
else {
- _nc_SPRINTF(tp, _nc_SLIMIT(MAX_STRING) "\\%03o", UChar(*sp));
+ _nc_SPRINTF(tp, _nc_SLIMIT(TP_LIMIT) "\\%03o", UChar(*sp));
tp += 4;
}
}
#include <hashed_db.h>
#endif
-MODULE_ID("$Id: toe.c,v 1.66 2012/02/22 23:57:44 tom Exp $")
+MODULE_ID("$Id: toe.c,v 1.67 2012/03/10 23:22:21 tom Exp $")
#define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
unsigned i;
for (i = 0; i < NUM_BOOLEANS(tp); i++) {
- result += (tp->Booleans[i]);
+ result += (unsigned long) (tp->Booleans[i]);
}
for (i = 0; i < NUM_NUMBERS(tp); i++) {
- result += (tp->Numbers[i]);
+ result += (unsigned long) (tp->Numbers[i]);
}
for (i = 0; i < NUM_STRINGS(tp); i++) {
result += string_sum(tp->Strings[i]);