mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH 0/2] bits/termios.h deduplication
@ 2015-09-13 21:06 Felix Janda
  2015-09-13 21:12 ` [PATCH 1/2] fix namespace violations in aarch64/bits/termios.h Felix Janda
  2015-09-13 21:13 ` [PATCH 2/2] reindent powerpc's bits/termios.h to be consistent with other archs Felix Janda
  0 siblings, 2 replies; 5+ messages in thread
From: Felix Janda @ 2015-09-13 21:06 UTC (permalink / raw)
  To: musl

The below patches make it easier to see which parts of bits/termios.h
can be deduplicated.

Except for mips and powerpc the headers are identical.

Unfortunately, the header for powerpc is very different from the rest.
The main things which are identical among all headers are B0 up to
B38400 and the 10 constants starting with TCOOFF.

Only mips and powerpc define EXTA, EXTB and BOTHER. Since these
constants are also defined in <asm-generic/termbits.h> it is not clear
to me why. POSIX reserves EXTA and EXTB but not BOTHER, which therefore
violates the namespace.

Felix Janda (2):
  fix namespace violations in aarch64/bits/termios.h
  reindent powerpc's bits/termios.h to be consistent with other archs

 arch/aarch64/bits/termios.h |  14 +--
 arch/powerpc/bits/termios.h | 278 ++++++++++++++++++++++----------------------
 2 files changed, 145 insertions(+), 147 deletions(-)

-- 
2.4.6


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] fix namespace violations in aarch64/bits/termios.h
  2015-09-13 21:06 [PATCH 0/2] bits/termios.h deduplication Felix Janda
@ 2015-09-13 21:12 ` Felix Janda
  2015-09-13 21:35   ` Szabolcs Nagy
  2015-09-13 21:13 ` [PATCH 2/2] reindent powerpc's bits/termios.h to be consistent with other archs Felix Janda
  1 sibling, 1 reply; 5+ messages in thread
From: Felix Janda @ 2015-09-13 21:12 UTC (permalink / raw)
  To: musl

in analogy with commit a627eb35864d5c29a3c3300dfe83745ab1e7a00f
---
 arch/aarch64/bits/termios.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/aarch64/bits/termios.h b/arch/aarch64/bits/termios.h
index 9265d6f..f0d81b1 100644
--- a/arch/aarch64/bits/termios.h
+++ b/arch/aarch64/bits/termios.h
@@ -76,8 +76,6 @@ struct termios
 #define VT0    0000000
 #define VT1    0040000
 
-#define XTABS  0014000
-
 #define B0       0000000
 #define B50      0000001
 #define B75      0000002
@@ -125,8 +123,6 @@ struct termios
 #define HUPCL  0002000
 #define CLOCAL 0004000
 
-#define CRTSCTS  020000000000
-
 #define ISIG   0000001
 #define ICANON 0000002
 #define ECHO   0000010
@@ -137,14 +133,11 @@ struct termios
 #define TOSTOP 0000400
 #define IEXTEN 0100000
 
-/* Extensions? */
-#define CBAUDEX 0010000
 #define ECHOCTL 0001000
 #define ECHOPRT 0002000
 #define ECHOKE 0004000
 #define FLUSHO 0010000
 #define PENDIN 0040000
-#define EXTPROC 0200000
 
 #define TCOOFF 0
 #define TCOON  1
@@ -158,3 +151,10 @@ struct termios
 #define TCSANOW   0
 #define TCSADRAIN 1
 #define TCSAFLUSH 2
+
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#define CBAUDEX 0010000
+#define CRTSCTS  020000000000
+#define EXTPROC 0200000
+#define XTABS  0014000
+#endif
-- 
2.4.6



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] reindent powerpc's bits/termios.h to be consistent with other archs
  2015-09-13 21:06 [PATCH 0/2] bits/termios.h deduplication Felix Janda
  2015-09-13 21:12 ` [PATCH 1/2] fix namespace violations in aarch64/bits/termios.h Felix Janda
