Files
haikuports/media-libs/libnsgif/patches/libnsgif-0.2.1-gcc2.patchset
2024-01-02 13:26:06 +01:00

47 lines
1.4 KiB
Plaintext

From de35bdb4f508cdf9a900781209dfb196d4f5acbe Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Sun, 23 Sep 2018 08:41:22 +0000
Subject: C89 fixes for gcc2 compatibility
diff --git a/src/lzw.c b/src/lzw.c
index 31cf7d4..355b14e 100644
--- a/src/lzw.c
+++ b/src/lzw.c
@@ -178,11 +178,10 @@ static inline lzw_result lzw__next_code(
uint8_t bits_remaining_0 = (code_size < (8 - current_bit)) ?
code_size : (8 - current_bit);
uint8_t bits_remaining_1 = code_size - bits_remaining_0;
- uint8_t bits_used[3] = {
- [0] = bits_remaining_0,
- [1] = bits_remaining_1 < 8 ? bits_remaining_1 : 8,
- [2] = bits_remaining_1 - 8,
- };
+ uint8_t bits_used[3];
+ bits_used[0] = bits_remaining_0;
+ bits_used[1] = bits_remaining_1 < 8 ? bits_remaining_1 : 8;
+ bits_used[2] = bits_remaining_1 - 8;
while (true) {
const uint8_t *data = ctx->sb_data;
@@ -271,6 +270,7 @@ lzw_result lzw_decode_init(
const uint8_t ** const stack_pos_out)
{
struct lzw_dictionary_entry *table = ctx->table;
+ uint32_t i;
/* Initialise the input reading context */
ctx->input.data = compressed_data;
@@ -287,7 +287,7 @@ lzw_result lzw_decode_init(
ctx->eoi_code = (1 << code_size) + 1;
/* Initialise the standard dictionary entries */
- for (uint32_t i = 0; i < ctx->clear_code; ++i) {
+ for (i = 0; i < ctx->clear_code; ++i) {
table[i].first_value = i;
table[i].last_value = i;
}
--
2.19.0