From: Chris Hanson Date: Wed, 28 Sep 1994 21:07:21 +0000 (+0000) Subject: Fix minor type error in X-LIST-FONTS. Rearrange code slightly. X-Git-Tag: 20090517-FFI~7106 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=84a8bf01f3639d773c39ed96b6a252a74bc70dff;p=mit-scheme.git Fix minor type error in X-LIST-FONTS. Rearrange code slightly. --- diff --git a/v7/src/microcode/x11base.c b/v7/src/microcode/x11base.c index 7ab89336a..959b54e03 100644 --- a/v7/src/microcode/x11base.c +++ b/v7/src/microcode/x11base.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: x11base.c,v 1.55 1994/09/17 17:35:12 adams Exp $ +$Id: x11base.c,v 1.56 1994/09/28 21:07:21 cph Exp $ Copyright (c) 1989-93 Massachusetts Institute of Technology @@ -2010,43 +2010,43 @@ DEFINE_PRIMITIVE ("X-WINDOW-FONT-STRUCTURE", Prim_x_window_font_structure, 1, 1, DEFINE_PRIMITIVE ("X-LIST-FONTS", Prim_x_list_fonts, 3, 3, "(display pattern limit)\n\ - LIMIT is an exact non-negative integer or #F for no limit\n\ + LIMIT is an exact non-negative integer or #F for no limit.\n\ Returns #F or a vector of at least one string.") { - PRIMITIVE_HEADER (1); + PRIMITIVE_HEADER (1); + { + int actual_count = 0; + char ** names = + (XListFonts ((XD_DISPLAY (x_display_arg (1))), + (STRING_ARG (2)), + ((FIXNUM_P (ARG_REF (3))) + ? (FIXNUM_TO_LONG (ARG_REF (3))) + : 1000000), + (&actual_count))); + if (names == 0) + PRIMITIVE_RETURN (SHARP_F); { - SCHEME_OBJECT result; - Display *display = XD_DISPLAY (x_display_arg (1)); - char *pattern = STRING_ARG (2); - int maxnames = - (FIXNUM_P (ARG_REF (3))) ? FIXNUM_TO_LONG (ARG_REF (3)) - : 1000000; - int actual_count = 0; - int words; - int i; - char **names = XListFonts (display, pattern, maxnames, &actual_count); - - if (!names) - PRIMITIVE_RETURN (SHARP_F); - - words = actual_count + 1; /* the vector of strings */ - - for (i=0; i