@ 2015-09-13 21:13 ` Felix Janda
  2015-09-15 18:33   ` Rich Felker
  1 sibling, 1 reply; 5+ messages in thread
From: Felix Janda @ 2015-09-13 21:13 UTC (permalink / raw)
  To: musl

---
 arch/powerpc/bits/termios.h | 278 ++++++++++++++++++++++----------------------
 1 file changed, 138 insertions(+), 140 deletions(-)

diff --git a/arch/powerpc/bits/termios.h b/arch/powerpc/bits/termios.h
index 9f8016c..7feaf49 100644
--- a/arch/powerpc/bits/termios.h
+++ b/arch/powerpc/bits/termios.h
@@ -12,161 +12,159 @@ struct termios
 	speed_t __c_ospeed;
 };
 
-#define VINTR		0
-#define VQUIT		1
-#define VERASE		2
-#define VKILL		3
-#define VEOF		4
-#define VMIN		5
-#define VEOL		6
-#define VTIME		7
-#define VEOL2		8
-#define VSWTC		9
-#define VWERASE		10
-#define VREPRINT	11
-#define VSUSP		12
-#define VSTART		13
-#define VSTOP		14
-#define VLNEXT		15
-#define VDISCARD	16
+#define VINTR     0
+#define VQUIT     1
+#define VERASE    2
+#define VKILL     3
+#define VEOF      4
+#define VMIN      5
+#define VEOL      6
+#define VTIME     7
+#define VEOL2     8
+#define VSWTC     9
+#define VWERASE  10
+#define VREPRINT 11
+#define VSUSP    12
+#define VSTART   13
+#define VSTOP    14
+#define VLNEXT   15
+#define VDISCARD 16
 
-#define IGNBRK	0000001
-#define BRKINT	0000002
-#define IGNPAR	0000004
-#define PARMRK	0000010
-#define INPCK	0000020
-#define ISTRIP	0000040
-#define INLCR	0000100
-#define IGNCR	0000200
-#define ICRNL	0000400
-#define IXON	0001000
-#define IXOFF	0002000
-#define IXANY	0004000
-#define IUCLC	0010000
+#define IGNBRK  0000001
+#define BRKINT  0000002
+#define IGNPAR  0000004
+#define PARMRK  0000010
+#define INPCK   0000020
+#define ISTRIP  0000040
+#define INLCR   0000100
+#define IGNCR   0000200
+#define ICRNL   0000400
+#define IXON    0001000
+#define IXOFF   0002000
+#define IXANY   0004000
+#define IUCLC   0010000
 #define IMAXBEL 0020000
-#define IUTF8	0040000
+#define IUTF8   0040000
 
-#define OPOST	0000001
-#define ONLCR	0000002
-#define OLCUC	0000004
+#define OPOST  0000001
+#define ONLCR  0000002
+#define OLCUC  0000004
+#define OCRNL  0000010
+#define ONOCR  0000020
+#define ONLRET 0000040
+#define OFILL  0000100
+#define OFDEL  0000200
+#define NLDLY  0001400
+#define NL0    0000000
+#define NL1    0000400
+#define NL2    0001000
+#define NL3    0001400
+#define TABDLY 0006000
+#define TAB0   0000000
+#define TAB1   0002000
+#define TAB2   0004000
+#define TAB3   0006000
+#define CRDLY  0030000
+#define CR0    0000000
+#define CR1    0010000
+#define CR2    0020000
+#define CR3    0030000
+#define FFDLY  0040000
+#define FF0    0000000
+#define FF1    0040000
+#define BSDLY  0100000
+#define BS0    0000000
+#define BS1    0100000
 
-#define OCRNL	0000010
-#define ONOCR	0000020
-#define ONLRET	0000040
+#define VTDLY  0200000
+#define VT0    0000000
+#define VT1    0200000
 
