From: Thomas E. Dickey Date: Sun, 25 Oct 2009 01:06:00 +0000 (+0000) Subject: ncurses 5.7 - patch 20091024 X-Git-Tag: v5.8~65 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=3a0d9d27e0cf115ff9dcc6163c251bccaa62bd7d ncurses 5.7 - patch 20091024 + quiet some pedantic gcc warnings. + modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a SIGWINCH, and discard that value, to avoid confusing application (patch by Eygene Ryabinkin, FreeBSD bin/136223). --- diff --git a/NEWS b/NEWS index f79ffccc..b807da14 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1450 2009/10/17 12:41:17 tom Exp $ +-- $Id: NEWS,v 1.1452 2009/10/24 20:34:42 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,12 @@ 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. +20091024 + + quiet some pedantic gcc warnings. + + modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a + SIGWINCH, and discard that value, to avoid confusing application + (patch by Eygene Ryabinkin, FreeBSD bin/136223). + 20091017 + modify handling of $PKG_CONFIG_LIBDIR to use only the first item in a possibly colon-separated list (Debian #550716). diff --git a/dist.mk b/dist.mk index bf7f5542..9352670e 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.726 2009/10/17 11:31:45 tom Exp $ +# $Id: dist.mk,v 1.727 2009/10/24 17:18:03 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 = 7 -NCURSES_PATCH = 20091017 +NCURSES_PATCH = 20091024 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/form/frm_driver.c b/form/frm_driver.c index 4847149e..1ee4c796 100644 --- a/form/frm_driver.c +++ b/form/frm_driver.c @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_driver.c,v 1.91 2009/10/10 16:17:01 tom Exp $") +MODULE_ID("$Id: frm_driver.c,v 1.93 2009/10/24 23:23:32 tom Exp $") /*---------------------------------------------------------------------------- This is the core module of the form library. It contains the majority @@ -663,7 +663,7 @@ Field_Grown(FIELD *field, int amount) result = TRUE; /* allow sharing of recovery on failure */ - T((T_CREATE("fieldcell %p"), newbuf)); + T((T_CREATE("fieldcell %p"), (void *)newbuf)); field->buf = newbuf; for (i = 0; i <= field->nbuf; i++) { @@ -752,7 +752,7 @@ Field_Grown(FIELD *field, int amount) static int Field_encloses(FIELD *field, int ry, int rx) { - T((T_CALLED("Field_encloses(%p)"), field)); + T((T_CALLED("Field_encloses(%p)"), (void *)field)); if (field != 0 && field->frow <= ry && (field->frow + field->rows) > ry @@ -825,7 +825,7 @@ _nc_Refresh_Current_Field(FORM *form) WINDOW *formwin; FIELD *field; - T((T_CALLED("_nc_Refresh_Current_Field(%p)"), form)); + T((T_CALLED("_nc_Refresh_Current_Field(%p)"), (void *)form)); if (!form) RETURN(E_BAD_ARGUMENT); @@ -1201,7 +1201,7 @@ _nc_Synchronize_Attributes(FIELD *field) int res = E_OK; WINDOW *formwin; - T((T_CALLED("_nc_Synchronize_Attributes(%p)"), field)); + T((T_CALLED("_nc_Synchronize_Attributes(%p)"), (void *)field)); if (!field) returnCode(E_BAD_ARGUMENT); @@ -1268,7 +1268,7 @@ _nc_Synchronize_Options(FIELD *field, Field_Options newopts) FORM *form; int res = E_OK; - T((T_CALLED("_nc_Synchronize_Options(%p,%#x)"), field, newopts)); + T((T_CALLED("_nc_Synchronize_Options(%p,%#x)"), (void *)field, newopts)); if (!field) returnCode(E_BAD_ARGUMENT); @@ -1369,7 +1369,7 @@ _nc_Set_Current_Field(FORM *form, FIELD *newfield) FIELD *field; WINDOW *new_window; - T((T_CALLED("_nc_Set_Current_Field(%p,%p)"), form, newfield)); + T((T_CALLED("_nc_Set_Current_Field(%p,%p)"), (void *)form, (void *)newfield)); if (!form || !newfield || !form->current || (newfield->form != form)) returnCode(E_BAD_ARGUMENT); @@ -1476,7 +1476,7 @@ IFN_Next_Character(FORM *form) FIELD *field = form->current; int step = myWCWIDTH(form->w, form->currow, form->curcol); - T((T_CALLED("IFN_Next_Character(%p)"), form)); + T((T_CALLED("IFN_Next_Character(%p)"), (void *)form)); if ((form->curcol += step) == field->dcols) { if ((++(form->currow)) == field->drows) @@ -1518,7 +1518,7 @@ IFN_Previous_Character(FORM *form) int amount = myWCWIDTH(form->w, form->currow, form->curcol - 1); int oldcol = form->curcol; - T((T_CALLED("IFN_Previous_Character(%p)"), form)); + T((T_CALLED("IFN_Previous_Character(%p)"), (void *)form)); if ((form->curcol -= amount) < 0) { if ((--(form->currow)) < 0) @@ -1546,7 +1546,7 @@ IFN_Next_Line(FORM *form) { FIELD *field = form->current; - T((T_CALLED("IFN_Next_Line(%p)"), form)); + T((T_CALLED("IFN_Next_Line(%p)"), (void *)form)); if ((++(form->currow)) == field->drows) { #if GROW_IF_NAVIGATE @@ -1572,7 +1572,7 @@ IFN_Next_Line(FORM *form) static int IFN_Previous_Line(FORM *form) { - T((T_CALLED("IFN_Previous_Line(%p)"), form)); + T((T_CALLED("IFN_Previous_Line(%p)"), (void *)form)); if ((--(form->currow)) < 0) { form->currow++; @@ -1599,7 +1599,7 @@ IFN_Next_Word(FORM *form) FIELD_CELL *s; FIELD_CELL *t; - T((T_CALLED("IFN_Next_Word(%p)"), form)); + T((T_CALLED("IFN_Next_Word(%p)"), (void *)form)); /* We really need access to the data, so we have to synchronize */ Synchronize_Buffer(form); @@ -1642,7 +1642,7 @@ IFN_Previous_Word(FORM *form) FIELD_CELL *t; bool again = FALSE; - T((T_CALLED("IFN_Previous_Word(%p)"), form)); + T((T_CALLED("IFN_Previous_Word(%p)"), (void *)form)); /* We really need access to the data, so we have to synchronize */ Synchronize_Buffer(form); @@ -1692,7 +1692,7 @@ IFN_Beginning_Of_Field(FORM *form) { FIELD *field = form->current; - T((T_CALLED("IFN_Beginning_Of_Field(%p)"), form)); + T((T_CALLED("IFN_Beginning_Of_Field(%p)"), (void *)form)); Synchronize_Buffer(form); Adjust_Cursor_Position(form, Get_Start_Of_Data(field->buf, Buffer_Length(field))); @@ -1716,7 +1716,7 @@ IFN_End_Of_Field(FORM *form) FIELD *field = form->current; FIELD_CELL *pos; - T((T_CALLED("IFN_End_Of_Field(%p)"), form)); + T((T_CALLED("IFN_End_Of_Field(%p)"), (void *)form)); Synchronize_Buffer(form); pos = After_End_Of_Data(field->buf, Buffer_Length(field)); if (pos == (field->buf + Buffer_Length(field))) @@ -1739,7 +1739,7 @@ IFN_Beginning_Of_Line(FORM *form) { FIELD *field = form->current; - T((T_CALLED("IFN_Beginning_Of_Line(%p)"), form)); + T((T_CALLED("IFN_Beginning_Of_Line(%p)"), (void *)form)); Synchronize_Buffer(form); Adjust_Cursor_Position(form, Get_Start_Of_Data(Address_Of_Current_Row_In_Buffer(form), @@ -1765,7 +1765,7 @@ IFN_End_Of_Line(FORM *form) FIELD_CELL *pos; FIELD_CELL *bp; - T((T_CALLED("IFN_End_Of_Line(%p)"), form)); + T((T_CALLED("IFN_End_Of_Line(%p)"), (void *)form)); Synchronize_Buffer(form); bp = Address_Of_Current_Row_In_Buffer(form); pos = After_End_Of_Data(bp, field->dcols); @@ -1791,7 +1791,7 @@ IFN_Left_Character(FORM *form) int amount = myWCWIDTH(form->w, form->currow, form->curcol - 1); int oldcol = form->curcol; - T((T_CALLED("IFN_Left_Character(%p)"), form)); + T((T_CALLED("IFN_Left_Character(%p)"), (void *)form)); if ((form->curcol -= amount) < 0) { form->curcol = oldcol; @@ -1816,7 +1816,7 @@ IFN_Right_Character(FORM *form) int amount = myWCWIDTH(form->w, form->currow, form->curcol); int oldcol = form->curcol; - T((T_CALLED("IFN_Right_Character(%p)"), form)); + T((T_CALLED("IFN_Right_Character(%p)"), (void *)form)); if ((form->curcol += amount) >= form->current->dcols) { #if GROW_IF_NAVIGATE @@ -1844,7 +1844,7 @@ IFN_Right_Character(FORM *form) static int IFN_Up_Character(FORM *form) { - T((T_CALLED("IFN_Up_Character(%p)"), form)); + T((T_CALLED("IFN_Up_Character(%p)"), (void *)form)); if ((--(form->currow)) < 0) { form->currow++; @@ -1868,7 +1868,7 @@ IFN_Down_Character(FORM *form) { FIELD *field = form->current; - T((T_CALLED("IFN_Down_Character(%p)"), form)); + T((T_CALLED("IFN_Down_Character(%p)"), (void *)form)); if ((++(form->currow)) == field->drows) { #if GROW_IF_NAVIGATE @@ -1977,7 +1977,7 @@ Vertical_Scrolling(int (*const fct) (FORM *), FORM *form) static int VSC_Scroll_Line_Forward(FORM *form) { - T((T_CALLED("VSC_Scroll_Line_Forward(%p)"), form)); + T((T_CALLED("VSC_Scroll_Line_Forward(%p)"), (void *)form)); returnCode(VSC_Generic(form, 1)); } @@ -1993,7 +1993,7 @@ VSC_Scroll_Line_Forward(FORM *form) static int VSC_Scroll_Line_Backward(FORM *form) { - T((T_CALLED("VSC_Scroll_Line_Backward(%p)"), form)); + T((T_CALLED("VSC_Scroll_Line_Backward(%p)"), (void *)form)); returnCode(VSC_Generic(form, -1)); } @@ -2009,7 +2009,7 @@ VSC_Scroll_Line_Backward(FORM *form) static int VSC_Scroll_Page_Forward(FORM *form) { - T((T_CALLED("VSC_Scroll_Page_Forward(%p)"), form)); + T((T_CALLED("VSC_Scroll_Page_Forward(%p)"), (void *)form)); returnCode(VSC_Generic(form, form->current->rows)); } @@ -2025,7 +2025,7 @@ VSC_Scroll_Page_Forward(FORM *form) static int VSC_Scroll_Half_Page_Forward(FORM *form) { - T((T_CALLED("VSC_Scroll_Half_Page_Forward(%p)"), form)); + T((T_CALLED("VSC_Scroll_Half_Page_Forward(%p)"), (void *)form)); returnCode(VSC_Generic(form, (form->current->rows + 1) / 2)); } @@ -2041,7 +2041,7 @@ VSC_Scroll_Half_Page_Forward(FORM *form) static int VSC_Scroll_Page_Backward(FORM *form) { - T((T_CALLED("VSC_Scroll_Page_Backward(%p)"), form)); + T((T_CALLED("VSC_Scroll_Page_Backward(%p)"), (void *)form)); returnCode(VSC_Generic(form, -(form->current->rows))); } @@ -2057,7 +2057,7 @@ VSC_Scroll_Page_Backward(FORM *form) static int VSC_Scroll_Half_Page_Backward(FORM *form) { - T((T_CALLED("VSC_Scroll_Half_Page_Backward(%p)"), form)); + T((T_CALLED("VSC_Scroll_Half_Page_Backward(%p)"), (void *)form)); returnCode(VSC_Generic(form, -((form->current->rows + 1) / 2))); } /*---------------------------------------------------------------------------- @@ -2151,7 +2151,7 @@ Horizontal_Scrolling(int (*const fct) (FORM *), FORM *form) static int HSC_Scroll_Char_Forward(FORM *form) { - T((T_CALLED("HSC_Scroll_Char_Forward(%p)"), form)); + T((T_CALLED("HSC_Scroll_Char_Forward(%p)"), (void *)form)); returnCode(HSC_Generic(form, 1)); } @@ -2167,7 +2167,7 @@ HSC_Scroll_Char_Forward(FORM *form) static int HSC_Scroll_Char_Backward(FORM *form) { - T((T_CALLED("HSC_Scroll_Char_Backward(%p)"), form)); + T((T_CALLED("HSC_Scroll_Char_Backward(%p)"), (void *)form)); returnCode(HSC_Generic(form, -1)); } @@ -2183,7 +2183,7 @@ HSC_Scroll_Char_Backward(FORM *form) static int HSC_Horizontal_Line_Forward(FORM *form) { - T((T_CALLED("HSC_Horizontal_Line_Forward(%p)"), form)); + T((T_CALLED("HSC_Horizontal_Line_Forward(%p)"), (void *)form)); returnCode(HSC_Generic(form, form->current->cols)); } @@ -2199,7 +2199,7 @@ HSC_Horizontal_Line_Forward(FORM *form) static int HSC_Horizontal_Half_Line_Forward(FORM *form) { - T((T_CALLED("HSC_Horizontal_Half_Line_Forward(%p)"), form)); + T((T_CALLED("HSC_Horizontal_Half_Line_Forward(%p)"), (void *)form)); returnCode(HSC_Generic(form, (form->current->cols + 1) / 2)); } @@ -2215,7 +2215,7 @@ HSC_Horizontal_Half_Line_Forward(FORM *form) static int HSC_Horizontal_Line_Backward(FORM *form) { - T((T_CALLED("HSC_Horizontal_Line_Backward(%p)"), form)); + T((T_CALLED("HSC_Horizontal_Line_Backward(%p)"), (void *)form)); returnCode(HSC_Generic(form, -(form->current->cols))); } @@ -2231,7 +2231,7 @@ HSC_Horizontal_Line_Backward(FORM *form) static int HSC_Horizontal_Half_Line_Backward(FORM *form) { - T((T_CALLED("HSC_Horizontal_Half_Line_Backward(%p)"), form)); + T((T_CALLED("HSC_Horizontal_Half_Line_Backward(%p)"), (void *)form)); returnCode(HSC_Generic(form, -((form->current->cols + 1) / 2))); } @@ -2527,7 +2527,7 @@ FE_New_Line(FORM *form) FIELD_CELL *bp, *t; bool Last_Row = ((field->drows - 1) == form->currow); - T((T_CALLED("FE_New_Line(%p)"), form)); + T((T_CALLED("FE_New_Line(%p)"), (void *)form)); if (form->status & _OVLMODE) { if (Last_Row && @@ -2610,7 +2610,7 @@ FE_Insert_Character(FORM *form) FIELD *field = form->current; int result = E_REQUEST_DENIED; - T((T_CALLED("FE_Insert_Character(%p)"), form)); + T((T_CALLED("FE_Insert_Character(%p)"), (void *)form)); if (Check_Char(field->type, (int)C_BLANK, (TypeArgument *)(field->arg))) { bool There_Is_Room = Is_There_Room_For_A_Char_In_Line(form); @@ -2645,7 +2645,7 @@ FE_Insert_Line(FORM *form) FIELD *field = form->current; int result = E_REQUEST_DENIED; - T((T_CALLED("FE_Insert_Line(%p)"), form)); + T((T_CALLED("FE_Insert_Line(%p)"), (void *)form)); if (Check_Char(field->type, (int)C_BLANK, (TypeArgument *)(field->arg))) { bool Maybe_Done = (form->currow != (field->drows - 1)) && @@ -2678,7 +2678,7 @@ FE_Insert_Line(FORM *form) static int FE_Delete_Character(FORM *form) { - T((T_CALLED("FE_Delete_Character(%p)"), form)); + T((T_CALLED("FE_Delete_Character(%p)"), (void *)form)); DeleteChar(form); returnCode(E_OK); } @@ -2701,7 +2701,7 @@ FE_Delete_Previous(FORM *form) { FIELD *field = form->current; - T((T_CALLED("FE_Delete_Previous(%p)"), form)); + T((T_CALLED("FE_Delete_Previous(%p)"), (void *)form)); if (First_Position_In_Current_Field(form)) returnCode(E_REQUEST_DENIED); @@ -2769,7 +2769,7 @@ FE_Delete_Previous(FORM *form) static int FE_Delete_Line(FORM *form) { - T((T_CALLED("FE_Delete_Line(%p)"), form)); + T((T_CALLED("FE_Delete_Line(%p)"), (void *)form)); form->curcol = 0; wdeleteln(form->w); returnCode(E_OK); @@ -2793,7 +2793,7 @@ FE_Delete_Word(FORM *form) FIELD_CELL *cp = bp + form->curcol; FIELD_CELL *s; - T((T_CALLED("FE_Delete_Word(%p)"), form)); + T((T_CALLED("FE_Delete_Word(%p)"), (void *)form)); Synchronize_Buffer(form); if (ISBLANK(*cp)) returnCode(E_REQUEST_DENIED); /* not in word */ @@ -2827,7 +2827,7 @@ FE_Delete_Word(FORM *form) static int FE_Clear_To_End_Of_Line(FORM *form) { - T((T_CALLED("FE_Clear_To_End_Of_Line(%p)"), form)); + T((T_CALLED("FE_Clear_To_End_Of_Line(%p)"), (void *)form)); wmove(form->w, form->currow, form->curcol); wclrtoeol(form->w); returnCode(E_OK); @@ -2844,7 +2844,7 @@ FE_Clear_To_End_Of_Line(FORM *form) static int FE_Clear_To_End_Of_Field(FORM *form) { - T((T_CALLED("FE_Clear_To_End_Of_Field(%p)"), form)); + T((T_CALLED("FE_Clear_To_End_Of_Field(%p)"), (void *)form)); wmove(form->w, form->currow, form->curcol); wclrtobot(form->w); returnCode(E_OK); @@ -2861,7 +2861,7 @@ FE_Clear_To_End_Of_Field(FORM *form) static int FE_Clear_Field(FORM *form) { - T((T_CALLED("FE_Clear_Field(%p)"), form)); + T((T_CALLED("FE_Clear_Field(%p)"), (void *)form)); form->currow = form->curcol = 0; werase(form->w); returnCode(E_OK); @@ -2885,7 +2885,7 @@ FE_Clear_Field(FORM *form) static int EM_Overlay_Mode(FORM *form) { - T((T_CALLED("EM_Overlay_Mode(%p)"), form)); + T((T_CALLED("EM_Overlay_Mode(%p)"), (void *)form)); form->status |= _OVLMODE; returnCode(E_OK); } @@ -2901,7 +2901,7 @@ EM_Overlay_Mode(FORM *form) static int EM_Insert_Mode(FORM *form) { - T((T_CALLED("EM_Insert_Mode(%p)"), form)); + T((T_CALLED("EM_Insert_Mode(%p)"), (void *)form)); form->status &= ~_OVLMODE; returnCode(E_OK); } @@ -3001,7 +3001,7 @@ CR_Next_Choice(FORM *form) { FIELD *field = form->current; - T((T_CALLED("CR_Next_Choice(%p)"), form)); + T((T_CALLED("CR_Next_Choice(%p)"), (void *)form)); Synchronize_Buffer(form); returnCode((Next_Choice(field->type, field, (TypeArgument *)(field->arg))) ? E_OK @@ -3022,7 +3022,7 @@ CR_Previous_Choice(FORM *form) { FIELD *field = form->current; - T((T_CALLED("CR_Previous_Choice(%p)"), form)); + T((T_CALLED("CR_Previous_Choice(%p)"), (void *)form)); Synchronize_Buffer(form); returnCode((Previous_Choice(field->type, field, (TypeArgument *)(field->arg))) ? E_OK @@ -3132,7 +3132,7 @@ _nc_Internal_Validation(FORM *form) static int FV_Validation(FORM *form) { - T((T_CALLED("FV_Validation(%p)"), form)); + T((T_CALLED("FV_Validation(%p)"), (void *)form)); if (_nc_Internal_Validation(form)) returnCode(E_OK); else @@ -3510,7 +3510,7 @@ Inter_Field_Navigation(int (*const fct) (FORM *), FORM *form) static int FN_Next_Field(FORM *form) { - T((T_CALLED("FN_Next_Field(%p)"), form)); + T((T_CALLED("FN_Next_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Next_Field_On_Page(form->current))); } @@ -3528,7 +3528,7 @@ FN_Next_Field(FORM *form) static int FN_Previous_Field(FORM *form) { - T((T_CALLED("FN_Previous_Field(%p)"), form)); + T((T_CALLED("FN_Previous_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Previous_Field_On_Page(form->current))); } @@ -3545,7 +3545,7 @@ FN_Previous_Field(FORM *form) static int FN_First_Field(FORM *form) { - T((T_CALLED("FN_First_Field(%p)"), form)); + T((T_CALLED("FN_First_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Next_Field_On_Page(form->field[form->page[form->curpage].pmax]))); } @@ -3562,7 +3562,7 @@ FN_First_Field(FORM *form) static int FN_Last_Field(FORM *form) { - T((T_CALLED("FN_Last_Field(%p)"), form)); + T((T_CALLED("FN_Last_Field(%p)"), (void *)form)); returnCode( _nc_Set_Current_Field(form, Previous_Field_On_Page(form->field[form->page[form->curpage].pmin]))); @@ -3581,7 +3581,7 @@ FN_Last_Field(FORM *form) static int FN_Sorted_Next_Field(FORM *form) { - T((T_CALLED("FN_Sorted_Next_Field(%p)"), form)); + T((T_CALLED("FN_Sorted_Next_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Sorted_Next_Field(form->current))); } @@ -3599,7 +3599,7 @@ FN_Sorted_Next_Field(FORM *form) static int FN_Sorted_Previous_Field(FORM *form) { - T((T_CALLED("FN_Sorted_Previous_Field(%p)"), form)); + T((T_CALLED("FN_Sorted_Previous_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Sorted_Previous_Field(form->current))); } @@ -3617,7 +3617,7 @@ FN_Sorted_Previous_Field(FORM *form) static int FN_Sorted_First_Field(FORM *form) { - T((T_CALLED("FN_Sorted_First_Field(%p)"), form)); + T((T_CALLED("FN_Sorted_First_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Sorted_Next_Field(form->field[form->page[form->curpage].smax]))); } @@ -3635,7 +3635,7 @@ FN_Sorted_First_Field(FORM *form) static int FN_Sorted_Last_Field(FORM *form) { - T((T_CALLED("FN_Sorted_Last_Field(%p)"), form)); + T((T_CALLED("FN_Sorted_Last_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Sorted_Previous_Field(form->field[form->page[form->curpage].smin]))); } @@ -3653,7 +3653,7 @@ FN_Sorted_Last_Field(FORM *form) static int FN_Left_Field(FORM *form) { - T((T_CALLED("FN_Left_Field(%p)"), form)); + T((T_CALLED("FN_Left_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Left_Neighbor_Field(form->current))); } @@ -3671,7 +3671,7 @@ FN_Left_Field(FORM *form) static int FN_Right_Field(FORM *form) { - T((T_CALLED("FN_Right_Field(%p)"), form)); + T((T_CALLED("FN_Right_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Right_Neighbor_Field(form->current))); } @@ -3691,7 +3691,7 @@ FN_Right_Field(FORM *form) static int FN_Up_Field(FORM *form) { - T((T_CALLED("FN_Up_Field(%p)"), form)); + T((T_CALLED("FN_Up_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Upper_Neighbor_Field(form->current))); } @@ -3711,7 +3711,7 @@ FN_Up_Field(FORM *form) static int FN_Down_Field(FORM *form) { - T((T_CALLED("FN_Down_Field(%p)"), form)); + T((T_CALLED("FN_Down_Field(%p)"), (void *)form)); returnCode(_nc_Set_Current_Field(form, Down_Neighbor_Field(form->current))); } @@ -3855,7 +3855,7 @@ Page_Navigation(int (*const fct) (FORM *), FORM *form) static int PN_Next_Page(FORM *form) { - T((T_CALLED("PN_Next_Page(%p)"), form)); + T((T_CALLED("PN_Next_Page(%p)"), (void *)form)); returnCode(_nc_Set_Form_Page(form, Next_Page_Number(form), (FIELD *)0)); } @@ -3871,7 +3871,7 @@ PN_Next_Page(FORM *form) static int PN_Previous_Page(FORM *form) { - T((T_CALLED("PN_Previous_Page(%p)"), form)); + T((T_CALLED("PN_Previous_Page(%p)"), (void *)form)); returnCode(_nc_Set_Form_Page(form, Previous_Page_Number(form), (FIELD *)0)); } @@ -3887,7 +3887,7 @@ PN_Previous_Page(FORM *form) static int PN_First_Page(FORM *form) { - T((T_CALLED("PN_First_Page(%p)"), form)); + T((T_CALLED("PN_First_Page(%p)"), (void *)form)); returnCode(_nc_Set_Form_Page(form, 0, (FIELD *)0)); } @@ -3903,7 +3903,7 @@ PN_First_Page(FORM *form) static int PN_Last_Page(FORM *form) { - T((T_CALLED("PN_Last_Page(%p)"), form)); + T((T_CALLED("PN_Last_Page(%p)"), (void *)form)); returnCode(_nc_Set_Form_Page(form, form->maxpage - 1, (FIELD *)0)); } @@ -3932,7 +3932,7 @@ Data_Entry(FORM *form, int c) FIELD *field = form->current; int result = E_REQUEST_DENIED; - T((T_CALLED("Data_Entry(%p,%s)"), form, _tracechtype((chtype)c))); + T((T_CALLED("Data_Entry(%p,%s)"), (void *)form, _tracechtype((chtype)c))); if ((field->opts & O_EDIT) #if FIX_FORM_INACTIVE_BUG && (field->opts & O_ACTIVE) @@ -4133,7 +4133,7 @@ form_driver(FORM *form, int c) const Binding_Info *BI = (Binding_Info *) 0; int res = E_UNKNOWN_COMMAND; - T((T_CALLED("form_driver(%p,%d)"), form, c)); + T((T_CALLED("form_driver(%p,%d)"), (void *)form, c)); if (!form) RETURN(E_BAD_ARGUMENT); @@ -4330,7 +4330,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value) FIELD_CELL *widevalue = 0; #endif - T((T_CALLED("set_field_buffer(%p,%d,%s)"), field, buffer, _nc_visbuf(value))); + T((T_CALLED("set_field_buffer(%p,%d,%s)"), (void *)field, buffer, _nc_visbuf(value))); if (!field || !value || ((buffer < 0) || (buffer > field->nbuf))) RETURN(E_BAD_ARGUMENT); @@ -4438,7 +4438,7 @@ field_buffer(const FIELD *field, int buffer) { char *result = 0; - T((T_CALLED("field_buffer(%p,%d)"), field, buffer)); + T((T_CALLED("field_buffer(%p,%d)"), (const void *)field, buffer)); if (field && (buffer >= 0) && (buffer <= field->nbuf)) { @@ -4484,22 +4484,6 @@ field_buffer(const FIELD *field, int buffer) #if USE_WIDEC_SUPPORT -/* FIXME: see lib_get_wch.c */ -#if HAVE_MBTOWC && HAVE_MBLEN -#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0) -#define count_mbytes(buffer,length,state) mblen(buffer,length) -#define trans_mbytes(wch,buffer,length,state) \ - (int) mbtowc(&wch, buffer, length) -#elif HAVE_MBRTOWC && HAVE_MBRLEN -#define NEED_STATE -#define reset_mbytes(state) init_mb(state) -#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state) -#define trans_mbytes(wch,buffer,length,state) \ - (int) mbrtowc(&wch, buffer, length, &state) -#else -make an error -#endif - /*--------------------------------------------------------------------------- | Convert a multibyte string to a wide-character string. The result must be | freed by the caller. @@ -4514,7 +4498,7 @@ _nc_Widen_String(char *source, int *lengthp) int pass; int status; -#ifdef NEED_STATE +#ifndef state_unused mbstate_t state; #endif @@ -4533,7 +4517,7 @@ _nc_Widen_String(char *source, int *lengthp) source[passed + tries] = 0; reset_mbytes(state); - status = trans_mbytes(wch, source + passed, tries, state); + status = check_mbytes(wch, source + passed, tries, state); source[passed + tries] = (char)save; if (status > 0) diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh index 3171ed3f..4f3d38e3 100755 --- a/ncurses/base/MKlib_gen.sh +++ b/ncurses/base/MKlib_gen.sh @@ -2,10 +2,10 @@ # # MKlib_gen.sh -- generate sources from curses.h macro definitions # -# ($Id: MKlib_gen.sh,v 1.35 2008/11/16 00:19:59 juergen Exp $) +# ($Id: MKlib_gen.sh,v 1.36 2009/10/24 20:34:05 tom Exp $) # ############################################################################## -# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. # +# Copyright (c) 1998-2008,2009 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 "Software"), # @@ -289,8 +289,10 @@ $0 !~ /^P_/ { call = call "%s" comma = comma "_nc_visbuf2(" num "," pointer = 0; - } else + } else { call = call "%p" + comma = comma "(const void *)" + } } else if (argcount != 0) { if ( argtype == "int" || argtype == "short" ) { call = call "%d" diff --git a/ncurses/base/define_key.c b/ncurses/base/define_key.c index d2ebd6ef..5fdce79f 100644 --- a/ncurses/base/define_key.c +++ b/ncurses/base/define_key.c @@ -33,14 +33,14 @@ #include -MODULE_ID("$Id: define_key.c,v 1.17 2009/05/09 18:30:16 tom Exp $") +MODULE_ID("$Id: define_key.c,v 1.18 2009/10/24 22:15:47 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(define_key) (NCURSES_SP_DCLx const char *str, int keycode) { int code = ERR; - T((T_CALLED("define_key(%p, %s,%d)"), SP_PARM, _nc_visbuf(str), keycode)); + T((T_CALLED("define_key(%p, %s,%d)"), (void *) SP_PARM, _nc_visbuf(str), keycode)); if (SP_PARM == 0 || !HasTInfoTerminal(SP_PARM)) { code = ERR; } else if (keycode > 0) { diff --git a/ncurses/base/key_defined.c b/ncurses/base/key_defined.c index f8f23466..ef987a54 100644 --- a/ncurses/base/key_defined.c +++ b/ncurses/base/key_defined.c @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: key_defined.c,v 1.8 2009/02/21 16:24:26 tom Exp $") +MODULE_ID("$Id: key_defined.c,v 1.9 2009/10/24 22:15:47 tom Exp $") static int find_definition(TRIES * tree, const char *str) @@ -69,7 +69,7 @@ NCURSES_SP_NAME(key_defined) (NCURSES_SP_DCLx const char *str) { int code = ERR; - T((T_CALLED("key_defined(%p, %s)"), SP_PARM, _nc_visbuf(str))); + T((T_CALLED("key_defined(%p, %s)"), (void *) SP_PARM, _nc_visbuf(str))); if (SP_PARM != 0 && str != 0) { code = find_definition(SP_PARM->_keytry, str); } diff --git a/ncurses/base/keybound.c b/ncurses/base/keybound.c index 70936359..65e6bfc6 100644 --- a/ncurses/base/keybound.c +++ b/ncurses/base/keybound.c @@ -33,7 +33,7 @@ #include -MODULE_ID("$Id: keybound.c,v 1.9 2009/02/21 16:32:34 tom Exp $") +MODULE_ID("$Id: keybound.c,v 1.10 2009/10/24 22:15:47 tom Exp $") /* * Returns the count'th string definition which is associated with the @@ -44,7 +44,7 @@ NCURSES_SP_NAME(keybound) (NCURSES_SP_DCLx int code, int count) { char *result = 0; - T((T_CALLED("keybound(%p, %d,%d)"), SP_PARM, code, count)); + T((T_CALLED("keybound(%p, %d,%d)"), (void *) SP_PARM, code, count)); if (SP_PARM != 0 && code >= 0) { result = _nc_expand_try(SP_PARM->_keytry, (unsigned) code, &count, 0); } diff --git a/ncurses/base/keyok.c b/ncurses/base/keyok.c index ed00ba75..0eacf492 100644 --- a/ncurses/base/keyok.c +++ b/ncurses/base/keyok.c @@ -33,7 +33,7 @@ #include -MODULE_ID("$Id: keyok.c,v 1.9 2009/06/06 19:24:57 tom Exp $") +MODULE_ID("$Id: keyok.c,v 1.10 2009/10/24 22:15:47 tom Exp $") /* * Enable (or disable) ncurses' interpretation of a keycode by adding (or @@ -50,7 +50,7 @@ NCURSES_SP_NAME(keyok) (NCURSES_SP_DCLx int c, bool flag) { int code = ERR; - T((T_CALLED("keyok(%p, %d,%d)"), SP_PARM, c, flag)); + T((T_CALLED("keyok(%p, %d,%d)"), (void *) SP_PARM, c, flag)); #ifdef USE_TERM_DRIVER code = CallDriver_2(sp, kyOk, c, flag); #else diff --git a/ncurses/base/legacy_coding.c b/ncurses/base/legacy_coding.c index b347cea7..d8c80208 100644 --- a/ncurses/base/legacy_coding.c +++ b/ncurses/base/legacy_coding.c @@ -33,14 +33,14 @@ #include -MODULE_ID("$Id: legacy_coding.c,v 1.4 2009/02/21 16:16:38 tom Exp $") +MODULE_ID("$Id: legacy_coding.c,v 1.5 2009/10/24 22:15:00 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (NCURSES_SP_DCLx int level) { int result = ERR; - T((T_CALLED("use_legacy_coding(%p,%d)"), SP_PARM, level)); + T((T_CALLED("use_legacy_coding(%p,%d)"), (void *) SP_PARM, level)); if (level >= 0 && level <= 2 && SP_PARM != 0) { result = SP_PARM->_legacy_coding; SP_PARM->_legacy_coding = level; diff --git a/ncurses/base/lib_addch.c b/ncurses/base/lib_addch.c index 27a1fb0f..e104e108 100644 --- a/ncurses/base/lib_addch.c +++ b/ncurses/base/lib_addch.c @@ -36,7 +36,7 @@ #include #include -MODULE_ID("$Id: lib_addch.c,v 1.121 2009/08/04 00:20:09 tom Exp $") +MODULE_ID("$Id: lib_addch.c,v 1.122 2009/10/24 22:49:16 tom Exp $") static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); @@ -539,7 +539,7 @@ waddch(WINDOW *win, const chtype ch) NCURSES_CH_T wch; SetChar2(wch, ch); - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("waddch(%p, %s)"), win, + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("waddch(%p, %s)"), (void *) win, _tracechtype(ch))); if (win && (waddch_nosync(win, wch) != ERR)) { @@ -558,7 +558,8 @@ wechochar(WINDOW *win, const chtype ch) NCURSES_CH_T wch; SetChar2(wch, ch); - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), win, + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), + (void *) win, _tracechtype(ch))); if (win && (waddch_nosync(win, wch) != ERR)) { diff --git a/ncurses/base/lib_addstr.c b/ncurses/base/lib_addstr.c index 4e3a040c..d8190e45 100644 --- a/ncurses/base/lib_addstr.c +++ b/ncurses/base/lib_addstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2009 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 * @@ -44,7 +44,7 @@ #include -MODULE_ID("$Id: lib_addstr.c,v 1.48 2007/10/13 19:56:57 tom Exp $") +MODULE_ID("$Id: lib_addstr.c,v 1.50 2009/10/24 23:24:03 tom Exp $") NCURSES_EXPORT(int) waddnstr(WINDOW *win, const char *astr, int n) @@ -52,7 +52,7 @@ waddnstr(WINDOW *win, const char *astr, int n) const char *str = astr; int code = ERR; - T((T_CALLED("waddnstr(%p,%s,%d)"), win, _nc_visbufn(astr, n), n)); + T((T_CALLED("waddnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(astr, n), n)); if (win && (str != 0)) { TR(TRACE_VIRTPUT | TRACE_ATTRS, @@ -85,7 +85,7 @@ waddchnstr(WINDOW *win, const chtype *astr, int n) int i; struct ldat *line; - T((T_CALLED("waddchnstr(%p,%p,%d)"), win, astr, n)); + T((T_CALLED("waddchnstr(%p,%p,%d)"), (void *) win, (const void *) astr, n)); if (!win) returnCode(ERR); @@ -135,7 +135,10 @@ wadd_wchnstr(WINDOW *win, const cchar_t *astr, int n) struct ldat *line; int i, j, start, len, end; - T((T_CALLED("wadd_wchnstr(%p,%s,%d)"), win, _nc_viscbuf(astr, n), n)); + T((T_CALLED("wadd_wchnstr(%p,%s,%d)"), + (void *) win, + _nc_viscbuf(astr, n), + n)); if (!win) returnCode(ERR); @@ -217,7 +220,7 @@ waddnwstr(WINDOW *win, const wchar_t *str, int n) { int code = ERR; - T((T_CALLED("waddnwstr(%p,%s,%d)"), win, _nc_viswbufn(str, n), n)); + T((T_CALLED("waddnwstr(%p,%s,%d)"), (void *) win, _nc_viswbufn(str, n), n)); if (win && (str != 0)) { TR(TRACE_VIRTPUT | TRACE_ATTRS, diff --git a/ncurses/base/lib_beep.c b/ncurses/base/lib_beep.c index 0bad4c16..9d7f7fd9 100644 --- a/ncurses/base/lib_beep.c +++ b/ncurses/base/lib_beep.c @@ -46,7 +46,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_beep.c,v 1.14 2009/05/23 19:33:20 tom Exp $") +MODULE_ID("$Id: lib_beep.c,v 1.15 2009/10/24 22:02:14 tom Exp $") /* * beep() @@ -61,7 +61,7 @@ NCURSES_SP_NAME(beep) (NCURSES_SP_DCL0) { int res = ERR; - T((T_CALLED("beep(%p)"), SP_PARM)); + T((T_CALLED("beep(%p)"), (void *) SP_PARM)); #ifdef USE_TERM_DRIVER if (SP_PARM != 0) diff --git a/ncurses/base/lib_bkgd.c b/ncurses/base/lib_bkgd.c index 306e09b6..f790ee9d 100644 --- a/ncurses/base/lib_bkgd.c +++ b/ncurses/base/lib_bkgd.c @@ -36,7 +36,7 @@ #include -MODULE_ID("$Id: lib_bkgd.c,v 1.37 2009/08/29 19:02:25 tom Exp $") +MODULE_ID("$Id: lib_bkgd.c,v 1.38 2009/10/24 22:02:14 tom Exp $") /* * Set the window's background information. @@ -48,7 +48,7 @@ static NCURSES_INLINE void #endif wbkgrndset(WINDOW *win, const ARG_CH_T ch) { - T((T_CALLED("wbkgdset(%p,%s)"), win, _tracech_t(ch))); + T((T_CALLED("wbkgdset(%p,%s)"), (void *) win, _tracech_t(ch))); if (win) { attr_t off = AttrOf(win->_nc_bkgd); @@ -120,7 +120,7 @@ wbkgrnd(WINDOW *win, const ARG_CH_T ch) int x, y; NCURSES_CH_T new_bkgd = CHDEREF(ch); - T((T_CALLED("wbkgd(%p,%s)"), win, _tracech_t(ch))); + T((T_CALLED("wbkgd(%p,%s)"), (void *) win, _tracech_t(ch))); if (win) { NCURSES_CH_T old_bkgrnd; diff --git a/ncurses/base/lib_box.c b/ncurses/base/lib_box.c index d6cfc6cf..06ae284f 100644 --- a/ncurses/base/lib_box.c +++ b/ncurses/base/lib_box.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2009 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 * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_box.c,v 1.22 2005/11/26 15:39:42 tom Exp $") +MODULE_ID("$Id: lib_box.c,v 1.23 2009/10/24 22:33:46 tom Exp $") #if USE_WIDEC_SUPPORT static NCURSES_INLINE chtype @@ -70,7 +70,7 @@ wborder(WINDOW *win, chtype wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), - win, + (void *) win, _tracechtype2(1, ls), _tracechtype2(2, rs), _tracechtype2(3, ts), diff --git a/ncurses/base/lib_chgat.c b/ncurses/base/lib_chgat.c index 89eefa7e..f8a2bfd8 100644 --- a/ncurses/base/lib_chgat.c +++ b/ncurses/base/lib_chgat.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2009 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 * @@ -42,14 +42,14 @@ #include -MODULE_ID("$Id: lib_chgat.c,v 1.7 2006/07/15 22:07:11 tom Exp $") +MODULE_ID("$Id: lib_chgat.c,v 1.8 2009/10/24 22:33:37 tom Exp $") NCURSES_EXPORT(int) wchgat(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED) { int i; - T((T_CALLED("wchgat(%p,%d,%s,%d)"), win, n, _traceattr(attr), color)); + T((T_CALLED("wchgat(%p,%d,%s,%d)"), (void *) win, n, _traceattr(attr), color)); if (win) { struct ldat *line = &(win->_line[win->_cury]); diff --git a/ncurses/base/lib_clear.c b/ncurses/base/lib_clear.c index e0b4edf9..008744cc 100644 --- a/ncurses/base/lib_clear.c +++ b/ncurses/base/lib_clear.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2009 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 * @@ -40,14 +40,14 @@ #include -MODULE_ID("$Id: lib_clear.c,v 1.7 2000/12/10 02:43:26 tom Exp $") +MODULE_ID("$Id: lib_clear.c,v 1.8 2009/10/24 22:33:29 tom Exp $") NCURSES_EXPORT(int) wclear(WINDOW *win) { int code = ERR; - T((T_CALLED("wclear(%p)"), win)); + T((T_CALLED("wclear(%p)"), (void *) win)); if ((code = werase(win)) != ERR) win->_clear = TRUE; diff --git a/ncurses/base/lib_clearok.c b/ncurses/base/lib_clearok.c index 9b56bd1e..ffc7d02d 100644 --- a/ncurses/base/lib_clearok.c +++ b/ncurses/base/lib_clearok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2009 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 * @@ -40,12 +40,12 @@ #include -MODULE_ID("$Id: lib_clearok.c,v 1.4 2000/12/10 02:43:26 tom Exp $") +MODULE_ID("$Id: lib_clearok.c,v 1.5 2009/10/24 22:34:53 tom Exp $") NCURSES_EXPORT(int) clearok(WINDOW *win, bool flag) { - T((T_CALLED("clearok(%p,%d)"), win, flag)); + T((T_CALLED("clearok(%p,%d)"), (void *) win, flag)); if (win) { win->_clear = flag; diff --git a/ncurses/base/lib_clrbot.c b/ncurses/base/lib_clrbot.c index df196e81..cbf2206d 100644 --- a/ncurses/base/lib_clrbot.c +++ b/ncurses/base/lib_clrbot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2009 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 * @@ -40,14 +40,14 @@ #include -MODULE_ID("$Id: lib_clrbot.c,v 1.20 2006/10/14 20:43:31 tom Exp $") +MODULE_ID("$Id: lib_clrbot.c,v 1.21 2009/10/24 22:33:19 tom Exp $") NCURSES_EXPORT(int) wclrtobot(WINDOW *win) { int code = ERR; - T((T_CALLED("wclrtobot(%p)"), win)); + T((T_CALLED("wclrtobot(%p)"), (void *) win)); if (win) { NCURSES_SIZE_T y; diff --git a/ncurses/base/lib_clreol.c b/ncurses/base/lib_clreol.c index c46ebd93..7aff84b3 100644 --- a/ncurses/base/lib_clreol.c +++ b/ncurses/base/lib_clreol.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2009 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 * @@ -40,14 +40,14 @@ #include -MODULE_ID("$Id: lib_clreol.c,v 1.21 2001/12/19 01:06:04 tom Exp $") +MODULE_ID("$Id: lib_clreol.c,v 1.22 2009/10/24 22:33:06 tom Exp $") NCURSES_EXPORT(int) wclrtoeol(WINDOW *win) { int code = ERR; - T((T_CALLED("wclrtoeol(%p)"), win)); + T((T_CALLED("wclrtoeol(%p)"), (void *) win)); if (win) { NCURSES_CH_T blank; diff --git a/ncurses/base/lib_color.c b/ncurses/base/lib_color.c index 42f5ea7f..1f1e25f3 100644 --- a/ncurses/base/lib_color.c +++ b/ncurses/base/lib_color.c @@ -45,7 +45,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_color.c,v 1.95 2009/08/22 19:04:36 tom Exp $") +MODULE_ID("$Id: lib_color.c,v 1.96 2009/10/24 22:50:51 tom Exp $") #ifdef USE_TERM_DRIVER #define CanChange InfoOf(SP_PARM).canchange @@ -281,7 +281,7 @@ NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_DCL0) { int result = FALSE; - T((T_CALLED("_nc_reset_colors(%p)"), SP_PARM)); + T((T_CALLED("_nc_reset_colors(%p)"), (void *) SP_PARM)); if (SP_PARM->_color_defs > 0) SP_PARM->_color_defs = -(SP_PARM->_color_defs); if (reset_color_pair(NCURSES_SP_ARG)) @@ -313,7 +313,7 @@ NCURSES_SP_NAME(start_color) (NCURSES_SP_DCL0) int result = ERR; int maxpairs = 0, maxcolors = 0; - T((T_CALLED("start_color(%p)"), SP_PARM)); + T((T_CALLED("start_color(%p)"), (void *) SP_PARM)); if (SP_PARM == 0) { result = ERR; @@ -429,7 +429,7 @@ NCURSES_SP_NAME(init_pair) (NCURSES_SP_DCLx short pair, short f, short b) colorpair_t previous; int maxcolors; - T((T_CALLED("init_pair(%p,%d,%d,%d)"), SP_PARM, pair, f, b)); + T((T_CALLED("init_pair(%p,%d,%d,%d)"), (void *) SP_PARM, pair, f, b)); if (!ValidPair(pair)) returnCode(ERR); @@ -572,7 +572,10 @@ NCURSES_SP_NAME(init_color) (NCURSES_SP_DCLx int result = ERR; int maxcolors; - T((T_CALLED("init_color(%p,%d,%d,%d,%d)"), SP_PARM, color, r, g, b)); + T((T_CALLED("init_color(%p,%d,%d,%d,%d)"), + (void *) SP_PARM, + color, + r, g, b)); if (SP_PARM == 0) returnCode(result); @@ -624,7 +627,7 @@ init_color(short color, short r, short g, short b) NCURSES_EXPORT(bool) NCURSES_SP_NAME(can_change_color) (NCURSES_SP_DCL) { - T((T_CALLED("can_change_color(%p)"), SP_PARM)); + T((T_CALLED("can_change_color(%p)"), (void *) SP_PARM)); returnCode((CanChange != 0) ? TRUE : FALSE); } @@ -670,7 +673,12 @@ NCURSES_SP_NAME(color_content) (NCURSES_SP_DCLx int result = ERR; int maxcolors; - T((T_CALLED("color_content(%p,%d,%p,%p,%p)"), SP_PARM, color, r, g, b)); + T((T_CALLED("color_content(%p,%d,%p,%p,%p)"), + (void *) SP_PARM, + color, + (void *) r, + (void *) g, + (void *) b)); if (SP_PARM == 0) returnCode(result); @@ -712,7 +720,11 @@ NCURSES_SP_NAME(pair_content) (NCURSES_SP_DCLx { int result; - T((T_CALLED("pair_content(%p,%d,%p,%p)"), SP_PARM, pair, f, b)); + T((T_CALLED("pair_content(%p,%d,%p,%p)"), + (void *) SP_PARM, + pair, + (void *) f, + (void *) b)); if (!ValidPair(pair)) { result = ERR; @@ -732,7 +744,10 @@ NCURSES_SP_NAME(pair_content) (NCURSES_SP_DCLx if (b) *b = bg; - TR(TRACE_ATTRS, ("...pair_content(%p,%d,%d,%d)", SP_PARM, pair, fg, bg)); + TR(TRACE_ATTRS, ("...pair_content(%p,%d,%d,%d)", + (void *) SP_PARM, + pair, + fg, bg)); result = OK; } returnCode(result); diff --git a/ncurses/base/lib_colorset.c b/ncurses/base/lib_colorset.c index 831efdc8..6210a0e8 100644 --- a/ncurses/base/lib_colorset.c +++ b/ncurses/base/lib_colorset.c @@ -41,14 +41,14 @@ #include #include -MODULE_ID("$Id: lib_colorset.c,v 1.12 2009/01/25 00:44:40 tom Exp $") +MODULE_ID("$Id: lib_colorset.c,v 1.13 2009/10/24 22:02:14 tom Exp $") NCURSES_EXPORT(int) wcolor_set(WINDOW *win, short color_pair_number, void *opts) { int code = ERR; - T((T_CALLED("wcolor_set(%p,%d)"), win, color_pair_number)); + T((T_CALLED("wcolor_set(%p,%d)"), (void *) win, color_pair_number)); if (win && !opts && (SP != 0) diff --git a/ncurses/base/lib_delch.c b/ncurses/base/lib_delch.c index 0c30f2d9..64c9da73 100644 --- a/ncurses/base/lib_delch.c +++ b/ncurses/base/lib_delch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2009 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 * @@ -40,14 +40,14 @@ #include -MODULE_ID("$Id: lib_delch.c,v 1.12 2001/12/19 01:06:09 tom Exp $") +MODULE_ID("$Id: lib_delch.c,v 1.13 2009/10/24 22:32:47 tom Exp $") NCURSES_EXPORT(int) wdelch(WINDOW *win) { int code = ERR; - T((T_CALLED("wdelch(%p)"), win)); + T((T_CALLED("wdelch(%p)"), (void *) win)); if (win) { NCURSES_CH_T blank = win->_nc_bkgd; diff --git a/ncurses/base/lib_delwin.c b/ncurses/base/lib_delwin.c index 59fa3f77..4bb536ca 100644 --- a/ncurses/base/lib_delwin.c +++ b/ncurses/base/lib_delwin.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_delwin.c,v 1.19 2009/05/23 19:56:55 tom Exp $") +MODULE_ID("$Id: lib_delwin.c,v 1.20 2009/10/24 22:02:14 tom Exp $") static bool cannot_delete(WINDOW *win) @@ -70,7 +70,7 @@ delwin(WINDOW *win) { int result = ERR; - T((T_CALLED("delwin(%p)"), win)); + T((T_CALLED("delwin(%p)"), (void *) win)); if (_nc_try_global(curses) == 0) { if (win == 0 diff --git a/ncurses/base/lib_dft_fgbg.c b/ncurses/base/lib_dft_fgbg.c index b72c0b94..4bb9fc27 100644 --- a/ncurses/base/lib_dft_fgbg.c +++ b/ncurses/base/lib_dft_fgbg.c @@ -37,7 +37,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_dft_fgbg.c,v 1.24 2009/05/30 20:00:00 tom Exp $") +MODULE_ID("$Id: lib_dft_fgbg.c,v 1.25 2009/10/24 22:15:00 tom Exp $") /* * Modify the behavior of color-pair 0 so that the library doesn't assume that @@ -46,7 +46,7 @@ MODULE_ID("$Id: lib_dft_fgbg.c,v 1.24 2009/05/30 20:00:00 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(use_default_colors) (NCURSES_SP_DCL0) { - T((T_CALLED("use_default_colors(%p)"), SP_PARM)); + T((T_CALLED("use_default_colors(%p)"), (void *) SP_PARM)); returnCode(NCURSES_SP_NAME(assume_default_colors) (NCURSES_SP_ARGx -1, -1)); } @@ -67,7 +67,7 @@ NCURSES_SP_NAME(assume_default_colors) (NCURSES_SP_DCLx int fg, int bg) { int code = ERR; - T((T_CALLED("assume_default_colors(%p,%d,%d)"), SP_PARM, fg, bg)); + T((T_CALLED("assume_default_colors(%p,%d,%d)"), (void *) SP_PARM, fg, bg)); #ifdef USE_TERM_DRIVER if (sp != 0) code = CallDriver_2(sp, defaultcolors, fg, bg); diff --git a/ncurses/base/lib_echo.c b/ncurses/base/lib_echo.c index c2cdfc9b..9e1d3c26 100644 --- a/ncurses/base/lib_echo.c +++ b/ncurses/base/lib_echo.c @@ -44,12 +44,12 @@ #include -MODULE_ID("$Id: lib_echo.c,v 1.7 2009/02/21 20:20:40 tom Exp $") +MODULE_ID("$Id: lib_echo.c,v 1.8 2009/10/24 22:02:14 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(echo) (NCURSES_SP_DCL0) { - T((T_CALLED("echo(%p)"), SP_PARM)); + T((T_CALLED("echo(%p)"), (void *) SP_PARM)); if (0 == SP_PARM) returnCode(ERR); SP_PARM->_echo = TRUE; @@ -67,7 +67,7 @@ echo(void) NCURSES_EXPORT(int) NCURSES_SP_NAME(noecho) (NCURSES_SP_DCL0) { - T((T_CALLED("noecho(%p)"), SP_PARM)); + T((T_CALLED("noecho(%p)"), (void *) SP_PARM)); if (0 == SP_PARM) returnCode(ERR); SP_PARM->_echo = FALSE; diff --git a/ncurses/base/lib_endwin.c b/ncurses/base/lib_endwin.c index 3b552dae..4596d074 100644 --- a/ncurses/base/lib_endwin.c +++ b/ncurses/base/lib_endwin.c @@ -42,14 +42,14 @@ #include -MODULE_ID("$Id: lib_endwin.c,v 1.21 2009/07/04 18:35:43 tom Exp $") +MODULE_ID("$Id: lib_endwin.c,v 1.22 2009/10/24 22:02:14 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(endwin) (NCURSES_SP_DCL0) { int code = ERR; - T((T_CALLED("endwin(%p)"), SP_PARM)); + T((T_CALLED("endwin(%p)"), (void *) SP_PARM)); if (SP_PARM) { #ifdef USE_TERM_DRIVER diff --git a/ncurses/base/lib_erase.c b/ncurses/base/lib_erase.c index 2566e8b3..bbf10ef8 100644 --- a/ncurses/base/lib_erase.c +++ b/ncurses/base/lib_erase.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2009 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 * @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: lib_erase.c,v 1.16 2005/10/30 00:36:36 tom Exp $") +MODULE_ID("$Id: lib_erase.c,v 1.17 2009/10/24 22:32:29 tom Exp $") NCURSES_EXPORT(int) werase(WINDOW *win) @@ -51,7 +51,7 @@ werase(WINDOW *win) NCURSES_CH_T blank; NCURSES_CH_T *sp, *end, *start; - T((T_CALLED("werase(%p)"), win)); + T((T_CALLED("werase(%p)"), (void *) win)); if (win) { blank = win->_nc_bkgd; diff --git a/ncurses/base/lib_flash.c b/ncurses/base/lib_flash.c index 8fbf91cf..03f11d92 100644 --- a/ncurses/base/lib_flash.c +++ b/ncurses/base/lib_flash.c @@ -46,7 +46,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_flash.c,v 1.10 2009/05/23 19:37:09 tom Exp $") +MODULE_ID("$Id: lib_flash.c,v 1.11 2009/10/24 22:02:14 tom Exp $") /* * flash() @@ -61,7 +61,7 @@ NCURSES_SP_NAME(flash) (NCURSES_SP_DCL0) { int res = ERR; - T((T_CALLED("flash(%p)"), SP_PARM)); + T((T_CALLED("flash(%p)"), (void *) SP_PARM)); #ifdef USE_TERM_DRIVER if (SP_PARM != 0) res = CallDriver_1(SP_PARM, doBeepOrFlash, FALSE); diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c index cdc965fe..f6520c06 100644 --- a/ncurses/base/lib_getch.c +++ b/ncurses/base/lib_getch.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_getch.c,v 1.107 2009/08/15 20:41:24 Clemens.Ladisch Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.109 2009/10/24 21:58:34 tom Exp $") #include @@ -380,7 +380,7 @@ _nc_wgetch(WINDOW *win, long event_delay = -1; #endif - T((T_CALLED("_nc_wgetch(%p)"), win)); + T((T_CALLED("_nc_wgetch(%p)"), (void *) win)); *result = 0; @@ -536,6 +536,12 @@ _nc_wgetch(WINDOW *win, /* resizeterm can push KEY_RESIZE */ if (cooked_key_in_fifo()) { *result = fifo_pull(sp); + /* + * Get the ERR from queue -- it is from WINCH, + * so we should take it out, the "error" is handled. + */ + if (fifo_peek(sp) == -1) + fifo_pull(sp); returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK); } } @@ -612,7 +618,7 @@ wgetch(WINDOW *win) int code; unsigned long value; - T((T_CALLED("wgetch(%p)"), win)); + T((T_CALLED("wgetch(%p)"), (void *) win)); code = _nc_wgetch(win, &value, _nc_use_meta(win) @@ -686,7 +692,7 @@ kgetch(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl)) break; } TR(TRACE_IEVENT, ("ptr=%p, ch=%d, value=%d", - ptr, ptr->ch, ptr->value)); + (void *) ptr, ptr->ch, ptr->value)); if (ptr->value != 0) { /* sequence terminated */ TR(TRACE_IEVENT, ("end of sequence")); diff --git a/ncurses/base/lib_getstr.c b/ncurses/base/lib_getstr.c index 0a71db51..21d8baa0 100644 --- a/ncurses/base/lib_getstr.c +++ b/ncurses/base/lib_getstr.c @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: lib_getstr.c,v 1.28 2009/05/09 17:02:41 tom Exp $") +MODULE_ID("$Id: lib_getstr.c,v 1.29 2009/10/24 21:59:02 tom Exp $") /* * This wipes out the last character, no matter whether it was a tab, control @@ -83,7 +83,7 @@ wgetnstr_events(WINDOW *win, int ch; int y, x; - T((T_CALLED("wgetnstr(%p,%p, %d)"), win, str, maxlen)); + T((T_CALLED("wgetnstr(%p,%p,%d)"), (void *) win, (void *) str, maxlen)); if (!win) returnCode(ERR); diff --git a/ncurses/base/lib_hline.c b/ncurses/base/lib_hline.c index 2ef2cc58..0ff2d5bd 100644 --- a/ncurses/base/lib_hline.c +++ b/ncurses/base/lib_hline.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2009 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 * @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: lib_hline.c,v 1.11 2006/03/11 21:52:27 tom Exp $") +MODULE_ID("$Id: lib_hline.c,v 1.12 2009/10/24 22:31:53 tom Exp $") NCURSES_EXPORT(int) whline(WINDOW *win, chtype ch, int n) @@ -49,7 +49,7 @@ whline(WINDOW *win, chtype ch, int n) NCURSES_SIZE_T start; NCURSES_SIZE_T end; - T((T_CALLED("whline(%p,%s,%d)"), win, _tracechtype(ch), n)); + T((T_CALLED("whline(%p,%s,%d)"), (void *) win, _tracechtype(ch), n)); if (win) { struct ldat *line = &(win->_line[win->_cury]); diff --git a/ncurses/base/lib_immedok.c b/ncurses/base/lib_immedok.c index 87988b66..d51b60a3 100644 --- a/ncurses/base/lib_immedok.c +++ b/ncurses/base/lib_immedok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2009 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 * @@ -40,12 +40,12 @@ #include -MODULE_ID("$Id: lib_immedok.c,v 1.4 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_immedok.c,v 1.5 2009/10/24 22:32:11 tom Exp $") NCURSES_EXPORT(void) immedok(WINDOW *win, bool flag) { - T((T_CALLED("immedok(%p,%d)"), win, flag)); + T((T_CALLED("immedok(%p,%d)"), (void *) win, flag)); if (win) win->_immed = flag; diff --git a/ncurses/base/lib_inchstr.c b/ncurses/base/lib_inchstr.c index 6ff01687..884ea51f 100644 --- a/ncurses/base/lib_inchstr.c +++ b/ncurses/base/lib_inchstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2009 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 * @@ -40,14 +40,14 @@ #include -MODULE_ID("$Id: lib_inchstr.c,v 1.10 2001/06/02 23:37:58 skimo Exp $") +MODULE_ID("$Id: lib_inchstr.c,v 1.11 2009/10/24 22:49:33 tom Exp $") NCURSES_EXPORT(int) -winchnstr(WINDOW *win, chtype * str, int n) +winchnstr(WINDOW *win, chtype *str, int n) { int i = 0; - T((T_CALLED("winchnstr(%p,%p,%d)"), win, str, n)); + T((T_CALLED("winchnstr(%p,%p,%d)"), (void *) win, (void *) str, n)); if (!str) returnCode(0); diff --git a/ncurses/base/lib_insch.c b/ncurses/base/lib_insch.c index 583a1990..e21ec02b 100644 --- a/ncurses/base/lib_insch.c +++ b/ncurses/base/lib_insch.c @@ -43,7 +43,7 @@ #include #include -MODULE_ID("$Id: lib_insch.c,v 1.31 2009/09/12 18:11:55 tom Exp $") +MODULE_ID("$Id: lib_insch.c,v 1.32 2009/10/24 22:04:35 tom Exp $") /* * Insert the given character, updating the current location to simplify @@ -153,7 +153,7 @@ winsch(WINDOW *win, chtype c) NCURSES_SIZE_T ox; int code = ERR; - T((T_CALLED("winsch(%p, %s)"), win, _tracechtype(c))); + T((T_CALLED("winsch(%p, %s)"), (void *) win, _tracechtype(c))); if (win != 0) { oy = win->_cury; diff --git a/ncurses/base/lib_insdel.c b/ncurses/base/lib_insdel.c index 342c6541..8f51bbed 100644 --- a/ncurses/base/lib_insdel.c +++ b/ncurses/base/lib_insdel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2003 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,2009 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 * @@ -42,14 +42,14 @@ #include -MODULE_ID("$Id: lib_insdel.c,v 1.12 2003/07/26 22:40:06 tom Exp $") +MODULE_ID("$Id: lib_insdel.c,v 1.13 2009/10/24 22:34:41 tom Exp $") NCURSES_EXPORT(int) winsdelln(WINDOW *win, int n) { int code = ERR; - T((T_CALLED("winsdelln(%p,%d)"), win, n)); + T((T_CALLED("winsdelln(%p,%d)"), (void *) win, n)); if (win) { if (n != 0) { diff --git a/ncurses/base/lib_insnstr.c b/ncurses/base/lib_insnstr.c index 16d94595..ce03e64b 100644 --- a/ncurses/base/lib_insnstr.c +++ b/ncurses/base/lib_insnstr.c @@ -40,7 +40,7 @@ #include #include -MODULE_ID("$Id: lib_insnstr.c,v 1.2 2009/05/30 14:53:49 tom Exp $") +MODULE_ID("$Id: lib_insnstr.c,v 1.3 2009/10/24 22:04:35 tom Exp $") NCURSES_EXPORT(int) winsnstr(WINDOW *win, const char *s, int n) @@ -51,7 +51,7 @@ winsnstr(WINDOW *win, const char *s, int n) const unsigned char *str = (const unsigned char *) s; const unsigned char *cp; - T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbufn(s, n), n)); + T((T_CALLED("winsnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(s, n), n)); if (win != 0 && str != 0) { SCREEN *sp = _nc_screen_of(win); diff --git a/ncurses/base/lib_instr.c b/ncurses/base/lib_instr.c index 3fb29490..e6d1a739 100644 --- a/ncurses/base/lib_instr.c +++ b/ncurses/base/lib_instr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2009 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 * @@ -41,14 +41,14 @@ #include -MODULE_ID("$Id: lib_instr.c,v 1.16 2007/07/21 20:18:10 tom Exp $") +MODULE_ID("$Id: lib_instr.c,v 1.17 2009/10/24 22:55:45 tom Exp $") NCURSES_EXPORT(int) winnstr(WINDOW *win, char *str, int n) { int i = 0, row, col; - T((T_CALLED("winnstr(%p,%p,%d)"), win, str, n)); + T((T_CALLED("winnstr(%p,%p,%d)"), (void *) win, str, n)); if (!str) returnCode(0); @@ -79,18 +79,18 @@ winnstr(WINDOW *win, char *str, int n) init_mb(state); n3 = wcstombs(0, wch, 0); - if (isEILSEQ(n3) || (n3 == 0)) { - ; - } else if ((int) (n3 + i) > n) { - done = TRUE; - } else if ((tmp = typeCalloc(char, n3 + 10)) == 0) { - done = TRUE; - } else { - init_mb(state); - wcstombs(tmp, wch, n3); - for (i3 = 0; i3 < n3; ++i3) - str[i++] = tmp[i3]; - free(tmp); + if (!isEILSEQ(n3) && (n3 != 0)) { + if (((int) n3 + i) > n) { + done = TRUE; + } else if ((tmp = typeCalloc(char, n3 + 10)) == 0) { + done = TRUE; + } else { + init_mb(state); + wcstombs(tmp, wch, n3); + for (i3 = 0; i3 < n3; ++i3) + str[i++] = tmp[i3]; + free(tmp); + } } } free(wch); diff --git a/ncurses/base/lib_leaveok.c b/ncurses/base/lib_leaveok.c index 17d095d0..e6995f85 100644 --- a/ncurses/base/lib_leaveok.c +++ b/ncurses/base/lib_leaveok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2009 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 * @@ -40,12 +40,12 @@ #include -MODULE_ID("$Id: lib_leaveok.c,v 1.5 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_leaveok.c,v 1.6 2009/10/24 22:34:23 tom Exp $") NCURSES_EXPORT(int) leaveok(WINDOW *win, bool flag) { - T((T_CALLED("leaveok(%p,%d)"), win, flag)); + T((T_CALLED("leaveok(%p,%d)"), (void *) win, flag)); if (win) { win->_leaveok = flag; diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index cd760dc0..4034c9a7 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -84,7 +84,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mouse.c,v 1.108 2009/07/04 19:51:08 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.110 2009/10/24 23:21:31 tom Exp $") #include @@ -1286,7 +1286,7 @@ _nc_mouse_resume(SCREEN *sp) NCURSES_EXPORT(int) NCURSES_SP_NAME(getmouse) (NCURSES_SP_DCLx MEVENT * aevent) { - T((T_CALLED("getmouse(%p,%p)"), SP_PARM, aevent)); + T((T_CALLED("getmouse(%p,%p)"), (void *) SP_PARM, (void *) aevent)); if ((aevent != 0) && (SP_PARM != 0) && (SP_PARM->_mouse_type != M_NONE)) { MEVENT *eventp = SP_PARM->_mouse_eventp; @@ -1320,7 +1320,7 @@ NCURSES_SP_NAME(ungetmouse) (NCURSES_SP_DCLx MEVENT * aevent) { int result = ERR; - T((T_CALLED("ungetmouse(%p,%p)"), SP_PARM, aevent)); + T((T_CALLED("ungetmouse(%p,%p)"), (void *) SP_PARM, (void *) aevent)); if (aevent != 0 && SP_PARM != 0) { MEVENT *eventp = SP_PARM->_mouse_eventp; @@ -1352,7 +1352,10 @@ NCURSES_SP_NAME(mousemask) (NCURSES_SP_DCLx mmask_t newmask, mmask_t * oldmask) { mmask_t result = 0; - T((T_CALLED("mousemask(%p,%#lx,%p)"), SP_PARM, (unsigned long) newmask, oldmask)); + T((T_CALLED("mousemask(%p,%#lx,%p)"), + (void *) SP_PARM, + (unsigned long) newmask, + (void *) oldmask)); if (SP_PARM != 0) { if (oldmask) @@ -1395,7 +1398,7 @@ wenclose(const WINDOW *win, int y, int x) { bool result = FALSE; - T((T_CALLED("wenclose(%p,%d,%d)"), win, y, x)); + T((T_CALLED("wenclose(%p,%d,%d)"), (const void *) win, y, x)); if (win != 0) { y -= win->_yoffset; @@ -1413,7 +1416,7 @@ NCURSES_SP_NAME(mouseinterval) (NCURSES_SP_DCLx int maxclick) { int oldval; - T((T_CALLED("mouseinterval(%p,%d)"), SP_PARM, maxclick)); + T((T_CALLED("mouseinterval(%p,%d)"), (void *) SP_PARM, maxclick)); if (SP_PARM != 0) { oldval = SP_PARM->_maxclick; @@ -1461,7 +1464,11 @@ wmouse_trafo(const WINDOW *win, int *pY, int *pX, bool to_screen) { bool result = FALSE; - T((T_CALLED("wmouse_trafo(%p,%p,%p,%d)"), win, pY, pX, to_screen)); + T((T_CALLED("wmouse_trafo(%p,%p,%p,%d)"), + (const void *) win, + (void *) pY, + (void *) pX, + to_screen)); if (win && pY && pX) { int y = *pY; diff --git a/ncurses/base/lib_move.c b/ncurses/base/lib_move.c index 652c44d7..488b195d 100644 --- a/ncurses/base/lib_move.c +++ b/ncurses/base/lib_move.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2004 Free Software Foundation, Inc. * + * Copyright (c) 1998-2004,2009 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 * @@ -41,12 +41,12 @@ #include -MODULE_ID("$Id: lib_move.c,v 1.12 2004/12/04 21:50:07 tom Exp $") +MODULE_ID("$Id: lib_move.c,v 1.13 2009/10/24 22:34:07 tom Exp $") NCURSES_EXPORT(int) wmove(WINDOW *win, int y, int x) { - T((T_CALLED("wmove(%p,%d,%d)"), win, y, x)); + T((T_CALLED("wmove(%p,%d,%d)"), (void *) win, y, x)); if (LEGALYX(win, y, x)) { win->_curx = (NCURSES_SIZE_T) x; diff --git a/ncurses/base/lib_mvwin.c b/ncurses/base/lib_mvwin.c index 8b2f816b..37963e40 100644 --- a/ncurses/base/lib_mvwin.c +++ b/ncurses/base/lib_mvwin.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_mvwin.c,v 1.16 2009/06/06 20:25:07 tom Exp $") +MODULE_ID("$Id: lib_mvwin.c,v 1.17 2009/10/24 22:05:03 tom Exp $") NCURSES_EXPORT(int) mvwin(WINDOW *win, int by, int bx) @@ -51,7 +51,7 @@ mvwin(WINDOW *win, int by, int bx) SCREEN *sp = _nc_screen_of(win); #endif - T((T_CALLED("mvwin(%p,%d,%d)"), win, by, bx)); + T((T_CALLED("mvwin(%p,%d,%d)"), (void *) win, by, bx)); if (!win || (win->_flags & _ISPAD)) returnCode(ERR); diff --git a/ncurses/base/lib_newterm.c b/ncurses/base/lib_newterm.c index 9e1649de..1579c280 100644 --- a/ncurses/base/lib_newterm.c +++ b/ncurses/base/lib_newterm.c @@ -52,7 +52,7 @@ #include -MODULE_ID("$Id: lib_newterm.c,v 1.81 2009/09/27 00:34:05 tom Exp $") +MODULE_ID("$Id: lib_newterm.c,v 1.82 2009/10/24 22:52:04 tom Exp $") #ifdef USE_TERM_DRIVER #define NumLabels InfoOf(SP_PARM).numlabels @@ -110,7 +110,7 @@ NCURSES_EXPORT(void) NCURSES_SP_NAME(filter) (NCURSES_SP_DCL0) { START_TRACE(); - T((T_CALLED("filter(%p)"), SP_PARM)); + T((T_CALLED("filter(%p)"), (void *) SP_PARM)); #if NCURSES_SP_FUNCS if (IsPreScreen(SP_PARM)) { SP_PARM->_filtered = TRUE; @@ -141,7 +141,7 @@ NCURSES_EXPORT(void) NCURSES_SP_NAME(nofilter) (NCURSES_SP_DCL0) { START_TRACE(); - T((T_CALLED("nofilter(%p)"), SP_PARM)); + T((T_CALLED("nofilter(%p)"), (void *) SP_PARM)); #if NCURSES_SP_FUNCS if (IsPreScreen(SP_PARM)) { SP_PARM->_filtered = FALSE; @@ -183,7 +183,11 @@ NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx TERMINAL *new_term = 0; START_TRACE(); - T((T_CALLED("newterm(%p, \"%s\", %p,%p)"), SP_PARM, name, ofp, ifp)); + T((T_CALLED("newterm(%p, \"%s\", %p,%p)"), + (void *) SP_PARM, + name, + (void *) ofp, + (void *) ifp)); #if NCURSES_SP_FUNCS assert(SP_PARM != 0); diff --git a/ncurses/base/lib_newwin.c b/ncurses/base/lib_newwin.c index 3ab466ab..ddbb3da7 100644 --- a/ncurses/base/lib_newwin.c +++ b/ncurses/base/lib_newwin.c @@ -43,7 +43,7 @@ #include #include -MODULE_ID("$Id: lib_newwin.c,v 1.60 2009/09/06 16:32:48 tom Exp $") +MODULE_ID("$Id: lib_newwin.c,v 1.61 2009/10/24 22:05:55 tom Exp $") #define window_is(name) ((sp)->_##name == win) @@ -98,7 +98,7 @@ _nc_freewin(WINDOW *win) SCREEN *sp = _nc_screen_of(win); /* pretend this is parameter */ #endif - T((T_CALLED("_nc_freewin(%p)"), win)); + T((T_CALLED("_nc_freewin(%p)"), (void *) win)); if (win != 0) { if (_nc_nonsp_try_global(curses) == 0) { @@ -119,7 +119,7 @@ _nc_freewin(WINDOW *win) free(p); result = OK; - T(("...deleted win=%p", win)); + T(("...deleted win=%p", (void *) win)); break; } q = p; @@ -138,7 +138,7 @@ NCURSES_SP_NAME(newwin) (NCURSES_SP_DCLx NCURSES_CH_T *ptr; int i; - T((T_CALLED("newwin(%p, %d,%d,%d,%d)"), SP_PARM, num_lines, num_columns, + T((T_CALLED("newwin(%p, %d,%d,%d,%d)"), (void *) SP_PARM, num_lines, num_columns, begy, begx)); if (begy < 0 || begx < 0 || num_lines < 0 || num_columns < 0) @@ -192,7 +192,7 @@ derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) SCREEN *sp = _nc_screen_of(orig); #endif - T((T_CALLED("derwin(%p,%d,%d,%d,%d)"), orig, num_lines, num_columns, + T((T_CALLED("derwin(%p,%d,%d,%d,%d)"), (void *) orig, num_lines, num_columns, begy, begx)); /* @@ -235,7 +235,7 @@ derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) NCURSES_EXPORT(WINDOW *) subwin(WINDOW *w, int l, int c, int y, int x) { - T((T_CALLED("subwin(%p, %d, %d, %d, %d)"), w, l, c, y, x)); + T((T_CALLED("subwin(%p, %d, %d, %d, %d)"), (void *) w, l, c, y, x)); T(("parent has begy = %ld, begx = %ld", (long) w->_begy, (long) w->_begx)); returnWin(derwin(w, l, c, y - w->_begy, x - w->_begx)); @@ -262,7 +262,7 @@ NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_DCLx bool is_padwin = (flags & _ISPAD); T((T_CALLED("_nc_makenew(%p,%d,%d,%d,%d)"), - SP_PARM, num_lines, num_columns, begy, begx)); + (void *) SP_PARM, num_lines, num_columns, begy, begx)); if (SP_PARM == 0) returnWin(0); @@ -360,7 +360,7 @@ NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_DCLx wp->screen = SP_PARM; WindowList(SP_PARM) = wp; - T((T_CREATE("window %p"), win)); + T((T_CREATE("window %p"), (void *) win)); _nc_nonsp_unlock_global(curses); returnWin(win); diff --git a/ncurses/base/lib_nl.c b/ncurses/base/lib_nl.c index 28c1848c..34254871 100644 --- a/ncurses/base/lib_nl.c +++ b/ncurses/base/lib_nl.c @@ -44,7 +44,7 @@ #include -MODULE_ID("$Id: lib_nl.c,v 1.11 2009/07/04 00:25:53 tom Exp $") +MODULE_ID("$Id: lib_nl.c,v 1.12 2009/10/24 22:05:55 tom Exp $") #ifdef __EMX__ #include @@ -53,7 +53,7 @@ MODULE_ID("$Id: lib_nl.c,v 1.11 2009/07/04 00:25:53 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(nl) (NCURSES_SP_DCL0) { - T((T_CALLED("nl(%p)"), SP_PARM)); + T((T_CALLED("nl(%p)"), (void *) SP_PARM)); if (0 == SP_PARM) returnCode(ERR); SP_PARM->_nl = TRUE; @@ -75,7 +75,7 @@ nl(void) NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (NCURSES_SP_DCL0) { - T((T_CALLED("nonl(%p)"), SP_PARM)); + T((T_CALLED("nonl(%p)"), (void *) SP_PARM)); if (0 == SP_PARM) returnCode(ERR); SP_PARM->_nl = FALSE; diff --git a/ncurses/base/lib_overlay.c b/ncurses/base/lib_overlay.c index 669e8e72..bfb817bc 100644 --- a/ncurses/base/lib_overlay.c +++ b/ncurses/base/lib_overlay.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 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 * @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: lib_overlay.c,v 1.27 2008/06/07 23:30:34 tom Exp $") +MODULE_ID("$Id: lib_overlay.c,v 1.29 2009/10/24 23:21:31 tom Exp $") static int overlap(const WINDOW *const src, WINDOW *const dst, int const flag) @@ -52,7 +52,7 @@ overlap(const WINDOW *const src, WINDOW *const dst, int const flag) int dminrow, dmincol; int dmaxrow, dmaxcol; - T((T_CALLED("overlap(%p,%p,%d)"), src, dst, flag)); + T((T_CALLED("overlap(%p,%p,%d)"), (const void *) src, (void *) dst, flag)); if (src != 0 && dst != 0) { _nc_lock_global(curses); @@ -110,7 +110,7 @@ overlap(const WINDOW *const src, WINDOW *const dst, int const flag) NCURSES_EXPORT(int) overlay(const WINDOW *win1, WINDOW *win2) { - T((T_CALLED("overlay(%p,%p)"), win1, win2)); + T((T_CALLED("overlay(%p,%p)"), (const void *) win1, (void *) win2)); returnCode(overlap(win1, win2, TRUE)); } @@ -127,7 +127,7 @@ overlay(const WINDOW *win1, WINDOW *win2) NCURSES_EXPORT(int) overwrite(const WINDOW *win1, WINDOW *win2) { - T((T_CALLED("overwrite(%p,%p)"), win1, win2)); + T((T_CALLED("overwrite(%p,%p)"), (const void *) win1, (void *) win2)); returnCode(overlap(win1, win2, FALSE)); } @@ -145,7 +145,11 @@ copywin(const WINDOW *src, WINDOW *dst, attr_t mask; T((T_CALLED("copywin(%p, %p, %d, %d, %d, %d, %d, %d, %d)"), - src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over)); + (const void *) src, + (void *) dst, + sminrow, smincol, + dminrow, dmincol, + dmaxrow, dmaxcol, over)); if (src && dst) { _nc_lock_global(curses); diff --git a/ncurses/base/lib_pad.c b/ncurses/base/lib_pad.c index ccd3ad7e..c5bd6c4f 100644 --- a/ncurses/base/lib_pad.c +++ b/ncurses/base/lib_pad.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_pad.c,v 1.44 2009/07/04 19:45:20 tom Exp $") +MODULE_ID("$Id: lib_pad.c,v 1.45 2009/10/24 22:07:03 tom Exp $") NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newpad) (NCURSES_SP_DCLx int l, int c) @@ -51,7 +51,7 @@ NCURSES_SP_NAME(newpad) (NCURSES_SP_DCLx int l, int c) NCURSES_CH_T *ptr; int i; - T((T_CALLED("newpad(%p,%d, %d)"), SP_PARM, l, c)); + T((T_CALLED("newpad(%p,%d, %d)"), (void *) SP_PARM, l, c)); if (l <= 0 || c <= 0) returnWin(0); @@ -140,7 +140,7 @@ pnoutrefresh(WINDOW *win, #endif T((T_CALLED("pnoutrefresh(%p, %d, %d, %d, %d, %d, %d)"), - win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)); + (void *) win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)); if (win == 0) returnCode(ERR); @@ -320,7 +320,7 @@ pnoutrefresh(WINDOW *win, NCURSES_EXPORT(int) pechochar(WINDOW *pad, const chtype ch) { - T((T_CALLED("pechochar(%p, %s)"), pad, _tracechtype(ch))); + T((T_CALLED("pechochar(%p, %s)"), (void *) pad, _tracechtype(ch))); if (pad == 0) returnCode(ERR); diff --git a/ncurses/base/lib_printw.c b/ncurses/base/lib_printw.c index cb43b2f5..963181d9 100644 --- a/ncurses/base/lib_printw.c +++ b/ncurses/base/lib_printw.c @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_printw.c,v 1.19 2009/04/18 18:45:55 tom Exp $") +MODULE_ID("$Id: lib_printw.c,v 1.20 2009/10/24 22:07:03 tom Exp $") NCURSES_EXPORT(int) printw(const char *fmt,...) @@ -70,7 +70,7 @@ wprintw(WINDOW *win, const char *fmt,...) #ifdef TRACE va_start(argp, fmt); T((T_CALLED("wprintw(%p,%s%s)"), - win, _nc_visbuf(fmt), _nc_varargs(fmt, argp))); + (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argp))); va_end(argp); #endif @@ -111,7 +111,7 @@ mvwprintw(WINDOW *win, int y, int x, const char *fmt,...) #ifdef TRACE va_start(argp, fmt); T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"), - y, x, win, _nc_visbuf(fmt), _nc_varargs(fmt, argp))); + y, x, (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argp))); va_end(argp); #endif @@ -132,7 +132,7 @@ vwprintw(WINDOW *win, const char *fmt, va_list argp) SCREEN *sp = _nc_screen_of(win); #endif - T((T_CALLED("vwprintw(%p,%s,va_list)"), win, _nc_visbuf(fmt))); + T((T_CALLED("vwprintw(%p,%s,va_list)"), (void *) win, _nc_visbuf(fmt))); buf = NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_ARGx fmt, argp); if (buf != 0) { diff --git a/ncurses/base/lib_redrawln.c b/ncurses/base/lib_redrawln.c index b04a488b..17f00ca8 100644 --- a/ncurses/base/lib_redrawln.c +++ b/ncurses/base/lib_redrawln.c @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_redrawln.c,v 1.13 2009/04/18 18:46:00 tom Exp $") +MODULE_ID("$Id: lib_redrawln.c,v 1.14 2009/10/24 22:08:32 tom Exp $") NCURSES_EXPORT(int) wredrawln(WINDOW *win, int beg, int num) @@ -49,7 +49,7 @@ wredrawln(WINDOW *win, int beg, int num) size_t len; SCREEN *sp; - T((T_CALLED("wredrawln(%p,%d,%d)"), win, beg, num)); + T((T_CALLED("wredrawln(%p,%d,%d)"), (void *) win, beg, num)); if (win == 0) returnCode(ERR); diff --git a/ncurses/base/lib_refresh.c b/ncurses/base/lib_refresh.c index 25b9b40a..01d363f4 100644 --- a/ncurses/base/lib_refresh.c +++ b/ncurses/base/lib_refresh.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_refresh.c,v 1.42 2009/06/06 20:27:39 tom Exp $") +MODULE_ID("$Id: lib_refresh.c,v 1.43 2009/10/24 22:08:32 tom Exp $") NCURSES_EXPORT(int) wrefresh(WINDOW *win) @@ -52,7 +52,7 @@ wrefresh(WINDOW *win) SCREEN *SP_PARM = _nc_screen_of(win); #endif - T((T_CALLED("wrefresh(%p)"), win)); + T((T_CALLED("wrefresh(%p)"), (void *) win)); if (win == 0) { code = ERR; @@ -89,7 +89,7 @@ wnoutrefresh(WINDOW *win) SCREEN *SP_PARM = _nc_screen_of(win); #endif - T((T_CALLED("wnoutrefresh(%p)"), win)); + T((T_CALLED("wnoutrefresh(%p)"), (void *) win)); #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE)) { _tracedump("...win", win); diff --git a/ncurses/base/lib_restart.c b/ncurses/base/lib_restart.c index 5be5c083..b28cfd1f 100644 --- a/ncurses/base/lib_restart.c +++ b/ncurses/base/lib_restart.c @@ -45,7 +45,7 @@ #define _POSIX_SOURCE #endif -MODULE_ID("$Id: lib_restart.c,v 1.12 2009/08/30 17:59:13 tom Exp $") +MODULE_ID("$Id: lib_restart.c,v 1.13 2009/10/24 22:47:43 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(restartterm) (NCURSES_SP_DCLx @@ -58,7 +58,11 @@ NCURSES_SP_NAME(restartterm) (NCURSES_SP_DCLx TERMINAL *new_term; #endif - T((T_CALLED("restartterm(%p,%s,%d,%p)"), SP_PARM, termp, filenum, errret)); + T((T_CALLED("restartterm(%p,%s,%d,%p)"), + (void *) SP_PARM, + termp, + filenum, + (void *) errret)); if (TINFO_SETUP_TERM(&new_term, termp, filenum, errret, FALSE) != OK) { result = ERR; diff --git a/ncurses/base/lib_scanw.c b/ncurses/base/lib_scanw.c index b8a5a227..a8621e63 100644 --- a/ncurses/base/lib_scanw.c +++ b/ncurses/base/lib_scanw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2009 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 * @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: lib_scanw.c,v 1.11 2001/06/30 23:39:41 tom Exp $") +MODULE_ID("$Id: lib_scanw.c,v 1.12 2009/10/24 22:35:14 tom Exp $") NCURSES_EXPORT(int) vwscanw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) @@ -73,7 +73,7 @@ wscanw(WINDOW *win, NCURSES_CONST char *fmt,...) int code; va_list ap; - T(("wscanw(%p,\"%s\",...) called", win, fmt)); + T(("wscanw(%p,\"%s\",...) called", (void *) win, fmt)); va_start(ap, fmt); code = vwscanw(win, fmt, ap); diff --git a/ncurses/base/lib_screen.c b/ncurses/base/lib_screen.c index 34af68a3..27212b79 100644 --- a/ncurses/base/lib_screen.c +++ b/ncurses/base/lib_screen.c @@ -39,7 +39,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_screen.c,v 1.37 2009/10/10 19:37:07 tom Exp $") +MODULE_ID("$Id: lib_screen.c,v 1.38 2009/10/24 22:08:55 tom Exp $") #define MAX_SIZE 0x3fff /* 16k is big enough for a window or pad */ @@ -49,7 +49,7 @@ NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep) WINDOW tmp, *nwin; int n; - T((T_CALLED("getwin(%p)"), filep)); + T((T_CALLED("getwin(%p)"), (void *) filep)); clearerr(filep); if (fread(&tmp, 1, sizeof(WINDOW), filep) < sizeof(WINDOW) @@ -135,7 +135,7 @@ putwin(WINDOW *win, FILE *filep) int code = ERR; int n; - T((T_CALLED("putwin(%p,%p)"), win, filep)); + T((T_CALLED("putwin(%p,%p)"), (void *) win, (void *) filep)); if (win != 0) { size_t len = (size_t) (win->_maxx + 1); @@ -162,7 +162,7 @@ NCURSES_SP_NAME(scr_restore) (NCURSES_SP_DCLx const char *file) { FILE *fp = 0; - T((T_CALLED("scr_restore(%p,%s)"), SP_PARM, _nc_visbuf(file))); + T((T_CALLED("scr_restore(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file))); if (_nc_access(file, R_OK) < 0 || (fp = fopen(file, "rb")) == 0) { @@ -209,7 +209,7 @@ NCURSES_SP_NAME(scr_init) (NCURSES_SP_DCLx const char *file) FILE *fp = 0; int code = ERR; - T((T_CALLED("scr_init(%p,%s)"), SP_PARM, _nc_visbuf(file))); + T((T_CALLED("scr_init(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file))); if (SP_PARM != 0 && #ifdef USE_TERM_DRIVER @@ -243,7 +243,7 @@ scr_init(const char *file) NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_set) (NCURSES_SP_DCLx const char *file) { - T((T_CALLED("scr_set(%p,%s)"), SP_PARM, _nc_visbuf(file))); + T((T_CALLED("scr_set(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file))); if (NCURSES_SP_NAME(scr_init) (NCURSES_SP_ARGx file) == ERR) { returnCode(ERR); diff --git a/ncurses/base/lib_scroll.c b/ncurses/base/lib_scroll.c index ac85bd55..454ad5b0 100644 --- a/ncurses/base/lib_scroll.c +++ b/ncurses/base/lib_scroll.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2009 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 * @@ -43,7 +43,7 @@ #include -MODULE_ID("$Id: lib_scroll.c,v 1.26 2006/10/14 20:46:08 tom Exp $") +MODULE_ID("$Id: lib_scroll.c,v 1.27 2009/10/24 22:35:45 tom Exp $") NCURSES_EXPORT(void) _nc_scroll_window(WINDOW *win, @@ -58,7 +58,7 @@ _nc_scroll_window(WINDOW *win, size_t to_copy = (size_t) (sizeof(NCURSES_CH_T) * (win->_maxx + 1)); TR(TRACE_MOVE, ("_nc_scroll_window(%p, %d, %ld, %ld)", - win, n, (long) top, (long) bottom)); + (void *) win, n, (long) top, (long) bottom)); if (top < 0 || bottom < top @@ -135,7 +135,7 @@ _nc_scroll_window(WINDOW *win, NCURSES_EXPORT(int) wscrl(WINDOW *win, int n) { - T((T_CALLED("wscrl(%p,%d)"), win, n)); + T((T_CALLED("wscrl(%p,%d)"), (void *) win, n)); if (!win || !win->_scroll) { TR(TRACE_MOVE, ("...scrollok is false")); diff --git a/ncurses/base/lib_scrollok.c b/ncurses/base/lib_scrollok.c index f6b30259..6a698a36 100644 --- a/ncurses/base/lib_scrollok.c +++ b/ncurses/base/lib_scrollok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2009 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 * @@ -40,12 +40,12 @@ #include -MODULE_ID("$Id: lib_scrollok.c,v 1.4 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_scrollok.c,v 1.5 2009/10/24 22:35:38 tom Exp $") NCURSES_EXPORT(int) scrollok(WINDOW *win, bool flag) { - T((T_CALLED("scrollok(%p,%d)"), win, flag)); + T((T_CALLED("scrollok(%p,%d)"), (void *) win, flag)); if (win) { win->_scroll = flag; diff --git a/ncurses/base/lib_scrreg.c b/ncurses/base/lib_scrreg.c index c85d60f1..546fbc18 100644 --- a/ncurses/base/lib_scrreg.c +++ b/ncurses/base/lib_scrreg.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2009 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 * @@ -40,12 +40,12 @@ #include -MODULE_ID("$Id: lib_scrreg.c,v 1.10 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_scrreg.c,v 1.11 2009/10/24 22:35:28 tom Exp $") NCURSES_EXPORT(int) wsetscrreg(WINDOW *win, int top, int bottom) { - T((T_CALLED("wsetscrreg(%p,%d,%d)"), win, top, bottom)); + T((T_CALLED("wsetscrreg(%p,%d,%d)"), (void *) win, top, bottom)); if (win && top >= 0 && top <= win->_maxy && diff --git a/ncurses/base/lib_set_term.c b/ncurses/base/lib_set_term.c index 49752fd7..7429e2aa 100644 --- a/ncurses/base/lib_set_term.c +++ b/ncurses/base/lib_set_term.c @@ -47,7 +47,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_set_term.c,v 1.128 2009/09/27 14:21:25 tom Exp $") +MODULE_ID("$Id: lib_set_term.c,v 1.129 2009/10/24 22:09:47 tom Exp $") #ifdef USE_TERM_DRIVER #define MaxColors InfoOf(sp).maxcolors @@ -63,7 +63,7 @@ set_term(SCREEN *screenp) SCREEN *oldSP; SCREEN *newSP; - T((T_CALLED("set_term(%p)"), screenp)); + T((T_CALLED("set_term(%p)"), (void *) screenp)); _nc_lock_global(curses); @@ -93,7 +93,7 @@ set_term(SCREEN *screenp) _nc_unlock_global(curses); - T((T_RETURN("%p"), oldSP)); + T((T_RETURN("%p"), (void *) oldSP)); return (oldSP); } @@ -136,7 +136,7 @@ delscreen(SCREEN *sp) { int i; - T((T_CALLED("delscreen(%p)"), sp)); + T((T_CALLED("delscreen(%p)"), (void *) sp)); _nc_lock_global(curses); if (delink_screen(sp)) { @@ -327,7 +327,7 @@ NCURSES_SP_NAME(_nc_setupscreen) ( #endif T((T_CALLED("_nc_setupscreen(%d, %d, %p, %d, %d)"), - slines, scolumns, output, filtered, slk_format)); + slines, scolumns, (void *) output, filtered, slk_format)); assert(CURRENT_SCREEN == 0); /* has been reset in newterm() ! */ @@ -359,7 +359,7 @@ NCURSES_SP_NAME(_nc_setupscreen) ( returnCode(ERR); } - T(("created SP %p", SP)); + T(("created SP %p", (void *) SP)); sp = SP; /* fixup so SET_LINES and SET_COLS works */ sp->_next_screen = _nc_screen_chain; @@ -751,7 +751,7 @@ NCURSES_SP_NAME(_nc_ripoffline) (NCURSES_SP_DCLx int code = ERR; START_TRACE(); - T((T_CALLED("ripoffline(%p,%d,%p)"), SP_PARM, line, init)); + T((T_CALLED("ripoffline(%p,%d,%p)"), (void *) SP_PARM, line, (void *) init)); if (SP_PARM != 0 && SP_PARM->_prescreen) { if (line == 0) { diff --git a/ncurses/base/lib_slk.c b/ncurses/base/lib_slk.c index d0407cec..9cd3a55c 100644 --- a/ncurses/base/lib_slk.c +++ b/ncurses/base/lib_slk.c @@ -47,7 +47,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_slk.c,v 1.42 2009/08/15 23:05:02 tom Exp $") +MODULE_ID("$Id: lib_slk.c,v 1.43 2009/10/24 22:12:21 tom Exp $") #ifdef USE_TERM_DRIVER #define NumLabels InfoOf(SP_PARM).numlabels @@ -231,7 +231,7 @@ _nc_slk_initialize(WINDOW *stwin, int cols) NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_restore) (NCURSES_SP_DCL0) { - T((T_CALLED("slk_restore(%p)"), SP_PARM)); + T((T_CALLED("slk_restore(%p)"), (void *) SP_PARM)); if (0 == SP_PARM) returnCode(ERR); diff --git a/ncurses/base/lib_slkatr_set.c b/ncurses/base/lib_slkatr_set.c index f9ac4951..bd5f5396 100644 --- a/ncurses/base/lib_slkatr_set.c +++ b/ncurses/base/lib_slkatr_set.c @@ -38,7 +38,7 @@ */ #include -MODULE_ID("$Id: lib_slkatr_set.c,v 1.13 2009/02/21 17:20:17 tom Exp $") +MODULE_ID("$Id: lib_slkatr_set.c,v 1.14 2009/10/24 22:47:03 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (NCURSES_SP_DCLx @@ -48,7 +48,10 @@ NCURSES_SP_NAME(slk_attr_set) (NCURSES_SP_DCLx { int code = ERR; - T((T_CALLED("slk_attr_set(%p,%s,%d)"), SP_PARM, _traceattr(attr), color_pair_number)); + T((T_CALLED("slk_attr_set(%p,%s,%d)"), + (void *) SP_PARM, + _traceattr(attr), + color_pair_number)); if (SP_PARM != 0 && SP_PARM->_slk != 0 diff --git a/ncurses/base/lib_slkatrof.c b/ncurses/base/lib_slkatrof.c index 274f963f..bb980ab8 100644 --- a/ncurses/base/lib_slkatrof.c +++ b/ncurses/base/lib_slkatrof.c @@ -38,12 +38,12 @@ */ #include -MODULE_ID("$Id: lib_slkatrof.c,v 1.10 2009/02/21 17:35:28 tom Exp $") +MODULE_ID("$Id: lib_slkatrof.c,v 1.11 2009/10/24 22:12:21 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attroff) (NCURSES_SP_DCLx const chtype attr) { - T((T_CALLED("slk_attroff(%p,%s)"), SP_PARM, _traceattr(attr))); + T((T_CALLED("slk_attroff(%p,%s)"), (void *) SP_PARM, _traceattr(attr))); if (SP_PARM != 0 && SP_PARM->_slk != 0) { TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr)))); diff --git a/ncurses/base/lib_slkatron.c b/ncurses/base/lib_slkatron.c index 4734ce5f..00e5df39 100644 --- a/ncurses/base/lib_slkatron.c +++ b/ncurses/base/lib_slkatron.c @@ -38,12 +38,12 @@ */ #include -MODULE_ID("$Id: lib_slkatron.c,v 1.10 2009/02/21 18:16:04 tom Exp $") +MODULE_ID("$Id: lib_slkatron.c,v 1.11 2009/10/24 22:12:21 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attron) (NCURSES_SP_DCLx const chtype attr) { - T((T_CALLED("slk_attron(%p,%s)"), SP_PARM, _traceattr(attr))); + T((T_CALLED("slk_attron(%p,%s)"), (void *) SP_PARM, _traceattr(attr))); if (SP_PARM != 0 && SP_PARM->_slk != 0) { TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr)))); diff --git a/ncurses/base/lib_slkatrset.c b/ncurses/base/lib_slkatrset.c index e33747e7..544b8d0f 100644 --- a/ncurses/base/lib_slkatrset.c +++ b/ncurses/base/lib_slkatrset.c @@ -38,12 +38,12 @@ */ #include -MODULE_ID("$Id: lib_slkatrset.c,v 1.9 2009/02/21 17:49:07 tom Exp $") +MODULE_ID("$Id: lib_slkatrset.c,v 1.10 2009/10/24 22:12:21 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attrset) (NCURSES_SP_DCLx const chtype attr) { - T((T_CALLED("slk_attrset(%p,%s)"), SP_PARM, _traceattr(attr))); + T((T_CALLED("slk_attrset(%p,%s)"), (void *) SP_PARM, _traceattr(attr))); if (SP_PARM != 0 && SP_PARM->_slk != 0) { SetAttr(SP_PARM->_slk->attr, attr); diff --git a/ncurses/base/lib_slkattr.c b/ncurses/base/lib_slkattr.c index 2e254da4..34aab2fb 100644 --- a/ncurses/base/lib_slkattr.c +++ b/ncurses/base/lib_slkattr.c @@ -38,12 +38,12 @@ */ #include -MODULE_ID("$Id: lib_slkattr.c,v 1.8 2009/02/21 17:48:14 tom Exp $") +MODULE_ID("$Id: lib_slkattr.c,v 1.9 2009/10/24 22:12:21 tom Exp $") NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(slk_attr) (NCURSES_SP_DCL0) { - T((T_CALLED("slk_attr(%p)"), SP_PARM)); + T((T_CALLED("slk_attr(%p)"), (void *) SP_PARM)); if (SP_PARM != 0 && SP_PARM->_slk != 0) { attr_t result = AttrOf(SP_PARM->_slk->attr) & ALL_BUT_COLOR; diff --git a/ncurses/base/lib_slkclear.c b/ncurses/base/lib_slkclear.c index 54d57816..ff4fe28c 100644 --- a/ncurses/base/lib_slkclear.c +++ b/ncurses/base/lib_slkclear.c @@ -40,14 +40,14 @@ */ #include -MODULE_ID("$Id: lib_slkclear.c,v 1.12 2009/02/21 17:47:14 tom Exp $") +MODULE_ID("$Id: lib_slkclear.c,v 1.13 2009/10/24 22:12:21 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_clear) (NCURSES_SP_DCL0) { int rc = ERR; - T((T_CALLED("slk_clear(%p)"), SP_PARM)); + T((T_CALLED("slk_clear(%p)"), (void *) SP_PARM)); if (SP_PARM != 0 && SP_PARM->_slk != 0) { SP_PARM->_slk->hidden = TRUE; diff --git a/ncurses/base/lib_slkcolor.c b/ncurses/base/lib_slkcolor.c index 17550bd1..c1211bcb 100644 --- a/ncurses/base/lib_slkcolor.c +++ b/ncurses/base/lib_slkcolor.c @@ -38,14 +38,14 @@ */ #include -MODULE_ID("$Id: lib_slkcolor.c,v 1.15 2009/02/21 16:59:50 tom Exp $") +MODULE_ID("$Id: lib_slkcolor.c,v 1.16 2009/10/24 22:12:21 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (NCURSES_SP_DCLx short color_pair_number) { int code = ERR; - T((T_CALLED("slk_color(%p,%d)"), SP_PARM, color_pair_number)); + T((T_CALLED("slk_color(%p,%d)"), (void *) SP_PARM, color_pair_number)); if (SP_PARM != 0 && SP_PARM->_slk != 0 diff --git a/ncurses/base/lib_slkinit.c b/ncurses/base/lib_slkinit.c index e7fa1221..f856a574 100644 --- a/ncurses/base/lib_slkinit.c +++ b/ncurses/base/lib_slkinit.c @@ -40,7 +40,7 @@ */ #include -MODULE_ID("$Id: lib_slkinit.c,v 1.11 2009/05/23 23:32:57 tom Exp $") +MODULE_ID("$Id: lib_slkinit.c,v 1.12 2009/10/24 22:12:21 tom Exp $") #ifdef USE_SP_RIPOFF #define SoftkeyFormat SP_PARM->slk_format @@ -53,7 +53,7 @@ NCURSES_SP_NAME(slk_init) (NCURSES_SP_DCLx int format) { int code = ERR; - T((T_CALLED("slk_init(%p,%d)"), SP_PARM, format)); + T((T_CALLED("slk_init(%p,%d)"), (void *) SP_PARM, format)); if (format >= 0 && format <= 3 diff --git a/ncurses/base/lib_slklab.c b/ncurses/base/lib_slklab.c index 85bb8cbd..d0b2a230 100644 --- a/ncurses/base/lib_slklab.c +++ b/ncurses/base/lib_slklab.c @@ -40,12 +40,12 @@ */ #include -MODULE_ID("$Id: lib_slklab.c,v 1.9 2009/02/21 18:48:42 tom Exp $") +MODULE_ID("$Id: lib_slklab.c,v 1.10 2009/10/24 22:12:21 tom Exp $") NCURSES_EXPORT(char *) NCURSES_SP_NAME(slk_label) (NCURSES_SP_DCLx int n) { - T((T_CALLED("slk_label(%p,%d)"), SP_PARM, n)); + T((T_CALLED("slk_label(%p,%d)"), (void *) SP_PARM, n)); if (SP_PARM == 0 || SP_PARM->_slk == 0 || n < 1 || n > SP_PARM->_slk->labcnt) returnPtr(0); diff --git a/ncurses/base/lib_slkrefr.c b/ncurses/base/lib_slkrefr.c index 01540f0f..167da9cd 100644 --- a/ncurses/base/lib_slkrefr.c +++ b/ncurses/base/lib_slkrefr.c @@ -43,7 +43,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_slkrefr.c,v 1.24 2009/08/29 18:43:13 tom Exp $") +MODULE_ID("$Id: lib_slkrefr.c,v 1.25 2009/10/24 22:12:21 tom Exp $") #ifdef USE_TERM_DRIVER #define NumLabels InfoOf(SP_PARM).numlabels @@ -144,7 +144,7 @@ slk_intern_refresh(SCREEN *sp) NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_noutrefresh) (NCURSES_SP_DCL0) { - T((T_CALLED("slk_noutrefresh(%p)"), SP_PARM)); + T((T_CALLED("slk_noutrefresh(%p)"), (void *) SP_PARM)); if (SP_PARM == 0 || SP_PARM->_slk == 0) returnCode(ERR); @@ -169,7 +169,7 @@ slk_noutrefresh(void) NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_refresh) (NCURSES_SP_DCL0) { - T((T_CALLED("slk_refresh(%p)"), SP_PARM)); + T((T_CALLED("slk_refresh(%p)"), (void *) SP_PARM)); if (SP_PARM == 0 || SP_PARM->_slk == 0) returnCode(ERR); diff --git a/ncurses/base/lib_slkset.c b/ncurses/base/lib_slkset.c index fa09bbf5..eba9f816 100644 --- a/ncurses/base/lib_slkset.c +++ b/ncurses/base/lib_slkset.c @@ -44,7 +44,7 @@ #endif #endif -MODULE_ID("$Id: lib_slkset.c,v 1.19 2009/02/21 17:34:06 tom Exp $") +MODULE_ID("$Id: lib_slkset.c,v 1.20 2009/10/24 22:12:21 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format) @@ -57,7 +57,7 @@ NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format) const char *str = astr; const char *p; - T((T_CALLED("slk_set(%p, %d, \"%s\", %d)"), SP_PARM, i, str, format)); + T((T_CALLED("slk_set(%p, %d, \"%s\", %d)"), (void *) SP_PARM, i, str, format)); if (SP_PARM == 0 || (slk = SP_PARM->_slk) == 0 diff --git a/ncurses/base/lib_slktouch.c b/ncurses/base/lib_slktouch.c index d27207ff..ba77fd23 100644 --- a/ncurses/base/lib_slktouch.c +++ b/ncurses/base/lib_slktouch.c @@ -38,12 +38,12 @@ */ #include -MODULE_ID("$Id: lib_slktouch.c,v 1.7 2009/02/21 17:42:59 tom Exp $") +MODULE_ID("$Id: lib_slktouch.c,v 1.8 2009/10/24 22:12:21 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_touch) (NCURSES_SP_DCL0) { - T((T_CALLED("slk_touch(%p)"), SP_PARM)); + T((T_CALLED("slk_touch(%p)"), (void *) SP_PARM)); if (SP_PARM == 0 || SP_PARM->_slk == 0) returnCode(ERR); diff --git a/ncurses/base/lib_touch.c b/ncurses/base/lib_touch.c index 2ac21f2e..3f8771a8 100644 --- a/ncurses/base/lib_touch.c +++ b/ncurses/base/lib_touch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2009 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 * @@ -43,12 +43,12 @@ #include -MODULE_ID("$Id: lib_touch.c,v 1.9 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_touch.c,v 1.10 2009/10/24 22:36:29 tom Exp $") NCURSES_EXPORT(bool) is_linetouched(WINDOW *win, int line) { - T((T_CALLED("is_linetouched(%p,%d)"), win, line)); + T((T_CALLED("is_linetouched(%p,%d)"), (void *) win, line)); /* XSI doesn't define any error */ if (!win || (line > win->_maxy) || (line < 0)) @@ -62,7 +62,7 @@ is_wintouched(WINDOW *win) { int i; - T((T_CALLED("is_wintouched(%p)"), win)); + T((T_CALLED("is_wintouched(%p)"), (void *) win)); if (win) for (i = 0; i <= win->_maxy; i++) @@ -76,7 +76,7 @@ wtouchln(WINDOW *win, int y, int n, int changed) { int i; - T((T_CALLED("wtouchln(%p,%d,%d,%d)"), win, y, n, changed)); + T((T_CALLED("wtouchln(%p,%d,%d,%d)"), (void *) win, y, n, changed)); if (!win || (n < 0) || (y < 0) || (y > win->_maxy)) returnCode(ERR); diff --git a/ncurses/base/lib_ungetch.c b/ncurses/base/lib_ungetch.c index 54a8998f..63a14cff 100644 --- a/ncurses/base/lib_ungetch.c +++ b/ncurses/base/lib_ungetch.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_ungetch.c,v 1.13 2009/04/18 20:30:12 tom Exp $") +MODULE_ID("$Id: lib_ungetch.c,v 1.14 2009/10/24 22:12:21 tom Exp $") #include @@ -62,7 +62,7 @@ safe_ungetch(SCREEN *sp, int ch) { int rc = ERR; - T((T_CALLED("ungetch(%p,%s)"), sp, _nc_tracechar(sp, ch))); + T((T_CALLED("ungetch(%p,%s)"), (void *) sp, _nc_tracechar(sp, ch))); if (tail != -1) { if (head == -1) { diff --git a/ncurses/base/lib_vline.c b/ncurses/base/lib_vline.c index 1a2537e7..a396e082 100644 --- a/ncurses/base/lib_vline.c +++ b/ncurses/base/lib_vline.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2009 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 * @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: lib_vline.c,v 1.10 2006/03/11 21:52:19 tom Exp $") +MODULE_ID("$Id: lib_vline.c,v 1.11 2009/10/24 22:36:15 tom Exp $") NCURSES_EXPORT(int) wvline(WINDOW *win, chtype ch, int n) @@ -49,7 +49,7 @@ wvline(WINDOW *win, chtype ch, int n) NCURSES_SIZE_T row, col; NCURSES_SIZE_T end; - T((T_CALLED("wvline(%p,%s,%d)"), win, _tracechtype(ch), n)); + T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracechtype(ch), n)); if (win) { NCURSES_CH_T wch; diff --git a/ncurses/base/lib_wattroff.c b/ncurses/base/lib_wattroff.c index bf2020e0..fff0b395 100644 --- a/ncurses/base/lib_wattroff.c +++ b/ncurses/base/lib_wattroff.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2009 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 * @@ -42,12 +42,12 @@ #include #include -MODULE_ID("$Id: lib_wattroff.c,v 1.9 2006/05/27 19:30:33 tom Exp $") +MODULE_ID("$Id: lib_wattroff.c,v 1.10 2009/10/24 22:36:08 tom Exp $") NCURSES_EXPORT(int) wattr_off(WINDOW *win, attr_t at, void *opts GCC_UNUSED) { - T((T_CALLED("wattr_off(%p,%s)"), win, _traceattr(at))); + T((T_CALLED("wattr_off(%p,%s)"), (void *) win, _traceattr(at))); if (win) { T(("... current %s (%d)", _traceattr(WINDOW_ATTRS(win)), diff --git a/ncurses/base/lib_wattron.c b/ncurses/base/lib_wattron.c index 2e17d965..611feaa3 100644 --- a/ncurses/base/lib_wattron.c +++ b/ncurses/base/lib_wattron.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2009 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 * @@ -42,12 +42,12 @@ #include #include -MODULE_ID("$Id: lib_wattron.c,v 1.9 2006/05/27 19:30:46 tom Exp $") +MODULE_ID("$Id: lib_wattron.c,v 1.10 2009/10/24 22:36:01 tom Exp $") NCURSES_EXPORT(int) wattr_on(WINDOW *win, attr_t at, void *opts GCC_UNUSED) { - T((T_CALLED("wattr_on(%p,%s)"), win, _traceattr(at))); + T((T_CALLED("wattr_on(%p,%s)"), (void *) win, _traceattr(at))); if (win != 0) { T(("... current %s (%d)", _traceattr(WINDOW_ATTRS(win)), diff --git a/ncurses/base/lib_winch.c b/ncurses/base/lib_winch.c index 5fb3f9e3..43c61459 100644 --- a/ncurses/base/lib_winch.c +++ b/ncurses/base/lib_winch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2009 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 * @@ -39,12 +39,12 @@ #include -MODULE_ID("$Id: lib_winch.c,v 1.6 2008/11/16 00:19:59 juergen Exp $") +MODULE_ID("$Id: lib_winch.c,v 1.7 2009/10/24 22:35:54 tom Exp $") NCURSES_EXPORT(chtype) winch(WINDOW *win) { - T((T_CALLED("winch(%p)"), win)); + T((T_CALLED("winch(%p)"), (void *) win)); if (win != 0) { returnChtype(CharOf(win->_line[win->_cury].text[win->_curx]) | AttrOf(win->_line[win->_cury].text[win->_curx])); diff --git a/ncurses/base/lib_window.c b/ncurses/base/lib_window.c index 2261a1f0..c740ea13 100644 --- a/ncurses/base/lib_window.c +++ b/ncurses/base/lib_window.c @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_window.c,v 1.26 2009/04/18 18:46:09 tom Exp $") +MODULE_ID("$Id: lib_window.c,v 1.27 2009/10/24 22:12:46 tom Exp $") NCURSES_EXPORT(void) _nc_synchook(WINDOW *win) @@ -58,7 +58,7 @@ mvderwin(WINDOW *win, int y, int x) WINDOW *orig; int i; - T((T_CALLED("mvderwin(%p,%d,%d)"), win, y, x)); + T((T_CALLED("mvderwin(%p,%d,%d)"), (void *) win, y, x)); if (win && (orig = win->_parent)) { if (win->_parx == x && win->_pary == y) @@ -82,7 +82,7 @@ NCURSES_EXPORT(int) syncok(WINDOW *win, bool bf) /* enable/disable automatic wsyncup() on each change to window */ { - T((T_CALLED("syncok(%p,%d)"), win, bf)); + T((T_CALLED("syncok(%p,%d)"), (void *) win, bf)); if (win) { win->_sync = bf; @@ -98,7 +98,7 @@ wsyncup(WINDOW *win) { WINDOW *wp; - T((T_CALLED("wsyncup(%p)"), win)); + T((T_CALLED("wsyncup(%p)"), (void *) win)); if (win && win->_parent) { for (wp = win; wp->_parent; wp = wp->_parent) { int y; @@ -128,7 +128,7 @@ wsyncdown(WINDOW *win) /* mark changed every cell in win that is changed in any of its ancestors */ /* Rewritten by J. Pfeifer, 1-Apr-96 (don't even think that...) */ { - T((T_CALLED("wsyncdown(%p)"), win)); + T((T_CALLED("wsyncdown(%p)"), (void *) win)); if (win && win->_parent) { WINDOW *pp = win->_parent; @@ -167,7 +167,7 @@ wcursyncup(WINDOW *win) { WINDOW *wp; - T((T_CALLED("wcursyncup(%p)"), win)); + T((T_CALLED("wcursyncup(%p)"), (void *) win)); for (wp = win; wp && wp->_parent; wp = wp->_parent) { wmove(wp->_parent, wp->_pary + wp->_cury, wp->_parx + wp->_curx); } @@ -182,7 +182,7 @@ dupwin(WINDOW *win) size_t linesize; int i; - T((T_CALLED("dupwin(%p)"), win)); + T((T_CALLED("dupwin(%p)"), (void *) win)); if (win != 0) { #if NCURSES_SP_FUNCS diff --git a/ncurses/base/resizeterm.c b/ncurses/base/resizeterm.c index 5ec3df6b..3db35fad 100644 --- a/ncurses/base/resizeterm.c +++ b/ncurses/base/resizeterm.c @@ -45,7 +45,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: resizeterm.c,v 1.41 2009/08/30 16:18:58 tom Exp $") +MODULE_ID("$Id: resizeterm.c,v 1.42 2009/10/24 20:38:43 tom Exp $") /* * If we're trying to be reentrant, do not want any local statics. @@ -71,13 +71,13 @@ show_window_sizes(const char *name) _nc_lock_global(curses); for (each_screen(sp)) { - _tracef("%s resizing: %p: %2d x %2d (%2d x %2d)", name, sp, + _tracef("%s resizing: %p: %2d x %2d (%2d x %2d)", name, (void *) sp, *(ptrLines(sp)), *(ptrCols(sp)), screen_lines(sp), screen_columns(sp)); for (each_window(sp, wp)) { _tracef(" window %p is %2ld x %2ld at %2ld,%2ld", - &(wp->win), + (void *) &(wp->win), (long) wp->win._maxy + 1, (long) wp->win._maxx + 1, (long) wp->win._begy, @@ -95,7 +95,7 @@ show_window_sizes(const char *name) NCURSES_EXPORT(bool) NCURSES_SP_NAME(is_term_resized) (NCURSES_SP_DCLx int ToLines, int ToCols) { - T((T_CALLED("is_term_resized(%p, %d, %d)"), SP_PARM, ToLines, ToCols)); + T((T_CALLED("is_term_resized(%p, %d, %d)"), (void *) SP_PARM, ToLines, ToCols)); returnCode(ToLines > 0 && ToCols > 0 && (ToLines != screen_lines(SP_PARM) @@ -214,7 +214,7 @@ adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen EXTRA_DCLS) ripoff_t *rop = ripped_window(win); T((T_CALLED("adjust_window(%p,%d,%d)%s depth %d/%d currently %ldx%ld at %ld,%ld"), - win, ToLines, ToCols, + (void *) win, ToLines, ToCols, (rop != 0) ? " (rip)" : "", parent_depth(win), child_depth(win), @@ -226,7 +226,7 @@ adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen EXTRA_DCLS) * If it is a ripped-off window at the bottom of the screen, simply * move it to the same relative position. */ - win->_begy = ToLines - ripped_bottom(win) - 0 - win->_yoffset; + win->_begy = (NCURSES_SIZE_T) (ToLines - ripped_bottom(win) - 0 - win->_yoffset); if (rop->hook == _nc_slk_initialize) _nc_format_slks( #if NCURSES_SP_FUNCS @@ -238,7 +238,7 @@ adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen EXTRA_DCLS) * If it is below the bottom of the new screen, move up by the same * amount that the screen shrank. */ - win->_begy += (ToLines - CurLines); + win->_begy = (NCURSES_SIZE_T) (win->_begy + (ToLines - CurLines)); } else { if (myLines == (CurLines - stolen) && ToLines != CurLines) { @@ -275,7 +275,7 @@ decrease_size(NCURSES_SP_DCLx int ToLines, int ToCols, int stolen EXTRA_DCLS) int depth = 0; WINDOWLIST *wp; - T((T_CALLED("decrease_size(%p, %d, %d)"), SP_PARM, ToLines, ToCols)); + T((T_CALLED("decrease_size(%p, %d, %d)"), (void *) SP_PARM, ToLines, ToCols)); do { found = FALSE; @@ -309,7 +309,7 @@ increase_size(NCURSES_SP_DCLx int ToLines, int ToCols, int stolen EXTRA_DCLS) int depth = 0; WINDOWLIST *wp; - T((T_CALLED("increase_size(%p, %d, %d)"), SP_PARM, ToLines, ToCols)); + T((T_CALLED("increase_size(%p, %d, %d)"), (void *) SP_PARM, ToLines, ToCols)); do { found = FALSE; @@ -343,9 +343,9 @@ NCURSES_SP_NAME(resize_term) (NCURSES_SP_DCLx int ToLines, int ToCols) int was_stolen; T((T_CALLED("resize_term(%p,%d,%d) old(%d,%d)"), - SP_PARM, ToLines, ToCols, - SP_PARM == 0 ? -1 : screen_lines(SP_PARM), - SP_PARM == 0 ? -1 : screen_columns(SP_PARM))); + (void *) SP_PARM, ToLines, ToCols, + (SP_PARM == 0) ? -1 : screen_lines(SP_PARM), + (SP_PARM == 0) ? -1 : screen_columns(SP_PARM))); if (SP_PARM == 0) { returnCode(ERR); @@ -383,17 +383,17 @@ NCURSES_SP_NAME(resize_term) (NCURSES_SP_DCLx int ToLines, int ToCols) decrease_size(NCURSES_SP_ARGx ToLines, ToCols, was_stolen EXTRA_ARGS); } - screen_lines(SP_PARM) = ToLines; - screen_columns(SP_PARM) = ToCols; + screen_lines(SP_PARM) = (NCURSES_SIZE_T) ToLines; + screen_columns(SP_PARM) = (NCURSES_SIZE_T) ToCols; #ifdef USE_TERM_DRIVER CallDriver_2(SP_PARM, setsize, ToLines, ToCols); #else - lines = ToLines; - columns = ToCols; + lines = (NCURSES_SIZE_T) ToLines; + columns = (NCURSES_SIZE_T) ToCols; #endif - SP_PARM->_lines_avail = ToLines - was_stolen; + SP_PARM->_lines_avail = (NCURSES_SIZE_T) (ToLines - was_stolen); if (SP_PARM->oldhash) { FreeAndNull(SP_PARM->oldhash); @@ -449,8 +449,9 @@ NCURSES_SP_NAME(resizeterm) (NCURSES_SP_DCLx int ToLines, int ToCols) int result = ERR; T((T_CALLED("resizeterm(%p, %d,%d) old(%d,%d)"), - SP_PARM, ToLines, ToCols, - SP_PARM == 0 ? -1 : screen_lines(SP_PARM), screen_columns(SP_PARM))); + (void *) SP_PARM, ToLines, ToCols, + (SP_PARM == 0) ? -1 : screen_lines(SP_PARM), + screen_columns(SP_PARM))); if (SP_PARM != 0) { result = OK; diff --git a/ncurses/base/tries.c b/ncurses/base/tries.c index 402bd2f7..6bbe6de5 100644 --- a/ncurses/base/tries.c +++ b/ncurses/base/tries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: tries.c,v 1.28 2008/11/16 00:19:59 juergen Exp $") +MODULE_ID("$Id: tries.c,v 1.29 2009/10/24 22:39:11 tom Exp $") /* * Expand a keycode into the string that it corresponds to, returning null if @@ -89,7 +89,7 @@ _nc_expand_try(TRIES * tree, unsigned code, int *count, size_t len) NCURSES_EXPORT(int) _nc_remove_key(TRIES ** tree, unsigned code) { - T((T_CALLED("_nc_remove_key(%p,%d)"), tree, code)); + T((T_CALLED("_nc_remove_key(%p,%d)"), (void *) tree, code)); if (code == 0) returnCode(FALSE); @@ -121,7 +121,7 @@ _nc_remove_key(TRIES ** tree, unsigned code) NCURSES_EXPORT(int) _nc_remove_string(TRIES ** tree, const char *string) { - T((T_CALLED("_nc_remove_string(%p,%s)"), tree, _nc_visbuf(string))); + T((T_CALLED("_nc_remove_string(%p,%s)"), (void *) tree, _nc_visbuf(string))); if (string == 0 || *string == 0) returnCode(FALSE); diff --git a/ncurses/base/use_window.c b/ncurses/base/use_window.c index f6408c37..8eb73391 100644 --- a/ncurses/base/use_window.c +++ b/ncurses/base/use_window.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2007-2008,2009 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 * @@ -32,14 +32,14 @@ #include -MODULE_ID("$Id: use_window.c,v 1.8 2008/06/07 14:13:46 tom Exp $") +MODULE_ID("$Id: use_window.c,v 1.9 2009/10/24 22:40:24 tom Exp $") NCURSES_EXPORT(int) use_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data) { int code = OK; - T((T_CALLED("use_window(%p,%p,%p)"), win, func, data)); + T((T_CALLED("use_window(%p,%p,%p)"), (void *) win, func, data)); _nc_lock_global(curses); code = func(win, data); _nc_unlock_global(curses); diff --git a/ncurses/base/wresize.c b/ncurses/base/wresize.c index e441b669..d5ce3974 100644 --- a/ncurses/base/wresize.c +++ b/ncurses/base/wresize.c @@ -33,7 +33,7 @@ #include -MODULE_ID("$Id: wresize.c,v 1.31 2009/05/23 19:50:16 tom Exp $") +MODULE_ID("$Id: wresize.c,v 1.32 2009/10/24 22:15:00 tom Exp $") static int cleanup_lines(struct ldat *data, int length) @@ -97,7 +97,7 @@ wresize(WINDOW *win, int ToLines, int ToCols) struct ldat *new_lines = 0; #ifdef TRACE - T((T_CALLED("wresize(%p,%d,%d)"), win, ToLines, ToCols)); + T((T_CALLED("wresize(%p,%d,%d)"), (void *) win, ToLines, ToCols)); if (win) { TR(TRACE_UPDATE, ("...beg (%ld, %ld), max(%ld,%ld), reg(%ld,%ld)", (long) win->_begy, (long) win->_begx, diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index f0e9f767..256c6f98 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -35,7 +35,7 @@ /* - * $Id: curses.priv.h,v 1.439 2009/09/26 22:25:35 tom Exp $ + * $Id: curses.priv.h,v 1.441 2009/10/24 20:29:56 tom Exp $ * * curses.priv.h * @@ -1257,7 +1257,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; putc(PUTC_ch,b); \ break; \ } \ - fwrite(PUTC_buf, (unsigned) PUTC_n, 1, b); \ + IGNORE_RC(fwrite(PUTC_buf, (unsigned) PUTC_n, 1, b)); \ } \ COUNT_OUTCHARS(PUTC_i); \ } } } while (0) @@ -1500,6 +1500,15 @@ extern NCURSES_EXPORT(const char *) _nc_viscbuf (const NCURSES_CH_T *, int); #endif /* TRACE/!TRACE */ +/* + * Workaround for defective implementation of gcc attribute warn_unused_result + */ +#if defined(__GNUC__) && defined(_FORTIFY_SOURCE) +#define IGNORE_RC(func) errno = func +#else +#define IGNORE_RC(func) (void) func +#endif /* gcc workarounds */ + /* * Return-codes for tgetent() and friends. */ @@ -1833,6 +1842,26 @@ extern NCURSES_EXPORT(int) _nc_eventlist_timeout(_nc_eventlist *); #define wgetnstr_events(win, str, maxlen, evl) wgetnstr(win, str, maxlen) #endif +/* + * Wide-character macros to hide some platform-differences. + */ +#if USE_WIDEC_SUPPORT +#if HAVE_MBTOWC && HAVE_MBLEN +#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) +#define count_mbytes(buffer,length,state) mblen(buffer,length) +#define check_mbytes(wch,buffer,length,state) \ + (int) mbtowc(&wch, buffer, length) +#define state_unused +#elif HAVE_MBRTOWC && HAVE_MBRLEN +#define reset_mbytes(state) init_mb(state) +#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state) +#define check_mbytes(wch,buffer,length,state) \ + (int) mbrtowc(&wch, buffer, length, &state) +#else +make an error +#endif +#endif + /* * Not everyone has vsscanf(), but we'd like to use it for scanw(). */ diff --git a/ncurses/tinfo/add_tries.c b/ncurses/tinfo/add_tries.c index 455d142e..fb6dd5c5 100644 --- a/ncurses/tinfo/add_tries.c +++ b/ncurses/tinfo/add_tries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2009 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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: add_tries.c,v 1.8 2006/12/30 23:15:26 tom Exp $") +MODULE_ID("$Id: add_tries.c,v 1.9 2009/10/24 22:41:36 tom Exp $") #define SET_TRY(dst,src) if ((dst->ch = *src++) == 128) dst->ch = '\0' #define CMP_TRY(a,b) ((a)? (a == b) : (b == 128)) @@ -50,7 +50,8 @@ _nc_add_to_try(TRIES ** tree, const char *str, unsigned code) TRIES *ptr, *savedptr; unsigned const char *txt = (unsigned const char *) str; - T((T_CALLED("_nc_add_to_try(%p, %s, %u)"), *tree, _nc_visbuf(str), code)); + T((T_CALLED("_nc_add_to_try(%p, %s, %u)"), + (void *) *tree, _nc_visbuf(str), code)); if (txt == 0 || *txt == '\0' || code == 0) returnCode(ERR); diff --git a/ncurses/tinfo/lib_baudrate.c b/ncurses/tinfo/lib_baudrate.c index f80303e0..854442a9 100644 --- a/ncurses/tinfo/lib_baudrate.c +++ b/ncurses/tinfo/lib_baudrate.c @@ -79,7 +79,7 @@ #undef USE_OLD_TTY #endif /* USE_OLD_TTY */ -MODULE_ID("$Id: lib_baudrate.c,v 1.29 2009/02/21 17:22:13 tom Exp $") +MODULE_ID("$Id: lib_baudrate.c,v 1.30 2009/10/24 22:15:00 tom Exp $") /* * int @@ -198,7 +198,7 @@ NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) { int result; - T((T_CALLED("baudrate(%p)"), SP_PARM)); + T((T_CALLED("baudrate(%p)"), (void *) SP_PARM)); /* * In debugging, allow the environment symbol to override when we're diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index 7607d74e..8c933b23 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -40,7 +40,7 @@ #include /* TTY, cur_term */ #include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.27 2009/09/13 14:40:05 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.28 2009/10/24 22:15:00 tom Exp $") #undef CUR #define CUR termp->type. @@ -82,7 +82,7 @@ NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) { TERMINAL *oldterm; - T((T_CALLED("set_curterm(%p)"), termp)); + T((T_CALLED("set_curterm(%p)"), (void *) termp)); _nc_lock_global(curses); oldterm = cur_term; @@ -110,7 +110,7 @@ NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) } _nc_unlock_global(curses); - T((T_RETURN("%p"), oldterm)); + T((T_RETURN("%p"), (void *) oldterm)); return (oldterm); } @@ -127,7 +127,7 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) { int rc = ERR; - T((T_CALLED("del_curterm(%p, %p)"), SP_PARM, termp)); + T((T_CALLED("del_curterm(%p, %p)"), (void *) SP_PARM, (void *) termp)); if (termp != 0) { #ifdef USE_TERM_DRIVER diff --git a/ncurses/tinfo/lib_has_cap.c b/ncurses/tinfo/lib_has_cap.c index f5af76cf..d1b9b8d9 100644 --- a/ncurses/tinfo/lib_has_cap.c +++ b/ncurses/tinfo/lib_has_cap.c @@ -46,14 +46,14 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_has_cap.c,v 1.8 2009/05/10 00:53:52 tom Exp $") +MODULE_ID("$Id: lib_has_cap.c,v 1.9 2009/10/24 22:15:47 tom Exp $") NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (NCURSES_SP_DCL0) { bool code = FALSE; - T((T_CALLED("has_ic(%p)"), SP_PARM)); + T((T_CALLED("has_ic(%p)"), (void *) SP_PARM)); if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) { code = ((insert_character || parm_ich @@ -76,7 +76,7 @@ NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_il) (NCURSES_SP_DCL0) { bool code = FALSE; - T((T_CALLED("has_il(%p)"), SP_PARM)); + T((T_CALLED("has_il(%p)"), (void *) SP_PARM)); if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) { code = ((insert_line || parm_insert_line) && (delete_line || parm_delete_line)) ? TRUE : FALSE; diff --git a/ncurses/tinfo/lib_kernel.c b/ncurses/tinfo/lib_kernel.c index 558b2073..8b4433ae 100644 --- a/ncurses/tinfo/lib_kernel.c +++ b/ncurses/tinfo/lib_kernel.c @@ -48,7 +48,7 @@ #include -MODULE_ID("$Id: lib_kernel.c,v 1.27 2009/06/06 21:25:50 tom Exp $") +MODULE_ID("$Id: lib_kernel.c,v 1.28 2009/10/24 22:15:47 tom Exp $") static int _nc_vdisable(void) @@ -84,7 +84,7 @@ NCURSES_SP_NAME(erasechar) (NCURSES_SP_DCL0) int result = ERR; TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("erasechar(%p)"), SP_PARM)); + T((T_CALLED("erasechar(%p)"), (void *) SP_PARM)); if (termp != 0) { #ifdef TERMIOS @@ -119,7 +119,7 @@ NCURSES_SP_NAME(killchar) (NCURSES_SP_DCL0) int result = ERR; TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("killchar(%p)"), SP_PARM)); + T((T_CALLED("killchar(%p)"), (void *) SP_PARM)); if (termp != 0) { #ifdef TERMIOS @@ -153,7 +153,7 @@ NCURSES_SP_NAME(flushinp) (NCURSES_SP_DCL0) { TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("flushinp(%p)"), SP_PARM)); + T((T_CALLED("flushinp(%p)"), (void *) SP_PARM)); if (termp != 0) { #ifdef TERMIOS diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index 5aaef468..654bf940 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -46,13 +46,13 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_options.c,v 1.70 2009/08/16 14:16:38 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.71 2009/10/24 21:56:15 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) { int res = ERR; - T((T_CALLED("idlok(%p,%d)"), win, flag)); + T((T_CALLED("idlok(%p,%d)"), (void *) win, flag)); if (win) { SCREEN *sp = _nc_screen_of(win); @@ -69,7 +69,7 @@ idlok(WINDOW *win, bool flag) NCURSES_EXPORT(void) idcok(WINDOW *win, bool flag) { - T((T_CALLED("idcok(%p,%d)"), win, flag)); + T((T_CALLED("idcok(%p,%d)"), (void *) win, flag)); if (win) { SCREEN *sp = _nc_screen_of(win); @@ -81,7 +81,7 @@ idcok(WINDOW *win, bool flag) NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t) { - T((T_CALLED("halfdelay(%p,%d)"), SP_PARM, t)); + T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t)); if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM)) returnCode(ERR); @@ -102,7 +102,7 @@ halfdelay(int t) NCURSES_EXPORT(int) nodelay(WINDOW *win, bool flag) { - T((T_CALLED("nodelay(%p,%d)"), win, flag)); + T((T_CALLED("nodelay(%p,%d)"), (void *) win, flag)); if (win) { if (flag == TRUE) @@ -117,7 +117,7 @@ nodelay(WINDOW *win, bool flag) NCURSES_EXPORT(int) notimeout(WINDOW *win, bool f) { - T((T_CALLED("notimeout(%p,%d)"), win, f)); + T((T_CALLED("notimeout(%p,%d)"), (void *) win, f)); if (win) { win->_notimeout = f; @@ -129,7 +129,7 @@ notimeout(WINDOW *win, bool f) NCURSES_EXPORT(void) wtimeout(WINDOW *win, int delay) { - T((T_CALLED("wtimeout(%p,%d)"), win, delay)); + T((T_CALLED("wtimeout(%p,%d)"), (void *) win, delay)); if (win) { win->_delay = delay; @@ -140,7 +140,7 @@ wtimeout(WINDOW *win, int delay) NCURSES_EXPORT(int) keypad(WINDOW *win, bool flag) { - T((T_CALLED("keypad(%p,%d)"), win, flag)); + T((T_CALLED("keypad(%p,%d)"), (void *) win, flag)); if (win) { win->_use_keypad = flag; @@ -156,7 +156,7 @@ meta(WINDOW *win GCC_UNUSED, bool flag) SCREEN *sp = (win == 0) ? CURRENT_SCREEN : _nc_screen_of(win); /* Ok, we stay relaxed and don't signal an error if win is NULL */ - T((T_CALLED("meta(%p,%d)"), win, flag)); + T((T_CALLED("meta(%p,%d)"), (void *) win, flag)); /* Ok, we stay relaxed and don't signal an error if win is NULL */ @@ -188,7 +188,7 @@ NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis) { int code = ERR; - T((T_CALLED("curs_set(%p,%d)"), SP_PARM, vis)); + T((T_CALLED("curs_set(%p,%d)"), (void *) SP_PARM, vis)); if (SP_PARM != 0 && vis >= 0 && vis <= 2) { int cursor = SP_PARM->_cursor; @@ -235,7 +235,7 @@ curs_set(int vis) NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd) { - T((T_CALLED("typeahead(%p, %d)"), SP_PARM, fd)); + T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd)); if (IsValidTIScreen(SP_PARM)) { SP_PARM->_checkfd = fd; returnCode(OK); @@ -283,7 +283,7 @@ TINFO_HAS_KEY(SCREEN *sp, int keycode) NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (NCURSES_SP_DCLx int keycode) { - T((T_CALLED("has_key(%p,%d)"), SP_PARM, keycode)); + T((T_CALLED("has_key(%p,%d)"), (void *) SP_PARM, keycode)); returnCode(SP != 0 ? has_key_internal(keycode, SP_PARM->_keytry) : FALSE); } diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c index aea5df54..7f67a752 100644 --- a/ncurses/tinfo/lib_raw.c +++ b/ncurses/tinfo/lib_raw.c @@ -49,7 +49,7 @@ #include -MODULE_ID("$Id: lib_raw.c,v 1.17 2009/08/01 23:11:02 tom Exp $") +MODULE_ID("$Id: lib_raw.c,v 1.18 2009/10/24 21:56:15 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -82,7 +82,7 @@ NCURSES_SP_NAME(raw) (NCURSES_SP_DCL0) int result = ERR; TERMINAL *termp; - T((T_CALLED("raw(%p)"), SP_PARM)); + T((T_CALLED("raw(%p)"), (void *) SP_PARM)); if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; @@ -123,7 +123,7 @@ NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0) int result = ERR; TERMINAL *termp; - T((T_CALLED("cbreak(%p)"), SP_PARM)); + T((T_CALLED("cbreak(%p)"), (void *) SP_PARM)); if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; @@ -168,7 +168,7 @@ NCURSES_SP_NAME(qiflush) (NCURSES_SP_DCL0) int result = ERR; TERMINAL *termp; - T((T_CALLED("qiflush(%p)"), SP_PARM)); + T((T_CALLED("qiflush(%p)"), (void *) SP_PARM)); if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; @@ -201,7 +201,7 @@ NCURSES_SP_NAME(noraw) (NCURSES_SP_DCL0) int result = ERR; TERMINAL *termp; - T((T_CALLED("noraw(%p)"), SP_PARM)); + T((T_CALLED("noraw(%p)"), (void *) SP_PARM)); if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; @@ -241,7 +241,7 @@ NCURSES_SP_NAME(nocbreak) (NCURSES_SP_DCL0) int result = ERR; TERMINAL *termp; - T((T_CALLED("nocbreak(%p)"), SP_PARM)); + T((T_CALLED("nocbreak(%p)"), (void *) SP_PARM)); if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; @@ -279,7 +279,7 @@ NCURSES_SP_NAME(noqiflush) (NCURSES_SP_DCL0) int result = ERR; TERMINAL *termp; - T((T_CALLED("noqiflush(%p)"), SP_PARM)); + T((T_CALLED("noqiflush(%p)"), (void *) SP_PARM)); if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; @@ -319,7 +319,7 @@ NCURSES_SP_NAME(intrflush) (NCURSES_SP_DCLx WINDOW *win GCC_UNUSED, bool flag) int result = ERR; TERMINAL *termp; - T((T_CALLED("intrflush(%p,%d)"), SP_PARM, flag)); + T((T_CALLED("intrflush(%p,%d)"), (void *) SP_PARM, flag)); if (SP_PARM == 0) returnCode(ERR); diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 1cc367cd..891a1012 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -52,7 +52,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.119 2009/09/05 20:10:02 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.120 2009/10/24 21:56:15 tom Exp $") /**************************************************************************** * @@ -224,7 +224,7 @@ _nc_handle_sigwinch(SCREEN *sp) NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (NCURSES_SP_DCLx bool f) { - T((T_CALLED("use_env(%p,%d)"), SP_PARM, (int) f)); + T((T_CALLED("use_env(%p,%d)"), (void *) SP_PARM, (int) f)); #if NCURSES_SP_FUNCS if (IsPreScreen(SP_PARM)) { SP_PARM->_use_env = f; @@ -602,7 +602,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp, termp = *tp; #else termp = cur_term; - T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, errret)); + T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, (void *) errret)); #endif if (tname == 0) { diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index 92cd451b..893d117d 100644 --- a/ncurses/tinfo/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.c @@ -50,7 +50,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_termcap.c,v 1.70 2009/08/30 17:16:00 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.71 2009/10/24 21:56:58 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -226,7 +226,7 @@ NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id) int result = 0; /* Solaris returns zero for missing flag */ int i, j; - T((T_CALLED("tgetflag(%p, %s)"), SP_PARM, id)); + T((T_CALLED("tgetflag(%p, %s)"), (void *) SP_PARM, id)); if (HasTInfoTerminal(SP_PARM)) { TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); struct name_table_entry const *entry_ptr; @@ -278,7 +278,7 @@ NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id) int result = ABSENT_NUMERIC; int i, j; - T((T_CALLED("tgetnum(%p, %s)"), SP_PARM, id)); + T((T_CALLED("tgetnum(%p, %s)"), (void *) SP_PARM, id)); if (HasTInfoTerminal(SP_PARM)) { TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); struct name_table_entry const *entry_ptr; @@ -330,7 +330,7 @@ NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area) char *result = NULL; int i, j; - T((T_CALLED("tgetstr(%s,%p)"), id, area)); + T((T_CALLED("tgetstr(%s,%p)"), id, (void *) area)); if (HasTInfoTerminal(SP_PARM)) { TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); struct name_table_entry const *entry_ptr; diff --git a/ncurses/tinfo/lib_termname.c b/ncurses/tinfo/lib_termname.c index 9163c7cd..e3f6827e 100644 --- a/ncurses/tinfo/lib_termname.c +++ b/ncurses/tinfo/lib_termname.c @@ -28,14 +28,14 @@ #include -MODULE_ID("$Id: lib_termname.c,v 1.11 2009/02/21 16:37:12 tom Exp $") +MODULE_ID("$Id: lib_termname.c,v 1.12 2009/10/24 21:56:58 tom Exp $") NCURSES_EXPORT(char *) NCURSES_SP_NAME(termname) (NCURSES_SP_DCL0) { char *name = 0; - T((T_CALLED("termname(%p)"), SP_PARM)); + T((T_CALLED("termname(%p)"), (void *) SP_PARM)); #if NCURSES_SP_FUNCS if (TerminalOf(SP_PARM) != 0) { diff --git a/ncurses/tinfo/lib_ti.c b/ncurses/tinfo/lib_ti.c index 6c94772a..bc618cd5 100644 --- a/ncurses/tinfo/lib_ti.c +++ b/ncurses/tinfo/lib_ti.c @@ -37,7 +37,7 @@ #include #include -MODULE_ID("$Id: lib_ti.c,v 1.27 2009/07/28 22:03:36 tom Exp $") +MODULE_ID("$Id: lib_ti.c,v 1.28 2009/10/24 21:56:58 tom Exp $") #if 0 static bool @@ -56,7 +56,7 @@ NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str) int result = ABSENT_BOOLEAN; int i, j; - T((T_CALLED("tigetflag(%p, %s)"), SP_PARM, str)); + T((T_CALLED("tigetflag(%p, %s)"), (void *) SP_PARM, str)); if (HasTInfoTerminal(SP_PARM)) { TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); @@ -101,7 +101,7 @@ NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str) int i, j; int result = CANCELLED_NUMERIC; /* Solaris returns a -1 on error */ - T((T_CALLED("tigetnum(%p, %s)"), SP_PARM, str)); + T((T_CALLED("tigetnum(%p, %s)"), (void *) SP_PARM, str)); if (HasTInfoTerminal(SP_PARM)) { TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); @@ -148,7 +148,7 @@ NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str) char *result = CANCELLED_STRING; int i, j; - T((T_CALLED("tigetstr(%p, %s)"), SP_PARM, str)); + T((T_CALLED("tigetstr(%p, %s)"), (void *) SP_PARM, str)); if (HasTInfoTerminal(SP_PARM)) { TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c index 9d859527..35f48174 100644 --- a/ncurses/tinfo/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -51,7 +51,7 @@ #include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.78 2009/10/10 16:01:42 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.79 2009/10/24 21:56:58 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ @@ -83,7 +83,7 @@ static NCURSES_SP_OUTC my_outch = NCURSES_SP_NAME(_nc_outch); NCURSES_EXPORT(int) NCURSES_SP_NAME(delay_output) (NCURSES_SP_DCLx int ms) { - T((T_CALLED("delay_output(%p,%d)"), SP_PARM, ms)); + T((T_CALLED("delay_output(%p,%d)"), (void *) SP_PARM, ms)); if (!HasTInfoTerminal(SP_PARM)) returnCode(ERR); @@ -213,7 +213,7 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx if (outc == NCURSES_SP_NAME(_nc_outch)) (void) strcpy(addrbuf, "_nc_outch"); else - (void) sprintf(addrbuf, "%p", outc); + (void) sprintf(addrbuf, "%p", (void *) outc); if (_nc_tputs_trace) { _tracef("tputs(%s = %s, %d, %s) called", _nc_tputs_trace, _nc_visbuf(string), affcnt, addrbuf); diff --git a/ncurses/tinfo/lib_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c index 17b13b2d..d0d58251 100644 --- a/ncurses/tinfo/lib_ttyflags.c +++ b/ncurses/tinfo/lib_ttyflags.c @@ -41,7 +41,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_ttyflags.c,v 1.25 2009/06/06 19:10:05 tom Exp $") +MODULE_ID("$Id: lib_ttyflags.c,v 1.26 2009/10/24 22:15:47 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) @@ -137,7 +137,7 @@ NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0) int rc = ERR; TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("def_shell_mode(%p)"), SP_PARM)); + T((T_CALLED("def_shell_mode(%p)"), (void *) SP_PARM)); if (termp != 0) { #ifdef USE_TERM_DRIVER @@ -175,7 +175,7 @@ NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0) int rc = ERR; TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("def_prog_mode(%p)"), SP_PARM)); + T((T_CALLED("def_prog_mode(%p)"), (void *) SP_PARM)); if (termp != 0) { #ifdef USE_TERM_DRIVER @@ -211,7 +211,7 @@ NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_DCL0) int rc = ERR; TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("reset_prog_mode(%p)"), SP_PARM)); + T((T_CALLED("reset_prog_mode(%p)"), (void *) SP_PARM)); if (termp != 0) { #ifdef USE_TERM_DRIVER @@ -244,7 +244,7 @@ NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_DCL0) int rc = ERR; TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("reset_shell_mode(%p)"), SP_PARM)); + T((T_CALLED("reset_shell_mode(%p)"), (void *) SP_PARM)); if (termp != 0) { #ifdef USE_TERM_DRIVER @@ -293,7 +293,7 @@ saved_tty(NCURSES_SP_DCL0) NCURSES_EXPORT(int) NCURSES_SP_NAME(savetty) (NCURSES_SP_DCL0) { - T((T_CALLED("savetty(%p)"), SP_PARM)); + T((T_CALLED("savetty(%p)"), (void *) SP_PARM)); returnCode(NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); } @@ -308,7 +308,7 @@ savetty(void) NCURSES_EXPORT(int) NCURSES_SP_NAME(resetty) (NCURSES_SP_DCL0) { - T((T_CALLED("resetty(%p)"), SP_PARM)); + T((T_CALLED("resetty(%p)"), (void *) SP_PARM)); returnCode(NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); } diff --git a/ncurses/tinfo/use_screen.c b/ncurses/tinfo/use_screen.c index 3b3f7361..6a0297ce 100644 --- a/ncurses/tinfo/use_screen.c +++ b/ncurses/tinfo/use_screen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2007-2008,2009 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 * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: use_screen.c,v 1.7 2008/11/16 00:19:59 juergen Exp $") +MODULE_ID("$Id: use_screen.c,v 1.8 2009/10/24 22:40:20 tom Exp $") NCURSES_EXPORT(int) use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) @@ -40,7 +40,7 @@ use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) SCREEN *save_SP; int code = OK; - T((T_CALLED("use_screen(%p,%p,%p)"), screen, func, data)); + T((T_CALLED("use_screen(%p,%p,%p)"), (void *) screen, func, (void *) data)); /* * FIXME - add a flag so a given thread can check if _it_ has already diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c index 0c733cd8..799d3afc 100644 --- a/ncurses/trace/lib_trace.c +++ b/ncurses/trace/lib_trace.c @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: lib_trace.c,v 1.72 2009/02/28 20:37:37 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.73 2009/10/24 21:56:58 tom Exp $") NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ @@ -272,7 +272,7 @@ _nc_retrace_void_ptr(void *code) NCURSES_EXPORT(SCREEN *) _nc_retrace_sp(SCREEN *code) { - T((T_RETURN("%p"), code)); + T((T_RETURN("%p"), (void *) code)); return code; } @@ -280,7 +280,7 @@ _nc_retrace_sp(SCREEN *code) NCURSES_EXPORT(WINDOW *) _nc_retrace_win(WINDOW *code) { - T((T_RETURN("%p"), code)); + T((T_RETURN("%p"), (void *) code)); return code; } diff --git a/ncurses/trace/trace_tries.c b/ncurses/trace/trace_tries.c index ad19fb78..c4274643 100644 --- a/ncurses/trace/trace_tries.c +++ b/ncurses/trace/trace_tries.c @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: trace_tries.c,v 1.14 2009/03/28 20:44:01 tom Exp $") +MODULE_ID("$Id: trace_tries.c,v 1.15 2009/10/24 22:15:47 tom Exp $") #ifdef TRACE #define my_buffer _nc_globals.tracetry_buf @@ -67,9 +67,9 @@ NCURSES_EXPORT(void) _nc_trace_tries(TRIES * tree) { my_buffer = typeMalloc(unsigned char, my_length = 80); - _tracef("BEGIN tries %p", tree); + _tracef("BEGIN tries %p", (void *) tree); recur_tries(tree, 0); - _tracef(". . . tries %p", tree); + _tracef(". . . tries %p", (void *) tree); free(my_buffer); } diff --git a/ncurses/tty/hardscroll.c b/ncurses/tty/hardscroll.c index af0b66c4..a270a27c 100644 --- a/ncurses/tty/hardscroll.c +++ b/ncurses/tty/hardscroll.c @@ -147,7 +147,7 @@ AUTHOR #include -MODULE_ID("$Id: hardscroll.c,v 1.43 2009/04/18 21:41:30 tom Exp $") +MODULE_ID("$Id: hardscroll.c,v 1.44 2009/10/24 21:57:38 tom Exp $") #if defined(SCROLLDEBUG) || defined(HASHDEBUG) @@ -188,7 +188,7 @@ NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_DCL0) int i; int start, end, shift; - TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize(%p)"), SP_PARM)); + TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize(%p)"), (void *) SP_PARM)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) #if USE_HASHMAP diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index 2b6ea7ae..9cecc5db 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -159,7 +159,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mvcur.c,v 1.121 2009/08/30 16:52:00 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.122 2009/10/24 22:05:03 tom Exp $") #define WANT_CHAR(sp, y, x) (sp)->_newscr->_line[y].text[x] /* desired state */ @@ -950,7 +950,7 @@ TINFO_MVCUR(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew) int code; TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("_nc_tinfo_mvcur(%p,%d,%d,%d,%d)"), - SP_PARM, yold, xold, ynew, xnew)); + (void *) SP_PARM, yold, xold, ynew, xnew)); if (SP_PARM == 0) { code = ERR; diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c index d2a8264a..6158dbd4 100644 --- a/ncurses/tty/lib_vidattr.c +++ b/ncurses/tty/lib_vidattr.c @@ -69,7 +69,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_vidattr.c,v 1.58 2009/08/15 22:12:01 tom Exp $") +MODULE_ID("$Id: lib_vidattr.c,v 1.59 2009/10/24 22:12:21 tom Exp $") #define doPut(mode) \ TPUTS_TRACE(#mode); \ @@ -113,7 +113,7 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx newmode &= A_ATTRIBUTES; - T((T_CALLED("vidputs(%p,%s)"), SP_PARM, _traceattr(newmode))); + T((T_CALLED("vidputs(%p,%s)"), (void *) SP_PARM, _traceattr(newmode))); if (!IsTermInfo(SP_PARM)) returnCode(ERR); @@ -319,7 +319,7 @@ vidputs(chtype newmode, NCURSES_OUTC outc) NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (NCURSES_SP_DCLx chtype newmode) { - T((T_CALLED("vidattr(%p,%s)"), SP_PARM, _traceattr(newmode))); + T((T_CALLED("vidattr(%p,%s)"), (void *) SP_PARM, _traceattr(newmode))); returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx newmode, NCURSES_SP_NAME(_nc_outch))); @@ -338,7 +338,7 @@ NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0) { chtype attrs = A_NORMAL; - T((T_CALLED("termattrs(%p)"), SP_PARM)); + T((T_CALLED("termattrs(%p)"), (void *) SP_PARM)); #ifdef USE_TERM_DRIVER if (HasTerminal(SP_PARM)) attrs = CallDriver(SP_PARM, conattr); diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index 20c971c2..02ec4626 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -82,7 +82,7 @@ #include -MODULE_ID("$Id: tty_update.c,v 1.260 2009/09/26 18:14:44 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.262 2009/10/24 23:21:31 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -193,7 +193,7 @@ static NCURSES_INLINE void GoTo(NCURSES_SP_DCLx int const row, int const col) { TR(TRACE_MOVE, ("GoTo(%p, %d, %d) from (%d, %d)", - SP_PARM, row, col, SP_PARM->_cursrow, SP_PARM->_curscol)); + (void *) SP_PARM, row, col, SP_PARM->_cursrow, SP_PARM->_curscol)); position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo"); @@ -628,7 +628,10 @@ PutRange(NCURSES_SP_DCLx int i, j, same; TR(TRACE_CHARPUT, ("PutRange(%p, %p, %p, %d, %d, %d)", - SP_PARM, otext, ntext, row, first, last)); + (void *) SP_PARM, + (const void *) otext, + (const void *) ntext, + row, first, last)); if (otext != ntext && (last - first + 1) > SP_PARM->_inline_cost) { @@ -670,7 +673,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) struct tms before, after; #endif /* USE_TRACE_TIMES */ - T((T_CALLED("_nc_tinfo:doupdate(%p)"), SP_PARM)); + T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM)); #if !USE_REENTRANT /* @@ -1224,7 +1227,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno) int n; bool attrchanged = FALSE; - TR(TRACE_UPDATE, (T_CALLED("TransformLine(%p, %d)"), SP_PARM, lineno)); + TR(TRACE_UPDATE, (T_CALLED("TransformLine(%p, %d)"), (void *) SP_PARM, lineno)); /* copy new hash value to old one */ if (SP_PARM->oldhash && SP_PARM->newhash) @@ -1623,7 +1626,9 @@ ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) static void InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) { - TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called", SP_PARM, line, count)); + TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called", + (void *) SP_PARM, + (void *) line, count)); /* Prefer parm_ich as it has the smallest cost - no need to shift * the whole line on each character. */ @@ -1682,7 +1687,7 @@ DelChar(NCURSES_SP_DCLx int count) int n; TR(TRACE_UPDATE, ("DelChar(%p, %d) called, position = (%ld,%ld)", - SP_PARM, count, + (void *) SP_PARM, count, (long) NewScreen(SP_PARM)->_cury, (long) NewScreen(SP_PARM)->_curx)); @@ -1939,7 +1944,8 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx bool cursor_saved = FALSE; int res; - TR(TRACE_MOVE, ("_nc_scrolln(%p, %d, %d, %d, %d)", SP_PARM, n, top, bot, maxy)); + TR(TRACE_MOVE, ("_nc_scrolln(%p, %d, %d, %d, %d)", + (void *) SP_PARM, n, top, bot, maxy)); if (!IsValidScreen(SP_PARM)) return (ERR); diff --git a/ncurses/widechar/lib_add_wch.c b/ncurses/widechar/lib_add_wch.c index 4d79114c..04847e4e 100644 --- a/ncurses/widechar/lib_add_wch.c +++ b/ncurses/widechar/lib_add_wch.c @@ -39,7 +39,7 @@ #include #endif -MODULE_ID("$Id: lib_add_wch.c,v 1.8 2009/07/25 14:38:01 tom Exp $") +MODULE_ID("$Id: lib_add_wch.c,v 1.9 2009/10/24 22:45:42 tom Exp $") /* clone/adapt lib_addch.c */ static const cchar_t blankchar = NewChar(BLANK_TEXT); @@ -415,7 +415,8 @@ wadd_wch(WINDOW *win, const cchar_t *wch) { int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win, + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), + (void *) win, _tracecchar_t(wch))); if (win && (wadd_wch_nosync(win, *wch) != ERR)) { @@ -432,7 +433,8 @@ wecho_wchar(WINDOW *win, const cchar_t *wch) { int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), win, + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), + (void *) win, _tracecchar_t(wch))); if (win && (wadd_wch_nosync(win, *wch) != ERR)) { diff --git a/ncurses/widechar/lib_box_set.c b/ncurses/widechar/lib_box_set.c index 35fce46d..585c9496 100644 --- a/ncurses/widechar/lib_box_set.c +++ b/ncurses/widechar/lib_box_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002-2003,2009 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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_box_set.c,v 1.4 2003/12/06 18:02:13 tom Exp $") +MODULE_ID("$Id: lib_box_set.c,v 1.5 2009/10/24 22:36:56 tom Exp $") NCURSES_EXPORT(int) wborder_set(WINDOW *win, @@ -53,7 +53,7 @@ wborder_set(WINDOW *win, NCURSES_CH_T wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), - win, + (void *) win, _tracech_t2(1, ls), _tracech_t2(2, rs), _tracech_t2(3, ts), diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c index 28413f43..478f284c 100644 --- a/ncurses/widechar/lib_cchar.c +++ b/ncurses/widechar/lib_cchar.c @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: lib_cchar.c,v 1.14 2009/07/18 15:20:42 tom Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.16 2009/10/24 23:21:31 tom Exp $") /* * The SuSv2 description leaves some room for interpretation. We'll assume wch @@ -55,7 +55,7 @@ setcchar(cchar_t *wcval, int code = OK; TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"), - wcval, _nc_viswbuf(wch), + (void *) wcval, _nc_viswbuf(wch), (unsigned long) attrs, color_pair, opts)); len = wcslen(wch); @@ -104,7 +104,11 @@ getcchar(const cchar_t *wcval, int code = ERR; TR(TRACE_CCALLS, (T_CALLED("getcchar(%p,%p,%p,%p,%p)"), - wcval, wch, attrs, color_pair, opts)); + (const void *) wcval, + (void *) wch, + (void *) attrs, + (void *) color_pair, + opts)); if (opts == NULL) { len = (wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) diff --git a/ncurses/widechar/lib_get_wch.c b/ncurses/widechar/lib_get_wch.c index c6ab9277..fa024d2c 100644 --- a/ncurses/widechar/lib_get_wch.c +++ b/ncurses/widechar/lib_get_wch.c @@ -40,22 +40,7 @@ #include #include -MODULE_ID("$Id: lib_get_wch.c,v 1.18 2009/04/18 22:41:33 tom Exp $") - -#if HAVE_MBTOWC && HAVE_MBLEN -#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0) -#define count_mbytes(buffer,length,state) mblen(buffer,length) -#define check_mbytes(wch,buffer,length,state) \ - (int) mbtowc(&wch, buffer, length) -#define state_unused -#elif HAVE_MBRTOWC && HAVE_MBRLEN -#define reset_mbytes(state) init_mb(state) -#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state) -#define check_mbytes(wch,buffer,length,state) \ - (int) mbrtowc(&wch, buffer, length, &state) -#else -make an error -#endif +MODULE_ID("$Id: lib_get_wch.c,v 1.20 2009/10/24 22:42:25 tom Exp $") NCURSES_EXPORT(int) wget_wch(WINDOW *win, wint_t *result) @@ -71,7 +56,7 @@ wget_wch(WINDOW *win, wint_t *result) mbstate_t state; #endif - T((T_CALLED("wget_wch(%p)"), win)); + T((T_CALLED("wget_wch(%p)"), (void *) win)); /* * We can get a stream of single-byte characters and KEY_xxx codes from @@ -95,12 +80,12 @@ wget_wch(WINDOW *win, wint_t *result) * whether the improvement would be worth the effort. */ if (count != 0) { - safe_ungetch (SP_PARM, (int) value); + safe_ungetch(SP_PARM, (int) value); code = ERR; } break; } else if (count + 1 >= sizeof(buffer)) { - safe_ungetch (SP_PARM, (int) value); + safe_ungetch(SP_PARM, (int) value); code = ERR; break; } else { @@ -111,7 +96,7 @@ wget_wch(WINDOW *win, wint_t *result) reset_mbytes(state); if (check_mbytes(wch, buffer, count, state) != status) { code = ERR; /* the two calls should match */ - safe_ungetch (SP_PARM, (int) value); + safe_ungetch(SP_PARM, (int) value); } value = wch; break; diff --git a/ncurses/widechar/lib_get_wstr.c b/ncurses/widechar/lib_get_wstr.c index bbfbbbd2..0b450211 100644 --- a/ncurses/widechar/lib_get_wstr.c +++ b/ncurses/widechar/lib_get_wstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004,2008 Free Software Foundation, Inc. * + * Copyright (c) 2002-2008,2009 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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_get_wstr.c,v 1.11 2008/11/16 00:19:59 juergen Exp $") +MODULE_ID("$Id: lib_get_wstr.c,v 1.12 2009/10/24 22:38:11 tom Exp $") static int wadd_wint(WINDOW *win, wint_t *src) @@ -95,7 +95,7 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen) wint_t ch; int y, x, code; - T((T_CALLED("wgetn_wstr(%p,%p, %d)"), win, str, maxlen)); + T((T_CALLED("wgetn_wstr(%p,%p, %d)"), (void *) win, (void *) str, maxlen)); if (!win) returnCode(ERR); diff --git a/ncurses/widechar/lib_hline_set.c b/ncurses/widechar/lib_hline_set.c index 43175de8..4bd77fa4 100644 --- a/ncurses/widechar/lib_hline_set.c +++ b/ncurses/widechar/lib_hline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002,2009 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 * @@ -39,16 +39,16 @@ #include -MODULE_ID("$Id: lib_hline_set.c,v 1.2 2002/03/23 21:35:34 tom Exp $") +MODULE_ID("$Id: lib_hline_set.c,v 1.3 2009/10/24 22:42:50 tom Exp $") NCURSES_EXPORT(int) -whline_set(WINDOW *win, const cchar_t * ch, int n) +whline_set(WINDOW *win, const cchar_t *ch, int n) { int code = ERR; NCURSES_SIZE_T start; NCURSES_SIZE_T end; - T((T_CALLED("whline_set(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + T((T_CALLED("whline_set(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); if (win) { struct ldat *line = &(win->_line[win->_cury]); diff --git a/ncurses/widechar/lib_in_wch.c b/ncurses/widechar/lib_in_wch.c index 5cd92e38..b2396508 100644 --- a/ncurses/widechar/lib_in_wch.c +++ b/ncurses/widechar/lib_in_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004,2006 Free Software Foundation, Inc. * + * Copyright (c) 2002-2006,2009 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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_in_wch.c,v 1.4 2006/09/03 15:41:22 tom Exp $") +MODULE_ID("$Id: lib_in_wch.c,v 1.5 2009/10/24 22:37:55 tom Exp $") NCURSES_EXPORT(int) win_wch(WINDOW *win, cchar_t *wcval) @@ -47,7 +47,7 @@ win_wch(WINDOW *win, cchar_t *wcval) int row, col; int code = OK; - TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), win, wcval)); + TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), (void *) win, (void *) wcval)); if (win != 0 && wcval != 0) { getyx(win, row, col); diff --git a/ncurses/widechar/lib_in_wchnstr.c b/ncurses/widechar/lib_in_wchnstr.c index e9f0646e..57cc2ca6 100644 --- a/ncurses/widechar/lib_in_wchnstr.c +++ b/ncurses/widechar/lib_in_wchnstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004-2007 Free Software Foundation, Inc. * + * Copyright (c) 2002-2007,2009 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 * @@ -39,14 +39,14 @@ #include -MODULE_ID("$Id: lib_in_wchnstr.c,v 1.7 2007/02/11 01:00:00 tom Exp $") +MODULE_ID("$Id: lib_in_wchnstr.c,v 1.8 2009/10/24 22:37:48 tom Exp $") NCURSES_EXPORT(int) win_wchnstr(WINDOW *win, cchar_t *wchstr, int n) { int code = OK; - T((T_CALLED("win_wchnstr(%p,%p,%d)"), win, wchstr, n)); + T((T_CALLED("win_wchnstr(%p,%p,%d)"), (void *) win, (void *) wchstr, n)); if (win != 0 && wchstr != 0) { NCURSES_CH_T *src; diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c index ae3302c4..e44f091b 100644 --- a/ncurses/widechar/lib_ins_wch.c +++ b/ncurses/widechar/lib_ins_wch.c @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_ins_wch.c,v 1.10 2009/09/12 18:07:23 tom Exp $") +MODULE_ID("$Id: lib_ins_wch.c,v 1.11 2009/10/24 22:43:14 tom Exp $") /* * Insert the given character, updating the current location to simplify @@ -81,7 +81,7 @@ wins_wch(WINDOW *win, const cchar_t *wch) NCURSES_SIZE_T ox; int code = ERR; - T((T_CALLED("wins_wch(%p, %s)"), win, _tracecchar_t(wch))); + T((T_CALLED("wins_wch(%p, %s)"), (void *) win, _tracecchar_t(wch))); if (win != 0) { oy = win->_cury; @@ -104,7 +104,8 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) NCURSES_SIZE_T ox; const wchar_t *cp; - T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr, n), n)); + T((T_CALLED("wins_nwstr(%p,%s,%d)"), + (void *) win, _nc_viswbufn(wstr, n), n)); if (win != 0 && wstr != 0) { diff --git a/ncurses/widechar/lib_inwstr.c b/ncurses/widechar/lib_inwstr.c index 2207a5f5..4cf7182a 100644 --- a/ncurses/widechar/lib_inwstr.c +++ b/ncurses/widechar/lib_inwstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2004 Free Software Foundation, Inc. * + * Copyright (c) 2002-2004,2009 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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_inwstr.c,v 1.4 2004/10/23 20:41:28 tom Exp $") +MODULE_ID("$Id: lib_inwstr.c,v 1.5 2009/10/24 22:37:29 tom Exp $") NCURSES_EXPORT(int) winnwstr(WINDOW *win, wchar_t *wstr, int n) @@ -50,7 +50,7 @@ winnwstr(WINDOW *win, wchar_t *wstr, int n) cchar_t *text; wchar_t wch; - T((T_CALLED("winnwstr(%p,%p,%d)"), win, wstr, n)); + T((T_CALLED("winnwstr(%p,%p,%d)"), (void *) win, (void *) wstr, n)); if (wstr != 0) { if (win) { getyx(win, row, col); @@ -93,7 +93,7 @@ NCURSES_EXPORT(int) winwstr(WINDOW *win, wchar_t *wstr) { int result = OK; - T((T_CALLED("winwstr(%p,%p)"), win, wstr)); + T((T_CALLED("winwstr(%p,%p)"), (void *) win, (void *) wstr)); if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR) result = ERR; returnCode(result); diff --git a/ncurses/widechar/lib_pecho_wchar.c b/ncurses/widechar/lib_pecho_wchar.c index e6127757..b6da7a86 100644 --- a/ncurses/widechar/lib_pecho_wchar.c +++ b/ncurses/widechar/lib_pecho_wchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004 Free Software Foundation, Inc. * + * Copyright (c) 2004,2009 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 * @@ -32,12 +32,12 @@ #include -MODULE_ID("$Id: lib_pecho_wchar.c,v 1.1 2004/01/03 21:42:01 tom Exp $") +MODULE_ID("$Id: lib_pecho_wchar.c,v 1.2 2009/10/24 22:43:32 tom Exp $") NCURSES_EXPORT(int) -pecho_wchar(WINDOW *pad, const cchar_t * wch) +pecho_wchar(WINDOW *pad, const cchar_t *wch) { - T((T_CALLED("pecho_wchar(%p, %s)"), pad, _tracech_t(wch))); + T((T_CALLED("pecho_wchar(%p, %s)"), (void *) pad, _tracech_t(wch))); if (pad == 0) returnCode(ERR); diff --git a/ncurses/widechar/lib_unget_wch.c b/ncurses/widechar/lib_unget_wch.c index d17e618c..e18a2960 100644 --- a/ncurses/widechar/lib_unget_wch.c +++ b/ncurses/widechar/lib_unget_wch.c @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_unget_wch.c,v 1.12 2009/10/10 20:01:13 tom Exp $") +MODULE_ID("$Id: lib_unget_wch.c,v 1.13 2009/10/24 21:52:49 tom Exp $") /* * Wrapper for wcrtomb() which obtains the length needed for the given @@ -55,13 +55,13 @@ _nc_wcrtomb(char *target, wchar_t source, mbstate_t * state) const wchar_t *tempp = temp; temp[0] = source; temp[1] = 0; - result = wcsrtombs(NULL, &tempp, 0, state); + result = (int) wcsrtombs(NULL, &tempp, 0, state); } else { - result = wcrtomb(target, source, state); + result = (int) wcrtomb(target, source, state); } if (!isEILSEQ(result) && (result == 0)) result = 1; - return result; + return (size_t) result; } NCURSES_EXPORT(int) @@ -72,7 +72,7 @@ NCURSES_SP_NAME(unget_wch) (NCURSES_SP_DCLx const wchar_t wch) size_t length; int n; - T((T_CALLED("unget_wch(%p, %#lx)"), SP_PARM, (unsigned long) wch)); + T((T_CALLED("unget_wch(%p, %#lx)"), (void *) SP_PARM, (unsigned long) wch)); init_mb(state); length = _nc_wcrtomb(0, wch, &state); @@ -83,10 +83,12 @@ NCURSES_SP_NAME(unget_wch) (NCURSES_SP_DCLx const wchar_t wch) if ((string = (char *) malloc(length)) != 0) { init_mb(state); - wcrtomb(string, wch, &state); + /* ignore the result, since we already validated the character */ + IGNORE_RC((int) wcrtomb(string, wch, &state)); for (n = (int) (length - 1); n >= 0; --n) { - if (NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx UChar(string[n])) != OK) { + if (NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx + UChar(string[n])) !=OK) { result = ERR; break; } diff --git a/ncurses/widechar/lib_vline_set.c b/ncurses/widechar/lib_vline_set.c index af42df1f..aacc00e3 100644 --- a/ncurses/widechar/lib_vline_set.c +++ b/ncurses/widechar/lib_vline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002,2009 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 * @@ -39,16 +39,16 @@ #include -MODULE_ID("$Id: lib_vline_set.c,v 1.2 2002/03/23 21:36:01 tom Exp $") +MODULE_ID("$Id: lib_vline_set.c,v 1.3 2009/10/24 22:43:43 tom Exp $") NCURSES_EXPORT(int) -wvline_set(WINDOW *win, const cchar_t * ch, int n) +wvline_set(WINDOW *win, const cchar_t *ch, int n) { int code = ERR; NCURSES_SIZE_T row, col; NCURSES_SIZE_T end; - T((T_CALLED("wvline(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); if (win) { NCURSES_CH_T wch; diff --git a/test/blue.c b/test/blue.c index a798c9d5..dfe6abf1 100644 --- a/test/blue.c +++ b/test/blue.c @@ -40,7 +40,7 @@ * results, use the ncurses(3) library. On non-Intel machines, SVr4 curses is * just as good. * - * $Id: blue.c,v 1.32 2009/10/10 16:16:46 tom Exp $ + * $Id: blue.c,v 1.33 2009/10/24 21:03:35 tom Exp $ */ #include @@ -300,7 +300,7 @@ play_game(void) if (selection[i] != NOCARD) { move(BASEROW + (selection[i] / GRID_WIDTH) * 2 + 3, (selection[i] % GRID_WIDTH) * 5); - (void) printw(" %c ", (char) (*lp++ = 'a' + i)); + (void) printw(" %c ", (*lp++ = (char) ('a' + i))); } }; *lp = '\0'; diff --git a/test/bs.c b/test/bs.c index c68d470f..b9a28836 100644 --- a/test/bs.c +++ b/test/bs.c @@ -34,7 +34,7 @@ * v2.0 featuring strict ANSI/POSIX conformance, November 1993. * v2.1 with ncurses mouse support, September 1995 * - * $Id: bs.c,v 1.49 2009/10/10 16:01:41 tom Exp $ + * $Id: bs.c,v 1.50 2009/10/24 21:24:24 tom Exp $ */ #include @@ -952,7 +952,8 @@ cpufire(int x, int y) bool hit, sunk; ship_t *ss = NULL; - hits[COMPUTER][x][y] = (char) (hit = (board[PLAYER][x][y])) ? MARK_HIT : MARK_MISS; + hit = board[PLAYER][x][y] ? MARK_HIT : MARK_MISS; + hits[COMPUTER][x][y] = (char) hit; (void) mvprintw(PROMPTLINE, 0, "I shoot at %c%d. I %s!", y + 'A', x, hit ? "hit" : "miss"); @@ -1129,7 +1130,7 @@ playagain(void) ++cpuwon; else ++plywon; - j = 18 + strlen(name); + j = 18 + (int) strlen(name); if (plywon >= 10) ++j; if (cpuwon >= 10) diff --git a/test/chgat.c b/test/chgat.c index bd30535c..aee178e1 100644 --- a/test/chgat.c +++ b/test/chgat.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: chgat.c,v 1.9 2009/07/15 23:21:04 tom Exp $ + * $Id: chgat.c,v 1.10 2009/10/24 21:32:57 tom Exp $ * * test-driver for chgat/wchgat/mvchgat/mvwchgat */ @@ -47,7 +47,7 @@ typedef struct { unsigned c; unsigned v; - int pair; + short pair; unsigned attr; int count; int ch; @@ -60,12 +60,12 @@ typedef struct { } STATUS; static const char * -color_params(unsigned state, int *pair) +color_params(unsigned state, short *pair) { /* *INDENT-OFF* */ static struct { - int pair; - int fg, bg; + short pair; + short fg, bg; const char *msg; } table[] = { { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" }, diff --git a/test/clip_printw.c b/test/clip_printw.c index c90cc859..272da7b4 100644 --- a/test/clip_printw.c +++ b/test/clip_printw.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: clip_printw.c,v 1.4 2009/08/29 19:00:44 tom Exp $ + * $Id: clip_printw.c,v 1.5 2009/10/24 21:02:55 tom Exp $ * * demonstrate how to use printw without wrapping. */ @@ -337,7 +337,7 @@ test_clipping(WINDOW *win) } if ((buffer = typeMalloc(char, need)) != 0) { for (j = 0; j < need; ++j) { - buffer[j] = 'A' + (j % 26); + buffer[j] = (char) ('A' + (j % 26)); } buffer[need - 1] = '\0'; st.status = clip_wprintw(win, fmt, '[', buffer, ']'); diff --git a/test/demo_menus.c b/test/demo_menus.c index 4d553e2e..90caf821 100644 --- a/test/demo_menus.c +++ b/test/demo_menus.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2005-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2005-2008,2009 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: demo_menus.c,v 1.28 2008/08/23 20:31:54 tom Exp $ + * $Id: demo_menus.c,v 1.29 2009/10/24 21:19:27 tom Exp $ * * Demonstrate a variety of functions from the menu library. * Thomas Dickey - 2005/4/9 @@ -260,13 +260,13 @@ menu_destroy(MENU * m) { int count; - Trace(("menu_destroy %p", m)); + Trace(("menu_destroy %p", (void *) m)); if (m != 0) { ITEM **items = menu_items(m); const char *blob = 0; count = item_count(m); - Trace(("menu_destroy %p count %d", m, count)); + Trace(("menu_destroy %p count %d", (void *) m, count)); if ((count > 0) && (m == mpSelect)) { blob = item_name(*items); } @@ -368,7 +368,9 @@ build_select_menu(MenuNo number, char *filename) CONST_MENUS char **list = typeCalloc(CONST_MENUS char *, size + 1); items = typeCalloc(ITEM *, size + 1); - Trace(("build_select_menu blob=%p, items=%p", blob, items)); + Trace(("build_select_menu blob=%p, items=%p", + (void *) blob, + (void *) items)); if (blob != 0 && list != 0) { FILE *fp = fopen(filename, "r"); if (fp != 0) { diff --git a/test/ditto.c b/test/ditto.c index 93fbe028..387f7077 100644 --- a/test/ditto.c +++ b/test/ditto.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 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.34 2009/07/17 00:07:25 tom Exp $ + * $Id: ditto.c,v 1.35 2009/10/24 21:33:24 tom Exp $ * * The program illustrates how to set up multiple screens from a single * program. @@ -43,7 +43,6 @@ */ #include #include -#include #ifdef USE_PTHREADS #include @@ -379,7 +378,7 @@ main(int argc, char *argv[]) if (argc <= 1) usage(); - + if ((data = typeCalloc(DITTO, (size_t) argc)) == 0) failed("calloc data"); diff --git a/test/ncurses.c b/test/ncurses.c index f351122c..200ea15c 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -40,7 +40,7 @@ AUTHOR Author: Eric S. Raymond 1993 Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.347 2009/10/03 22:01:56 tom Exp $ +$Id: ncurses.c,v 1.349 2009/10/24 21:28:36 tom Exp $ ***************************************************************************/ @@ -121,22 +121,22 @@ extern unsigned _nc_tracing; #if HAVE_WCSRTOMBS #define count_wchars(src, len, state) wcsrtombs(0, &src, len, state) #define trans_wchars(dst, src, len, state) wcsrtombs(dst, &src, len, state) -#define reset_wchars(state) memset(&state, 0, sizeof(state)) +#define reset_wchars(state) init_mb(state) #elif HAVE_WCSTOMBS && HAVE_MBTOWC && HAVE_MBLEN #define count_wchars(src, len, state) wcstombs(0, src, len) #define trans_wchars(dst, src, len, state) wcstombs(dst, src, len) -#define reset_wchars(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0) +#define reset_wchars(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) #define state_unused #endif #if HAVE_MBSRTOWCS #define count_mbytes(src, len, state) mbsrtowcs(0, &src, len, state) #define trans_mbytes(dst, src, len, state) mbsrtowcs(dst, &src, len, state) -#define reset_mbytes(state) memset(&state, 0, sizeof(state)) +#define reset_mbytes(state) init_mb(state) #elif HAVE_MBSTOWCS && HAVE_MBTOWC && HAVE_MBLEN #define count_mbytes(src, len, state) mbstowcs(0, src, len) #define trans_mbytes(dst, src, len, state) mbstowcs(dst, src, len) -#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0) +#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) #define state_unused #endif @@ -6470,7 +6470,7 @@ rip_footer(WINDOW *win, int cols) wbkgd(win, A_REVERSE); werase(win); wmove(win, 0, 0); - wprintw(win, "footer: window %p, %d columns", win, cols); + wprintw(win, "footer: window %p, %d columns", (void *) win, cols); wnoutrefresh(win); return OK; } @@ -6481,7 +6481,7 @@ rip_header(WINDOW *win, int cols) wbkgd(win, A_REVERSE); werase(win); wmove(win, 0, 0); - wprintw(win, "header: window %p, %d columns", win, cols); + wprintw(win, "header: window %p, %d columns", (void *) win, cols); wnoutrefresh(win); return OK; } diff --git a/test/railroad.c b/test/railroad.c index 696ae73a..973ec46a 100644 --- a/test/railroad.c +++ b/test/railroad.c @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey - 2000 * - * $Id: railroad.c,v 1.18 2009/10/10 16:14:42 tom Exp $ + * $Id: railroad.c,v 1.19 2009/10/24 21:37:56 tom Exp $ * * A simple demo of the termcap interface. */ @@ -58,13 +58,17 @@ static bool interrupted = FALSE; static int outc(TPUTS_ARG c) { + int rc = OK; + if (interrupted) { char tmp = (char) c; - write(STDOUT_FILENO, &tmp, 1); + if (write(STDOUT_FILENO, &tmp, 1) == -1) + rc = ERR; } else { - putc(c, stdout); + if (putc(c, stdout) == EOF) + rc = ERR; } - return 0; + return rc; } static void diff --git a/test/test.priv.h b/test/test.priv.h index 50b6effb..f856f618 100644 --- a/test/test.priv.h +++ b/test/test.priv.h @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: test.priv.h,v 1.91 2009/07/18 12:19:23 tom Exp $ */ +/* $Id: test.priv.h,v 1.93 2009/10/24 21:30:13 tom Exp $ */ #ifndef __TEST_PRIV_H #define __TEST_PRIV_H 1 @@ -222,6 +222,7 @@ #include #include #include +#include #if HAVE_UNISTD_H #include @@ -643,6 +644,15 @@ typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *); #define USE_TRACE 0 #endif +/* + * Workaround for defective implementation of gcc attribute warn_unused_result + */ +#if defined(__GNUC__) && defined(_FORTIFY_SOURCE) +#define IGNORE_RC(func) errno = func +#else +#define IGNORE_RC(func) (void) func +#endif /* gcc workarounds */ + #define init_mb(state) memset(&state, 0, sizeof(state)) #endif /* __TEST_PRIV_H */ diff --git a/test/test_opaque.c b/test/test_opaque.c index 6ae2689e..6ec75fa1 100644 --- a/test/test_opaque.c +++ b/test/test_opaque.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_opaque.c,v 1.8 2009/08/29 19:02:25 tom Exp $ + * $Id: test_opaque.c,v 1.9 2009/10/24 21:21:29 tom Exp $ * * Author: Thomas E Dickey * @@ -231,7 +231,7 @@ show_opaque(WINDOW *stswin, WINDOW *txtwin, bool before, int active) show_keyword(stswin, n, active, "wgetparent"); to_result(stswin, n, TRUE); - wprintw(stswin, "%p", wgetparent(txtwin)); + wprintw(stswin, "%p", (void *) wgetparent(txtwin)); ++n; show_keyword(stswin, n, active, "wgetscrreg"); diff --git a/test/view.c b/test/view.c index d6de0d0a..5b52e980 100644 --- a/test/view.c +++ b/test/view.c @@ -50,7 +50,7 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.75 2009/07/19 00:34:07 tom Exp $ + * $Id: view.c,v 1.76 2009/10/24 21:26:38 tom Exp $ */ #include @@ -83,7 +83,7 @@ #if USE_WIDEC_SUPPORT #if HAVE_MBTOWC && HAVE_MBLEN -#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0) +#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) #define count_mbytes(buffer,length,state) mblen(buffer,length) #define check_mbytes(wch,buffer,length,state) \ (int) mbtowc(&wch, buffer, length)