On Sun, 30 Apr 2000, Andrew Apted wrote:
> Christoph Egger writes:
>
> > OK - I have made a patch (attached). Is it ok?
>
> [SNIP]
>
> > - for (count=0; *str && (x < LIBGGI_VIRTX(vis));
> > + for (*str && (x < LIBGGI_VIRTX(vis));
> > str++, x += char_w) {
>
> Did that compile ? There's an `;' missing.
Oops! Right you are. I've fixed that and attached my diff again.
Christoph Egger
E-Mail: [EMAIL PROTECTED]
--- gtext.c.old Sat Apr 29 17:38:20 2000
+++ gtext.c Sat Apr 29 19:01:02 2000
@@ -74,20 +74,20 @@
int GGI_stubs_puts(ggi_visual *vis, int x, int y, const char *str)
{
- int count;
+ int err = 0;
int char_w, char_h;
- ggiGetCharSize(vis, &char_w, &char_h);
+ err = ggiGetCharSize(vis, &char_w, &char_h);
/* vertically out of the clipping area ? */
if ((y+char_h < LIBGGI_GC(vis)->cliptl.y) ||
(y >= LIBGGI_GC(vis)->clipbr.y)) {
- return 0;
+ return err;
}
- for (count=0; *str && (x < LIBGGI_VIRTX(vis));
+ for (;*str && (x < LIBGGI_VIRTX(vis));
str++, x += char_w) {
/* horizontally within the clipping area ? */
@@ -95,10 +95,9 @@
if ((x+char_w >= LIBGGI_GC(vis)->cliptl.x) &&
(x < LIBGGI_GC(vis)->clipbr.x)) {
- ggiPutc(vis, x, y, *str);
- count++;
+ err = ggiPutc(vis, x, y, *str);
}
}
- return count;
+ return err;
}