-#define OFILL	00000100
-#define OFDEL	00000200
-#define NLDLY	00001400
-#define NL0	00000000
-#define NL1	00000400
-#define NL2	00001000
-#define NL3	00001400
-#define TABDLY	00006000
-#define TAB0	00000000
-#define TAB1	00002000
-#define TAB2	00004000
-#define TAB3	00006000
-#define CRDLY	00030000
-#define CR0	00000000
-#define CR1	00010000
-#define CR2	00020000
-#define CR3	00030000
-#define FFDLY	00040000
-#define FF0	00000000
-#define FF1	00040000
-#define BSDLY	00100000
-#define BS0	00000000
-#define BS1	00100000
-#define VTDLY	00200000
-#define VT0	00000000
-#define VT1	00200000
+#define B0       0000000
+#define B50      0000001
+#define B75      0000002
+#define B110     0000003
+#define B134     0000004
+#define B150     0000005
+#define B200     0000006
+#define B300     0000007
+#define B600     0000010
+#define B1200    0000011
+#define B1800    0000012
+#define B2400    0000013
+#define B4800    0000014
+#define B9600    0000015
+#define B19200   0000016
+#define B38400   0000017
+#define EXTA     0000016
+#define EXTB     0000017
 
-#define CBAUD	0000377
-#define B0	0000000
-#define B50	0000001
-#define B75	0000002
-#define B110	0000003
-#define B134	0000004
-#define B150	0000005
-#define B200	0000006
-#define B300	0000007
-#define B600	0000010
-#define B1200	0000011
-#define B1800	0000012
-#define B2400	0000013
-#define B4800	0000014
-#define B9600	0000015
-#define B19200	0000016
-#define B38400	0000017
-#define EXTA	B19200
-#define EXTB	B38400
-#define B57600	00020
-#define B115200	00021
-#define B230400	00022
-#define B460800	00023
-#define B500000	00024
-#define B576000	00025
-#define B921600	00026
+#define B57600   00020
+#define B115200  00021
+#define B230400  00022
+#define B460800  00023
+#define B500000  00024
+#define B576000  00025
+#define B921600  00026
+#define B1000000 00027
+#define B1152000 00030
+#define B1500000 00031
+#define B2000000 00032
+#define B2500000 00033
+#define B3000000 00034
+#define B3500000 00035
+#define B4000000 00036
+#define BOTHER   00037
 
-#define B1000000	00027
-#define B1152000	00030
-#define B1500000	00031
-#define B2000000	00032
-#define B2500000	00033
-#define B3000000	00034
-#define B3500000	00035
-#define B4000000	00036
-#define BOTHER	00037
+#define CBAUD    00377
 
-#define CSIZE	00001400
-#define CS5	00000000
-#define CS6	00000400
-#define CS7	00001000
-#define CS8	00001400
+#define CSIZE  00001400
+#define CS5    00000000
+#define CS6    00000400
+#define CS7    00001000
+#define CS8    00001400
+#define CSTOPB 00002000
+#define CREAD  00004000
+#define PARENB 00010000
+#define PARODD 00020000
+#define HUPCL  00040000
+#define CLOCAL 00100000
 
-#define CSTOPB	00002000
-#define CREAD	00004000
-#define PARENB	00010000
-#define PARODD	00020000
-#define HUPCL	00040000
-
-#define CLOCAL	00100000
-
-#define ISIG	0x00000080
-#define ICANON	0x00000100
-#define XCASE	0x00004000
-#define ECHO	0x00000008
-#define ECHOE	0x00000002
-#define ECHOK	0x00000004
-#define ECHONL	0x00000010
-#define NOFLSH	0x80000000
-#define TOSTOP	0x00400000
-#define ECHOCTL 0x00000040
+#define ECHOKE  0x00000001
+#define ECHOE   0x00000002
+#define ECHOK   0x00000004
+#define ECHO    0x00000008
+#define ECHONL  0x00000010
 #define ECHOPRT 0x00000020
