Mercurial > hg > xemacs-beta
annotate src/libinterface.c @ 5753:dbd8305e13cb
Warn about non-string non-integer ARG to #'gensym, bytecomp.el.
lisp/ChangeLog addition:
2013-08-21 Aidan Kehoe <kehoea@parhasard.net>
* bytecomp.el:
* bytecomp.el (gensym):
* bytecomp.el (byte-compile-gensym): New.
Warn that gensym called in a for-effect context is unlikely to be
useful.
Warn about non-string non-integer ARGs, this is incorrect.
Am not changing the function to error with same, most code that
makes the mistake is has no problems, which is why it has survived
so long.
* window-xemacs.el (save-window-excursion/mapping):
* window.el (save-window-excursion):
Call #'gensym with a string, not a symbol.
| author | Aidan Kehoe <kehoea@parhasard.net> |
|---|---|
| date | Wed, 21 Aug 2013 19:02:59 +0100 |
| parents | 308d34e9f07d |
| children |
| rev | line source |
|---|---|
| 870 | 1 /* Interface to graphics/etc libraries, with cdecl calling convention. |
| 2 Copyright (C) 2002 Ben Wing | |
| 3 | |
| 4 This file is part of XEmacs. | |
| 5 | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
870
diff
changeset
|
6 XEmacs is free software: you can redistribute it and/or modify it |
| 870 | 7 under the terms of the GNU General Public License as published by the |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
870
diff
changeset
|
8 Free Software Foundation, either version 3 of the License, or (at your |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
870
diff
changeset
|
9 option) any later version. |
| 870 | 10 |
| 11 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 for more details. | |
| 15 | |
| 16 You should have received a copy of the GNU General Public License | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
870
diff
changeset
|
17 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 870 | 18 |
| 19 /* Synched up with: Not in FSF. */ | |
| 20 | |
| 21 #include <config.h> | |
| 22 #include "lisp.h" | |
| 23 | |
| 24 #include "libinterface.h" | |
| 25 | |
| 26 /* YUUUUUUUUUUUUUUCK! | |
| 27 | |
| 28 This file exists only because VC++ lacks pragmas that let you change the | |
| 29 default calling convention in the middle of a file. With optimization, | |
| 30 we compile XEmacs using fastcall as the default convention; but | |
| 31 libraries are not compiled this way, and thus need __cdecl in their | |
| 32 declaration. Without the pragma, we either | |
| 33 | |
| 34 (a) depend on libraries that declare their external functions with | |
| 35 suitable preprocessor definitions that we can change; | |
| 36 | |
| 37 (b) force the user to recompile the library with fastcall (not | |
| 38 reasonable); | |
| 39 | |
| 40 (c) hack the headers manually (not reasonable); | |
| 41 | |
| 42 (d) put all calls to the library in a separate file where the default | |
| 43 calling convention is __cdecl (hence, this file). | |
| 44 | |
| 45 In fact, some libraries do make (a) feasible. This is the case with PNG | |
| 46 and ZLIB. JPEG almost does so, since all externs are wrapped with | |
| 47 EXTERN(); but they fail to wrap their definition of EXTERN with #ifndef | |
| 48 EXTERN, so we can't override it. XPM is similar, wrapping their externs | |
| 49 with FUNC() -- again, not overridable. With PNG, we define PNG_EXPORT; | |
| 50 with ZLIB, we define ZEXPORT and ZEXPORTVA. */ | |
| 51 | |
| 52 #ifdef HAVE_XPM | |
| 53 | |
| 54 void | |
| 55 qxe_XpmFreeXpmImage (XpmImage *image) | |
| 56 { | |
| 57 XpmFreeXpmImage (image); | |
| 58 } | |
| 59 | |
| 60 void | |
| 61 qxe_XpmFreeXpmInfo (XpmInfo *info) | |
| 62 { | |
| 63 XpmFreeXpmInfo (info); | |
| 64 } | |
| 65 | |
| 66 int | |
| 67 qxe_XpmCreateXpmImageFromBuffer (char *buffer, XpmImage *image, XpmInfo *info) | |
| 68 { | |
| 69 return XpmCreateXpmImageFromBuffer (buffer, image, info); | |
| 70 } | |
| 71 | |
| 72 void | |
| 73 qxe_XpmFree (void *ptr) | |
| 74 { | |
| 75 XpmFree (ptr); | |
| 76 } | |
| 77 | |
| 78 int | |
| 79 qxe_XpmReadFileToData (char *filename, char ***data_return) | |
| 80 { | |
| 81 return XpmReadFileToData (filename, data_return); | |
| 82 } | |
| 83 | |
| 84 #endif /* HAVE_XPM */ | |
| 85 | |
| 86 #ifdef HAVE_JPEG | |
| 87 | |
| 88 boolean | |
| 89 qxe_jpeg_finish_decompress (j_decompress_ptr cinfo) | |
| 90 { | |
| 91 return jpeg_finish_decompress (cinfo); | |
| 92 } | |
| 93 | |
| 94 boolean | |
| 95 qxe_jpeg_start_decompress (j_decompress_ptr cinfo) | |
| 96 { | |
| 97 return jpeg_start_decompress (cinfo); | |
| 98 } | |
| 99 | |
| 100 JDIMENSION | |
| 101 qxe_jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, | |
| 102 JDIMENSION max_lines) | |
| 103 { | |
| 104 return jpeg_read_scanlines (cinfo, scanlines, max_lines); | |
| 105 } | |
| 106 | |
| 107 int | |
| 108 qxe_jpeg_read_header (j_decompress_ptr cinfo, boolean require_image) | |
| 109 { | |
| 110 return jpeg_read_header (cinfo, require_image); | |
| 111 } | |
| 112 | |
| 113 void | |
| 114 qxe_jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, | |
| 115 size_t structsize) | |
| 116 { | |
| 117 jpeg_CreateDecompress (cinfo, version, structsize); | |
| 118 } | |
| 119 | |
| 120 struct jpeg_error_mgr * | |
| 121 qxe_jpeg_std_error (struct jpeg_error_mgr *err) | |
| 122 { | |
| 123 return jpeg_std_error (err); | |
| 124 } | |
| 125 | |
| 126 void | |
| 127 qxe_jpeg_destroy_decompress (j_decompress_ptr cinfo) | |
| 128 { | |
| 129 jpeg_destroy_decompress (cinfo); | |
| 130 } | |
| 131 | |
| 132 boolean | |
| 133 qxe_jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) | |
| 134 { | |
| 135 return jpeg_resync_to_restart (cinfo, desired); | |
| 136 } | |
| 137 | |
| 138 #endif /* HAVE_JPEG */ | |
| 139 | |
| 140 #ifdef HAVE_TIFF | |
| 141 | |
| 142 tdata_t | |
| 143 qxe_TIFFmalloc (tsize_t x1) | |
| 144 { | |
| 145 return _TIFFmalloc (x1); | |
| 146 } | |
| 147 | |
| 148 void | |
| 149 qxe_TIFFfree (tdata_t x1) | |
| 150 { | |
| 151 _TIFFfree (x1); | |
| 152 } | |
| 153 | |
| 154 void | |
| 155 qxe_TIFFClose (TIFF *x1) | |
| 156 { | |
| 157 TIFFClose (x1); | |
| 158 } | |
| 159 | |
| 160 int | |
| 161 qxe_TIFFGetField (TIFF *x1, ttag_t x2, uint32 *x3) | |
| 162 { | |
| 163 return TIFFGetField (x1, x2, x3); | |
| 164 } | |
| 165 | |
| 166 TIFF * | |
| 167 qxe_TIFFClientOpen (const char *x1, const char *x2, | |
| 168 thandle_t x3, | |
| 169 TIFFReadWriteProc x4, TIFFReadWriteProc x5, | |
| 170 TIFFSeekProc x6, TIFFCloseProc x7, | |
| 171 TIFFSizeProc x8, | |
| 172 TIFFMapFileProc x9, TIFFUnmapFileProc x10) | |
| 173 { | |
| 174 return TIFFClientOpen (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10); | |
| 175 } | |
| 176 | |
| 177 TIFFErrorHandler | |
| 178 qxe_TIFFSetErrorHandler (TIFFErrorHandler x1) | |
| 179 { | |
| 180 return TIFFSetErrorHandler (x1); | |
| 181 } | |
| 182 | |
| 183 TIFFErrorHandler | |
| 184 qxe_TIFFSetWarningHandler (TIFFErrorHandler x1) | |
| 185 { | |
| 186 return TIFFSetWarningHandler (x1); | |
| 187 } | |
| 188 | |
| 189 int | |
| 190 qxe_TIFFReadRGBAImage (TIFF *x1, uint32 x2, uint32 x3, uint32 *x4, int x5) | |
| 191 { | |
| 192 return TIFFReadRGBAImage (x1, x2, x3, x4, x5); | |
| 193 } | |
| 194 | |
| 195 #endif /* HAVE_TIFF */ |
