dump_funcs(void) {
int i;
struct kbsentry fbuf;
- char *p;
+ unsigned char *p;
for (i = 0; i < MAX_NR_FUNC; i++) {
fbuf.kb_func = i;
#endif /* KDFONTOP */
int
-font_charheight(char *buf, int count, int width) {
+font_charheight(unsigned char *buf, int count, int width) {
int h, i, x;
int bytewidth = (width+7)/8;
* Must not exit - we may have cleanup to do.
*/
int
-getfont(int fd, char *buf, int *count, int *width, int *height) {
+getfont(int fd, unsigned char *buf, int *count, int *width, int *height) {
struct consolefontdesc cfd;
struct console_font_op cfo;
int i;
/* Second attempt: GIO_FONTX */
cfd.charcount = *count;
cfd.charheight = 0;
- cfd.chardata = buf;
+ cfd.chardata = (char *)buf;
i = ioctl(fd, GIO_FONTX, &cfd);
if (i == 0) {
*count = cfd.charcount;
}
int
-putfont(int fd, char *buf, int count, int width, int height) {
+putfont(int fd, unsigned char *buf, int count, int width, int height) {
struct consolefontdesc cfd;
struct console_font_op cfo;
int i;
round up and try again. */
if (errno == EINVAL && width == 8 && count != 256 && count < 512) {
int ct = ((count > 256) ? 512 : 256);
- char *mybuf = malloc(32 * ct);
+ unsigned char *mybuf = malloc(32 * ct);
if (!mybuf) {
fprintf(stderr, _("%s: out of memory\n"), progname);
/* Second attempt: PIO_FONTX */
cfd.charcount = count;
cfd.charheight = height;
- cfd.chardata = buf;
+ cfd.chardata = (char *)buf;
i = ioctl(fd, PIO_FONTX, &cfd);
if (i == 0)
return 0;
* Return 0 on success -1 on failure.
* Sets number of glyphs in COUNT, glyph size in WIDTH and HEIGHT.
*/
-extern int getfont(int fd, char *buf, int *count, int *width, int *height);
+extern int getfont(int fd, unsigned char *buf, int *count, int *width, int *height);
/*
* Load kernel font of width WIDTH and pointsize HEIGHT from BUF
* with length COUNT.
* Return 0 on success, -1 on failure.
*/
-extern int putfont(int fd, char *buf, int count, int width, int height);
+extern int putfont(int fd, unsigned char *buf, int count, int width, int height);
/*
* Find the maximum height of nonblank pixels
* (in the ((WIDTH+7)/8)*32*COUNT bytes of BUF).
*/
-extern int font_charheight(char *buf, int count, int width);
+extern int font_charheight(unsigned char *buf, int count, int width);
/*
* Find the size of the kernel font.
int keyct, funcct, diacct = 0;
fd = getfd(console);
- keyct = defkeys(fd, console, &warned);
+ keyct = defkeys(fd, console, warned);
funcct = deffuncs(fd);
if (verbose) {
printf(_("\nChanged %d %s and %d %s.\n"),
void saveoldmap(int fd, char *omfil);
void loadnewmap(int fd, char *mfil);
-static int ctoi (unsigned char *);
+static int ctoi (char *);
/* search for the map file in these directories (with trailing /) */
static char *mapdirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 };
* ('x', x a single byte or a utf8 sequence).
*/
int
-ctoi(unsigned char *s) {
+ctoi(char *s) {
int i;
if ((strncmp(s,"0x",2) == 0) &&
#include <stdlib.h> /* exit */
#include "psf.h"
-void
+static void
usage(void) {
fprintf(stderr, "call: outpsfheader psftype fontsize charsize hastable\n");
exit(1);
}
outbuf = xmalloc(rows*(cols+1));
- p = screenbuf + 2;
+ p = ((char *)screenbuf) + 2;
q = outbuf;
for (i=0; i<rows; i++) {
for (j=0; j<cols; j++)
static void
do_loadfont(int fd, char *inbuf, int width, int height, int hwunit,
int fontsize, char *pathname) {
- char *buf;
+ unsigned char *buf;
int i, buflen;
int bytewidth = (width+7)/8;
int charsize = height * bytewidth;
/* this is the max font size the kernel is willing to handle */
#define MAXFONTSIZE 65536
- char buf[MAXFONTSIZE];
+ unsigned char buf[MAXFONTSIZE];
int i, ct, width, height, bytewidth, charsize, kcharsize;
#include <sys/ioctl.h> /* ioctl */
#include <unistd.h> /* sleep */
-void
-sighup(){
+static void
+sighup(int n) {
if (system("openvt -s -l bash") == -1) {
perror("system");
exit(1);
#include <sys/ioctl.h>
#include <linux/kd.h>
-void
-sighup() {
+static void
+sighup(int n) {
if (system("openvt -s -l -- login -h spawn") == -1) {
perror("system");
exit(1);
*err = UTF8_BAD;
return 0;
}
- *inptr = in;
+ *inptr = (char *)in;
*err = 0;
return uc;
}