-#define ECHOKE	0x00000001
-#define FLUSHO	0x00800000
-#define PENDIN	0x20000000
-#define IEXTEN	0x00000400
+#define ECHOCTL 0x00000040
+#define ISIG    0x00000080
+#define ICANON  0x00000100
+#define IEXTEN  0x00000400
+#define XCASE   0x00004000
+#define TOSTOP  0x00400000
+#define FLUSHO  0x00800000
+#define PENDIN  0x20000000
+#define NOFLSH  0x80000000
 
-#define TCOOFF	0
-#define TCOON	1
-#define TCIOFF	2
-#define TCION	3
+#define TCOOFF 0
+#define TCOON  1
+#define TCIOFF 2
+#define TCION  3
 
-#define TCIFLUSH	0
-#define TCOFLUSH	1
-#define TCIOFLUSH	2
+#define TCIFLUSH  0
+#define TCOFLUSH  1
+#define TCIOFLUSH 2
 
-#define TCSANOW		0
-#define TCSADRAIN	1
-#define TCSAFLUSH	2
+#define TCSANOW   0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define CBAUDEX	0000000
-#define CIBAUD	077600000
+#define CBAUDEX 0000000
+#define CIBAUD  077600000
 #define IBSHIFT 16
-#define CMSPAR	010000000000
-#define CRTSCTS	020000000000
+#define CMSPAR  010000000000
+#define CRTSCTS 020000000000
 #define EXTPROC 0x10000000
-#define XTABS	00006000
+#define XTABS   00006000
 #endif
-- 
2.4.6


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] fix namespace violations in aarch64/bits/termios.h
  2015-09-13 21:12 ` [PATCH 1/2] fix namespace violations in aarch64/bits/termios.h Felix Janda
@ 2015-09-13 21:35   ` Szabolcs Nagy
  0 siblings, 0 replies; 5+ messages in thread
From: Szabolcs Nagy @ 2015-09-13 21:35 UTC (permalink / raw)
  To: musl

* Felix Janda <felix.janda@posteo.de> [2015-09-13 23:12:48 +0200]:
> in analogy with commit a627eb35864d5c29a3c3300dfe83745ab1e7a00f
> ---
>  arch/aarch64/bits/termios.h | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)

this looks ok


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] reindent powerpc's bits/termios.h to be consistent with other archs
  2015-09-13 21:13 ` [PATCH 2/2] reindent powerpc's bits/termios.h to be consistent with other archs Felix Janda
@ 2015-09-15 18:33   ` Rich Felker
  0 siblings, 0 replies; 5+ messages in thread
From: Rich Felker @ 2015-09-15 18:33 UTC (permalink / raw)
  To: musl

On Sun, Sep 13, 2015 at 11:13:00PM +0200, Felix Janda wrote:
> ---
>  arch/powerpc/bits/termios.h | 278 ++++++++++++++++++++++----------------------
>  1 file changed, 138 insertions(+), 140 deletions(-)
> 
> diff --git a/arch/powerpc/bits/termios.h b/arch/powerpc/bits/termios.h
> index 9f8016c..7feaf49 100644
> --- a/arch/powerpc/bits/termios.h
> +++ b/arch/powerpc/bits/termios.h
> @@ -12,161 +12,159 @@ struct termios
>  	speed_t __c_ospeed;
>  };
>  
> -#define VINTR		0
> -#define VQUIT		1
> -#define VERASE		2
> -#define VKILL		3
> [...]

I reviewed these changes using sort and comparing the old/new files
visually and they match except for indention & other cosmetic details,
so I think it's ok; I'll apply this and the other patch. Thanks!

Rich


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-15 18:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-13 21:06 [PATCH 0/2] bits/termios.h deduplication Felix Janda
2015-09-13 21:12 ` [PATCH 1/2] fix namespace violations in aarch64/bits/termios.h Felix Janda
2015-09-13 21:35   ` Szabolcs Nagy
2015-09-13 21:13 ` [PATCH 2/2] reindent powerpc's bits/termios.h to be consistent with other archs Felix Janda
2015-09-15 18:33   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).