From c7d035ae1a729232579a0fe41ed5affa131d3623 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:27 -0800 Subject: Import Upstream version 5d9 --- x.c | 229 ++++++++++++++++++++++++++++++++++---------------------------------- 1 file changed, 115 insertions(+), 114 deletions(-) (limited to 'x.c') diff --git a/x.c b/x.c index 8b3a53c..2c9041f 100644 --- a/x.c +++ b/x.c @@ -59,6 +59,7 @@ #include #include /*#include */ /* For IntensityTbl */ +#include #include #include @@ -644,7 +645,7 @@ sizet x_free_xevent(ptr) /* Utility macro and functions for checking and coercing SCM arguments. */ #define GET_NEXT_INT(result, args, err, rtn) \ - ASSERT(NIMP(args) && CONSP(args) && INUMP(CAR(args)), args, err, rtn); \ + ASRTER(NIMP(args) && CONSP(args) && INUMP(CAR(args)), args, err, rtn); \ result = INUM(CAR(args)); \ args = CDR(args); @@ -787,7 +788,7 @@ Pixmap thepxmap(obj, s_caller) char *s_caller; { if (FALSEP(obj) || (INUM0==obj)) return 0L; - ASSERT(NIMP(obj) && ((OpPxmpMask & (int)CAR(obj))==OpPxmp), + ASRTER(NIMP(obj) && ((OpPxmpMask & (int)CAR(obj))==OpPxmp), obj, ARGn, s_caller); return WINDOW(obj)->p.pm; } @@ -795,7 +796,7 @@ Font thefont(obj, s_caller) SCM obj; char *s_caller; { - ASSERT(NIMP(obj) && FONTP(obj), obj, ARGn, s_caller); + ASRTER(NIMP(obj) && FONTP(obj), obj, ARGn, s_caller); return FONT(obj)->font; } Colormap thecmap(obj, s_caller) @@ -803,7 +804,7 @@ Colormap thecmap(obj, s_caller) char *s_caller; { if (FALSEP(obj) || (INUM0==obj)) return 0L; - ASSERT(NIMP(obj) && COLORMAPP(obj), obj, ARGn, s_caller); + ASRTER(NIMP(obj) && COLORMAPP(obj), obj, ARGn, s_caller); return COLORMAP(obj)->cm; } Cursor thecsr(obj, s_caller) @@ -811,7 +812,7 @@ Cursor thecsr(obj, s_caller) char *s_caller; { if (FALSEP(obj) || (INUM0==obj)) return 0L; - ASSERT(NIMP(obj) && CURSORP(obj), obj, ARGn, s_caller); + ASRTER(NIMP(obj) && CURSORP(obj), obj, ARGn, s_caller); return CURSOR(obj)->cursor; } Bool thebool(obj, s_caller) @@ -819,7 +820,7 @@ Bool thebool(obj, s_caller) char *s_caller; { SCM val = thevalue(obj); - ASSERT(BOOL_F==val || BOOL_T==val, obj, ARGn, s_caller); + ASRTER(BOOL_F==val || BOOL_T==val, obj, ARGn, s_caller); return NFALSEP(val); } int theint(obj, s_caller) @@ -827,7 +828,7 @@ int theint(obj, s_caller) char *s_caller; { SCM val = thevalue(obj); - ASSERT(INUMP(val), obj, ARGn, s_caller); + ASRTER(INUMP(val), obj, ARGn, s_caller); return INUM(val); } int theuint(obj, s_caller) @@ -835,7 +836,7 @@ int theuint(obj, s_caller) char *s_caller; { SCM val = thevalue(obj); - ASSERT(INUMP(val) && (0 <= INUM(val)), obj, ARGn, s_caller); + ASRTER(INUMP(val) && (0 <= INUM(val)), obj, ARGn, s_caller); return INUM(val); } @@ -847,7 +848,7 @@ static int args2valmask(oargs, s_caller) int attr, len, attr_mask = 0; if (!(len = ilength(args))) return 0; while (len) { - ASSERT(NIMP(args), oargs, WNA, s_caller); + ASRTER(NIMP(args), oargs, WNA, s_caller); attr = theint(CAR(args), s_caller); args = CDR(args); attr_mask |= attr; len -= 1; @@ -864,11 +865,11 @@ static int args2xgcvalues(sgc, vlu, oargs) int attr, len, attr_mask = 0; /* (void)memset((char *)vlu, 0, sizeof(XGCValues)); */ if (!(len = ilength(args))) return 0; - ASSERT(len > 0 && (! (len & 1)), oargs, WNA, s_gc); + ASRTER(len > 0 && (! (len & 1)), oargs, WNA, s_gc); while (len) { - ASSERT(NIMP(args), oargs, WNA, s_gc); + ASRTER(NIMP(args), oargs, WNA, s_gc); attr = theint(CAR(args), s_gc); args = CDR(args); - ASSERT(NIMP(args), oargs, WNA, s_gc); + ASRTER(NIMP(args), oargs, WNA, s_gc); sval = CAR(args); args = CDR(args); attr_mask |= attr; switch (attr) { @@ -917,7 +918,7 @@ static int args2xgcvalues(sgc, vlu, oargs) case GCDashList: vlu->dashes = (char)theint(sval, s_gc); break; case GCArcMode: vlu->arc_mode = theint(sval, s_gc); break; - default: ASSERT(0, MAKINUM(attr), ARGn, s_gc); + default: ASRTER(0, MAKINUM(attr), ARGn, s_gc); } len -= 2; } @@ -931,11 +932,11 @@ static int args2winattribs(vlu, oargs) int attr, len, attr_mask = 0; /* (void)memset((char *)vlu, 0, sizeof(XSetWindowAttributes)); */ if (!(len = ilength(args))) return 0; - ASSERT(len > 0 && (! (len & 1)), oargs, WNA, s_window); + ASRTER(len > 0 && (! (len & 1)), oargs, WNA, s_window); while (len) { - ASSERT(NIMP(args), oargs, WNA, s_window); + ASRTER(NIMP(args), oargs, WNA, s_window); attr = theint(CAR(args), s_window); args = CDR(args); - ASSERT(NIMP(args), oargs, WNA, s_window); + ASRTER(NIMP(args), oargs, WNA, s_window); sval = CAR(args); args = CDR(args); attr_mask |= attr; switch (attr) { @@ -958,7 +959,7 @@ static int args2winattribs(vlu, oargs) case CWColormap: vlu->colormap = thecmap(sval, s_window); break; case CWCursor: vlu->cursor = thecsr(sval, s_window); break; - default: ASSERT(0, MAKINUM(attr), ARGn, s_window); + default: ASRTER(0, MAKINUM(attr), ARGn, s_window); } len -= 2; } @@ -972,11 +973,11 @@ static int args2wincfgs(vlu, oargs) int cfgs, len, cfgs_mask = 0; /* (void)memset((char *)vlu, 0, sizeof(XWindowChanges)); */ if (!(len = ilength(args))) return 0; - ASSERT(len > 0 && (! (len & 1)), oargs, WNA, s_window); + ASRTER(len > 0 && (! (len & 1)), oargs, WNA, s_window); while (len) { - ASSERT(NIMP(args), oargs, WNA, s_window); + ASRTER(NIMP(args), oargs, WNA, s_window); cfgs = theint(CAR(args), s_window); args = CDR(args); - ASSERT(NIMP(args), oargs, WNA, s_window); + ASRTER(NIMP(args), oargs, WNA, s_window); sval = CAR(args); args = CDR(args); cfgs_mask |= cfgs; switch (cfgs) { @@ -988,7 +989,7 @@ static int args2wincfgs(vlu, oargs) case CWBorderWidth: vlu->border_width = theuint(sval, s_window); break; case CWSibling: vlu->sibling =thepxmap(sval, s_window); break; case CWStackMode: vlu->stack_mode = theint(sval, s_window); break; - default: ASSERT(0, MAKINUM(cfgs), ARGn, s_window); + default: ASRTER(0, MAKINUM(cfgs), ARGn, s_window); } len -= 2; } @@ -1002,7 +1003,7 @@ SCM x_open_display(dpy_name) { Display *display; if FALSEP(dpy_name) dpy_name = nullstr; - ASSERT(NIMP(dpy_name) && STRINGP(dpy_name), dpy_name, ARG1, s_x_open_display); + ASRTER(NIMP(dpy_name) && STRINGP(dpy_name), dpy_name, ARG1, s_x_open_display); display = XOpenDisplay(CHARS(dpy_name)); return (display ? make_xdisplay(display) : BOOL_F); } @@ -1019,7 +1020,7 @@ SCM x_display_debug(sd, si) SCM x_default_screen(sdpy) SCM sdpy; { - ASSERT(NIMP(sdpy) && OPDISPLAYP(sdpy), sdpy, ARG1, s_x_default_screen); + ASRTER(NIMP(sdpy) && OPDISPLAYP(sdpy), sdpy, ARG1, s_x_default_screen); return MAKINUM(DefaultScreen(XDISPLAY(sdpy))); } @@ -1031,7 +1032,7 @@ SCM x_create_window(swin, spos, sargs) Window window; int len = ilength(sargs); - ASSERT(NIMP(swin) && OPWINDOWP(swin), swin, ARG1, s_x_create_window); + ASRTER(NIMP(swin) && OPWINDOWP(swin), swin, ARG1, s_x_create_window); scm2XPoint(!0, spos, &position, (char *)ARG2, s_x_create_window); scm2XPoint(0, CAR(sargs), &size, (char *)ARG3, s_x_create_window); sargs = CDR(sargs); @@ -1052,11 +1053,11 @@ SCM x_create_window(swin, spos, sargs) SCM svis; unsigned long valuemask; XSetWindowAttributes attributes; - ASSERT(5 <= len, sargs, WNA, s_x_create_window); + ASRTER(5 <= len, sargs, WNA, s_x_create_window); GET_NEXT_INT(depth, sargs, ARG5, s_x_create_window); GET_NEXT_INT(class, sargs, ARGn, s_x_create_window); svis = CAR(sargs); sargs = CDR(sargs); - ASSERT(NIMP(svis) && VISUALP(svis), svis, ARGn, s_x_create_window); + ASRTER(NIMP(svis) && VISUALP(svis), svis, ARGn, s_x_create_window); valuemask = args2winattribs(&attributes, sargs); window = XCreateWindow(XWINDISPLAY(swin), XWINDOW(swin), position.x, position.y, /* initial placement */ @@ -1098,7 +1099,7 @@ SCM x_create_pixmap(obj, s_size, s_depth) } else goto badarg1; scm2XPoint(0, s_size, &size, (char *)ARG2, s_x_create_pixmap); - ASSERT(INUMP(s_depth) && depth >= 0, s_depth, ARG3, s_x_create_pixmap); + ASRTER(INUMP(s_depth) && depth >= 0, s_depth, ARG3, s_x_create_pixmap); p = XCreatePixmap(dpy, drawable, size.x, size.y, depth); return make_xwindow(display, scn, p, (char) 1, (char) 0); } @@ -1111,10 +1112,10 @@ SCM x_window_ref(oargs) XWindowAttributes vlu; int attr, len = ilength(args); /* (void)memset((char *)&vlu, 0, sizeof(XWindowAttributes)); */ - ASSERT(len > 0, oargs, WNA, s_x_window_ref); + ASRTER(len > 0, oargs, WNA, s_x_window_ref); if (1==len--) return EOL; swn = CAR(args); args = CDR(args); - ASSERT(NIMP(swn) && WINDOWP(swn), swn, ARG1, s_x_window_ref); + ASRTER(NIMP(swn) && WINDOWP(swn), swn, ARG1, s_x_window_ref); xwn = WINDOW(swn); if (!XGetWindowAttributes(xwn->dpy, xwn->p.win, &vlu)) return BOOL_F; while (len) { @@ -1133,7 +1134,7 @@ SCM x_window_ref(oargs) case CWDontPropagate:sval = MAKINUM(vlu.do_not_propagate_mask); break; case CWColormap: sval = make_xcolormap(xwn->display, vlu.colormap); break; - default: ASSERT(0, MAKINUM(attr), ARGn, s_x_window_ref); + default: ASRTER(0, MAKINUM(attr), ARGn, s_x_window_ref); } CAR(valend) = sval; CDR(valend) = cons(BOOL_T, EOL); @@ -1151,9 +1152,9 @@ SCM x_window_set(args) XSetWindowAttributes vlu; unsigned long mask; - ASSERT(NIMP(args), args, WNA, s_x_window_set); + ASRTER(NIMP(args), args, WNA, s_x_window_set); swn = CAR(args); args = CDR(args); - ASSERT(NIMP(swn) && WINDOWP(swn), swn, ARG1, s_x_window_set); + ASRTER(NIMP(swn) && WINDOWP(swn), swn, ARG1, s_x_window_set); xwn = WINDOW(swn); mask = args2winattribs(&vlu, args); XChangeWindowAttributes(xwn->dpy, xwn->p.win, mask, &vlu); @@ -1169,7 +1170,7 @@ SCM x_window_geometry(swin) int x, y; unsigned int w, h, border_width, depth; - ASSERT(NIMP(swin) && OPWINDOWP(swin), swin, ARG1, s_x_window_geometry); + ASRTER(NIMP(swin) && OPWINDOWP(swin), swin, ARG1, s_x_window_geometry); sxw = WINDOW(swin); sts = XGetGeometry(sxw->dpy, sxw->p.drbl, &root, &x, &y, &w, &h, &border_width, &depth); @@ -1186,9 +1187,9 @@ SCM x_window_geometry_set(args) XWindowChanges vlu; unsigned long mask; - ASSERT(NIMP(args), args, WNA, s_x_window_geometry_set); + ASRTER(NIMP(args), args, WNA, s_x_window_geometry_set); swn = CAR(args); args = CDR(args); - ASSERT(NIMP(swn) && WINDOWP(swn), swn, ARG1, s_x_window_geometry_set); + ASRTER(NIMP(swn) && WINDOWP(swn), swn, ARG1, s_x_window_geometry_set); xwn = WINDOW(swn); mask = args2wincfgs(&vlu, args); XConfigureWindow(xwn->dpy, xwn->p.win, mask, &vlu); @@ -1198,10 +1199,10 @@ SCM x_window_geometry_set(args) SCM x_close(obj) SCM obj; { - ASSERT(NIMP(obj), obj, ARG1, s_x_close); + ASRTER(NIMP(obj), obj, ARG1, s_x_close); if WINDOWP(obj) { Display *dpy; - ASSERT(!(CAR((SCM)obj) & SCROOT), obj, ARG1, s_x_close); + ASRTER(!(CAR((SCM)obj) & SCROOT), obj, ARG1, s_x_close); if CLOSEDP(obj) return UNSPECIFIED; DEFER_INTS; dpy = XWINDISPLAY(obj); @@ -1209,7 +1210,7 @@ SCM x_close(obj) XFlush(dpy); ALLOW_INTS; } else { - ASSERT(DISPLAYP(obj), obj, ARG1, s_x_close); + ASRTER(DISPLAYP(obj), obj, ARG1, s_x_close); DEFER_INTS; free_xdisplay((CELLPTR)obj); ALLOW_INTS; @@ -1237,12 +1238,12 @@ SCM x_create_colormap(swin, s_vis, s_alloc) SCM alloc; int allo; struct xs_Window *sxw; - ASSERT(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_create_colormap); + ASRTER(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_create_colormap); sxw = WINDOW(swin); - ASSERT(NIMP(s_vis) && VISUALP(s_vis), s_vis, ARG2, s_x_create_colormap); + ASRTER(NIMP(s_vis) && VISUALP(s_vis), s_vis, ARG2, s_x_create_colormap); alloc = thevalue(s_alloc); allo = INUM(alloc); - ASSERT(INUMP(alloc) && (allo==AllocNone || allo==AllocAll), + ASRTER(INUMP(alloc) && (allo==AllocNone || allo==AllocAll), s_alloc, ARG3, s_x_create_colormap); return make_xcolormap(sxw->display, XCreateColormap(sxw->dpy, sxw->p.win, @@ -1252,7 +1253,7 @@ SCM x_recreate_colormap(s_cm) SCM s_cm; { struct xs_Colormap *sxw; - ASSERT(NIMP(s_cm) && COLORMAPP(s_cm), s_cm, ARG1, s_x_recreate_colormap); + ASRTER(NIMP(s_cm) && COLORMAPP(s_cm), s_cm, ARG1, s_x_recreate_colormap); sxw = COLORMAP(s_cm); return make_xcolormap(sxw->display, XCopyColormapAndFree(XDISPLAY(sxw->display), sxw->cm)); @@ -1261,7 +1262,7 @@ SCM x_install_colormap(s_cm, s_flg) SCM s_cm, s_flg; { struct xs_Colormap *xcm; - ASSERT(NIMP(s_cm) && COLORMAPP(s_cm), s_cm, ARG1, s_x_install_colormap); + ASRTER(NIMP(s_cm) && COLORMAPP(s_cm), s_cm, ARG1, s_x_install_colormap); if UNBNDP(s_flg) s_flg = BOOL_T; xcm = COLORMAP(s_cm); if FALSEP(s_flg) XUninstallColormap(XDISPLAY(xcm->display), xcm->cm); @@ -1272,19 +1273,19 @@ SCM x_install_colormap(s_cm, s_flg) /* SCM svsl; */ /* { */ /* XColormapInfo *vsl; */ -/* ASSERT(NIMP(svsl) && COLORMAPP(svsl), svsl, ARG1, s_x_colormap_basis); */ +/* ASRTER(NIMP(svsl) && COLORMAPP(svsl), svsl, ARG1, s_x_colormap_basis); */ /* vsl = XCOLORMAPINFO(svsl); */ /* return cons2(vsl->red_mult, vsl->green_mult, */ -/* cons2(vsl->blue_mult, vsl->base_pixel, EOL)); */ +/* cons2(vsl->blue_mult, vsl->base_pixel, EOL)); */ /* } */ /* SCM x_colormap_limits(svsl) */ /* SCM svsl; */ /* { */ /* XColormapInfo *vsl; */ -/* ASSERT(NIMP(svsl) && COLORMAPP(svsl), svsl, ARG1, s_x_colormap_limits); */ +/* ASRTER(NIMP(svsl) && COLORMAPP(svsl), svsl, ARG1, s_x_colormap_limits); */ /* vsl = XCOLORMAPINFO(svsl); */ /* return cons2(vsl->red_mult, vsl->green_mult, */ -/* cons2(vsl->blue_mult, vsl->base_pixel, EOL)); */ +/* cons2(vsl->blue_mult, vsl->base_pixel, EOL)); */ /* } */ /* Colors in Colormap */ @@ -1298,11 +1299,11 @@ SCM x_alloc_color_cells(scmap, spxls, sargs) Bool contig = 0; SCM pxra, plra; unsigned int npixels, nplanes; - ASSERT(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_alloc_color_cells); + ASRTER(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_alloc_color_cells); xcm = COLORMAP(scmap); npixels = INUM(spxls); - ASSERT(INUMP(spxls) && npixels > 0, spxls, ARG2, s_x_alloc_color_cells); - pxra = make_uve(npixels, MOST_POSITIVE_FIXNUM); /* Uniform vector of long */ + ASRTER(INUMP(spxls) && npixels > 0, spxls, ARG2, s_x_alloc_color_cells); + pxra = make_uve(npixels, MAKINUM(32L)); /* Uniform vector of long */ switch (ilength(sargs) + 2) { default: wta(sargs, (char *)WNA, s_x_alloc_color_cells); case 3: case 4: @@ -1322,7 +1323,7 @@ SCM x_alloc_color_cells(scmap, spxls, sargs) nplanes = theuint(CAR(sargs), s_x_alloc_color_cells); sargs = CDR(sargs); if NNULLP(sargs) contig = thebool(CAR(sargs), s_x_alloc_color_cells); - plra = make_uve(nplanes, MOST_POSITIVE_FIXNUM); /* Uniform vector of long */ + plra = make_uve(nplanes, MAKINUM(32L)); /* Uniform vector of long */ sts = XAllocColorCells(xcm->dpy, xcm->cm, contig, VELTS(plra), nplanes, VELTS(pxra), npixels); if (!sts) return BOOL_F; @@ -1334,9 +1335,9 @@ SCM x_free_color_cells(scmap, spxls, sargs) { struct xs_Colormap *xcm; unsigned int planes = 0; - ASSERT(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_free_color_cells); + ASRTER(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_free_color_cells); xcm = COLORMAP(scmap); - ASSERT(NIMP(spxls) && (TYP7(spxls)==tc7_uvect), spxls, ARG2, + ASRTER(NIMP(spxls) && (TYP7(spxls)==tc7_uvect), spxls, ARG2, s_x_free_color_cells); switch (ilength(sargs) + 2) { default: wta(sargs, (char *)WNA, s_x_free_color_cells); @@ -1354,10 +1355,10 @@ SCM x_find_color(scmap, dat) XColor xclr; struct xs_Colormap *xcm; (void)memset((char *)&xclr, 0, sizeof(xclr)); - ASSERT(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_find_color); + ASRTER(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_find_color); xcm = COLORMAP(scmap); if (!scm2XColor(dat, &xclr)) { - ASSERT(NIMP(dat) && STRINGP(dat), dat, (char*)ARG2, s_x_find_color); + ASRTER(NIMP(dat) && STRINGP(dat), dat, (char*)ARG2, s_x_find_color); if (XAllocNamedColor(xcm->dpy, xcm->cm, CHARS(dat), &xclr, &xclr)) return MAKINUM(xclr.pixel); else return BOOL_F; @@ -1372,13 +1373,13 @@ SCM x_color_set(scmap, s_pix, dat) XColor xclr; struct xs_Colormap *xcm; (void)memset((char *)&xclr, 0, sizeof(xclr)); - ASSERT(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_color_set); - ASSERT(INUMP(s_pix), s_pix, ARG2, s_x_color_set); + ASRTER(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_color_set); + ASRTER(INUMP(s_pix), s_pix, ARG2, s_x_color_set); xcm = COLORMAP(scmap); xclr.pixel = INUM(s_pix); xclr.flags = DoRed | DoGreen | DoBlue; if (!scm2XColor(dat, &xclr)) { - ASSERT(NIMP(dat) && STRINGP(dat), dat, (char*)ARG3, s_x_color_set); + ASRTER(NIMP(dat) && STRINGP(dat), dat, (char*)ARG3, s_x_color_set); XStoreNamedColor(xcm->dpy, xcm->cm, CHARS(dat), xclr.pixel, xclr.flags); } else XStoreColor(xcm->dpy, xcm->cm, &xclr); @@ -1390,9 +1391,9 @@ SCM x_color_ref(scmap, sidx) XColor xclr; struct xs_Colormap *xcm; (void)memset((char *)&xclr, 0, sizeof(xclr)); - ASSERT(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_color_ref); + ASRTER(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_color_ref); xcm = COLORMAP(scmap); - ASSERT(INUMP(sidx), sidx, (char*)ARG2, s_x_color_ref); + ASRTER(INUMP(sidx), sidx, (char*)ARG2, s_x_color_ref); xclr.pixel = INUM(sidx); XQueryColor(xcm->dpy, xcm->cm, &xclr); if (xclr.flags==(DoRed | DoGreen | DoBlue)) @@ -1407,7 +1408,7 @@ SCM x_map_window(swin) SCM swin; { struct xs_Window *w; - ASSERT(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_map_window); + ASRTER(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_map_window); w = WINDOW(swin); XMapWindow(w->dpy, w->p.win); return UNSPECIFIED; @@ -1416,7 +1417,7 @@ SCM x_map_subwindows(swin) SCM swin; { struct xs_Window *w; - ASSERT(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_map_subwindows); + ASRTER(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_map_subwindows); w = WINDOW(swin); XMapSubwindows(w->dpy, w->p.win); return UNSPECIFIED; @@ -1425,7 +1426,7 @@ SCM x_unmap_window(swin) SCM swin; { struct xs_Window *w; - ASSERT(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_unmap_window); + ASRTER(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_unmap_window); w = WINDOW(swin); XUnmapWindow(w->dpy, w->p.win); return UNSPECIFIED; @@ -1434,7 +1435,7 @@ SCM x_unmap_subwindows(swin) SCM swin; { struct xs_Window *w; - ASSERT(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_unmap_subwindows); + ASRTER(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_unmap_subwindows); w = WINDOW(swin); XUnmapSubwindows(w->dpy, w->p.win); return UNSPECIFIED; @@ -1450,9 +1451,9 @@ SCM x_create_gc(args) unsigned long mask; SCM ans; - ASSERT(NIMP(args), args, WNA, s_x_create_gc); + ASRTER(NIMP(args), args, WNA, s_x_create_gc); swin = CAR(args); args = CDR(args); - ASSERT(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_create_gc); + ASRTER(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_create_gc); xsw = WINDOW(swin); ans = make_xgcontext(xsw->display, xsw->screen_number, XCreateGC(xsw->dpy, xsw->p.drbl, 0L, &v), 0); @@ -1469,9 +1470,9 @@ SCM x_gc_set(args) XGCValues v; unsigned long mask; - ASSERT(NIMP(args), args, WNA, s_x_gc_set); + ASRTER(NIMP(args), args, WNA, s_x_gc_set); sgc = CAR(args); args = CDR(args); - ASSERT(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG1, s_x_gc_set); + ASRTER(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG1, s_x_gc_set); xgc = GCONTEXT(sgc); mask = args2xgcvalues(sgc, &v, args); XChangeGC(xgc->dpy, xgc->gc, mask, &v); @@ -1485,8 +1486,8 @@ SCM x_copy_gc(dst, src, args) struct xs_GContext *dgc, *sgc; unsigned long mask; - ASSERT(NIMP(dst) && GCONTEXTP(dst), dst, ARG1, s_x_copy_gc); - ASSERT(NIMP(src) && GCONTEXTP(src), src, ARG2, s_x_copy_gc); + ASRTER(NIMP(dst) && GCONTEXTP(dst), dst, ARG1, s_x_copy_gc); + ASRTER(NIMP(src) && GCONTEXTP(src), src, ARG2, s_x_copy_gc); dgc = GCONTEXT(dst); sgc = GCONTEXT(src); mask = args2valmask(args, s_gc); @@ -1503,10 +1504,10 @@ SCM x_gc_ref(oargs) XGCValues vlu; int attr, len = ilength(args); /* (void)memset((char *)&vlu, 0, sizeof(XGCValues)); */ - ASSERT(len > 0, oargs, WNA, s_x_gc_ref); + ASRTER(len > 0, oargs, WNA, s_x_gc_ref); if (1==len--) return EOL; sgc = CAR(args); args = CDR(args); - ASSERT(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG1, s_x_gc_ref); + ASRTER(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG1, s_x_gc_ref); xgc = GCONTEXT(sgc); valuemask = args2valmask(args, s_gc); /* printf("valuemask = %lx\n", valuemask); */ @@ -1553,7 +1554,7 @@ SCM x_gc_ref(oargs) case GCDashList: sval = MAKINUM(vlu.dashes); break; case GCArcMode: sval = MAKINUM(vlu.arc_mode); break; - default: ASSERT(0, MAKINUM(attr), ARGn, s_x_gc_ref); + default: ASRTER(0, MAKINUM(attr), ARGn, s_x_gc_ref); } CAR(valend) = sval; CDR(valend) = cons(BOOL_T, EOL); @@ -1570,12 +1571,12 @@ SCM x_create_cursor(sdpy, scsr, sargs) Cursor cursor; switch (ilength(sargs)) { - default: ASSERT(0, sargs, WNA, s_x_create_cursor); + default: ASRTER(0, sargs, WNA, s_x_create_cursor); case 0: { SCM shape; - ASSERT(NIMP(sdpy) && DISPLAYP(sdpy), sdpy, ARG1, s_x_create_cursor); + ASRTER(NIMP(sdpy) && DISPLAYP(sdpy), sdpy, ARG1, s_x_create_cursor); shape = thevalue(scsr); - ASSERT(INUMP(shape) && 0 <= INUM(shape), scsr, ARG2, s_x_create_cursor); + ASRTER(INUMP(shape) && 0 <= INUM(shape), scsr, ARG2, s_x_create_cursor); cursor = XCreateFontCursor(XDISPLAY(sdpy), INUM(shape)); return make_xcursor(sdpy, cursor); } @@ -1583,14 +1584,14 @@ SCM x_create_cursor(sdpy, scsr, sargs) XColor foreground_color, background_color; XPoint origin; int sts; - ASSERT(NIMP(sdpy) && WINDOWP(sdpy), sdpy, ARG1, s_x_create_cursor); - ASSERT(FALSEP(scsr) || (NIMP(scsr) && WINDOWP(scsr)), scsr, ARG2, + ASRTER(NIMP(sdpy) && WINDOWP(sdpy), sdpy, ARG1, s_x_create_cursor); + ASRTER(FALSEP(scsr) || (NIMP(scsr) && WINDOWP(scsr)), scsr, ARG2, s_x_create_cursor); sts = scm2XColor(CAR(sargs), &foreground_color); - ASSERT(sts, CAR(sargs), ARG3, s_x_create_cursor); + ASRTER(sts, CAR(sargs), ARG3, s_x_create_cursor); sargs = CDR(sargs); sts = scm2XColor(CAR(sargs), &background_color); - ASSERT(sts, CAR(sargs), ARG4, s_x_create_cursor); + ASRTER(sts, CAR(sargs), ARG4, s_x_create_cursor); sargs = CDR(sargs); scm2XPoint(0, CAR(sargs), &origin, (char*)ARG5, s_x_create_cursor); cursor = XCreatePixmapCursor(XWINDISPLAY(sdpy), XWINDOW(sdpy), @@ -1608,7 +1609,7 @@ SCM x_create_cursor(sdpy, scsr, sargs) GET_NEXT_INT(source_char, sargs, ARG2, s_x_create_cursor); if FALSEP(CAR(sargs)) { sargs = CDR(sargs); - ASSERT(FALSEP(CAR(sargs)), sargs, ARG4, s_x_create_cursor); + ASRTER(FALSEP(CAR(sargs)), sargs, ARG4, s_x_create_cursor); sargs = CDR(sargs); } else { mask_font = thefont(CAR(sargs), s_x_create_cursor); @@ -1616,10 +1617,10 @@ SCM x_create_cursor(sdpy, scsr, sargs) GET_NEXT_INT(mask_char, sargs, ARG4, s_x_create_cursor); } sts = scm2XColor(CAR(sargs), &foreground_color); - ASSERT(sts, CAR(sargs), ARG5, s_x_create_cursor); + ASRTER(sts, CAR(sargs), ARG5, s_x_create_cursor); sargs = CDR(sargs); sts = scm2XColor(CAR(sargs), &background_color); - ASSERT(sts, CAR(sargs), ARGn, s_x_create_cursor); + ASRTER(sts, CAR(sargs), ARGn, s_x_create_cursor); cursor = XCreateGlyphCursor(XWINDISPLAY(sdpy), source_font, mask_font, source_char, mask_char, &foreground_color, &background_color); @@ -1632,8 +1633,8 @@ SCM x_load_font(sdpy, fntnam) { Font font; - ASSERT(NIMP(sdpy) && DISPLAYP(sdpy), sdpy, ARG1, s_x_load_font); - ASSERT(NIMP(fntnam) && STRINGP(fntnam), fntnam, ARG2, s_x_load_font); + ASRTER(NIMP(sdpy) && DISPLAYP(sdpy), sdpy, ARG1, s_x_load_font); + ASRTER(NIMP(fntnam) && STRINGP(fntnam), fntnam, ARG2, s_x_load_font); font = XLoadFont(XDISPLAY(sdpy), CHARS(fntnam)); return make_xfont(sdpy, font, fntnam); } @@ -1749,7 +1750,7 @@ SCM x_screen_depths(sd, si) scm2display_screen(sd, si, &dspscn, s_x_screen_depths); depths = XListDepths(dspscn.dpy, dspscn.screen_number, &count_return); if (!depths) return BOOL_F; - depra = make_uve(count_return, MOST_POSITIVE_FIXNUM); /* Uniform vector of long */ + depra = make_uve(count_return, MAKINUM(32L)); /* Uniform vector of long */ for (;count_return--;) VELTS(depra)[count_return] = depths[count_return]; XFree(depths); return depra; @@ -1835,7 +1836,7 @@ SCM x_visual_geometry(svsl) SCM svsl; { XVisualInfo *vsl; - ASSERT(NIMP(svsl) && VISUALP(svsl), svsl, ARG1, s_x_visual_geometry); + ASRTER(NIMP(svsl) && VISUALP(svsl), svsl, ARG1, s_x_visual_geometry); vsl = XVISUALINFO(svsl); return cons2(MAKINUM(vsl->red_mask), MAKINUM(vsl->green_mask), cons2(MAKINUM(vsl->blue_mask), MAKINUM(vsl->colormap_size), @@ -1845,7 +1846,7 @@ SCM x_visual_class(svsl) SCM svsl; { XVisualInfo *vsl; - ASSERT(NIMP(svsl) && VISUALP(svsl), svsl, ARG1, s_x_visual_class); + ASRTER(NIMP(svsl) && VISUALP(svsl), svsl, ARG1, s_x_visual_class); vsl = XVISUALINFO(svsl); return MAKINUM(vsl->class); } @@ -1916,8 +1917,8 @@ SCM x_ccc_screen_info(sccc, sfmt) { XcmsCCC xccc; XcmsPerScrnInfo *pPerScrnInfo; - ASSERT(NIMP(sccc) && CCCP(sccc), sccc, ARG1, s_x_ccc_screen_info); - ASSERT(NIMP(sfmt) && STRINGP(sfmt), sfmt, ARG2, s_x_ccc_screen_info); + ASRTER(NIMP(sccc) && CCCP(sccc), sccc, ARG1, s_x_ccc_screen_info); + ASRTER(NIMP(sfmt) && STRINGP(sfmt), sfmt, ARG2, s_x_ccc_screen_info); xccc = XCCC(sccc); pPerScrnInfo = (XcmsFunctionSet *)xccc->pPerScrnInfo; return ; @@ -1989,13 +1990,13 @@ SCM x_get_window_property(swin, sprop, sargs) unsigned long bytes_after_return; unsigned char *prop_return; int sarglen = ilength(sargs); - ASSERT(IMP(sprop) ? INUMP(sprop) : STRINGP(sprop), + ASRTER(IMP(sprop) ? INUMP(sprop) : STRINGP(sprop), sprop, ARG2, s_x_get_window_property); - ASSERT(sarglen >= 0 && sarglen < 2, sargs, WNA, s_x_get_window_property); + ASRTER(sarglen >= 0 && sarglen < 2, sargs, WNA, s_x_get_window_property); if (1 == sarglen) { - ASSERT(NFALSEP(booleanp(CAR(sargs))), sargs, ARG3, s_x_get_window_property); + ASRTER(NFALSEP(booleanp(CAR(sargs))), sargs, ARG3, s_x_get_window_property); } - ASSERT(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_map_window); + ASRTER(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_map_window); xwn = WINDOW(swin); if (INUMP(sprop)) property = INUM(sprop); @@ -2024,7 +2025,7 @@ SCM x_list_properties(swin) Atom *atoms; int num_prop_return; SCM lst; - ASSERT(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_map_window); + ASRTER(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_map_window); xwn = WINDOW(swin); atoms = XListProperties(xwn->dpy, xwn->p.win, &num_prop_return); { @@ -2046,8 +2047,8 @@ SCM x_clear_area(swin, spos, sargs) SCM swin, spos, sargs; { XPoint position, size; - ASSERT(2==ilength(sargs), sargs, WNA, s_x_clear_area); - ASSERT(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_clear_area); + ASRTER(2==ilength(sargs), sargs, WNA, s_x_clear_area); + ASRTER(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_clear_area); scm2XPoint(!0, spos, &position, (char *)ARG2, s_x_clear_area); scm2XPoint(0, CAR(sargs), &size, (char *)ARG3, s_x_clear_area); sargs = CDR(sargs); @@ -2060,9 +2061,9 @@ SCM x_fill_rectangle(swin, sgc, sargs) SCM swin, sgc, sargs; { XPoint position, size; - ASSERT(2==ilength(sargs), sargs, WNA, s_x_fill_rectangle); - ASSERT(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_fill_rectangle); - ASSERT(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG2, s_x_fill_rectangle); + ASRTER(2==ilength(sargs), sargs, WNA, s_x_fill_rectangle); + ASRTER(NIMP(swin) && WINDOWP(swin), swin, ARG1, s_x_fill_rectangle); + ASRTER(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG2, s_x_fill_rectangle); scm2XPoint(!0, CAR(sargs), &position, (char *)ARG3, s_x_fill_rectangle); sargs = CDR(sargs); scm2XPoint(0, CAR(sargs), &size, (char *)ARG4, s_x_fill_rectangle); @@ -2077,13 +2078,13 @@ void xldraw_string(sdbl, sgc, sargs, proc, s_caller) char *s_caller; { XPoint position; - ASSERT(2==ilength(sargs), sargs, WNA, s_caller); - ASSERT(NIMP(sdbl) && WINDOWP(sdbl), sdbl, ARG1, s_caller); - ASSERT(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG2, s_caller); + ASRTER(2==ilength(sargs), sargs, WNA, s_caller); + ASRTER(NIMP(sdbl) && WINDOWP(sdbl), sdbl, ARG1, s_caller); + ASRTER(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG2, s_caller); scm2XPoint(!0, CAR(sargs), &position, (char *)ARG3, s_caller); sargs = CDR(sargs); sargs = CAR(sargs); - ASSERT(NIMP(sargs) && STRINGP(sargs), sargs, ARG4, s_caller); + ASRTER(NIMP(sargs) && STRINGP(sargs), sargs, ARG4, s_caller); proc(XWINDISPLAY(sdbl), XWINDOW(sdbl), XGCONTEXT(sgc), position.x, position.y, CHARS(sargs), LENGTH(sargs)); } @@ -2106,13 +2107,13 @@ SCM x_draw_points(sdbl, sgc, sargs) XPoint pos[1]; int len; SCM sarg; - ASSERT(NIMP(sdbl) && WINDOWP(sdbl), sdbl, ARG1, s_x_draw_points); - ASSERT(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG2, s_x_draw_points); + ASRTER(NIMP(sdbl) && WINDOWP(sdbl), sdbl, ARG1, s_x_draw_points); + ASRTER(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG2, s_x_draw_points); loop: if NULLP(sargs) return UNSPECIFIED; sarg = CAR(sargs); sargs = CDR(sargs); if (INUMP(sarg)) { - ASSERT(NNULLP(sargs), sargs, WNA, s_x_draw_points); + ASRTER(NNULLP(sargs), sargs, WNA, s_x_draw_points); pos[0].x = INUM(sarg); GET_NEXT_INT(pos[0].y, sargs, ARGn, s_x_draw_points); goto drawshort; @@ -2125,7 +2126,7 @@ SCM x_draw_points(sdbl, sgc, sargs) &(pos[0]), 1, CoordModeOrigin); goto loop; } else { - ASSERT(NULLP(sargs), sargs, WNA, s_x_draw_points); + ASRTER(NULLP(sargs), sargs, WNA, s_x_draw_points); XDrawPoints(XWINDISPLAY(sdbl), XWINDOW(sdbl), XGCONTEXT(sgc), (XPoint *)scm_base_addr(sarg, s_x_draw_points), len, CoordModeOrigin); @@ -2140,13 +2141,13 @@ SCM xldraw_lines(sdbl, sgc, sargs, funcod, s_caller) XPoint pos[2]; int len; SCM sarg; - ASSERT(NIMP(sdbl) && WINDOWP(sdbl), sdbl, ARG1, s_caller); - ASSERT(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG2, s_caller); + ASRTER(NIMP(sdbl) && WINDOWP(sdbl), sdbl, ARG1, s_caller); + ASRTER(NIMP(sgc) && GCONTEXTP(sgc), sgc, ARG2, s_caller); loop: if NULLP(sargs) return UNSPECIFIED; sarg = CAR(sargs); sargs = CDR(sargs); if (INUMP(sarg)) { - ASSERT(NNULLP(sargs), sargs, WNA, s_caller); + ASRTER(NNULLP(sargs), sargs, WNA, s_caller); pos[0].x = INUM(sarg); GET_NEXT_INT(pos[0].y, sargs, ARGn, s_caller); GET_NEXT_INT(pos[1].x, sargs, ARGn, s_caller); @@ -2214,7 +2215,7 @@ SCM x_read_bitmap_file(sdbl, sfname) unsigned int w, h; int x, y; Pixmap pxmp; - ASSERT(NIMP(sdbl) && WINDOWP(sdbl), sdbl, ARG1, s_x_read_bitmap_file); + ASRTER(NIMP(sdbl) && WINDOWP(sdbl), sdbl, ARG1, s_x_read_bitmap_file); if (XReadBitmapFile(XWINDISPLAY(sdbl), WINDOW(sdbl)->p.pm, CHARS(sfname), @@ -2238,8 +2239,8 @@ SCM x_event_ref(sevent, sfield) SCM sevent, sfield; { void *x; - ASSERT(NIMP(sevent) && XEVENTP(sevent), sevent, ARG1, s_x_event_ref); - ASSERT(INUMP(sfield), sfield, ARG2, s_x_event_ref); + ASRTER(NIMP(sevent) && XEVENTP(sevent), sevent, ARG1, s_x_event_ref); + ASRTER(INUMP(sfield), sfield, ARG2, s_x_event_ref); x = (void *) CHARS(sevent); switch (((((XEvent*)x)->type)<<8)+INUM(sfield)) { default: wta(sevent, "Incompatible field for", s_x_event_ref); -- cgit v1.2.3