From patchwork Mon Sep 2 13:59:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 824804 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD6DF19E98B for ; Mon, 2 Sep 2024 14:00:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725285627; cv=none; b=QTdWwSuj/VRyaZcHuunpi2JHXsbSXgHHB7zYoF/LYAFSFEc1ftVWHMd/OdLB6ARAbrYC9R3rouSEusZ2+qjgQijICQp5UG0GkOLFZy64gOKygaaJXV/pxcnUQ6ZxvCK+GWm+SH1rK/2P21PrIrc0YiSbq4XP9oARFIOR+Un5HDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725285627; c=relaxed/simple; bh=UetKe0nW+Txu4MN/1f6+u0xL82nlJDtRxYbQh6Cxml8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=AxQdriSVwzlofQXWSJyvU9YQgTYcNqq0HWiMntdehBy9Oeo2vOEk8cLedjJhE7eukcCU0wBzfjBE35gNFXonQ0r1jwyANvcrzWW+t0fZC8ll1oKZn9g4v6+e7zsy26dZo33j4ZVCcgiBR4rbCbXJ6AAaRsk1CWwf3HjbUjMc66o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=ps.report@gmx.net header.b=VWiHNOFm; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=ps.report@gmx.net header.b="VWiHNOFm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1725285623; x=1725890423; i=ps.report@gmx.net; bh=UetKe0nW+Txu4MN/1f6+u0xL82nlJDtRxYbQh6Cxml8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=VWiHNOFm5agQht+4q2CoqA0X33GJfnz7YMJadXpYV2FbfYc25rcLHOMqbNsKlyrL rIjkUjIKi8eSuOMnGzp/Z2pmlgmdmzgqtzxiOkj0FgJnDvQJfLG9h3xD/w682AHSL ABFNv/NMfDwCCd9vjeEakEjlPd7jSJjEPmzzZMxwSudrLYSRbxtEXlWImpJqp8ybr WvKjToPSqRCF3+E0gwTs9mm9s6yrqIbYB+mWfCizNRxZ5dr/ZB0X5b0f2hotEiDtk RruSfsd87yVJPzU3PrUCudkg4pgCdffKqf7torJ8vXywSMbQKMpmy6zUO60tGfs3h 6nbvod6sptcbbRgUQw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from localhost.fritz.box ([82.135.81.185]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MxDp4-1rrwa63UEK-014Q2Z; Mon, 02 Sep 2024 16:00:22 +0200 From: Peter Seiderer To: linux-media@vger.kernel.org Cc: Peter Seiderer Subject: [PATCH v4l-utils v1] libv4lconvert: fix jpeg-v9x/gcc-14.x compile (jpeg_mem_dest argument mismatch) Date: Mon, 2 Sep 2024 15:59:53 +0200 Message-ID: <20240902135953.1856308-1-ps.report@gmx.net> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:YnMWju/A92+4mQDNfXziPJbmDM3GGcBK6ds0PiZgKTyYGHenIMd G9eSbesRQulmCCin00JltILSbVIeSh2n+Y/L/eBl0fUHLVbdRxdpJL3b0aOrKDP4rkQStvf h4+UMzXmQDbeBElKl4vfNAfyEqb5odRndcS5iUk+dSXo/ThOCCYKAX7t7DM7scgZ5iNttFD ZILpSImVm+TkhqWIABhyQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:T/dDKSUB54A=;jMsCuZ1oBRwZbcjZkPkLcigmRZc lIHdyjTnwJdj0d81U562fhs1PkNxcHgin4pYjHB3yGnegaOjhIJnuQeWQ7nxgpFzJB9W1uBht XhL0ptT/dtn/oItYUwgpSrp8tc2JgfSsLPXLuOzCM6kwXy3QMOwmCnX3truWtxe3OBLDLXeQT 7ydLQICpCkTRZL9G5w9kzf6D8rHXhPFeO03eiDQ5c0v7Hl8ZV4GgZ9uc/Q92VcrZrspymGOXb Ty66BOBhYs3GcZ3WyGYKkoMz8tKN9cA/+K9LFzo0TaAlKaaID6xKq6D9+86BPcqWFsUQkHwHI 1GXcnVFOlIYoJz6F2QbZUHfTtuQB2CasKSOjm9f0eWzedgaPtBUHpD2l7/D252qm5yd76gWNZ lPyvTrseDF/wIqxMtCwV8lbggFX4bpll+sx0WJ9cbdZ7OW2CIawtHkKQtEnc9UU5ASc9dEwtg 5tAhAXMxA/h3gcGAFH8MMG4cR8JPAa9PL32I+K0GJA145jTg+WU+dWcpzdzX3WaUQmKJvlUEB +rBRt8Df0Twl0i3T+VuU893JfW8hJJewIJJSefBgWXy2mRPtlHWU5anFbcEHkEdGsCpvmyqr7 Cu/W1xkJuwYIqm0ydp3IQlUvMwoZ4ycvMSAxqlC5STCt7H4ff8Mh56WLZiUCQHT5Jqr9w+RHL FcDb88ZBBdJY+JmGLJ8lZ/EAxBUFru20JhCf3r0xKDzblfwVEh3ivnUcOvj9zXM7ixt+w7K7Y jH5uKqSEiDcDiDfc6MEL7CPGViBC93Ubtoe2loslONdaAnpEzzqklnM0rAzTI3TKH3DoU9ZmO rgqw9pRZ0u4HRG2XRHQmzJgQ== - fix jpeg_mem_dest pointer arument mismatch (long unsigned int vs. size_t) with jpeg-v9x/gcc-14.x 32-bit arm compile Fixes: ../lib/libv4lconvert/jl2005bcd.c: In function ‘v4lconvert_decode_jl2005bcd’: ../lib/libv4lconvert/jl2005bcd.c:94:46: error: passing argument 3 of ‘jpeg_mem_dest’ from incompatible pointer type [-Wincompatible-pointer-types] 94 | jpeg_mem_dest (&cinfo, &jpeg_header, &jpeg_header_size); | ^~~~~~~~~~~~~~~~~ | | | long unsigned int * In file included from ../lib/libv4lconvert/libv4lconvert-priv.h:26, from ../lib/libv4lconvert/jl2005bcd.c:30: .../host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/jpeglib.h:979:28: note: expected ‘size_t *’ {aka ‘unsigned int *’} but argument is of type ‘long unsigned int *’ 979 | EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, | ^~~ ../lib/libv4lconvert/jpeg.c: In function ‘init_libjpeg_cinfo’: ../lib/libv4lconvert/jpeg.c:157:45: error: passing argument 3 of ‘jpeg_mem_dest’ from incompatible pointer type [-Wincompatible-pointer-types] 157 | jpeg_mem_dest(&cinfo, &jpeg_header, &jpeg_header_size); | ^~~~~~~~~~~~~~~~~ | | | long unsigned int * In file included from ../lib/libv4lconvert/libv4lconvert-priv.h:26, from ../lib/libv4lconvert/jpeg.c:21: .../host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/jpeglib.h:979:28: note: expected ‘size_t *’ {aka ‘unsigned int *’} but argument is of type ‘long unsigned int *’ 979 | EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, | ^~~ Signed-off-by: Peter Seiderer --- lib/libv4lconvert/jl2005bcd.c | 4 ++++ lib/libv4lconvert/jpeg.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/libv4lconvert/jl2005bcd.c b/lib/libv4lconvert/jl2005bcd.c index 707c3205..14b040f3 100644 --- a/lib/libv4lconvert/jl2005bcd.c +++ b/lib/libv4lconvert/jl2005bcd.c @@ -63,7 +63,11 @@ int v4lconvert_decode_jl2005bcd(struct v4lconvert_data *data, struct jpeg_decompress_struct dinfo; struct jpeg_error_mgr jcerr, jderr; JOCTET *jpeg_header = NULL; +#if JPEG_LIB_VERSION >= 90 + size_t jpeg_header_size = 0; +#else unsigned long jpeg_header_size = 0; +#endif int i, x, y, x1, y1, jpeg_data_size, jpeg_data_idx, eoi, size; /* src_size had better be bigger than 16 */ diff --git a/lib/libv4lconvert/jpeg.c b/lib/libv4lconvert/jpeg.c index ebfc8149..450d0967 100644 --- a/lib/libv4lconvert/jpeg.c +++ b/lib/libv4lconvert/jpeg.c @@ -136,7 +136,11 @@ static void init_libjpeg_cinfo(struct v4lconvert_data *data) { struct jpeg_compress_struct cinfo; unsigned char *jpeg_header = NULL; +#if JPEG_LIB_VERSION >= 90 + size_t jpeg_header_size = 0; +#else unsigned long jpeg_header_size = 0; +#endif if (data->cinfo_initialized) return;