History

lib/decompress_bunzip2.c: fix checkstack warning

Fix checkstack error: lib/decompress_bunzip2.c: In function `get_next_block': lib/decompress_bunzip2.c:511: warning: the frame size of 1932 bytes is larger than 1024 bytes byteCount, symToByte, and mtfSymbol cannot be declared static or allocated dynamically so place them in the bunzip_data struct.

Prarit Bhargava committed 16 years ago

Commit dd21e9b1 parent 5bf2b191 file · +7 −3Browse files

Unified · Split

lib/decompress_bunzip2.c+7−3
@@ -107,6 +107,8 @@ struct bunzip_data { · 106 unmodified lines
107107 unsigned char selectors[32768]; /* nSelectors = 15 bits */
108108 struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
109109 int io_error; /* non-zero if we have IO error */
110+ int byteCount[256];
111+ unsigned char symToByte[256], mtfSymbol[256];
110112 };
111113
112114
@@ -158,14 +160,16 @@ static int INIT get_next_block(struct bunzip_data *bd) · 45 unmodified lines
158160 int *base = NULL;
159161 int *limit = NULL;
160162 int dbufCount, nextSym, dbufSize, groupCount, selector,
161− i, j, k, t, runPos, symCount, symTotal, nSelectors,
162− byteCount[256];
163− unsigned char uc, symToByte[256], mtfSymbol[256], *selectors;
163+ i, j, k, t, runPos, symCount, symTotal, nSelectors, *byteCount;
164+ unsigned char uc, *symToByte, *mtfSymbol, *selectors;
164165 unsigned int *dbuf, origPtr;
165166
166167 dbuf = bd->dbuf;
167168 dbufSize = bd->dbufSize;
168169 selectors = bd->selectors;
170+ byteCount = bd->byteCount;
171+ symToByte = bd->symToByte;
172+ mtfSymbol = bd->mtfSymbol;
169173
170174 /* Read in header signature and CRC, then validate signature.
171175 (last block signature means CRC is for whole file, return now) */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t