File: 0001-Avoid-to-use-sparc-keyword.patch

package info (click to toggle)
python-bcj 1.0.3%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,332 kB
  • sloc: ansic: 1,503; python: 528; makefile: 4
file content (79 lines) | stat: -rw-r--r-- 3,094 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Date: Wed, 24 Apr 2024 05:30:03 +0900
Subject: Avoid to use "sparc" keyword
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

"sparc" is already defined as "1" in SPARC64 gcc (cpp).
Use other keyword "sparc_arch" to avoid the error.

----
sparc64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc/ext -I/usr/include/python3.11 -c src/ext/_bcjmodule.c -o build/temp.linux-sparc64-cpython-311/src/ext/_bcjmodule.o
src/ext/_bcjmodule.c:32:5: error: expected identifier before numeric constant
   32 |     sparc,
      |     ^~~~~
src/ext/_bcjmodule.c: In function ‘BCJFilter_do_method’:
src/ext/_bcjmodule.c:123:9: error: duplicate case value
  123 |         case sparc:
      |         ^~~~
src/ext/_bcjmodule.c:114:9: note: previously used here
  114 |         case arm:
      |         ^~~~
src/ext/_bcjmodule.c:126:14: error: ‘ia64’ undeclared (first use in this function)
  126 |         case ia64:
      |              ^~~~
src/ext/_bcjmodule.c:126:14: note: each undeclared identifier is reported only once for each function it appears in
src/ext/_bcjmodule.c: In function ‘IA64Encoder_init’:
src/ext/_bcjmodule.c:640:20: error: ‘ia64’ undeclared (first use in this function)
  640 |     self->method = ia64;
      |                    ^~~~
src/ext/_bcjmodule.c: In function ‘IA64Decoder_init’:
src/ext/_bcjmodule.c:696:20: error: ‘ia64’ undeclared (first use in this function)
  696 |     self->method = ia64;
      |                    ^~~~
error: command '/usr/bin/sparc64-linux-gnu-gcc' failed with exit code 1
---
 src/ext/_bcjmodule.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/ext/_bcjmodule.c b/src/ext/_bcjmodule.c
index 1eb5296..304394c 100644
--- a/src/ext/_bcjmodule.c
+++ b/src/ext/_bcjmodule.c
@@ -29,7 +29,7 @@ enum Method {
     arm,
     armt,
     ppc,
-    sparc,
+    sparc_arch,
     ia64
 };
 
@@ -120,7 +120,7 @@ BCJFilter_do_method(BCJFilter *self) {
         case ppc:
             outLen = PPC_Convert(buf, size, self->ip, self->isEncoder);
             break;
-        case sparc:
+        case sparc_arch:
             outLen = SPARC_Convert(buf, size, self->ip, self->isEncoder);
             break;
         case ia64:
@@ -734,7 +734,7 @@ SparcEncoder_init(BCJFilter *self, PyObject *args, PyObject *kwargs) {
         goto error;
     }
     self->inited = 1;
-    self->method = sparc;
+    self->method = sparc_arch;
     self->readAhead = 4;
     self->isEncoder = True;
     self->remiaining = INT_MAX;
@@ -790,7 +790,7 @@ SparcDecoder_init(BCJFilter *self, PyObject *args, PyObject *kwargs) {
         goto error;
     }
     self->inited = 1;
-    self->method = sparc;
+    self->method = sparc_arch;
     self->readAhead = 4;
     self->isEncoder = False;
     self->remiaining = size;