diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-08-22 22:52:11 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-08-23 09:55:28 -0700 |
commit | e1e889bae41529770cb800aba3bfd1189e4ac39d (patch) | |
tree | d3f17654896a44b0c633736826381586f5976b67 /meta-oe | |
parent | 375be9fd60e22fb60b53d664983cb70d26d8a288 (diff) | |
download | meta-openembedded-e1e889bae41529770cb800aba3bfd1189e4ac39d.tar.gz |
gd: Fix build with clang-15
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/recipes-support/gd/gd/0001-Fix-deprecared-function-prototypes.patch | 115 | ||||
-rw-r--r-- | meta-oe/recipes-support/gd/gd_2.3.3.bb | 1 |
2 files changed, 116 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/gd/gd/0001-Fix-deprecared-function-prototypes.patch b/meta-oe/recipes-support/gd/gd/0001-Fix-deprecared-function-prototypes.patch new file mode 100644 index 000000000..5ac517072 --- /dev/null +++ b/meta-oe/recipes-support/gd/gd/0001-Fix-deprecared-function-prototypes.patch | |||
@@ -0,0 +1,115 @@ | |||
1 | From 6379331cd0647fc6f149f55e4505a9a92e4f159f Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 22 Aug 2022 22:43:26 -0700 | ||
4 | Subject: [PATCH] Fix deprecared function prototypes | ||
5 | |||
6 | Fixes following errors: | ||
7 | error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] | ||
8 | |||
9 | Upstream-Status: Submitted [https://github.com/libgd/libgd/pull/835] | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | src/gd_nnquant.c | 32 +++++++------------------------- | ||
13 | src/gd_tiff.c | 4 +--- | ||
14 | 2 files changed, 8 insertions(+), 28 deletions(-) | ||
15 | |||
16 | diff --git a/src/gd_nnquant.c b/src/gd_nnquant.c | ||
17 | index 8b9aa794..013f7160 100644 | ||
18 | --- a/src/gd_nnquant.c | ||
19 | +++ b/src/gd_nnquant.c | ||
20 | @@ -112,12 +112,7 @@ typedef struct { | ||
21 | |||
22 | /* Initialise network in range (0,0,0,0) to (255,255,255,255) and set parameters | ||
23 | ----------------------------------------------------------------------- */ | ||
24 | -static void initnet(nnq, thepic, len, sample, colours) | ||
25 | -nn_quant *nnq; | ||
26 | -unsigned char *thepic; | ||
27 | -int len; | ||
28 | -int sample; | ||
29 | -int colours; | ||
30 | +static void initnet(nn_quant *nnq, unsigned char *thepic, int len, int sample, int colours) | ||
31 | { | ||
32 | register int i; | ||
33 | register int *p; | ||
34 | @@ -163,9 +158,7 @@ static void unbiasnet(nn_quant *nnq) | ||
35 | } | ||
36 | |||
37 | /* Output colormap to unsigned char ptr in RGBA format */ | ||
38 | -static void getcolormap(nnq, map) | ||
39 | -nn_quant *nnq; | ||
40 | -unsigned char *map; | ||
41 | +static void getcolormap(nn_quant *nnq, unsigned char *map) | ||
42 | { | ||
43 | int i,j; | ||
44 | for(j=0; j < nnq->netsize; j++) { | ||
45 | @@ -232,9 +225,7 @@ static void inxbuild(nn_quant *nnq) | ||
46 | |||
47 | /* Search for ABGR values 0..255 (after net is unbiased) and return colour index | ||
48 | ---------------------------------------------------------------------------- */ | ||
49 | -static unsigned int inxsearch(nnq, al,b,g,r) | ||
50 | -nn_quant *nnq; | ||
51 | -register int al, b, g, r; | ||
52 | +static unsigned int inxsearch(nn_quant *nnq, int al, int b, int g, int r) | ||
53 | { | ||
54 | register int i, j, dist, a, bestd; | ||
55 | register int *p; | ||
56 | @@ -306,9 +297,7 @@ register int al, b, g, r; | ||
57 | |||
58 | /* Search for biased ABGR values | ||
59 | ---------------------------- */ | ||
60 | -static int contest(nnq, al,b,g,r) | ||
61 | -nn_quant *nnq; | ||
62 | -register int al,b,g,r; | ||
63 | +static int contest(nn_quant *nnq, int al, int b, int g, int r) | ||
64 | { | ||
65 | /* finds closest neuron (min dist) and updates freq */ | ||
66 | /* finds best neuron (min dist-bias) and returns position */ | ||
67 | @@ -362,9 +351,7 @@ register int al,b,g,r; | ||
68 | /* Move neuron i towards biased (a,b,g,r) by factor alpha | ||
69 | ---------------------------------------------------- */ | ||
70 | |||
71 | -static void altersingle(nnq, alpha,i,al,b,g,r) | ||
72 | -nn_quant *nnq; | ||
73 | -register int alpha,i,al,b,g,r; | ||
74 | +static void altersingle(nn_quant *nnq, int alpha, int i,int al, int b, int g, int r) | ||
75 | { | ||
76 | register int *n; | ||
77 | |||
78 | @@ -382,10 +369,7 @@ register int alpha,i,al,b,g,r; | ||
79 | /* Move adjacent neurons by precomputed alpha*(1-((i-j)^2/[r]^2)) in radpower[|i-j|] | ||
80 | --------------------------------------------------------------------------------- */ | ||
81 | |||
82 | -static void alterneigh(nnq, rad,i,al,b,g,r) | ||
83 | -nn_quant *nnq; | ||
84 | -int rad,i; | ||
85 | -register int al,b,g,r; | ||
86 | +static void alterneigh(nn_quant *nnq, int rad, int i, int al,int b,int g, int r) | ||
87 | { | ||
88 | register int j,k,lo,hi,a; | ||
89 | register int *p, *q; | ||
90 | @@ -429,9 +413,7 @@ register int al,b,g,r; | ||
91 | /* Main Learning Loop | ||
92 | ------------------ */ | ||
93 | |||
94 | -static void learn(nnq, verbose) /* Stu: N.B. added parameter so that main() could control verbosity. */ | ||
95 | -nn_quant *nnq; | ||
96 | -int verbose; | ||
97 | +static void learn(nn_quant *nnq, int verbose) /* Stu: N.B. added parameter so that main() could control verbosity. */ | ||
98 | { | ||
99 | register int i,j,al,b,g,r; | ||
100 | int radius,rad,alpha,step,delta,samplepixels; | ||
101 | diff --git a/src/gd_tiff.c b/src/gd_tiff.c | ||
102 | index 7f72b610..3d90e61a 100644 | ||
103 | --- a/src/gd_tiff.c | ||
104 | +++ b/src/gd_tiff.c | ||
105 | @@ -446,9 +446,7 @@ BGD_DECLARE(void) gdImageTiffCtx(gdImagePtr image, gdIOCtx *out) | ||
106 | } | ||
107 | |||
108 | /* Check if we are really in 8bit mode */ | ||
109 | -static int checkColorMap(n, r, g, b) | ||
110 | -int n; | ||
111 | -uint16_t *r, *g, *b; | ||
112 | +static int checkColorMap(int n, uint16_t *r, uint16_t *g, uint16_t *b) | ||
113 | { | ||
114 | while (n-- > 0) | ||
115 | if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256) | ||
diff --git a/meta-oe/recipes-support/gd/gd_2.3.3.bb b/meta-oe/recipes-support/gd/gd_2.3.3.bb index 9d4ee1fe4..cc2c1571e 100644 --- a/meta-oe/recipes-support/gd/gd_2.3.3.bb +++ b/meta-oe/recipes-support/gd/gd_2.3.3.bb | |||
@@ -14,6 +14,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=ace63adfdac78400fc30fa22ee9c1bb1" | |||
14 | DEPENDS = "freetype libpng jpeg zlib tiff" | 14 | DEPENDS = "freetype libpng jpeg zlib tiff" |
15 | 15 | ||
16 | SRC_URI = "git://github.com/libgd/libgd.git;nobranch=1;protocol=https \ | 16 | SRC_URI = "git://github.com/libgd/libgd.git;nobranch=1;protocol=https \ |
17 | file://0001-Fix-deprecared-function-prototypes.patch \ | ||
17 | " | 18 | " |
18 | 19 | ||
19 | SRCREV = "b5319a41286107b53daa0e08e402aa1819764bdc" | 20 | SRCREV = "b5319a41286107b53daa0e08e402aa1819764bdc" |