]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
lzo: Fix conversion warning
authorFrank Lichtenheld <frank@lichtenheld.com>
Wed, 8 Oct 2025 17:01:44 +0000 (19:01 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 9 Oct 2025 14:47:29 +0000 (16:47 +0200)
We already have an assert ensuring the value is sane,
so just add the cast.

Change-Id: I4a5c46f321709c83a4a921366630fb8e02834701
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1260
Message-Id: <20251008170149.10301-1-gert@greenie.muc.de>
URL: https://sourceforge.net/p/openvpn/mailman/message/59244106/
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/lzo.c

index 8daaec01a429a6a78c198f4894a81bf8246902fd..8307b598593266a5a1c195db34284443301c1a1d 100644 (file)
@@ -72,11 +72,6 @@ lzo_compress(struct buffer *buf, struct buffer work, struct compress_context *co
     *header = NO_COMPRESS_BYTE;
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
 static void
 lzo_decompress(struct buffer *buf, struct buffer work, struct compress_context *compctx,
                const struct frame *frame)
@@ -107,7 +102,7 @@ lzo_decompress(struct buffer *buf, struct buffer work, struct compress_context *
         }
 
         ASSERT(buf_safe(&work, zlen));
-        work.len = zlen;
+        work.len = (int)zlen;
 
         dmsg(D_COMP, "LZO decompress %d -> %d", buf->len, work.len);
         compctx->pre_decompress += buf->len;
@@ -126,10 +121,6 @@ lzo_decompress(struct buffer *buf, struct buffer work, struct compress_context *
     }
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 const struct compress_alg lzo_alg = { "lzo", lzo_compress_init, lzo_compress_uninit, lzo_compress,
                                       lzo_decompress };
 #endif /* ENABLE_LZO */