From a223524f5f4b62cf8bd85bd7467314629de93a9a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 7 Apr 2022 18:08:23 -0700 Subject: [PATCH 1/4] Use _CONST_X_STRING to make libXt declare String as const char * Clears 18 out of 44 -Wdiscarded-qualifiers warnings from gcc Signed-off-by: Alan Coopersmith --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 66e01ae..b9a70b6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,6 +22,7 @@ SUBDIRS = man bin_PROGRAMS = xconsole +AM_CPPFLAGS = -D_CONST_X_STRING AM_CFLAGS = $(XCONSOLE_CFLAGS) $(CWARNFLAGS) xconsole_LDADD = $(XCONSOLE_LIBS) -- GitLab From c374939e9e2cf36fcb6aa1984a472d73b05a821d Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 7 Apr 2022 18:17:32 -0700 Subject: [PATCH 2/4] unifdef sgi SGI Irix end of support life was in 2013 Signed-off-by: Alan Coopersmith --- xconsole.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/xconsole.c b/xconsole.c index f7edac9..031e228 100644 --- a/xconsole.c +++ b/xconsole.c @@ -823,14 +823,6 @@ get_pty(int *pty, int *tty, char *ttydev, char *ptydev) #else static int devindex, letter = 0; -#ifdef sgi - { - char *slave; - slave = _getpty (pty, O_RDWR, 0622, 0); - if ((*tty = open (slave, O_RDWR)) != -1) - return 0; - } -#else strcpy (ttydev, "/dev/ttyxx"); strcpy (ptydev, "/dev/ptyxx"); while (PTYCHAR1[letter]) { @@ -857,7 +849,6 @@ get_pty(int *pty, int *tty, char *ttydev, char *ptydev) devindex = 0; (void) letter++; } -#endif /* sgi else not sgi */ #endif /* USE_GET_PSEUDOTTY */ #endif /* SVR4 */ /* -- GitLab From a5a13a9eb0cb2ab0627192dce684ccb61e59678a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 8 Apr 2022 08:29:40 -0700 Subject: [PATCH 3/4] Reduce scope of ttydev & ptydev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eliminates them completely if HAS_OPENPTY is set. Resolves gcc warnings: xconsole.c: In function ‘get_pty’: xconsole.c:792:35: warning: declaration of ‘ttydev’ shadows a global declaration [-Wshadow] get_pty(int *pty, int *tty, char *ttydev, char *ptydev) ^~~~~~ xconsole.c:181:13: note: shadowed declaration is here static char ttydev[64], ptydev[64]; ^~~~~~ xconsole.c:792:49: warning: declaration of ‘ptydev’ shadows a global declaration [-Wshadow] get_pty(int *pty, int *tty, char *ttydev, char *ptydev) ^~~~~~ xconsole.c:181:25: note: shadowed declaration is here static char ttydev[64], ptydev[64]; ^~~~~~ Signed-off-by: Alan Coopersmith --- xconsole.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xconsole.c b/xconsole.c index 031e228..3a0020f 100644 --- a/xconsole.c +++ b/xconsole.c @@ -178,7 +178,6 @@ static XrmOptionDescRec options[] = { # if defined(TIOCCONS) || defined(SRIOCSREDIR) # define USE_PTY static int tty_fd, pty_fd; -static char ttydev[64], ptydev[64]; # endif #endif @@ -188,7 +187,7 @@ static char ttydev[64], ptydev[64]; #endif #ifdef USE_PTY -static int get_pty(int *pty, int *tty, char *ttydev, char *ptydev); +static int get_pty(int *pty, int *tty); #endif #ifdef USE_OSM @@ -243,7 +242,7 @@ OpenConsole(void) #endif #ifdef USE_PTY - if (!input && get_pty (&pty_fd, &tty_fd, ttydev, ptydev) == 0) + if (!input && get_pty (&pty_fd, &tty_fd) == 0) { # ifdef TIOCCONS int on = 1; @@ -789,14 +788,17 @@ ScrollLine(Widget w) */ static int -get_pty(int *pty, int *tty, char *ttydev, char *ptydev) +get_pty(int *pty, int *tty) { #ifdef HAS_OPENPTY if (openpty(pty, tty, NULL, NULL, NULL) == -1) { return 1; } return 0; -#elif defined (SVR4) || defined (USE_PTS) +#else + static char ttydev[64], ptydev[64]; + +#if defined (SVR4) || defined (USE_PTS) #if defined (_AIX) if ((*pty = open ("/dev/ptc", O_RDWR)) < 0) #else @@ -856,6 +858,7 @@ get_pty(int *pty, int *tty, char *ttydev, char *ptydev) * condition and let our caller terminate cleanly. */ return(1); +#endif /* HAS_OPENPTY */ } #endif -- GitLab From 6c8e22bcc450bcd6c0697fab4d89d99bae168b8c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 16 Apr 2022 07:50:50 -0700 Subject: [PATCH 4/4] gitlab CI: stop requiring Signed-off-by in commits Signed-off-by: Alan Coopersmith --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index adefc12..b2107c2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,7 +42,7 @@ check-commits: - .fdo.ci-fairy stage: prep script: - - ci-fairy check-commits --signed-off-by --junit-xml=results.xml + - ci-fairy check-commits --junit-xml=results.xml except: - master@xorg/app/xconsole variables: -- GitLab