bzip2: runningOrder[] values are always 0..255, make it uint8
function old new delta mainSort 1171 1124 -47 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
df23f55e39
commit
c364d32ccc
@ -732,7 +732,7 @@ void mainSort(EState* state,
|
|||||||
int32_t i, j;
|
int32_t i, j;
|
||||||
Bool bigDone[256];
|
Bool bigDone[256];
|
||||||
/* bbox: moved to EState to save stack
|
/* bbox: moved to EState to save stack
|
||||||
int32_t runningOrder[256];
|
uint8_t runningOrder[256];
|
||||||
int32_t copyStart[256];
|
int32_t copyStart[256];
|
||||||
int32_t copyEnd [256];
|
int32_t copyEnd [256];
|
||||||
*/
|
*/
|
||||||
@ -833,16 +833,15 @@ void mainSort(EState* state,
|
|||||||
/*h = h / 3;*/
|
/*h = h / 3;*/
|
||||||
h = (h * 171) >> 9; /* bbox: fast h/3 */
|
h = (h * 171) >> 9; /* bbox: fast h/3 */
|
||||||
for (i = h; i <= 255; i++) {
|
for (i = h; i <= 255; i++) {
|
||||||
int32_t vv;
|
unsigned vv;
|
||||||
vv = runningOrder[i];
|
vv = runningOrder[i]; /* uint8[] */
|
||||||
j = i;
|
j = i;
|
||||||
while (BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv)) {
|
while (BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv)) {
|
||||||
runningOrder[j] = runningOrder[j-h];
|
runningOrder[j] = runningOrder[j-h];
|
||||||
j = j - h;
|
j = j - h;
|
||||||
if (j <= (h - 1))
|
if (j <= (h - 1))
|
||||||
goto zero;
|
break;
|
||||||
}
|
}
|
||||||
zero:
|
|
||||||
runningOrder[j] = vv;
|
runningOrder[j] = vv;
|
||||||
}
|
}
|
||||||
} while (h != 1);
|
} while (h != 1);
|
||||||
|
@ -192,7 +192,7 @@ typedef struct EState {
|
|||||||
int32_t BZ2_hbMakeCodeLengths__weight[BZ_MAX_ALPHA_SIZE * 2];
|
int32_t BZ2_hbMakeCodeLengths__weight[BZ_MAX_ALPHA_SIZE * 2];
|
||||||
int32_t BZ2_hbMakeCodeLengths__parent[BZ_MAX_ALPHA_SIZE * 2];
|
int32_t BZ2_hbMakeCodeLengths__parent[BZ_MAX_ALPHA_SIZE * 2];
|
||||||
|
|
||||||
int32_t mainSort__runningOrder[256];
|
uint8_t mainSort__runningOrder[256];
|
||||||
int32_t mainSort__copyStart[256];
|
int32_t mainSort__copyStart[256];
|
||||||
int32_t mainSort__copyEnd[256];
|
int32_t mainSort__copyEnd[256];
|
||||||
} EState;
|
} EState;
|
||||||
|
Loading…
Reference in New Issue
Block a user