1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-04 06:15:24 +00:00

Fix build with gcc-3.4.2

Submitted by:	maintainer
This commit is contained in:
Kirill Ponomarev 2004-07-30 07:58:12 +00:00
parent d235dd8d40
commit 1bcc4cf74d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=115055
4 changed files with 119 additions and 100 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= svgalib
PORTVERSION= 1.4.3
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= graphics devel
MASTER_SITES= http://www.svgalib.org/

View File

@ -1,6 +1,15 @@
diff -druN svgalib-1.4.2.orig/src/mach32.c src/mach32.c
--- svgalib-1.4.2.orig/src/mach32.c Fri Aug 25 04:39:39 2000
+++ src/mach32.c Fri Aug 25 04:39:57 2000
@@ -1544,7 +1544,7 @@
goto writerr;
printf("mach32: Notice: new EEPROM file >%s< succesful created.\n",
eeprom_fname);
- finish_w_eeprom:
+ finish_w_eeprom: ;
}
/* Change eeprom contents if requested: */
if (!(eeprom_option & EEPROM_USE_MEMCFG))
@@ -2415,7 +2415,7 @@
return ptr;
}

View File

@ -54,105 +54,6 @@
+ compressed_font_fg = fg;
+}
+
+void gl_ccwriten(int x, int y, int n, char *s)
+{
+ char *str = alloca(n + 1);
+ memcpy(str, s, n);
+ str[n] = 0;
+ gl_ccwrite(x, y, str);
+}
+
+#ifndef SVGA_AOUT
+
+static int ccnprintf(int sx, int sy,
+ size_t bufs, const char *fmt, va_list args)
+{
+ char *buf;
+ static int x = 0, y = 0, x_start = 0;
+ int n;
+
+ buf = alloca(bufs);
+ n = vsnprintf(buf, bufs, fmt, args);
+ if (n < 0)
+ return n; /* buffer did not suffice, return and retry */
+
+ if ((sx >= 0) && (sy >= 0)) {
+ x = x_start = sx;
+ y = sy;
+ }
+
+ for (; *buf; buf++)
+ switch (*buf) {
+ case '\a': /* badly implemented */
+ fputc('\a', stdout);
+ fflush(stdout);
+ break;
+ case '\b':
+ x -= afont_width;
+ if (x < x_start) {
+ x = WIDTH + (x_start % afont_width);
+ while(x + afont_width > WIDTH)
+ x -= afont_width;
+ if (y >= font_height)
+ y -= font_height;
+ }
+ break;
+ case '\n':
+ newline:
+ y += font_height;
+ if (y + font_height > HEIGHT)
+ y %= font_height;
+ case '\r':
+ x = x_start;
+ break;
+ case '\t':
+ x += ((TEXT_TABSIZE -
+ ((x - x_start) / afont_width) % TEXT_TABSIZE) * afont_width);
+ goto chk_wrap;
+ break;
+ case '\v':
+ y += font_height;
+ if (y + font_height > HEIGHT)
+ y %= font_height;
+ break;
+ default:
+ if( ((unsigned char)(*buf) > 0xa0)
+ && ((unsigned char)(*(buf + 1)) > 0xa0)) {
+ gl_ccwriten(x, y, 2, buf);
+ buf += 1;
+ x += cfont_width;
+ }
+ else {
+ gl_ccwriten(x, y, 1, buf);
+ x += afont_width;
+ }
+ chk_wrap:
+ if (x + afont_width > WIDTH)
+ goto newline;
+ }
+ return n;
+}
+
+int gl_ccprintf(int x, int y, const char *fmt, ...)
+{
+ size_t bufs = BUFSIZ;
+ int result;
+ va_list args;
+
+ va_start(args, fmt);
+
+ /* Loop until buffer size suffices */
+ do {
+ result = ccnprintf(x, y, bufs, fmt, args);
+ bufs <<= 1;
+ } while(result < 0);
+
+ va_end(args);
+ return result;
+}
+
+#endif
+
+static int getnextchar(char* s, uchar* cc)
+{
+ if( s[0] == '\0') return 0;
@ -323,3 +224,102 @@
+ }
+}
+
+void gl_ccwriten(int x, int y, int n, char *s)
+{
+ char *str = alloca(n + 1);
+ memcpy(str, s, n);
+ str[n] = 0;
+ gl_ccwrite(x, y, str);
+}
+
+#ifndef SVGA_AOUT
+
+static int ccnprintf(int sx, int sy,
+ size_t bufs, const char *fmt, va_list args)
+{
+ char *buf;
+ static int x = 0, y = 0, x_start = 0;
+ int n;
+
+ buf = alloca(bufs);
+ n = vsnprintf(buf, bufs, fmt, args);
+ if (n < 0)
+ return n; /* buffer did not suffice, return and retry */
+
+ if ((sx >= 0) && (sy >= 0)) {
+ x = x_start = sx;
+ y = sy;
+ }
+
+ for (; *buf; buf++)
+ switch (*buf) {
+ case '\a': /* badly implemented */
+ fputc('\a', stdout);
+ fflush(stdout);
+ break;
+ case '\b':
+ x -= afont_width;
+ if (x < x_start) {
+ x = WIDTH + (x_start % afont_width);
+ while(x + afont_width > WIDTH)
+ x -= afont_width;
+ if (y >= font_height)
+ y -= font_height;
+ }
+ break;
+ case '\n':
+ newline:
+ y += font_height;
+ if (y + font_height > HEIGHT)
+ y %= font_height;
+ case '\r':
+ x = x_start;
+ break;
+ case '\t':
+ x += ((TEXT_TABSIZE -
+ ((x - x_start) / afont_width) % TEXT_TABSIZE) * afont_width);
+ goto chk_wrap;
+ break;
+ case '\v':
+ y += font_height;
+ if (y + font_height > HEIGHT)
+ y %= font_height;
+ break;
+ default:
+ if( ((unsigned char)(*buf) > 0xa0)
+ && ((unsigned char)(*(buf + 1)) > 0xa0)) {
+ gl_ccwriten(x, y, 2, buf);
+ buf += 1;
+ x += cfont_width;
+ }
+ else {
+ gl_ccwriten(x, y, 1, buf);
+ x += afont_width;
+ }
+ chk_wrap:
+ if (x + afont_width > WIDTH)
+ goto newline;
+ }
+ return n;
+}
+
+int gl_ccprintf(int x, int y, const char *fmt, ...)
+{
+ size_t bufs = BUFSIZ;
+ int result;
+ va_list args;
+
+ va_start(args, fmt);
+
+ /* Loop until buffer size suffices */
+ do {
+ result = ccnprintf(x, y, bufs, fmt, args);
+ bufs <<= 1;
+ } while(result < 0);
+
+ va_end(args);
+ return result;
+}
+
+#endif
+

View File

@ -0,0 +1,10 @@
--- src/s3.c.orig Wed May 3 19:23:57 2000
+++ src/s3.c Fri Jul 30 13:21:55 2004
@@ -474,7 +474,6 @@
dac_used->restoreState(regs);
return old_values;
}
- default:
}
return 0;
}