# HG changeset patch # User Gerd Moellmann # Date 942271536 0 # Node ID 9457656ded8b24053823cec630a06a48b24f94e6 # Parent 53eeb3b7c785c1a8e57684a70cdbec182933f22a (QCuser_data): Removed. (syms_of_xfns): Initialization of QCuser_data removed. (parse_image_spec): Don't handle :user-data specially. Allow unknown keys. Remove parameter ALLOW_OTHER_KEYS. (xbm_image_p, xbm_load, xpm_image_p, pbm_image_p, png_image_p) (tiff_image_p, jpeg_image_p, gif_image_p, gs_image_p): Call parse_image_spec accordingly. diff -r 53eeb3b7c785 -r 9457656ded8b src/xfns.c --- a/src/xfns.c Wed Nov 10 22:01:35 1999 +0000 +++ b/src/xfns.c Wed Nov 10 22:05:36 1999 +0000 @@ -5441,7 +5441,7 @@ Lisp_Object QCtype, QCdata, QCascent, QCmargin, QCrelief; extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile; Lisp_Object QCalgorithm, QCcolor_symbols, QCheuristic_mask; -Lisp_Object QCindex, QCuser_data; +Lisp_Object QCindex; /* Other symbols. */ @@ -5576,10 +5576,8 @@ }; -static int parse_image_spec P_ ((Lisp_Object spec, - struct image_keyword *keywords, - int nkeywords, Lisp_Object type, - int allow_other_keys_p)); +static int parse_image_spec P_ ((Lisp_Object, struct image_keyword *, + int, Lisp_Object)); static Lisp_Object image_spec_value P_ ((Lisp_Object, Lisp_Object, int *)); @@ -5587,17 +5585,14 @@ has the format (image KEYWORD VALUE ...). One of the keyword/ value pairs must be `:type TYPE'. KEYWORDS is a vector of image_keywords structures of size NKEYWORDS describing other - allowed keyword/value pairs. ALLOW_OTHER_KEYS_P non-zero means - allow KEYWORD/VALUE pairs other than those described by KEYWORDS - without checking them. Value is non-zero if SPEC is valid. */ + allowed keyword/value pairs. Value is non-zero if SPEC is valid. */ static int -parse_image_spec (spec, keywords, nkeywords, type, allow_other_keys_p) +parse_image_spec (spec, keywords, nkeywords, type) Lisp_Object spec; struct image_keyword *keywords; int nkeywords; Lisp_Object type; - int allow_other_keys_p; { int i; Lisp_Object plist; @@ -5622,21 +5617,13 @@ value = XCAR (plist); plist = XCDR (plist); - /* Always ignore :user-data DATA. */ - if (EQ (key, QCuser_data)) - continue; - /* Find key in KEYWORDS. Error if not found. */ for (i = 0; i < nkeywords; ++i) if (strcmp (keywords[i].name, XSYMBOL (key)->name->data) == 0) break; if (i == nkeywords) - { - if (!allow_other_keys_p) - return 0; - continue; - } + continue; /* Record that we recognized the keyword. If a keywords was found more than once, it's an error. */ @@ -6430,7 +6417,7 @@ struct image_keyword kw[XBM_LAST]; bcopy (xbm_format, kw, sizeof kw); - if (!parse_image_spec (object, kw, XBM_LAST, Qxbm, 0)) + if (!parse_image_spec (object, kw, XBM_LAST, Qxbm)) return 0; xassert (EQ (kw[XBM_TYPE].value, Qxbm)); @@ -6846,7 +6833,7 @@ /* Parse the list specification. */ bcopy (xbm_format, fmt, sizeof fmt); - parsed_p = parse_image_spec (img->spec, fmt, XBM_LAST, Qxbm, 0); + parsed_p = parse_image_spec (img->spec, fmt, XBM_LAST, Qxbm); xassert (parsed_p); /* Get specified width, and height. */ @@ -7005,7 +6992,7 @@ { struct image_keyword fmt[XPM_LAST]; bcopy (xpm_format, fmt, sizeof fmt); - return (parse_image_spec (object, fmt, XPM_LAST, Qxpm, 0) + return (parse_image_spec (object, fmt, XPM_LAST, Qxpm) /* Either `:file' or `:data' must be present. */ && fmt[XPM_FILE].count + fmt[XPM_DATA].count == 1 /* Either no `:color-symbols' or it's a list of conses @@ -7675,7 +7662,7 @@ bcopy (pbm_format, fmt, sizeof fmt); - if (!parse_image_spec (object, fmt, PBM_LAST, Qpbm, 0) + if (!parse_image_spec (object, fmt, PBM_LAST, Qpbm) || (fmt[PBM_ASCENT].count && XFASTINT (fmt[PBM_ASCENT].value) > 100)) return 0; @@ -7989,7 +7976,7 @@ struct image_keyword fmt[PNG_LAST]; bcopy (png_format, fmt, sizeof fmt); - if (!parse_image_spec (object, fmt, PNG_LAST, Qpng, 1) + if (!parse_image_spec (object, fmt, PNG_LAST, Qpng) || (fmt[PNG_ASCENT].count && XFASTINT (fmt[PNG_ASCENT].value) > 100)) return 0; @@ -8410,7 +8397,7 @@ bcopy (jpeg_format, fmt, sizeof fmt); - if (!parse_image_spec (object, fmt, JPEG_LAST, Qjpeg, 0) + if (!parse_image_spec (object, fmt, JPEG_LAST, Qjpeg) || (fmt[JPEG_ASCENT].count && XFASTINT (fmt[JPEG_ASCENT].value) > 100)) return 0; @@ -8657,7 +8644,7 @@ struct image_keyword fmt[TIFF_LAST]; bcopy (tiff_format, fmt, sizeof fmt); - if (!parse_image_spec (object, fmt, TIFF_LAST, Qtiff, 1) + if (!parse_image_spec (object, fmt, TIFF_LAST, Qtiff) || (fmt[TIFF_ASCENT].count && XFASTINT (fmt[TIFF_ASCENT].value) > 100)) return 0; @@ -8833,7 +8820,7 @@ struct image_keyword fmt[GIF_LAST]; bcopy (gif_format, fmt, sizeof fmt); - if (!parse_image_spec (object, fmt, GIF_LAST, Qgif, 1) + if (!parse_image_spec (object, fmt, GIF_LAST, Qgif) || (fmt[GIF_ASCENT].count && XFASTINT (fmt[GIF_ASCENT].value) > 100)) return 0; @@ -9102,7 +9089,7 @@ bcopy (gs_format, fmt, sizeof fmt); - if (!parse_image_spec (object, fmt, GS_LAST, Qpostscript, 1) + if (!parse_image_spec (object, fmt, GS_LAST, Qpostscript) || (fmt[GS_ASCENT].count && XFASTINT (fmt[GS_ASCENT].value) > 100)) return 0; @@ -10428,8 +10415,6 @@ staticpro (&QCpt_height); QCindex = intern (":index"); staticpro (&QCindex); - QCuser_data = intern (":user-data"); - staticpro (&QCuser_data); Qpbm = intern ("pbm"); staticpro (&Qpbm);