tty xputc()
Another part of github issue 227. Casting a function pointer when passing it to another function is iffy when lying about the return type. tputs() expects a routine which returns int, so give it one. Other xputc() usage is equivalent to putchar(), so define xputc() with the same function signature as that has. The tputs() declarations in system.h should probably be changed (third argument is a function which takes an int rather than unspecified parameters) but I've left them alone. I made that change to tputs() in sys/share/tclib.c though. NT and MSDOS changes are untested. tclib.c compiles ok with clang- as-gcc on OSX but hasn't been tested with the port that uses it (VMS).
This commit is contained in:
@@ -571,8 +571,10 @@ const char *s;
|
||||
}
|
||||
}
|
||||
|
||||
void xputc(ch) /* write out character (and attribute) */
|
||||
char ch;
|
||||
/* same signature as 'putchar()' with potential failure result ignored */
|
||||
int
|
||||
xputc(ch) /* write out character (and attribute) */
|
||||
int ch;
|
||||
{
|
||||
int i;
|
||||
char attribute;
|
||||
@@ -591,16 +593,17 @@ char ch;
|
||||
vesa_xputc(ch, attribute);
|
||||
#endif /*SCREEN_VESA*/
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void xputg(glyphnum, ch,
|
||||
special) /* write out a glyph picture at current location */
|
||||
/* write out a glyph picture at current location */
|
||||
void xputg(glyphnum, ch, special)
|
||||
int glyphnum;
|
||||
int ch;
|
||||
unsigned special;
|
||||
{
|
||||
if (!iflags.grmode || !iflags.tile_view) {
|
||||
xputc((char) ch);
|
||||
(void) xputc((char) ch);
|
||||
#ifdef SCREEN_VGA
|
||||
} else if (iflags.grmode && iflags.usevga) {
|
||||
vga_xputg(glyphnum, ch, special);
|
||||
|
||||
Reference in New Issue
Block a user