ports/graphics/lepton/files/patch-warnings
Mikhail Teterin 00d132c04a graphics/lepton: upgrade and fix package-building
The upstream addressed our earlier BSD-specific concerns, so some of
our patches are no longer needed.

We now explicitly add -mssse3 to the CFLAGS. The SSSE3-capability
has always been a requirement, but without it set (either explicitly
or via -march), parts of the code would not compile:

PR:	275197
2023-12-17 19:28:15 -05:00

114 lines
5.1 KiB
Plaintext

+++ test_suite/timing_driver.cc
@@ -396,5 +398,5 @@
leptonBuffer.size());
if (result != testImage.size()) {
- fprintf(stderr, "Output Size %ld != %ld\n", result, testImage.size());
+ fprintf(stderr, "Output Size %zu != %zu\n", result, testImage.size());
}
always_assert(result == (size_t)testImage.size() &&
+++ src/lepton/validation.cc
@@ -159,5 +159,5 @@
}
if (roundtrip_size != size || memcmp(&md5[0], &rtmd5[0], md5.size()) != 0) {
- fprintf(stderr, "Input Size %ld != Roundtrip Size %ld\n", size, roundtrip_size);
+ fprintf(stderr, "Input Size %zu != Roundtrip Size %zu\n", size, roundtrip_size);
for (size_t i = 0; i < md5.size(); ++i) {
fprintf(stderr, "%02x", md5[i]);
+++ src/io/ioutil.cc
@@ -339,3 +339,3 @@
static_assert(sizeof(buffer) >= header.size(), "Buffer must be able to hold header");
- uint32_t cursor = 0;
+ size_t cursor = 0;
bool finished = false;
@@ -576,5 +576,5 @@
if (del > 0) {
//fprintf(stderr, "D\n");
- if (del < cursor) {
+ if ((size_t)del < cursor) {
//fprintf(stderr, "E %ld %ld\n", del, cursor - del);
memmove(buffer, buffer + del, cursor - del);
--- src/vp8/encoder/encoder.cc 2022-04-13 03:01:03.000000000 -0400
+++ src/vp8/encoder/encoder.cc 2023-12-17 18:33:33.889333000 -0500
@@ -380,12 +380,4 @@
}
- double delta = 0;
- for (int i = 0; i < 64; ++i) {
- delta += outp[i] - outp_sans_dc[i];
- //fprintf (stderr, "%d + %d = %d\n", outp_sans_dc[i], context.here().dc(), outp[i]);
- }
- delta /= 64;
- //fprintf (stderr, "==== %f = %f =?= %d\n", delta, delta * 8, context.here().dc());
-
int debug_width = LeptonDebug::getDebugWidth((int)color);
int offset = k_debug_block[(int)color];
--- test_suite/test_invariants.cc 2022-04-13 03:01:03.000000000 -0400
+++ test_suite/test_invariants.cc 2023-12-17 18:37:42.915625000 -0500
@@ -464,5 +464,5 @@
uint8_t* d =&aligned7d.at(0, 2, 1, 3, 2, 1, 0);
*d = 4;
- size_t offset = d - (uint8_t*)nullptr;
+ size_t offset = (uintptr_t)d;
always_assert(0 == (offset & 15) && "Must have alignment");
always_assert(aligned7d.at(0, 2, 1, 3, 2, 1, 0) == 4);
@@ -470,5 +470,5 @@
uint8_t* d2 =&a7.at(0, 2, 1, 3, 2, 1, 0);
*d2 = 5;
- offset = d2 - (uint8_t*)nullptr;
+ offset = (uintptr_t)d2;
if (offset & 15) {
fprintf(stderr, "Array7d array doesn't require alignment");
--- src/vp8/model/model.cc 2022-04-13 03:01:03.000000000 -0400
+++ src/vp8/model/model.cc 2023-12-17 18:40:51.433134000 -0500
@@ -44,8 +44,8 @@
__m256i r1 = _mm256_loadu_si256((const __m256i*)(data + 32));
__m256i r2 = _mm256_loadu_si256((const __m256i*)(data + 64));
- size_t offset = data - (char*)0;
+ size_t offset = (uintptr_t)data;
size_t align = 32 - (offset % 32);
char * dataend = (char*)end;
- size_t offsetend = dataend - (char*)0;
+ size_t offsetend = (uintptr_t)dataend;
__m256i *write_end = (__m256i*)(dataend - (offsetend % 32));
__m256i *write_cursor = (__m256i*)(data + align);
--- src/vp8/util/block_based_image.hh 2022-04-13 03:01:03.000000000 -0400
+++ src/vp8/util/block_based_image.hh 2023-12-17 18:41:56.054633000 -0500
@@ -67,5 +67,5 @@
nblocks_ = nblocks;
storage_ = (uint8_t*)custom_calloc(nblocks * sizeof(Block) + 31);
- size_t offset = storage_ - (uint8_t*)nullptr;
+ size_t offset = (uintptr_t)storage_;
if (offset & 31) { //needs alignment adjustment
image_ = (Block*)(storage_ + 32 - (offset & 31));
--- src/lepton/idct.cc 2022-04-13 03:01:03.000000000 -0400
+++ src/lepton/idct.cc 2023-12-17 18:46:58.471208000 -0500
@@ -198,5 +198,5 @@
char vintermed_storage[64 * sizeof(int32_t) + 16];
// align intermediate storage to 16 bytes
- int32_t *vintermed = (int32_t*) (vintermed_storage + 16 - ((vintermed_storage - (char*)nullptr) &0xf));
+ int32_t *vintermed = (int32_t*) (vintermed_storage + 16 - ((uintptr_t)vintermed_storage &0xf));
using namespace idct_local;
// Horizontal 1-D IDCT.
--- src/io/Zlib0.hh 2022-04-13 03:01:03.000000000 -0400
+++ src/io/Zlib0.hh 2023-12-17 18:48:25.076584000 -0500
@@ -39,5 +39,4 @@
uint32_t mAdler32; // adler32 sum
bool mClosed;
- uint16_t mBilledBytesLeft;
std::pair<uint32, JpegError> writeHeader();
--- src/lepton/jpgcoder.cc 2022-04-13 03:01:03.000000000 -0400
+++ src/lepton/jpgcoder.cc 2023-12-17 18:58:02.650346000 -0500
@@ -1245,11 +1245,4 @@
current_run_size = cumulative_buffer_size;
- size_t bit_writer_augmentation = 0;
- if (g_allow_progressive) {
- for (size_t cur_size = jpgfilesize - 1; cur_size; cur_size >>=1) {
- bit_writer_augmentation |= cur_size;
- }
- bit_writer_augmentation += 1; // this is used to compute the buffer size of the abit_writer for writing
- }
size_t garbage_augmentation = 0;
for (size_t cur_size = hdrs - 1; cur_size; cur_size >>=1) {