From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Delayed loading of image libraries Date: Wed, 30 Jun 2004 12:15:29 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <20040610133420.CAC7.JMBARRANQUERO@wke.es> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1088590911 8234 80.91.224.253 (30 Jun 2004 10:21:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 30 Jun 2004 10:21:51 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jun 30 12:21:28 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BfcDX-0006IU-00 for ; Wed, 30 Jun 2004 12:21:27 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BfcDX-0005pt-00 for ; Wed, 30 Jun 2004 12:21:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BfcFF-0003EM-2k for emacs-devel@quimby.gnus.org; Wed, 30 Jun 2004 06:23:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BfcF3-0003DN-2m for emacs-devel@gnu.org; Wed, 30 Jun 2004 06:23:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BfcF1-0003AO-B3 for emacs-devel@gnu.org; Wed, 30 Jun 2004 06:23:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BfcF1-0003AA-6j for emacs-devel@gnu.org; Wed, 30 Jun 2004 06:22:59 -0400 Original-Received: from [195.135.220.2] (helo=Cantor.suse.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BfcCe-0003K2-04 for emacs-devel@gnu.org; Wed, 30 Jun 2004 06:20:32 -0400 Original-Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 03732810120; Wed, 30 Jun 2004 12:15:30 +0200 (CEST) Original-To: Juanma Barranquero X-Yow: Two LITTLE black dots and one BIG black dot...nice 'n' FLUFFY!! In-Reply-To: <20040610133420.CAC7.JMBARRANQUERO@wke.es> (Juanma Barranquero's message of "Thu, 10 Jun 2004 14:38:46 +0200") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25323 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25323 Juanma Barranquero writes: > +DEFUN ("init-image-library", Finit_image_library, Sinit_image_library,= 2, 2, 0, > + doc: /* Initialize image library implementing image type TYPE. > +Return non-nil if TYPE is a supported image type. > + > +Image types pbm and xbm are prebuilt; other types are loaded here. > +Libraries to load are specified in alist LIBRARIES (usually, the value > +of `image-library-alist', which see. */) > + (type, libraries) > +{ > + Lisp_Object tested; > + > + /* Don't try to reload the library. */ > + tested =3D Fassq (type, Vimage_type_cache); > + if (CONSP (tested)) > + return XCDR (tested); > + > +#if defined (HAVE_XPM) || defined (MAC_OS) > + if (EQ (type, Qxpm)) > + return CHECK_LIB_AVAILABLE(&xpm_type, init_xpm_functions); > +#endif Please make libraries an explicit parameter of CHECK_LIB_AVAILABLE, so that it does not look like it is completely ignored. Also, you are missing to declare the parameters. Please always compile with -Wall. Andreas. --=20 Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."