/****************************************************************************
- * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <curses.priv.h>
-MODULE_ID("$Id: setbuf.c,v 1.15 2009/05/23 22:13:44 tom Exp $")
+MODULE_ID("$Id: setbuf.c,v 1.17 2011/10/22 16:34:50 tom Exp $")
/*
* If the output file descriptor is connected to a tty (the typical case) it
* buffer. So we disable this by default (there may yet be a workaround).
*/
NCURSES_EXPORT(void)
-NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered)
+NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, int buffered)
{
int Cols;
int Lines;
setmode(ofp, O_BINARY);
#endif
if (buffered != 0) {
- buf_len = min(Lines * (Cols + 6), 2800);
+ buf_len = (unsigned) min(Lines * (Cols + 6), 2800);
if ((buf_ptr = SP_PARM->_setbuf) == 0) {
if ((buf_ptr = typeMalloc(char, buf_len)) == NULL)
return;
#ifdef SETVBUF_REVERSED /* pre-svr3? */
(void) setvbuf(ofp, buf_ptr, buf_len, buf_len ? _IOFBF : _IOLBF);
#else
- (void) setvbuf(ofp, buf_ptr, buf_len ? _IOFBF : _IOLBF, buf_len);
+ (void) setvbuf(ofp, buf_ptr, buf_len ? _IOFBF : _IOLBF, (size_t) buf_len);
#endif
#elif HAVE_SETBUFFER
(void) setbuffer(ofp, buf_ptr, (int) buf_len);
#if NCURSES_SP_FUNCS
NCURSES_EXPORT(void)
-_nc_set_buffer(FILE *ofp, bool buffered)
+_nc_set_buffer(FILE *ofp, int buffered)
{
NCURSES_SP_NAME(_nc_set_buffer) (CURRENT_SCREEN, ofp, buffered);
}