* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
- * Permission to use, copy, modify, distribute, and sell this software and
+ * Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
- *
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
u_char firstchar; /* first token of string */
} code_t;
-typedef int (*decodeFunc)(TIFF*, tidata_t, tsize_t, tsample_t);
+typedef int (LINKAGEMODE *decodeFunc)(TIFF*, tidata_t, tsize_t, tsample_t);
typedef struct {
LZWBaseState base;
#define DecoderState(tif) ((LZWDecodeState*) LZWState(tif))
#define EncoderState(tif) ((LZWEncodeState*) LZWState(tif))
-static int LZWDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+static int LINKAGEMODE LZWDecode(TIFF*, tidata_t, tsize_t, tsample_t);
#ifdef LZW_COMPAT
-static int LZWDecodeCompat(TIFF*, tidata_t, tsize_t, tsample_t);
+static int LINKAGEMODE LZWDecodeCompat(TIFF*, tidata_t, tsize_t, tsample_t);
#endif
static void cl_hash(LZWEncodeState*);
nextbits -= nbits; \
}
-static int
+static int LINKAGEMODE
LZWDecodeCompat(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s)
{
LZWDecodeState *sp = DecoderState(tif);
/*
* Encode a chunk of pixels.
*
- * Uses an open addressing double hashing (no chaining) on the
+ * Uses an open addressing double hashing (no chaining) on the
* prefix code/next character combination. We do a variant of
* Knuth's algorithm D (vol. 3, sec. 6.4) along with G. Knott's
* relatively-prime secondary probe. Here, the modular division
- * first probe is gives way to a faster exclusive-or manipulation.
+ * first probe is gives way to a faster exclusive-or manipulation.
* Also do block compression with an adaptive reset, whereby the
* code table is cleared when the compression ratio decreases,
* but after the table fills. The variable-length output codes
* are re-sized at this point, and a CODE_CLEAR is generated
- * for the decoder.
+ * for the decoder.
*/
-static int
+static int LINKAGEMODE
LZWEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
{
register LZWEncodeState *sp = EncoderState(tif);
sp->enc_oldcode = (hcode_t) -1;
}
PutNextCode(op, CODE_EOI);
- if (nextbits > 0)
+ if (nextbits > 0)
*op++ = (u_char)(nextdata << (8-nextbits));
tif->tif_rawcc = (tsize_t)(op - tif->tif_rawdata);
return (1);