From: hansr Date: Thu, 9 Oct 2014 11:55:20 +0000 (+0200) Subject: Remove FAR definition X-Git-Tag: 1.9.9-b1~928 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0db1040667b13c0f9405af810f669857a487b08e;p=thirdparty%2Fzlib-ng.git Remove FAR definition Remove a few leftovers from the legacy OS support removal --- diff --git a/crc32.c b/crc32.c index 524ace6e7..79c6c1950 100644 --- a/crc32.c +++ b/crc32.c @@ -28,7 +28,7 @@ # endif /* !DYNAMIC_CRC_TABLE */ #endif /* MAKECRCH */ -#include "zutil.h" /* for STDC and FAR definitions */ +#include "zutil.h" /* for STDC definitions */ #define local static @@ -38,9 +38,9 @@ #endif #ifdef BYFOUR local unsigned long crc32_little OF((unsigned long, - const unsigned char FAR *, unsigned)); + const unsigned char *, unsigned)); local unsigned long crc32_big OF((unsigned long, - const unsigned char FAR *, unsigned)); + const unsigned char *, unsigned)); # define TBLS 8 #else # define TBLS 1 @@ -56,10 +56,10 @@ local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2)); #ifdef DYNAMIC_CRC_TABLE local volatile int crc_table_empty = 1; -local z_crc_t FAR crc_table[TBLS][256]; +local z_crc_t crc_table[TBLS][256]; local void make_crc_table OF((void)); #ifdef MAKECRCH - local void write_table OF((FILE *, const z_crc_t FAR *)); + local void write_table OF((FILE *, const z_crc_t *)); #endif /* MAKECRCH */ /* Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: @@ -146,7 +146,7 @@ local void make_crc_table() if (out == NULL) return; fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); - fprintf(out, "local const z_crc_t FAR "); + fprintf(out, "local const z_crc_t "); fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); write_table(out, crc_table[0]); # ifdef BYFOUR @@ -166,7 +166,7 @@ local void make_crc_table() #ifdef MAKECRCH local void write_table(out, table) FILE *out; - const z_crc_t FAR *table; + const z_crc_t *table; { int n; @@ -187,13 +187,13 @@ local void write_table(out, table) /* ========================================================================= * This function can be used by asm versions of crc32() */ -const z_crc_t FAR * ZEXPORT get_crc_table() +const z_crc_t * ZEXPORT get_crc_table() { #ifdef DYNAMIC_CRC_TABLE if (crc_table_empty) make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ - return (const z_crc_t FAR *)crc_table; + return (const z_crc_t *)crc_table; } /* ========================================================================= */ @@ -204,7 +204,7 @@ const z_crc_t FAR * ZEXPORT get_crc_table() /* ========================================================================= */ unsigned long ZEXPORT crc32(crc, buf, len) unsigned long crc; - const unsigned char FAR *buf; + const unsigned char *buf; uInt len; { if (buf == Z_NULL) return 0UL; @@ -256,11 +256,11 @@ unsigned long ZEXPORT crc32(crc, buf, len) /* ========================================================================= */ local unsigned long crc32_little(crc, buf, len) unsigned long crc; - const unsigned char FAR *buf; + const unsigned char *buf; unsigned len; { register z_crc_t c; - register const z_crc_t FAR *buf4; + register const z_crc_t *buf4; c = (z_crc_t)crc; c = ~c; @@ -269,7 +269,7 @@ local unsigned long crc32_little(crc, buf, len) len--; } - buf4 = (const z_crc_t FAR *)(const void FAR *)buf; + buf4 = (const z_crc_t *)(const void *)buf; #ifndef CRC32_UNROLL_LESS while (len >= 32) { @@ -282,7 +282,7 @@ local unsigned long crc32_little(crc, buf, len) DOLIT4; len -= 4; } - buf = (const unsigned char FAR *)buf4; + buf = (const unsigned char *)buf4; if (len) do { c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); @@ -300,11 +300,11 @@ local unsigned long crc32_little(crc, buf, len) /* ========================================================================= */ local unsigned long crc32_big(crc, buf, len) unsigned long crc; - const unsigned char FAR *buf; + const unsigned char *buf; unsigned len; { register z_crc_t c; - register const z_crc_t FAR *buf4; + register const z_crc_t *buf4; c = ZSWAP32((z_crc_t)crc); c = ~c; @@ -313,7 +313,7 @@ local unsigned long crc32_big(crc, buf, len) len--; } - buf4 = (const z_crc_t FAR *)(const void FAR *)buf; + buf4 = (const z_crc_t *)(const void *)buf; buf4--; while (len >= 32) { DOBIG32; @@ -324,7 +324,7 @@ local unsigned long crc32_big(crc, buf, len) len -= 4; } buf4++; - buf = (const unsigned char FAR *)buf4; + buf = (const unsigned char *)buf4; if (len) do { c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); diff --git a/crc32.h b/crc32.h index 9e0c77810..c2f4c6bc9 100644 --- a/crc32.h +++ b/crc32.h @@ -2,7 +2,7 @@ * Generated automatically by crc32.c */ -local const z_crc_t FAR crc_table[TBLS][256] = +local const z_crc_t crc_table[TBLS][256] = { { 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, diff --git a/deflate.c b/deflate.c index 17792a42c..b26f4d1ab 100644 --- a/deflate.c +++ b/deflate.c @@ -344,7 +344,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); if (s == Z_NULL) return Z_MEM_ERROR; - strm->state = (struct internal_state FAR *)s; + strm->state = (struct internal_state *)s; s->strm = strm; s->wrap = wrap; @@ -1114,7 +1114,7 @@ int ZEXPORT deflateCopy (dest, source) ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); if (ds == Z_NULL) return Z_MEM_ERROR; - dest->state = (struct internal_state FAR *) ds; + dest->state = (struct internal_state *) ds; zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state)); ds->strm = dest; diff --git a/deflate.h b/deflate.h index c4d0b8926..2edf21a52 100644 --- a/deflate.h +++ b/deflate.h @@ -74,7 +74,7 @@ typedef struct ct_data_s { ush dad; /* father node in Huffman tree */ ush len; /* length of bit string */ } dl; -} FAR ct_data; +} ct_data; #define Freq fc.freq #define Code fc.code @@ -87,10 +87,10 @@ typedef struct tree_desc_s { ct_data *dyn_tree; /* the dynamic tree */ int max_code; /* largest code with non zero frequency */ static_tree_desc *stat_desc; /* the corresponding static tree */ -} FAR tree_desc; +} tree_desc; typedef ush Pos; -typedef Pos FAR Posf; +typedef Pos Posf; typedef unsigned IPos; /* A Pos is an index in the character window. We use short instead of int to @@ -277,7 +277,7 @@ typedef struct internal_state { * updated to the new high water mark. */ -} FAR deflate_state; +} deflate_state; typedef enum { need_more, /* block not completed, need more input or more output */ diff --git a/gzguts.h b/gzguts.h index 85a9c4d84..e42a11efd 100644 --- a/gzguts.h +++ b/gzguts.h @@ -170,7 +170,7 @@ typedef struct { /* zlib inflate or deflate stream */ z_stream strm; /* stream structure in-place (not a pointer) */ } gz_state; -typedef gz_state FAR *gz_statep; +typedef gz_state *gz_statep; /* shared functions */ void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); diff --git a/infback.c b/infback.c index f3833c2e4..4f2bb5b38 100644 --- a/infback.c +++ b/infback.c @@ -16,7 +16,7 @@ #include "inffast.h" /* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); +local void fixedtables OF((struct inflate_state *state)); /* strm provides memory allocation functions in zalloc and zfree, or @@ -28,11 +28,11 @@ local void fixedtables OF((struct inflate_state FAR *state)); int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) z_streamp strm; int windowBits; -unsigned char FAR *window; +unsigned char *window; const char *version; int stream_size; { - struct inflate_state FAR *state; + struct inflate_state *state; if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || stream_size != (int)(sizeof(z_stream))) @@ -55,11 +55,11 @@ int stream_size; #else strm->zfree = zcfree; #endif - state = (struct inflate_state FAR *)ZALLOC(strm, 1, + state = (struct inflate_state *)ZALLOC(strm, 1, sizeof(struct inflate_state)); if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; + strm->state = (struct internal_state *)state; state->dmax = 32768U; state->wbits = windowBits; state->wsize = 1U << windowBits; @@ -80,7 +80,7 @@ int stream_size; may not be thread-safe. */ local void fixedtables(state) -struct inflate_state FAR *state; +struct inflate_state *state; { #ifdef BUILDFIXED static int virgin = 1; @@ -250,18 +250,18 @@ struct inflate_state FAR *state; int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) z_streamp strm; in_func in; -void FAR *in_desc; +void *in_desc; out_func out; -void FAR *out_desc; +void *out_desc; { - struct inflate_state FAR *state; - z_const unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ + struct inflate_state *state; + z_const unsigned char *next; /* next input */ + unsigned char *put; /* next output */ unsigned have, left; /* available input and output */ unsigned long hold; /* bit buffer */ unsigned bits; /* bits in bit buffer */ unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ + unsigned char *from; /* where to copy match bytes from */ code here; /* current decoding table entry */ code last; /* parent table entry */ unsigned len; /* length to copy for repeats, bits to drop */ @@ -272,7 +272,7 @@ void FAR *out_desc; /* Check that the strm exists and that the state was initialized */ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; /* Reset the state */ strm->msg = Z_NULL; @@ -383,7 +383,7 @@ void FAR *out_desc; while (state->have < 19) state->lens[order[state->have++]] = 0; state->next = state->codes; - state->lencode = (code const FAR *)(state->next); + state->lencode = (code const *)(state->next); state->lenbits = 7; ret = inflate_table(CODES, state->lens, 19, &(state->next), &(state->lenbits), state->work); @@ -457,7 +457,7 @@ void FAR *out_desc; values here (9 and 6) without reading the comments in inftrees.h concerning the ENOUGH constants, which depend on those values */ state->next = state->codes; - state->lencode = (code const FAR *)(state->next); + state->lencode = (code const *)(state->next); state->lenbits = 9; ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), &(state->lenbits), state->work); @@ -466,7 +466,7 @@ void FAR *out_desc; state->mode = BAD; break; } - state->distcode = (code const FAR *)(state->next); + state->distcode = (code const *)(state->next); state->distbits = 6; ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, &(state->next), &(state->distbits), state->work); diff --git a/inffast.c b/inffast.c index bda59ceb6..a3200f307 100644 --- a/inffast.c +++ b/inffast.c @@ -68,23 +68,23 @@ void ZLIB_INTERNAL inflate_fast(strm, start) z_streamp strm; unsigned start; /* inflate()'s starting value for strm->avail_out */ { - struct inflate_state FAR *state; - z_const unsigned char FAR *in; /* local strm->next_in */ - z_const unsigned char FAR *last; /* have enough input while in < last */ - unsigned char FAR *out; /* local strm->next_out */ - unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ - unsigned char FAR *end; /* while out < end, enough space available */ + struct inflate_state *state; + z_const unsigned char *in; /* local strm->next_in */ + z_const unsigned char *last; /* have enough input while in < last */ + unsigned char *out; /* local strm->next_out */ + unsigned char *beg; /* inflate()'s initial strm->next_out */ + unsigned char *end; /* while out < end, enough space available */ #ifdef INFLATE_STRICT unsigned dmax; /* maximum distance from zlib header */ #endif unsigned wsize; /* window size or zero if not using window */ unsigned whave; /* valid bytes in the window */ unsigned wnext; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ + unsigned char *window; /* allocated sliding window, if wsize != 0 */ unsigned long hold; /* local strm->hold */ unsigned bits; /* local strm->bits */ - code const FAR *lcode; /* local strm->lencode */ - code const FAR *dcode; /* local strm->distcode */ + code const *lcode; /* local strm->lencode */ + code const *dcode; /* local strm->distcode */ unsigned lmask; /* mask for first level of length codes */ unsigned dmask; /* mask for first level of distance codes */ code here; /* retrieved table entry */ @@ -92,10 +92,10 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ /* window position, window bytes to copy */ unsigned len; /* match length, unused bytes */ unsigned dist; /* match distance */ - unsigned char FAR *from; /* where to copy match from */ + unsigned char *from; /* where to copy match from */ /* copy state to local variables */ - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; in = strm->next_in - OFF; last = in + (strm->avail_in - 5); out = strm->next_out - OFF; diff --git a/inflate.c b/inflate.c index 870f89bb4..9690bed78 100644 --- a/inflate.c +++ b/inflate.c @@ -92,22 +92,22 @@ #endif /* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, +local void fixedtables OF((struct inflate_state *state)); +local int updatewindow OF((z_streamp strm, const unsigned char *end, unsigned copy)); #ifdef BUILDFIXED void makefixed OF((void)); #endif -local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, +local unsigned syncsearch OF((unsigned *have, const unsigned char *buf, unsigned len)); int ZEXPORT inflateResetKeep(strm) z_streamp strm; { - struct inflate_state FAR *state; + struct inflate_state *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; strm->total_in = strm->total_out = state->total = 0; strm->msg = Z_NULL; if (state->wrap) /* to support ill-conceived Java test suite */ @@ -129,10 +129,10 @@ z_streamp strm; int ZEXPORT inflateReset(strm) z_streamp strm; { - struct inflate_state FAR *state; + struct inflate_state *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; state->wsize = 0; state->whave = 0; state->wnext = 0; @@ -144,11 +144,11 @@ z_streamp strm; int windowBits; { int wrap; - struct inflate_state FAR *state; + struct inflate_state *state; /* get the state */ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; /* extract wrap request from windowBits parameter */ if (windowBits < 0) { @@ -184,7 +184,7 @@ const char *version; int stream_size; { int ret; - struct inflate_state FAR *state; + struct inflate_state *state; if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || stream_size != (int)(sizeof(z_stream))) @@ -205,11 +205,11 @@ int stream_size; #else strm->zfree = zcfree; #endif - state = (struct inflate_state FAR *) + state = (struct inflate_state *) ZALLOC(strm, 1, sizeof(struct inflate_state)); if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; + strm->state = (struct internal_state *)state; state->window = Z_NULL; ret = inflateReset2(strm, windowBits); if (ret != Z_OK) { @@ -232,10 +232,10 @@ z_streamp strm; int bits; int value; { - struct inflate_state FAR *state; + struct inflate_state *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; if (bits < 0) { state->hold = 0; state->bits = 0; @@ -259,7 +259,7 @@ int value; may not be thread-safe. */ local void fixedtables(state) -struct inflate_state FAR *state; +struct inflate_state *state; { #ifdef BUILDFIXED static int virgin = 1; @@ -381,14 +381,14 @@ z_streamp strm; const Bytef *end; unsigned copy; { - struct inflate_state FAR *state; + struct inflate_state *state; unsigned dist; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; /* if it hasn't been done already, allocate space for the window */ if (state->window == Z_NULL) { - state->window = (unsigned char FAR *) + state->window = (unsigned char *) ZALLOC(strm, 1U << state->wbits, sizeof(unsigned char)); if (state->window == Z_NULL) return 1; @@ -606,15 +606,15 @@ int ZEXPORT inflate(strm, flush) z_streamp strm; int flush; { - struct inflate_state FAR *state; - z_const unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ + struct inflate_state *state; + z_const unsigned char *next; /* next input */ + unsigned char *put; /* next output */ unsigned have, left; /* available input and output */ unsigned long hold; /* bit buffer */ unsigned bits; /* bits in bit buffer */ unsigned in, out; /* save starting available input and output */ unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ + unsigned char *from; /* where to copy match bytes from */ code here; /* current decoding table entry */ code last; /* parent table entry */ unsigned len; /* length to copy for repeats, bits to drop */ @@ -629,7 +629,7 @@ int flush; (strm->next_in == Z_NULL && strm->avail_in != 0)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ LOAD(); in = have; @@ -921,7 +921,7 @@ int flush; while (state->have < 19) state->lens[order[state->have++]] = 0; state->next = state->codes; - state->lencode = (const code FAR *)(state->next); + state->lencode = (const code *)(state->next); state->lenbits = 7; ret = inflate_table(CODES, state->lens, 19, &(state->next), &(state->lenbits), state->work); @@ -995,7 +995,7 @@ int flush; values here (9 and 6) without reading the comments in inftrees.h concerning the ENOUGH constants, which depend on those values */ state->next = state->codes; - state->lencode = (const code FAR *)(state->next); + state->lencode = (const code *)(state->next); state->lenbits = 9; ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), &(state->lenbits), state->work); @@ -1004,7 +1004,7 @@ int flush; state->mode = BAD; break; } - state->distcode = (const code FAR *)(state->next); + state->distcode = (const code *)(state->next); state->distbits = 6; ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, &(state->next), &(state->distbits), state->work); @@ -1254,10 +1254,10 @@ int flush; int ZEXPORT inflateEnd(strm) z_streamp strm; { - struct inflate_state FAR *state; + struct inflate_state *state; if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; if (state->window != Z_NULL) ZFREE(strm, state->window); ZFREE(strm, strm->state); strm->state = Z_NULL; @@ -1270,11 +1270,11 @@ z_streamp strm; Bytef *dictionary; uInt *dictLength; { - struct inflate_state FAR *state; + struct inflate_state *state; /* check state */ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; /* copy dictionary */ if (state->whave && dictionary != Z_NULL) { @@ -1293,13 +1293,13 @@ z_streamp strm; const Bytef *dictionary; uInt dictLength; { - struct inflate_state FAR *state; + struct inflate_state *state; unsigned long dictid; int ret; /* check state */ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; if (state->wrap != 0 && state->mode != DICT) return Z_STREAM_ERROR; @@ -1327,11 +1327,11 @@ int ZEXPORT inflateGetHeader(strm, head) z_streamp strm; gz_headerp head; { - struct inflate_state FAR *state; + struct inflate_state *state; /* check state */ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; /* save header structure */ @@ -1352,8 +1352,8 @@ gz_headerp head; zero for the first call. */ local unsigned syncsearch(have, buf, len) -unsigned FAR *have; -const unsigned char FAR *buf; +unsigned *have; +const unsigned char *buf; unsigned len; { unsigned got; @@ -1380,11 +1380,11 @@ z_streamp strm; unsigned len; /* number of bytes to look at or looked at */ unsigned long in, out; /* temporary to save total_in and total_out */ unsigned char buf[4]; /* to restore bit buffer to byte string */ - struct inflate_state FAR *state; + struct inflate_state *state; /* check parameters */ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; /* if first time, start search in bit buffer */ @@ -1428,10 +1428,10 @@ z_streamp strm; int ZEXPORT inflateSyncPoint(strm) z_streamp strm; { - struct inflate_state FAR *state; + struct inflate_state *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; return state->mode == STORED && state->bits == 0; } @@ -1439,24 +1439,24 @@ int ZEXPORT inflateCopy(dest, source) z_streamp dest; z_streamp source; { - struct inflate_state FAR *state; - struct inflate_state FAR *copy; - unsigned char FAR *window; + struct inflate_state *state; + struct inflate_state *copy; + unsigned char *window; unsigned wsize; /* check input */ if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)source->state; + state = (struct inflate_state *)source->state; /* allocate space */ - copy = (struct inflate_state FAR *) + copy = (struct inflate_state *) ZALLOC(source, 1, sizeof(struct inflate_state)); if (copy == Z_NULL) return Z_MEM_ERROR; window = Z_NULL; if (state->window != Z_NULL) { - window = (unsigned char FAR *) + window = (unsigned char *) ZALLOC(source, 1U << state->wbits, sizeof(unsigned char)); if (window == Z_NULL) { ZFREE(source, copy); @@ -1478,7 +1478,7 @@ z_streamp source; zmemcpy(window, state->window, wsize); } copy->window = window; - dest->state = (struct internal_state FAR *)copy; + dest->state = (struct internal_state *)copy; return Z_OK; } @@ -1486,10 +1486,10 @@ int ZEXPORT inflateUndermine(strm, subvert) z_streamp strm; int subvert; { - struct inflate_state FAR *state; + struct inflate_state *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; state->sane = !subvert; #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR return Z_OK; @@ -1502,10 +1502,10 @@ int subvert; long ZEXPORT inflateMark(strm) z_streamp strm; { - struct inflate_state FAR *state; + struct inflate_state *state; if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; - state = (struct inflate_state FAR *)strm->state; + state = (struct inflate_state *)strm->state; return ((long)(state->back) << 16) + (state->mode == COPY ? state->length : (state->mode == MATCH ? state->was - state->length : 0)); diff --git a/inflate.h b/inflate.h index 95f4986d4..dbd26f0b9 100644 --- a/inflate.h +++ b/inflate.h @@ -93,7 +93,7 @@ struct inflate_state { unsigned wsize; /* window size or zero if not using window */ unsigned whave; /* valid bytes in the window */ unsigned wnext; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if needed */ + unsigned char *window; /* allocated sliding window, if needed */ /* bit accumulator */ unsigned long hold; /* input bit accumulator */ unsigned bits; /* number of bits in "in" */ @@ -103,8 +103,8 @@ struct inflate_state { /* for table and code decoding */ unsigned extra; /* extra bits needed */ /* fixed and dynamic code tables */ - code const FAR *lencode; /* starting table for length/literal codes */ - code const FAR *distcode; /* starting table for distance codes */ + code const *lencode; /* starting table for length/literal codes */ + code const *distcode; /* starting table for distance codes */ unsigned lenbits; /* index bits for lencode */ unsigned distbits; /* index bits for distcode */ /* dynamic table building */ @@ -112,7 +112,7 @@ struct inflate_state { unsigned nlen; /* number of length code lengths */ unsigned ndist; /* number of distance code lengths */ unsigned have; /* number of code lengths in lens[] */ - code FAR *next; /* next available space in codes[] */ + code *next; /* next available space in codes[] */ unsigned short lens[320]; /* temporary storage for code lengths */ unsigned short work[288]; /* work area for code table building */ code codes[ENOUGH]; /* space for code tables */ diff --git a/inftrees.c b/inftrees.c index 44d89cf24..98654550e 100644 --- a/inftrees.c +++ b/inftrees.c @@ -31,11 +31,11 @@ const char inflate_copyright[] = */ int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work) codetype type; -unsigned short FAR *lens; +unsigned short *lens; unsigned codes; -code FAR * FAR *table; -unsigned FAR *bits; -unsigned short FAR *work; +code * *table; +unsigned *bits; +unsigned short *work; { unsigned len; /* a code's length in bits */ unsigned sym; /* index of code symbols */ @@ -51,9 +51,9 @@ unsigned short FAR *work; unsigned low; /* low bits for current root entry */ unsigned mask; /* mask for low root bits */ code here; /* table entry for duplication */ - code FAR *next; /* next available space in table */ - const unsigned short FAR *base; /* base value table to use */ - const unsigned short FAR *extra; /* extra bits table to use */ + code *next; /* next available space in table */ + const unsigned short *base; /* base value table to use */ + const unsigned short *extra; /* extra bits table to use */ int end; /* use base and extra for symbol > end */ unsigned short count[MAXBITS+1]; /* number of codes of each length */ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ diff --git a/inftrees.h b/inftrees.h index baa53a0b1..c20f96b69 100644 --- a/inftrees.h +++ b/inftrees.h @@ -57,6 +57,6 @@ typedef enum { DISTS } codetype; -int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, - unsigned codes, code FAR * FAR *table, - unsigned FAR *bits, unsigned short FAR *work)); +int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short *lens, + unsigned codes, code * *table, + unsigned *bits, unsigned short *work)); diff --git a/zconf.h b/zconf.h index b6ee26984..46662177f 100644 --- a/zconf.h +++ b/zconf.h @@ -272,11 +272,7 @@ /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif +# define ZEXPORTVA WINAPIV # endif #endif @@ -302,34 +298,25 @@ # define ZEXPORTVA #endif -#ifndef FAR -# define FAR -#endif - #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; +typedef Byte Bytef; +typedef char charf; +typedef int intf; +typedef uInt uIntf; +typedef uLong uLongf; #ifdef STDC typedef void const *voidpc; - typedef void FAR *voidpf; + typedef void *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; - typedef Byte FAR *voidpf; + typedef Byte *voidpf; typedef Byte *voidp; #endif diff --git a/zconf.h.cmakein b/zconf.h.cmakein index 020d61126..3d118038c 100644 --- a/zconf.h.cmakein +++ b/zconf.h.cmakein @@ -274,11 +274,7 @@ /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif +# define ZEXPORTVA WINAPIV # endif #endif @@ -304,34 +300,25 @@ # define ZEXPORTVA #endif -#ifndef FAR -# define FAR -#endif - #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; +typedef Byte Bytef; +typedef char charf; +typedef int intf; +typedef uInt uIntf; +typedef uLong uLongf; #ifdef STDC typedef void const *voidpc; - typedef void FAR *voidpf; + typedef void *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; - typedef Byte FAR *voidpf; + typedef Byte *voidpf; typedef Byte *voidp; #endif diff --git a/zconf.h.in b/zconf.h.in index b6ee26984..46662177f 100644 --- a/zconf.h.in +++ b/zconf.h.in @@ -272,11 +272,7 @@ /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif +# define ZEXPORTVA WINAPIV # endif #endif @@ -302,34 +298,25 @@ # define ZEXPORTVA #endif -#ifndef FAR -# define FAR -#endif - #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; +typedef Byte Bytef; +typedef char charf; +typedef int intf; +typedef uInt uIntf; +typedef uLong uLongf; #ifdef STDC typedef void const *voidpc; - typedef void FAR *voidpf; + typedef void *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; - typedef Byte FAR *voidpf; + typedef Byte *voidpf; typedef Byte *voidp; #endif diff --git a/zlib.h b/zlib.h index 6d700feed..c580db3b3 100644 --- a/zlib.h +++ b/zlib.h @@ -92,7 +92,7 @@ typedef struct z_stream_s { uLong total_out; /* total number of bytes output so far */ z_const char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ + struct internal_state *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ @@ -103,7 +103,7 @@ typedef struct z_stream_s { uLong reserved; /* reserved for future use */ } z_stream; -typedef z_stream FAR *z_streamp; +typedef z_stream *z_streamp; /* gzip header information passed to and from zlib routines. See RFC 1952 @@ -126,7 +126,7 @@ typedef struct gz_header_s { when writing a gzip file) */ } gz_header; -typedef gz_header FAR *gz_headerp; +typedef gz_header *gz_headerp; /* The application must update next_in and avail_in when avail_in has dropped @@ -993,7 +993,7 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, /* ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); + unsigned char *window)); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized @@ -1013,13 +1013,13 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, the version of the header file. */ -typedef unsigned (*in_func) OF((void FAR *, - z_const unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); +typedef unsigned (*in_func) OF((void *, + z_const unsigned char * *)); +typedef int (*out_func) OF((void *, unsigned char *, unsigned)); ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); + in_func in, void *in_desc, + out_func out, void *out_desc)); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is potentially more efficient than @@ -1632,7 +1632,7 @@ ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, + unsigned char *window, const char *version, int stream_size)); #define deflateInit(strm, level) \ @@ -1736,7 +1736,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ /* undocumented functions */ ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); +ZEXTERN const z_crc_t * ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); diff --git a/zutil.h b/zutil.h index 2171b73bf..20fb98552 100644 --- a/zutil.h +++ b/zutil.h @@ -39,9 +39,9 @@ /* compile with -Dlocal if your debugger can't find static symbols */ typedef unsigned char uch; -typedef uch FAR uchf; +typedef uch uchf; typedef unsigned short ush; -typedef ush FAR ushf; +typedef ush ushf; typedef unsigned long ulg; extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ @@ -93,20 +93,12 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # endif #endif -#ifdef TOPS20 -# define OS_CODE 0x0a -#endif - #ifdef WIN32 # ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ # define OS_CODE 0x0b # endif #endif -#ifdef __50SERIES /* Prime/PRIMOS */ -# define OS_CODE 0x0f -#endif - #if defined(_BEOS_) || defined(RISCOS) # define fdopen(fd,mode) NULL /* No fdopen() */ #endif