mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
changing {} style to match majority of previous style
This commit is contained in:
parent
da6cdf014b
commit
961d929f4d
320 changed files with 5502 additions and 10485 deletions
|
@ -242,7 +242,7 @@ int stream_size;
|
|||
*/
|
||||
|
||||
if (version == Z_NULL || version[0] != my_version[0] ||
|
||||
stream_size != sizeof(z_stream)) {
|
||||
stream_size != sizeof(z_stream)) {
|
||||
return Z_VERSION_ERROR;
|
||||
}
|
||||
if (strm == Z_NULL) return Z_STREAM_ERROR;
|
||||
|
@ -280,8 +280,8 @@ int stream_size;
|
|||
}
|
||||
#endif
|
||||
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
|
||||
windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
|
||||
strategy < 0 || strategy > Z_FIXED) {
|
||||
windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
|
||||
strategy < 0 || strategy > Z_FIXED) {
|
||||
return Z_STREAM_ERROR;
|
||||
}
|
||||
if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */
|
||||
|
@ -314,7 +314,7 @@ int stream_size;
|
|||
s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush) + 2L);
|
||||
|
||||
if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
|
||||
s->pending_buf == Z_NULL) {
|
||||
s->pending_buf == Z_NULL) {
|
||||
s->status = FINISH_STATE;
|
||||
strm->msg = ERR_MSG(Z_MEM_ERROR);
|
||||
deflateEnd(strm);
|
||||
|
@ -406,7 +406,7 @@ z_streamp strm;
|
|||
deflate_state *s;
|
||||
|
||||
if (strm == Z_NULL || strm->state == Z_NULL ||
|
||||
strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
|
||||
strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
|
||||
return Z_STREAM_ERROR;
|
||||
}
|
||||
|
||||
|
@ -521,7 +521,7 @@ int strategy;
|
|||
func = configuration_table[s->level].func;
|
||||
|
||||
if ((strategy != s->strategy || func != configuration_table[level].func) &&
|
||||
strm->total_in != 0) {
|
||||
strm->total_in != 0) {
|
||||
/* Flush the last buffer: */
|
||||
err = deflate(strm, Z_BLOCK);
|
||||
if (err == Z_BUF_ERROR && s->pending == 0)
|
||||
|
@ -681,14 +681,14 @@ int flush;
|
|||
deflate_state *s;
|
||||
|
||||
if (strm == Z_NULL || strm->state == Z_NULL ||
|
||||
flush > Z_BLOCK || flush < 0) {
|
||||
flush > Z_BLOCK || flush < 0) {
|
||||
return Z_STREAM_ERROR;
|
||||
}
|
||||
s = strm->state;
|
||||
|
||||
if (strm->next_out == Z_NULL ||
|
||||
(strm->next_in == Z_NULL && strm->avail_in != 0) ||
|
||||
(s->status == FINISH_STATE && flush != Z_FINISH)) {
|
||||
(strm->next_in == Z_NULL && strm->avail_in != 0) ||
|
||||
(s->status == FINISH_STATE && flush != Z_FINISH)) {
|
||||
ERR_RETURN(strm, Z_STREAM_ERROR);
|
||||
}
|
||||
if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
|
||||
|
@ -902,7 +902,7 @@ int flush;
|
|||
/* Start a new block or continue the current one.
|
||||
*/
|
||||
if (strm->avail_in != 0 || s->lookahead != 0 ||
|
||||
(flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
|
||||
(flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
|
||||
block_state bstate;
|
||||
|
||||
bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
|
||||
|
@ -989,12 +989,12 @@ z_streamp strm;
|
|||
|
||||
status = strm->state->status;
|
||||
if (status != INIT_STATE &&
|
||||
status != EXTRA_STATE &&
|
||||
status != NAME_STATE &&
|
||||
status != COMMENT_STATE &&
|
||||
status != HCRC_STATE &&
|
||||
status != BUSY_STATE &&
|
||||
status != FINISH_STATE) {
|
||||
status != EXTRA_STATE &&
|
||||
status != NAME_STATE &&
|
||||
status != COMMENT_STATE &&
|
||||
status != HCRC_STATE &&
|
||||
status != BUSY_STATE &&
|
||||
status != FINISH_STATE) {
|
||||
return Z_STREAM_ERROR;
|
||||
}
|
||||
|
||||
|
@ -1048,7 +1048,7 @@ z_streamp source;
|
|||
ds->pending_buf = (uchf *) overlay;
|
||||
|
||||
if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
|
||||
ds->pending_buf == Z_NULL) {
|
||||
ds->pending_buf == Z_NULL) {
|
||||
deflateEnd(dest);
|
||||
return Z_MEM_ERROR;
|
||||
}
|
||||
|
@ -1217,7 +1217,7 @@ IPos cur_match; /* current match */
|
|||
* UNALIGNED_OK if your compiler uses a different size.
|
||||
*/
|
||||
if (*(ushf *)(match + best_len - 1) != scan_end ||
|
||||
*(ushf *)match != scan_start) continue;
|
||||
*(ushf *)match != scan_start) continue;
|
||||
|
||||
/* It is not necessary to compare scan[2] and match[2] since they are
|
||||
* always equal when the other bytes match, given that the hash keys
|
||||
|
@ -1248,9 +1248,9 @@ IPos cur_match; /* current match */
|
|||
#else /* UNALIGNED_OK */
|
||||
|
||||
if (match[best_len] != scan_end ||
|
||||
match[best_len - 1] != scan_end1 ||
|
||||
*match != *scan ||
|
||||
*++match != scan[1]) continue;
|
||||
match[best_len - 1] != scan_end1 ||
|
||||
*match != *scan ||
|
||||
*++match != scan[1]) continue;
|
||||
|
||||
/* The check at best_len-1 can be removed because it will be made
|
||||
* again later. (This heuristic is not always a win.)
|
||||
|
@ -1686,7 +1686,7 @@ int flush;
|
|||
*/
|
||||
#ifndef FASTEST
|
||||
if (s->match_length <= s->max_insert_length &&
|
||||
s->lookahead >= MIN_MATCH) {
|
||||
s->lookahead >= MIN_MATCH) {
|
||||
s->match_length--; /* string at strstart already in table */
|
||||
do {
|
||||
s->strstart++;
|
||||
|
@ -1851,7 +1851,7 @@ int flush;
|
|||
|
||||
#else
|
||||
if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
|
||||
s->strstart - hash_head <= MAX_DIST(s)) {
|
||||
s->strstart - hash_head <= MAX_DIST(s)) {
|
||||
/* To simplify the code, we prevent matches with the string
|
||||
* of window index 0 (in particular we have to avoid a match
|
||||
* of the string with itself at the start of the input file).
|
||||
|
|
|
@ -199,7 +199,7 @@ int stream_size;
|
|||
struct inflate_state FAR *state;
|
||||
|
||||
if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
|
||||
stream_size != (int)(sizeof(z_stream)))
|
||||
stream_size != (int)(sizeof(z_stream)))
|
||||
return Z_VERSION_ERROR;
|
||||
if (strm == Z_NULL) return Z_STREAM_ERROR;
|
||||
strm->msg = Z_NULL; /* in case we return an error */
|
||||
|
@ -335,8 +335,7 @@ struct inflate_state FAR *state;
|
|||
|
||||
a.out > inffixed.h
|
||||
*/
|
||||
void makefixed()
|
||||
{
|
||||
void makefixed() {
|
||||
unsigned low, size;
|
||||
struct inflate_state state;
|
||||
|
||||
|
@ -637,7 +636,7 @@ int flush;
|
|||
{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
|
||||
|
||||
if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
|
||||
(strm->next_in == Z_NULL && strm->avail_in != 0))
|
||||
(strm->next_in == Z_NULL && strm->avail_in != 0))
|
||||
return Z_STREAM_ERROR;
|
||||
|
||||
state = (struct inflate_state FAR *)strm->state;
|
||||
|
@ -669,7 +668,7 @@ int flush;
|
|||
#else
|
||||
if (
|
||||
#endif
|
||||
((BITS(8) << 8) + (hold >> 8)) % 31) {
|
||||
((BITS(8) << 8) + (hold >> 8)) % 31) {
|
||||
strm->msg = (char *)"incorrect header check";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
|
@ -746,7 +745,7 @@ int flush;
|
|||
if (copy > have) copy = have;
|
||||
if (copy) {
|
||||
if (state->head != Z_NULL &&
|
||||
state->head->extra != Z_NULL) {
|
||||
state->head->extra != Z_NULL) {
|
||||
len = state->head->extra_len - state->length;
|
||||
zmemcpy(state->head->extra + len, next,
|
||||
len + copy > state->head->extra_max ?
|
||||
|
@ -769,8 +768,8 @@ int flush;
|
|||
do {
|
||||
len = (unsigned)(next[copy++]);
|
||||
if (state->head != Z_NULL &&
|
||||
state->head->name != Z_NULL &&
|
||||
state->length < state->head->name_max)
|
||||
state->head->name != Z_NULL &&
|
||||
state->length < state->head->name_max)
|
||||
state->head->name[state->length++] = len;
|
||||
} while (len && copy < have);
|
||||
if (state->flags & 0x0200)
|
||||
|
@ -789,8 +788,8 @@ int flush;
|
|||
do {
|
||||
len = (unsigned)(next[copy++]);
|
||||
if (state->head != Z_NULL &&
|
||||
state->head->comment != Z_NULL &&
|
||||
state->length < state->head->comm_max)
|
||||
state->head->comment != Z_NULL &&
|
||||
state->length < state->head->comm_max)
|
||||
state->head->comment[state->length++] = len;
|
||||
} while (len && copy < have);
|
||||
if (state->flags & 0x0200)
|
||||
|
@ -1191,9 +1190,9 @@ int flush;
|
|||
out = left;
|
||||
if ((
|
||||
#ifdef GUNZIP
|
||||
state->flags ? hold :
|
||||
state->flags ? hold :
|
||||
#endif
|
||||
ZSWAP32(hold)) != state->check) {
|
||||
ZSWAP32(hold)) != state->check) {
|
||||
strm->msg = (char *)"incorrect data check";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
|
@ -1456,7 +1455,7 @@ z_streamp source;
|
|||
|
||||
/* check input */
|
||||
if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
|
||||
source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
|
||||
source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
|
||||
return Z_STREAM_ERROR;
|
||||
state = (struct inflate_state FAR *)source->state;
|
||||
|
||||
|
@ -1478,7 +1477,7 @@ z_streamp source;
|
|||
zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
|
||||
zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
|
||||
if (state->lencode >= state->codes &&
|
||||
state->lencode <= state->codes + ENOUGH - 1) {
|
||||
state->lencode <= state->codes + ENOUGH - 1) {
|
||||
copy->lencode = copy->codes + (state->lencode - state->codes);
|
||||
copy->distcode = copy->codes + (state->distcode - state->codes);
|
||||
}
|
||||
|
|
|
@ -31,8 +31,7 @@ const char inflate_copyright[] =
|
|||
*/
|
||||
int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
|
||||
unsigned codes, code FAR *FAR *table,
|
||||
unsigned FAR *bits, unsigned short FAR *work)
|
||||
{
|
||||
unsigned FAR *bits, unsigned short FAR *work) {
|
||||
unsigned len; /* a code's length in bits */
|
||||
unsigned sym; /* index of code symbols */
|
||||
unsigned min, max; /* minimum and maximum code lengths */
|
||||
|
@ -209,7 +208,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
|
|||
|
||||
/* check available table space */
|
||||
if ((type == LENS && used > ENOUGH_LENS) ||
|
||||
(type == DISTS && used > ENOUGH_DISTS))
|
||||
(type == DISTS && used > ENOUGH_DISTS))
|
||||
return 1;
|
||||
|
||||
/* process all codes and make table entries */
|
||||
|
@ -275,7 +274,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
|
|||
/* check for enough space */
|
||||
used += 1U << curr;
|
||||
if ((type == LENS && used > ENOUGH_LENS) ||
|
||||
(type == DISTS && used > ENOUGH_DISTS))
|
||||
(type == DISTS && used > ENOUGH_DISTS))
|
||||
return 1;
|
||||
|
||||
/* point entry in root table to sub-table */
|
||||
|
|
10
zlib/trees.c
10
zlib/trees.c
|
@ -239,8 +239,7 @@ int length; /* number of bits */
|
|||
/* ===========================================================================
|
||||
* Initialize the various 'constant' tables.
|
||||
*/
|
||||
local void tr_static_init()
|
||||
{
|
||||
local void tr_static_init() {
|
||||
#if defined(GEN_TREES_H) || !defined(STDC)
|
||||
static int static_init_done = 0;
|
||||
int n; /* iterates over tree elements */
|
||||
|
@ -333,8 +332,7 @@ local void tr_static_init()
|
|||
((i) == (last)? "\n};\n\n" : \
|
||||
((i) % (width) == (width)-1 ? ",\n" : ", "))
|
||||
|
||||
void gen_trees_header()
|
||||
{
|
||||
void gen_trees_header() {
|
||||
FILE *header = fopen("trees.h", "w");
|
||||
int i;
|
||||
|
||||
|
@ -468,7 +466,7 @@ int k; /* node to move down */
|
|||
while (j <= s->heap_len) {
|
||||
/* Set j to the smallest of the two sons: */
|
||||
if (j < s->heap_len &&
|
||||
smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
|
||||
smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
|
||||
j++;
|
||||
}
|
||||
/* Exit if v is smaller than both sons */
|
||||
|
@ -1157,7 +1155,7 @@ deflate_state *s;
|
|||
|
||||
/* Check for textual ("white-listed") bytes. */
|
||||
if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
|
||||
|| s->dyn_ltree[13].Freq != 0)
|
||||
|| s->dyn_ltree[13].Freq != 0)
|
||||
return Z_TEXT;
|
||||
for (n = 32; n < LITERALS; n++)
|
||||
if (s->dyn_ltree[n].Freq != 0)
|
||||
|
|
18
zlib/zutil.c
18
zlib/zutil.c
|
@ -28,13 +28,11 @@ z_const char *const z_errmsg[10] = {
|
|||
};
|
||||
|
||||
|
||||
const char *ZEXPORT zlibVersion()
|
||||
{
|
||||
const char *ZEXPORT zlibVersion() {
|
||||
return ZLIB_VERSION;
|
||||
}
|
||||
|
||||
uLong ZEXPORT zlibCompileFlags()
|
||||
{
|
||||
uLong ZEXPORT zlibCompileFlags() {
|
||||
uLong flags;
|
||||
|
||||
flags = 0;
|
||||
|
@ -242,8 +240,7 @@ local ptr_table table[MAX_PTR];
|
|||
* a protected system like OS/2. Use Microsoft C instead.
|
||||
*/
|
||||
|
||||
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
|
||||
{
|
||||
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
|
||||
voidpf buf = opaque; /* just to make some compilers happy */
|
||||
ulg bsize = (ulg)items * size;
|
||||
|
||||
|
@ -266,8 +263,7 @@ voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
|
|||
return buf;
|
||||
}
|
||||
|
||||
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
|
||||
{
|
||||
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
|
||||
int n;
|
||||
if (*(ush *)&ptr != 0) { /* object < 64K */
|
||||
farfree(ptr);
|
||||
|
@ -301,14 +297,12 @@ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
|
|||
# define _hfree hfree
|
||||
#endif
|
||||
|
||||
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size)
|
||||
{
|
||||
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) {
|
||||
if (opaque) opaque = 0; /* to make compiler happy */
|
||||
return _halloc((long)items, size);
|
||||
}
|
||||
|
||||
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
|
||||
{
|
||||
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
|
||||
if (opaque) opaque = 0; /* to make compiler happy */
|
||||
_hfree(ptr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue