+strict # lclint level
# --- in progress
--globs
-infloops # 1
--nullassign # 1
--staticinittrans # 5
--abstract # 4
-aliasunique # 2
--assignexpose
-branchstate
-bufferoverflowhigh
-castfcnptr # 6
--compdef # 16
--compmempass # 37
+-compdef # 20
+-compmempass # 39
-evalorder # 2
--globstate # 1
--mods # 5
-noeffectuncon # 10
-nullderef # 9
--nullpass # 24
+-nullpass # 2
-nullptrarith # 4
--nullret # 11
--protoparammatch # 22
+-protoparammatch # 4
-redef # 4
--retalias # 4
-retvalint # painful
-sizeoftype # 106
-type # 3
--usereleased # 38
-
--dependenttrans # 2
--immediatetrans
--kepttrans # 8
--observertrans
--readonlytrans
--statictrans
--temptrans # 7
--unqualifiedtrans # 10
+-usereleased # 35
+
+-statictrans # 4
+-temptrans # 6
-casebreak
-looploopbreak
* Generated automatically by crc32.c
*/
+/*@unchecked@*/ /*@observer@*/
local const unsigned long FAR crc_table[TBLS][256] =
{
{
#include "deflate.h"
+/*@unchecked@*/ /*@observer@*/
const char deflate_copyright[] =
" deflate 1.2.1.1 Copyright 1995-2003 Jean-loup Gailly ";
/*
compress_func func;
} config;
+/*@unchecked@*/ /*@observer@*/
#ifdef FASTEST
local const config configuration_table[2] = {
/* good lazy nice chain */
typedef struct static_tree_desc_s static_tree_desc;
typedef struct tree_desc_s {
+/*@shared@*/
ct_data *dyn_tree; /* the dynamic tree */
int max_code; /* largest code with non zero frequency */
+/*@shared@*/
static_tree_desc *stat_desc; /* the corresponding static tree */
} FAR tree_desc;
typedef struct internal_state {
z_streamp strm; /* pointer back to this zlib stream */
int status; /* as the name implies */
+/*@owned@*/
Bytef *pending_buf; /* output still pending */
ulg pending_buf_size; /* size of pending_buf */
+/*@dependent@*/
Bytef *pending_out; /* next pending byte to output to the stream */
int pending; /* nb of bytes in the pending buffer */
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
/* Depth of each subtree used as tie breaker for trees of equal frequency
*/
+/*@kept@*/
uchf *l_buf; /* buffer for literals or lengths */
uInt lit_bufsize;
/*@modifies *s @*/;
void _tr_align OF((deflate_state *s))
/*@modifies *s @*/;
-void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
+void _tr_stored_block OF((deflate_state *s, /*@null@*/ charf *buf, ulg stored_len,
int eof))
/*@modifies *s @*/;
extern uch _length_code[];
extern uch _dist_code[];
#else
+/*@unchecked@*/ /*@observer@*/
extern const uch _length_code[];
+/*@unchecked@*/ /*@observer@*/
extern const uch _dist_code[];
#endif
/* @(#) $Id$ */
+/*@access FILE @*/
+
#include <stdio.h>
#include "zutil.h"
#define ALLOC(size) malloc(size)
#define TRYFREE(p) {if (p) free(p);}
+/*@unchecked@*/ /*@observer@*/
static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
/* gzip flag byte */
z_stream stream;
int z_err; /* error code for last stream operation */
int z_eof; /* set if end of input file */
-/*@relnull@*/
+/*@relnull@*/ /*@dependent@*/
FILE *file; /* .gz file */
/*@relnull@*/
Byte *inbuf; /* input buffer */
} gz_stream;
+/*@null@*/
local gzFile gz_open OF((const char *path, const char *mode, int fd))
/*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
local void check_header OF((gz_stream *s))
/*@globals errno, fileSystem @*/
/*@modifies s, errno, fileSystem @*/;
-local int destroy OF((gz_stream *s))
+local int destroy OF((/*@only@*/ gz_stream *s))
/*@globals fileSystem @*/
/*@modifies s, fileSystem @*/;
local void putLong OF((FILE *file, uLong x))
/* for table and code decoding */
unsigned extra; /* extra bits needed */
/* fixed and dynamic code tables */
+/*@shared@*/
code const FAR *lencode; /* starting table for length/literal codes */
+/*@shared@*/
code const FAR *distcode; /* starting table for distance codes */
unsigned lenbits; /* index bits for lencode */
unsigned distbits; /* index bits for distcode */
unsigned nlen; /* number of length code lengths */
unsigned ndist; /* number of distance code lengths */
unsigned have; /* number of code lengths in lens[] */
+/*@shared@*/
code FAR *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 */
#define REPZ_11_138 18
/* repeat a zero length 11-138 times (7 bits of repeat count) */
+/*@unchecked@*/ /*@observer@*/
local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
= {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
+/*@unchecked@*/ /*@observer@*/
local const int extra_dbits[D_CODES] /* extra bits for each distance code */
= {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
+/*@unchecked@*/ /*@observer@*/
local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
+/*@unchecked@*/ /*@observer@*/
local const uch bl_order[BL_CODES]
= {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
/* The lengths of the bit length codes are sent in order of decreasing
#if defined(GEN_TREES_H) || !defined(STDC)
/* non ANSI compilers may not accept trees.h */
+/*@unchecked@*/
local ct_data static_ltree[L_CODES+2];
/* The static literal tree. Since the bit lengths are imposed, there is no
* need for the L_CODES extra codes used during heap construction. However
* below).
*/
+/*@unchecked@*/
local ct_data static_dtree[D_CODES];
/* The static distance tree. (Actually a trivial tree since all codes use
* 5 bits.)
uch _length_code[MAX_MATCH-MIN_MATCH+1];
/* length code for each normalized match length (0 == MIN_MATCH) */
+/*@unchecked@*/
local int base_length[LENGTH_CODES];
/* First normalized length for each code (0 = MIN_MATCH) */
+/*@unchecked@*/
local int base_dist[D_CODES];
/* First normalized distance for each code (0 = distance of 1) */
#endif /* GEN_TREES_H */
struct static_tree_desc_s {
+/*@observer@*/ /*@relnull@*/
const ct_data *static_tree; /* static tree or NULL */
+/*@observer@*/
const intf *extra_bits; /* extra bits for each code or NULL */
int extra_base; /* base index for extra_bits */
int elems; /* max number of elements in the tree */
int max_length; /* max bit length for the codes */
};
+/*@unchecked@*/
local static_tree_desc static_l_desc =
{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
+/*@unchecked@*/
local static_tree_desc static_d_desc =
{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
+/*@unchecked@*/
local static_tree_desc static_bl_desc =
{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
* on one bit only.
*/
void _tr_align(deflate_state *s)
+ /*@globals static_ltree @*/
{
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
* trees or store, and output the encoded block to the zip file.
*/
void _tr_flush_block(deflate_state *s, charf *buf, ulg stored_len, int eof)
+ /*@globals static_dtree, static_ltree @*/
{
ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
int max_blindex = 0; /* index of last bit length code of non zero freq */
* Send the block data compressed using the given Huffman trees
*/
local void compress_block(deflate_state *s, ct_data *ltree, ct_data *dtree)
+ /*@globals base_dist, base_length @*/
{
unsigned dist; /* distance of matched string */
int lc; /* match length or unmatched char (if dist == 0) */
uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */
-/*@relnull@*/
+/*@relnull@*/ /*@observer@*/
char *msg; /* last error message, NULL if no error */
/*@relnull@*/
struct internal_state FAR *state; /* not visible by applications */
/* basic functions */
+/*@observer@*/
ZEXTERN const char * ZEXPORT zlibVersion OF((void))
/*@*/;
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
typedef voidp gzFile;
+/*@null@*/
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode))
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR). */
+/*@null@*/
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode))
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
gzputs returns the number of characters written, or -1 in case of error.
*/
+/*@null@*/
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len))
/*@globals fileSystem @*/
/*@modifies file, buf, fileSystem @*/;
input stream, otherwise zero.
*/
-ZEXTERN int ZEXPORT gzclose OF((gzFile file))
+ZEXTERN int ZEXPORT gzclose OF((/*@only@*/ gzFile file))
/*@globals fileSystem @*/
/*@modifies file, fileSystem @*/;
/*
error number (see function gzerror below).
*/
+/*@observer@*/
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum))
/*@modifies *errnum @*/;
/*
compression library.
*/
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len))
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, /*@null@*/ const Bytef *buf, uInt len))
/*@*/;
/*
if (adler != original_adler) error();
*/
-ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len))
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, /*@null@*/ const Bytef *buf, uInt len))
/*@*/;
/*
Update a running crc with the bytes buf[0..len-1] and return the updated
struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif
+/*@observer@*/
ZEXTERN const char * ZEXPORT zError OF((int err))
/*@*/;
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z))
/*@modifies z @*/;
+/*@observer@*/
ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void))
/*@*/;
typedef ush FAR ushf;
typedef unsigned long ulg;
+/*@unchecked@*/ /*@observer@*/
extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* (size given to avoid silly warnings with Visual C++) */
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
#define ERR_RETURN(strm,err) \
- return (strm->msg = (char*)ERR_MSG(err), (err))
+ return /*@-mods@*/ (strm->msg = (char*)ERR_MSG(err), (err)) /*@=mods@*/
/* To be used only when the state is known to be valid */
/* common constants */
#endif
+/*@null@*/
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size))
/*@*/;
-void zcfree OF((voidpf opaque, voidpf ptr))
+void zcfree OF((voidpf opaque, /*@only@*/ voidpf ptr))
/*@modifies ptr @*/;
#define ZALLOC(strm, items, size) \