More warning cleanup -- mainly getting prototypes working.

This commit is contained in:
William McBrine
2005-11-20 04:01:01 +00:00
parent bd9df7ffe4
commit 2bc972817e
11 changed files with 88 additions and 33 deletions

View File

@@ -35,21 +35,21 @@
#endif
#ifdef PDCDEBUG
char *rcsid_firework = "$Id: firework.c,v 1.4 2004/08/07 04:45:08 rexx Exp $";
char *rcsid_firework = "$Id: firework.c,v 1.5 2005/11/20 04:01:00 wmcbrine Exp $";
#endif
#if __STDC__
# define Args(x) x
#else
# define Args(x) ()
#ifndef Args
# ifdef HAVE_PROTO
# define Args(x) x
# else
# define Args(x) ()
# endif
#endif
void myrefresh Args((void));
chtype get_colour Args((void));
void explode Args((int,int));
#undef Args
int main()
{
int start,end,row,diff,flag,direction,seed;

View File

@@ -44,13 +44,15 @@
#endif
#ifdef PDCDEBUG
char *rcsid_newdemo = "$Id: newdemo.c,v 1.5 2005/11/12 20:54:58 wmcbrine Exp $";
char *rcsid_newdemo = "$Id: newdemo.c,v 1.6 2005/11/20 04:01:00 wmcbrine Exp $";
#endif
#if __STDC__
#define Args(x) x
#else
#define Args(x) ()
#ifndef Args
# ifdef HAVE_PROTO
# define Args(x) x
# else
# define Args(x) ()
# endif
#endif
int WaitForUser Args((void));
@@ -58,8 +60,6 @@ int SubWinTest Args((WINDOW *));
int BouncingBalls Args((WINDOW *));
void trap Args((int));
#undef Args
/*
* The Australian map
*/
@@ -107,7 +107,7 @@ int WaitForUser()
t = time((time_t *)0);
while(1)
{
if ((ch = getch()) != ERR)
if ((ch = getch()) != (chtype)ERR)
{
if (ch == '\033')
{

View File

@@ -26,7 +26,7 @@
#endif
#ifdef PDCDEBUG
char *rcsid_ptest = "$Id: ptest.c,v 1.2 2005/11/13 14:54:50 wmcbrine Exp $";
char *rcsid_ptest = "$Id: ptest.c,v 1.3 2005/11/20 04:01:00 wmcbrine Exp $";
#endif
#include <curses.h>
@@ -102,7 +102,7 @@ PANEL *pan;
if(!win)
return((PANEL *)0);
if(pan = new_panel(win))
if((pan = new_panel(win)))
return(pan);
delwin(win);
return((PANEL *)0);

View File

@@ -34,7 +34,7 @@
#ifdef PDCDEBUG
# define CURSES_LIBRARY /* needed for the prototype of PDC_debug */
char *rcsid_testcurs = "$Id: testcurs.c,v 1.12 2004/09/14 07:56:14 rexx Exp $";
char *rcsid_testcurs = "$Id: testcurs.c,v 1.13 2005/11/20 04:01:00 wmcbrine Exp $";
#endif
#include <stdio.h>
@@ -46,6 +46,10 @@ char *rcsid_testcurs = "$Id: testcurs.c,v 1.12 2004/09/14 07:56:14 rexx Exp $";
char *XCursesProgramName = "testcurs";
#endif
#if defined(HAVE_PROTO) && !defined(__STDC__)
# define __STDC__
#endif
#ifdef __STDC__
void inputTest (WINDOW *);
void scrollTest (WINDOW *);

View File

@@ -37,8 +37,14 @@
#include <time.h>
#include "tui.h"
#ifdef __STDC__
void statusmsg (char *);
int waitforkey (void);
void rmerror (void);
#endif
#ifdef PDCDEBUG
char *rcsid_tui = "$Id: tui.c,v 1.3 2005/11/13 14:54:50 wmcbrine Exp $";
char *rcsid_tui = "$Id: tui.c,v 1.4 2005/11/20 04:01:00 wmcbrine Exp $";
#endif
#if defined(__unix) && !defined(__DJGPP__)
@@ -99,7 +105,7 @@ int length;
static char buf[MAXSTRLEN];
char fmt[10];
sprintf (fmt, strlen(s)>length ? "%%.%ds" : "%%-%ds", length);
sprintf (fmt, ((int)strlen(s))>length ? "%%.%ds" : "%%-%ds", length);
sprintf (buf, fmt, s);
return buf;
}
@@ -779,7 +785,8 @@ int field;
WINDOW *wedit;
int c=0;
if ((field>=MAXSTRLEN) || (buf==NULL) || (strlen(buf) > field-1)) return ERR;
if ((field>=MAXSTRLEN) || (buf==NULL) || ((int)strlen(buf) > field-1))
return ERR;
strcpy (org, buf); /* save original */
wrefresh (win);
@@ -819,7 +826,7 @@ int field;
case KEY_RIGHT:
defdisp = FALSE;
if (bp - buf < strlen(buf)) bp++;
if (bp - buf < (int)strlen(buf)) bp++;
break;
case '\t': /* TAB, because Insert not properly handled on HP-UX ! */
@@ -855,7 +862,7 @@ int field;
if (defdisp) { bp = buf; *bp = '\0'; defdisp = FALSE; }
if (insert)
{
if (strlen(buf) < field-1)
if ((int)strlen(buf) < field-1)
{
memmove ((void *)(bp+1), (const void *)bp, strlen(bp)+1);
*bp++ = c;

View File

@@ -29,6 +29,10 @@
#include <curses.h>
#if defined(HAVE_PROTO) && !defined(__STDC__)
# define __STDC__
#endif
#ifndef getbegyx
#define getbegyx(w,y,x) ( y = (w)->_begy, x = (w)->_begx )
#endif

View File

@@ -44,7 +44,7 @@
#include "tui.h"
#ifdef PDCDEBUG
char *rcsid_tuidemo = "$Id: tuidemo.c,v 1.1 2001/01/10 08:27:46 mark Exp $";
char *rcsid_tuidemo = "$Id: tuidemo.c,v 1.2 2005/11/20 04:01:00 wmcbrine Exp $";
#endif
#if defined(XCURSES)
@@ -54,7 +54,9 @@ char *rcsid_tuidemo = "$Id: tuidemo.c,v 1.1 2001/01/10 08:27:46 mark Exp $";
# define FNAME "demos\\tui.c" /* change this if source at other location */
#endif
#if defined(HAVE_PROTO) && !defined(__STDC__)
# define __STDC__
#endif
/**************************** strings entry box ***************************/
@@ -159,10 +161,17 @@ char *fname;
/***************************** forward declarations ***********************/
#ifdef __STDC__
void sub0(void), sub1(void), sub2(void), sub3(void);
void func1(void), func2(void);
void subfunc1(void), subfunc2(void);
void subsub(void);
#else
void sub0(), sub1(), sub2(), sub3();
void func1(), func2();
void subfunc1(), subfunc2();
void subsub();
#endif
/***************************** menus initialization ***********************/

View File

@@ -115,7 +115,7 @@
#endif
#ifdef PDCDEBUG
char *rcsid_xmas = "$Id: xmas.c,v 1.2 2003/06/23 07:55:04 mark Exp $";
char *rcsid_xmas = "$Id: xmas.c,v 1.3 2005/11/20 04:01:00 wmcbrine Exp $";
#endif
#include <curses.h>
@@ -125,6 +125,24 @@ char *rcsid_xmas = "$Id: xmas.c,v 1.2 2003/06/23 07:55:04 mark Exp $";
char *XCursesProgramName = "xmas";
#endif
#ifdef HAVE_PROTO
int boxit(void);
int seas(void);
int greet(void);
int fromwho(void);
int del_msg(void);
int tree(void);
int balls(void);
int star(void);
int strng1(void);
int strng2(void);
int strng3(void);
int strng4(void);
int strng5(void);
int blinkit(void);
int reindeer(void);
void done(void);
#else
int boxit();
int seas();
int greet();
@@ -141,6 +159,7 @@ int strng5();
int blinkit();
int reindeer();
void done();
#endif
#define FROMWHO "Mark Hessling - (M.Hessling@qut.edu.au)"

View File

@@ -31,7 +31,7 @@
#endif
#ifdef PDCDEBUG
char *rcsid_panel = "$Id: panel.c,v 1.3 2005/11/12 20:54:58 wmcbrine Exp $";
char *rcsid_panel = "$Id: panel.c,v 1.4 2005/11/20 04:01:01 wmcbrine Exp $";
#endif
@@ -112,6 +112,17 @@ PANEL __stdscr_pseudo_panel = { (WINDOW *)0 };
#define STATIC static
#ifdef HAVE_PROTO
STATIC void __calculate_obscure(void);
STATIC void __free_obscure(PANEL *);
STATIC void __override(PANEL *, int);
STATIC int __panel_is_linked(PANEL *);
STATIC void __panel_link_bottom(PANEL *);
STATIC void __panel_link_top(PANEL *);
STATIC int __panels_overlapped(PANEL *, PANEL *);
STATIC void __panel_unlink(PANEL *);
#endif
/*+-------------------------------------------------------------------------
dPanel(text,pan)
--------------------------------------------------------------------------*/

View File

@@ -36,7 +36,7 @@
#endif
#ifdef PDCDEBUG
char *rcsid_PDCwin = "$Id: pdcwin.c,v 1.6 2005/11/19 19:07:21 wmcbrine Exp $";
char *rcsid_PDCwin = "$Id: pdcwin.c,v 1.7 2005/11/20 04:01:01 wmcbrine Exp $";
#endif
/*man-start*********************************************************************
@@ -638,8 +638,8 @@ bool advance;
int retval = ERR;
int x;
int y;
int newx=0;
chtype attr=0, bktmp=0;
int newx;
chtype attr=0, bktmp;
int ts;
#ifdef PDCDEBUG

View File

@@ -25,7 +25,7 @@
#include <stdio.h>
#ifdef PDCDEBUG
char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.17 2005/11/14 00:17:32 rexx Exp $";
char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.18 2005/11/20 04:01:01 wmcbrine Exp $";
#endif
#define KEY_STATE TRUE
@@ -469,7 +469,9 @@ bool PDC_check_bios_key(void)
int processKeyEvent(void)
{
CHAR ascii = save_ip.Event.KeyEvent.uChar.AsciiChar;
#if 0
WCHAR unicode = save_ip.Event.KeyEvent.uChar.UnicodeChar;
#endif
WORD vk = save_ip.Event.KeyEvent.wVirtualKeyCode;
DWORD state = save_ip.Event.KeyEvent.dwControlKeyState;
unsigned long local_key_modifiers = 0L;
@@ -617,8 +619,7 @@ int PDC_get_bios_key(void)
static MOUSE_STATUS Actual_Mouse_status;
int button_no=0;
bool trap_mouse=FALSE;
int idx=0,key=0;
bool enhanced=FALSE;
int key=0;
int retval;
#ifdef PDCDEBUG