aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2021-06-10 00:37:08 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2021-06-10 00:37:08 +0000
commit15b5916ed82c8de48b85d7b7afe670cb00e79796 (patch)
treeb7891e7faa9ffaa27911b367d0551a38d03a53a6
parentc2036b385da968e77c3abbefa44cb4c88eff9512 (diff)
downloadlynx-snapshots-15b5916ed82c8de48b85d7b7afe670cb00e79796.tar.gz
snapshot of project "lynx", label v2-9-0dev_6j
-rw-r--r--CHANGES7
-rw-r--r--WWW/Library/Implementation/HTNews.c14
-rw-r--r--WWW/Library/Implementation/HTParse.c6
-rw-r--r--WWW/Library/Implementation/HTString.c6
-rw-r--r--WWW/Library/Implementation/HTString.h4
-rw-r--r--WWW/Library/Implementation/HTTCP.c9
-rw-r--r--WWW/Library/Implementation/HTTP.c6
-rw-r--r--WWW/Library/Implementation/HTUtils.h3
-rw-r--r--aclocal.m424
-rwxr-xr-xconfig.guess46
-rwxr-xr-xconfigure18
-rw-r--r--src/GridText.c15
-rw-r--r--src/LYCharUtils.c6
-rw-r--r--src/LYCurses.c23
-rw-r--r--src/LYEdit.c4
-rw-r--r--src/LYHistory.c33
-rw-r--r--src/LYHistory.h4
-rw-r--r--src/LYKeymap.c7
-rw-r--r--src/LYMain.c16
-rw-r--r--src/LYReadCFG.c16
-rw-r--r--src/LYStrings.c11
-rw-r--r--src/LYStructs.h4
-rw-r--r--src/LYStyle.c4
-rw-r--r--src/LYUtils.c6
-rw-r--r--src/UCAuto.c9
-rw-r--r--src/UCAux.c9
-rw-r--r--src/UCdomap.c4
-rw-r--r--src/parsdate.c17
-rw-r--r--src/parsdate.y3
29 files changed, 184 insertions, 150 deletions
diff --git a/CHANGES b/CHANGES
index 31f10fcd..530f8604 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,10 @@
--- $LynxId: CHANGES,v 1.1071 2021/05/19 23:34:05 tom Exp $
+-- $LynxId: CHANGES,v 1.1073 2021/06/10 00:37:08 tom Exp $
===============================================================================
Changes since Lynx 2.8 release
===============================================================================
-2021-05-19 (2.9.0dev.7)
+2021-06-09 (2.9.0dev.7)
+* fix warnings from scan-build -TD
* update configure script to work with _Noreturn changes in ncurses 20210320
development snapshot -TD
* document the NO_TABLE_CENTER setting and explain the corresponding -center
@@ -18,7 +19,7 @@ Changes since Lynx 2.8 release
+ improve configure script workaround for unwanted
-Werror=implicit-function-declaration by clang
+ add "darwin" (macOS) to list of case-insensitive filesystems
-* update config.guess (2021-04-21), config.sub (2021-04-30)
+* update config.guess (2021-05-24), config.sub (2021-04-30)
2020-09-05 (2.9.0dev.6)
* remove commented ENABLE_LYNXRC for SHOW_COLOR:ON, and SHOW_DOTFILES since
diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c
index 5fd0e99d..c6c25636 100644
--- a/WWW/Library/Implementation/HTNews.c
+++ b/WWW/Library/Implementation/HTNews.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: HTNews.c,v 1.75 2020/01/21 22:12:00 tom Exp $
+ * $LynxId: HTNews.c,v 1.78 2021/06/09 19:29:36 tom Exp $
*
* NEWS ACCESS HTNews.c
* ===========
@@ -2300,7 +2300,7 @@ static int HTLoadNews(const char *arg,
} else if (*(arg + 5) == '/' && *(arg + 6) != '/') {
p1 = (arg + 6);
} else {
- p1 = (cp + 1);
+ p1 = (cp ? (cp + 1) : (arg + 6));
}
if (!(cp = HTParse(arg, "", PARSE_HOST)) || *cp == '\0') {
if (s >= 0 && NewsHost && strcasecomp(NewsHost, HTNewsHost)) {
@@ -2334,7 +2334,7 @@ static int HTLoadNews(const char *arg,
} else if (*(arg + 6) == '/' && *(arg + 7) != '/') {
p1 = (arg + 7);
} else {
- p1 = (cp + 1);
+ p1 = (cp ? (cp + 1) : (arg + 7));
}
if (!(cp = HTParse(arg, "", PARSE_HOST)) || *cp == '\0') {
if (s >= 0 && NewsHost && strcasecomp(NewsHost, HTNewsHost)) {
@@ -2368,7 +2368,7 @@ static int HTLoadNews(const char *arg,
} else if (*(arg + 6) != '/') {
p1 = (arg + 6);
} else {
- p1 = (cp + 1);
+ p1 = (cp ? (cp + 1) : (arg + 6));
}
if (!(cp = HTParse(arg, "", PARSE_HOST)) || *cp == '\0') {
if (s >= 0 && NewsHost && strcasecomp(NewsHost, HTNewsHost)) {
@@ -2436,16 +2436,18 @@ static int HTLoadNews(const char *arg,
p1 = (strrchr(arg, ':') + 1);
}
} else {
+ char *cp2;
+
/*
* Reset p1 so that it points to the newsgroup (or a wildcard),
* or the article.
*/
- if (!(cp = strrchr((p1 + 6), '/')) || *(cp + 1) == '\0') {
+ if (!(cp2 = strrchr((p1 + 6), '/')) || *(cp2 + 1) == '\0') {
p1 = "*";
group_wanted = FALSE;
list_wanted = TRUE;
} else {
- p1 = (cp + 1);
+ p1 = (cp2 + 1);
}
}
}
diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c
index a7f648fd..dd121ce4 100644
--- a/WWW/Library/Implementation/HTParse.c
+++ b/WWW/Library/Implementation/HTParse.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: HTParse.c,v 1.90 2020/09/05 00:19:54 tom Exp $
+ * $LynxId: HTParse.c,v 1.92 2021/06/09 19:30:55 tom Exp $
*
* Parse HyperText Document Address HTParse.c
* ================================
@@ -822,7 +822,7 @@ void HTSimplify(char *filename, BOOL absolute)
{
#define MY_FMT "HTParse HTSimplify\t(%s)"
#ifdef NO_LYNX_TRACE
-#define debug_at(at) /* nothing */
+#define debug_at(at) /* nothing */
#define atln "?"
#else
const char *atln;
@@ -905,7 +905,7 @@ void HTSimplify(char *filename, BOOL absolute)
if (prior != filename) {
trim += (size_t) (filename - prior);
limit += (size_t) (filename - prior);
- filename = p = prior;
+ filename = prior;
CTRACE2(TRACE_HTPARSE,
(tfp, MY_FMT " TRIM %lu/%lu (%.*s)\n",
mark, (unsigned long) trim, (unsigned long) limit,
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c
index 2c663546..78054d7b 100644
--- a/WWW/Library/Implementation/HTString.c
+++ b/WWW/Library/Implementation/HTString.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: HTString.c,v 1.79 2020/01/23 01:10:36 tom Exp $
+ * $LynxId: HTString.c,v 1.81 2021/06/09 20:16:06 tom Exp $
*
* Case-independent string comparison HTString.c
*
@@ -624,7 +624,7 @@ typedef enum {
PUBLIC_IF_FIND_LEAKS char *StrAllocVsprintf(char **pstr,
size_t dst_len,
const char *fmt,
- va_list * ap)
+ va_list *ap)
{
#ifdef HAVE_VASPRINTF
/*
@@ -1102,6 +1102,8 @@ void HTAddXpand(char **result,
int number,
const char *parameter)
{
+ if (parameter == NULL)
+ parameter = "";
if (number > 0) {
const char *last = HTAfterCommandArg(command, number - 1);
const char *next = last;
diff --git a/WWW/Library/Implementation/HTString.h b/WWW/Library/Implementation/HTString.h
index e5ab99e8..82520ad5 100644
--- a/WWW/Library/Implementation/HTString.h
+++ b/WWW/Library/Implementation/HTString.h
@@ -1,5 +1,5 @@
/*
- * $LynxId: HTString.h,v 1.40 2018/12/27 10:27:01 tom Exp $
+ * $LynxId: HTString.h,v 1.41 2021/06/09 19:30:55 tom Exp $
* String handling for libwww
* STRINGS
*
@@ -97,7 +97,7 @@ extern "C" {
extern char *StrAllocVsprintf(char **pstr,
size_t len,
const char *fmt,
- va_list * ap);
+ va_list *ap);
#endif
#if defined(__CYGWIN__)
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index 945c9f91..c4d648ac 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: HTTCP.c,v 1.157 2020/09/03 22:57:14 tom Exp $
+ * $LynxId: HTTCP.c,v 1.160 2021/06/08 23:44:43 tom Exp $
*
* Generic Communication Code HTTCP.c
* ==========================
@@ -1600,7 +1600,7 @@ static void really_getaddrinfo(const char *host,
#ifdef DEBUG_HOSTENT_CHILD
dump_addrinfo("CHILD fill_addrinfo", (const LYNX_ADDRINFO *) (*result));
#endif
- if (statuses->rehostentlen <= sizeof(LYNX_ADDRINFO)) {
+ if (statuses->rehostentlen <= sizeof(LYNX_ADDRINFO) || (*result) == NULL) {
statuses->rehostentlen = 0;
statuses->h_length = 0;
} else {
@@ -1825,7 +1825,7 @@ int HTDoConnect(const char *url,
int default_port,
int *s)
{
- char *socks5_host;
+ char *socks5_host = NULL;
unsigned socks5_host_len = 0;
int socks5_port;
const char *socks5_orig_url;
@@ -1858,7 +1858,6 @@ int HTDoConnect(const char *url,
StrAllocCopy(socks5_new_url, url);
/* Get node name and optional port number of wanted URL */
- socks5_host = NULL;
if ((p1 = HTParse(socks5_new_url, "", PARSE_HOST)) != NULL) {
StrAllocCopy(socks5_host, p1);
strip_userid(socks5_host, FALSE);
@@ -2301,7 +2300,7 @@ int HTDoConnect(const char *url,
}
if ((size_t) write(*s, pbuf, i) != i) {
goto report_system_err;
- } else if ((i = (unsigned) HTDoRead(*s, pbuf, 4)) != 4) {
+ } else if ((unsigned) HTDoRead(*s, pbuf, 4) != 4) {
goto report_system_err;
}
/* Version 5, reserved must be 0 */
diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c
index 7e0234aa..07e30d74 100644
--- a/WWW/Library/Implementation/HTTP.c
+++ b/WWW/Library/Implementation/HTTP.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: HTTP.c,v 1.178 2020/01/21 22:09:33 tom Exp $
+ * $LynxId: HTTP.c,v 1.179 2021/06/08 23:28:23 tom Exp $
*
* HyperText Transfer Protocol - Client implementation HTTP.c
* ===========================
@@ -755,7 +755,9 @@ static char *StripIpv6Brackets(char *host)
p = host + strlen(host) - 1;
if (*p == ']') {
*p = '\0';
- ++host;
+ for (p = host; (p[0] = p[1]) != '\0'; ++p) {
+ ; /* EMPTY */
+ }
}
}
return host;
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index 57aa64e7..5aedc2f4 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -1,5 +1,5 @@
/*
- * $LynxId: HTUtils.h,v 1.132 2021/03/22 23:03:56 tom Exp $
+ * $LynxId: HTUtils.h,v 1.133 2021/06/09 22:17:19 tom Exp $
*
* Utility macros for the W3 code library
* MACROS FOR GENERAL USE
@@ -685,6 +685,7 @@ extern int WWW_TraceMask;
* Printing-format for "UCode_t".
*/
#define PRI_UCode_t "lX"
+#define CAST_UCode_t(n) (unsigned long)(n)
/*
* Verbose-tracing.
diff --git a/aclocal.m4 b/aclocal.m4
index 954b7c19..50ae6ca8 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-dnl $LynxId: aclocal.m4,v 1.299 2021/05/19 23:37:29 tom Exp $
+dnl $LynxId: aclocal.m4,v 1.301 2021/06/08 22:08:14 tom Exp $
dnl Macros for auto-configure script.
dnl by Thomas E. Dickey <dickey@invisible-island.net>
dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
@@ -963,7 +963,7 @@ for mapname in acs_map _acs_map
do
AC_TRY_LINK([
#include <${cf_cv_ncurses_header:-curses.h}>
- ],[chtype x = ${mapname}['l']; ${mapname}['m'] = 0],
+ ],[chtype x = ${mapname}['l']; ${mapname}['m'] = 0; (void)x],
[cf_cv_alt_char_set=$mapname
break],
[cf_cv_alt_char_set=no])
@@ -1879,7 +1879,7 @@ if test "$cf_cv_color_curses" = yes ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CONST_X_STRING version: 6 updated: 2021/01/01 13:31:04
+dnl CF_CONST_X_STRING version: 7 updated: 2021/06/07 17:39:17
dnl -----------------
dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most
dnl character-strings.
@@ -1909,7 +1909,7 @@ AC_TRY_COMPILE(
#include <stdlib.h>
#include <X11/Intrinsic.h>
],
-[String foo = malloc(1); (void)foo],[
+[String foo = malloc(1); free((void*)foo)],[
AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[
AC_TRY_COMPILE(
@@ -2885,7 +2885,7 @@ AC_TRY_LINK([
#include <sys/types.h>
#include <sys/ioctl.h>
],[
- int ret = ioctl(0, FIONBIO, (char *)0);
+ int ret = ioctl(0, FIONBIO, (char *)0); (void) ret
],[cf_cv_fionbio=ioctl],[
AC_TRY_LINK([
#include <sys/types.h>
@@ -3065,7 +3065,7 @@ AC_CACHE_VAL(ac_cv_func_lstat,[
AC_TRY_LINK([
#include <sys/types.h>
#include <sys/stat.h>],
- [lstat(".", (struct stat *)0)],
+ [struct stat sb; lstat(".", &sb); (void) sb],
[ac_cv_func_lstat=yes],
[ac_cv_func_lstat=no])
])
@@ -5967,7 +5967,7 @@ AC_TRY_LINK([
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
-],[long seed = 1; $cf_srand_func(seed); seed = $cf_rand_func()],
+],[long seed = 1; $cf_srand_func(seed); seed = $cf_rand_func(); (void)seed],
[cf_cv_srand_func=$cf_func
break])
done
@@ -6525,8 +6525,8 @@ AC_CACHE_VAL(cf_cv_tm_gmtoff,[
# endif
#endif
],[
- struct tm foo;
- long bar = foo.tm_gmtoff],
+ static struct tm foo;
+ long bar = foo.tm_gmtoff; (void) bar],
[cf_cv_tm_gmtoff=yes],
[cf_cv_tm_gmtoff=no])])
AC_MSG_RESULT($cf_cv_tm_gmtoff)
@@ -6751,7 +6751,7 @@ AC_REQUIRE([CF_WAIT_HEADERS])
AC_MSG_CHECKING([for union wait])
AC_CACHE_VAL(cf_cv_type_unionwait,[
AC_TRY_LINK($cf_wait_headers,
- [int x;
+ [static int x;
int y = WEXITSTATUS(x);
int z = WTERMSIG(x);
wait(&x);
@@ -6942,7 +6942,7 @@ esac
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_UTMP_UT_SESSION version: 8 updated: 2021/01/02 09:31:20
+dnl CF_UTMP_UT_SESSION version: 9 updated: 2021/06/07 17:39:17
dnl ------------------
dnl Check if UTMP/UTMPX struct defines ut_session member
AC_DEFUN([CF_UTMP_UT_SESSION],
@@ -6952,7 +6952,7 @@ AC_CACHE_CHECK(if ${cf_cv_have_utmp}.ut_session is declared, cf_cv_have_utmp_ut_
AC_TRY_COMPILE([
#include <sys/types.h>
#include <${cf_cv_have_utmp}.h>],
- [struct $cf_cv_have_utmp x;
+ [static struct $cf_cv_have_utmp x;
long y = x.ut_session;
(void)x;
(void)y],
diff --git a/config.guess b/config.guess
index ec94a102..9c65c6c1 100755
--- a/config.guess
+++ b/config.guess
@@ -3,7 +3,7 @@
# Copyright 2021 Thomas E. Dickey
# Copyright 1992-2021 Free Software Foundation, Inc.
-timestamp='2021-04-21'
+timestamp='2021-05-24'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -137,7 +137,7 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "$UNAME_SYSTEM" in
+case $UNAME_SYSTEM in
Linux|GNU|GNU/*)
LIBC=unknown
@@ -177,7 +177,7 @@ esac
# Note: order is significant - the case branches are not exclusive.
-case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
+case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -193,7 +193,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
/usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
echo unknown)`
- case "$UNAME_MACHINE_ARCH" in
+ case $UNAME_MACHINE_ARCH in
aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
@@ -209,7 +209,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
esac
# The Operating System including object format, if it has switched
# to ELF recently (or will in the future) and ABI.
- case "$UNAME_MACHINE_ARCH" in
+ case $UNAME_MACHINE_ARCH in
earm*)
os=netbsdelf
;;
@@ -230,7 +230,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
;;
esac
# Determine ABI tags.
- case "$UNAME_MACHINE_ARCH" in
+ case $UNAME_MACHINE_ARCH in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
@@ -241,7 +241,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
- case "$UNAME_VERSION" in
+ case $UNAME_VERSION in
Debian*)
release='-gnu'
;;
@@ -301,6 +301,8 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
echo mips-dec-osf1
exit ;;
alpha:OSF1:*:*)
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ trap '' 0
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -314,7 +316,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
+ case $ALPHA_CPU_TYPE in
"EV4 (21064)")
UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
@@ -352,10 +354,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
+ exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
@@ -436,7 +435,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
+ case `/usr/bin/arch -k` in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
@@ -450,7 +449,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
- case "`/bin/arch`" in
+ case `/bin/arch` in
sun3)
echo m68k-sun-sunos"$UNAME_RELEASE"
;;
@@ -666,18 +665,18 @@ EOF
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
- case "$UNAME_MACHINE" in
+ case $UNAME_MACHINE in
9000/31?) HP_ARCH=m68000 ;;
9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "$sc_cpu_version" in
+ case $sc_cpu_version in
523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
- case "$sc_kernel_bits" in
+ case $sc_kernel_bits in
32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
@@ -878,7 +877,7 @@ EOF
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
- case "$UNAME_PROCESSOR" in
+ case $UNAME_PROCESSOR in
amd64)
UNAME_PROCESSOR=x86_64 ;;
i386)
@@ -902,7 +901,7 @@ EOF
echo "$UNAME_MACHINE"-pc-pw32
exit ;;
*:Interix*:*)
- case "$UNAME_MACHINE" in
+ case $UNAME_MACHINE in
x86)
echo i586-pc-interix"$UNAME_RELEASE"
exit ;;
@@ -1439,10 +1438,9 @@ EOF
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- # shellcheck disable=SC2154
- if test "$cputype" = 386; then
+ if test "${cputype-}" = 386; then
UNAME_MACHINE=i386
- else
+ elif test "x${cputype-}" != x; then
UNAME_MACHINE="$cputype"
fi
echo "$UNAME_MACHINE"-unknown-plan9
@@ -1473,7 +1471,7 @@ EOF
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "$UNAME_MACHINE" in
+ case $UNAME_MACHINE in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
@@ -1640,7 +1638,7 @@ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
echo "$0: unable to guess system type" >&2
-case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+case $UNAME_MACHINE:$UNAME_SYSTEM in
mips:Linux | mips64:Linux)
# If we got here on MIPS GNU/Linux, output extra information.
cat >&2 <<EOF
diff --git a/configure b/configure
index e8879104..df2f7b8f 100755
--- a/configure
+++ b/configure
@@ -5627,7 +5627,7 @@ cat >"conftest.$ac_ext" <<_ACEOF
int
main (void)
{
-String foo = malloc(1); (void)foo
+String foo = malloc(1); free((void*)foo)
;
return 0;
}
@@ -31384,7 +31384,7 @@ $cf_wait_headers
int
main (void)
{
-int x;
+static int x;
int y = WEXITSTATUS(x);
int z = WTERMSIG(x);
wait(&x);
@@ -32056,8 +32056,8 @@ int
main (void)
{
- struct tm foo;
- long bar = foo.tm_gmtoff
+ static struct tm foo;
+ long bar = foo.tm_gmtoff; (void) bar
;
return 0;
}
@@ -34074,7 +34074,7 @@ int
main (void)
{
- int ret = ioctl(0, FIONBIO, (char *)0);
+ int ret = ioctl(0, FIONBIO, (char *)0); (void) ret
;
return 0;
@@ -34243,7 +34243,7 @@ cat >"conftest.$ac_ext" <<_ACEOF
int
main (void)
{
-lstat(".", (struct stat *)0)
+struct stat sb; lstat(".", &sb); (void) sb
;
return 0;
}
@@ -34772,7 +34772,7 @@ cat >"conftest.$ac_ext" <<_ACEOF
int
main (void)
{
-long seed = 1; $cf_srand_func(seed); seed = $cf_rand_func()
+long seed = 1; $cf_srand_func(seed); seed = $cf_rand_func(); (void)seed
;
return 0;
}
@@ -36629,7 +36629,7 @@ else
int
main (void)
{
-struct $cf_cv_have_utmp x;
+static struct $cf_cv_have_utmp x;
long y = x.ut_session;
(void)x;
(void)y
@@ -47001,7 +47001,7 @@ do
int
main (void)
{
-chtype x = ${mapname}['l']; ${mapname}['m'] = 0
+chtype x = ${mapname}['l']; ${mapname}['m'] = 0; (void)x
;
return 0;
}
diff --git a/src/GridText.c b/src/GridText.c
index 46cbb51f..88e2efe7 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: GridText.c,v 1.325 2020/02/25 01:41:00 tom Exp $
+ * $LynxId: GridText.c,v 1.328 2021/06/09 23:35:23 tom Exp $
*
* Character grid hypertext object
* ===============================
@@ -5935,10 +5935,12 @@ static void HText_trimHightext(HText *text,
/*
* Find the right line.
*/
- for (; anchor_ptr->line_num > cur_line;
+ for (; line_ptr != NULL && anchor_ptr->line_num > cur_line;
line_ptr = line_ptr->next, cur_line++) {
; /* null body */
}
+ if (line_ptr == NULL)
+ continue;
if (!final) {
/*
@@ -8308,7 +8310,9 @@ void print_wwwfile_to_fd(FILE *fp,
off2, cur->length,
FieldFirst(cur, this_wrap),
FieldLast(cur, this_wrap) - 1,
- byte_offset, cell_chr, temp_chr));
+ byte_offset,
+ (unsigned) cell_chr,
+ (unsigned) temp_chr));
cell_chr = temp_chr;
cell_ptr = temp_ptr;
cell_len = temp_len;
@@ -10958,7 +10962,7 @@ static int check_if_base64_needed(int submit_method,
int ch = UCH(text[n]);
if (is8bits(ch) || ((ch < 32 && ch != '\n'))) {
- CTRACE((tfp, "nonprintable %d:%#x\n", n, ch));
+ CTRACE((tfp, "nonprintable %d:%#x\n", n, (unsigned) ch));
printable = FALSE;
}
if (ch == '\n' || ch == '\r') {
@@ -13484,6 +13488,9 @@ void HText_ExpandTextarea(LinkInfo * form_link, int newlines)
anchor_ptr = anchor_ptr->next;
}
+ if (end_anchor == NULL)
+ return;
+
for (i = 1; i <= newlines; i++) {
insert_new_textarea_anchor(&end_anchor, &htline);
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index 4a7c3a39..bb05aab0 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYCharUtils.c,v 1.133 2020/01/21 21:36:01 tom Exp $
+ * $LynxId: LYCharUtils.c,v 1.135 2021/06/09 22:29:03 tom Exp $
*
* Functions associated with LYCharSets.c and the Lynx version of HTML.c - FM
* ==========================================================================
@@ -1665,7 +1665,7 @@ char **LYUCFullyTranslateString(char **str,
} else if (code == 8204 || code == 8205 ||
code == 8206 || code == 8207) {
CTRACE((tfp, "LYUCFullyTranslateString: Ignoring '%"
- PRI_UCode_t "'.\n", code));
+ PRI_UCode_t "'.\n", CAST_UCode_t (code)));
replace_buf[0] = '\0';
state = S_got_outstring;
break;
@@ -1739,7 +1739,7 @@ char **LYUCFullyTranslateString(char **str,
} else if (!T.output_utf8 && stype == st_HTML && !hidden &&
!(HTPassEightBitRaw &&
UCH(*p) >= lowest_8)) {
- sprintf(replace_buf, "U%.2" PRI_UCode_t "", code);
+ sprintf(replace_buf, "U%.2" PRI_UCode_t "", CAST_UCode_t (code));
state = S_got_outstring;
} else {
diff --git a/src/LYCurses.c b/src/LYCurses.c
index ae06fa9e..b35f5362 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYCurses.c,v 1.196 2020/01/21 21:35:05 tom Exp $ */
+/* $LynxId: LYCurses.c,v 1.197 2021/06/09 21:44:35 tom Exp $ */
#include <HTUtils.h>
#include <HTAlert.h>
@@ -408,7 +408,7 @@ void setHashStyle(int style,
CTRACE2(TRACE_STYLE,
(tfp, "CSS(SET): <%s> hash=%d, ca=%#x, ma=%#x\n",
- element, style, color, mono));
+ element, style, (unsigned) color, (unsigned) mono));
ds->used = TRUE;
ds->color = color;
@@ -428,11 +428,13 @@ static void LYAttrset(WINDOW * win, int color,
&& LYShowColor >= SHOW_COLOR_ON
&& color >= 0) {
CTRACE2(TRACE_STYLE, (tfp, "CSS:LYAttrset color %#x -> (%s)\n",
- color, shown = attr_to_string(color)));
+ (unsigned) color,
+ shown = attr_to_string(color)));
(void) wattrset(win, color);
} else if (mono >= 0) {
CTRACE2(TRACE_STYLE, (tfp, "CSS:LYAttrset mono %#x -> (%s)\n",
- mono, shown = attr_to_string(mono)));
+ (unsigned) mono,
+ shown = attr_to_string(mono)));
(void) wattrset(win, mono);
} else {
CTRACE2(TRACE_STYLE, (tfp, "CSS:LYAttrset (A_NORMAL)\n"));
@@ -468,7 +470,9 @@ void curses_w_style(WINDOW * win, int style,
CTRACE2(TRACE_STYLE, (tfp, "CSS.CS:<%s%s> style %d color %#x\n",
(dir ? "" : "/"),
- ds->name, style, ds->color));
+ ds->name,
+ style,
+ (unsigned) ds->color));
getyx(win, YP, XP);
@@ -496,7 +500,7 @@ void curses_w_style(WINDOW * win, int style,
if (last_colorattr_ptr >= MAX_LAST_STYLES) {
CTRACE2(TRACE_STYLE, (tfp, "........... %s (0x%x) %s\r\n",
"attribute cache FULL, dropping last",
- last_styles[last_colorattr_ptr],
+ (unsigned) last_styles[last_colorattr_ptr],
"in LynxChangeStyle(curses_w_style)"));
last_colorattr_ptr = MAX_LAST_STYLES - 1;
}
@@ -721,8 +725,13 @@ char *LYgetTableString(int code)
if (fg == 0 && bg == 0) {
fg = COLOR_WHITE;
}
+
CTRACE((tfp, "%#x -> %#x (mono %#x pair %d) fg=%d, bg=%d\n",
- mask, second, mono, pair, fg, bg));
+ (unsigned) mask,
+ (unsigned) second,
+ (unsigned) mono,
+ pair, fg, bg));
+
for (n = 0; n < TABLESIZE(Mono_Attrs); ++n) {
if ((Mono_Attrs[n].code & mono) != 0) {
if (result != 0)
diff --git a/src/LYEdit.c b/src/LYEdit.c
index ee0b8329..304bb4e2 100644
--- a/src/LYEdit.c
+++ b/src/LYEdit.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYEdit.c,v 1.42 2013/11/28 11:18:19 tom Exp $ */
+/* $LynxId: LYEdit.c,v 1.43 2021/06/09 21:39:57 tom Exp $ */
#include <HTUtils.h>
#include <HTParse.h>
#include <HTAlert.h>
@@ -263,7 +263,7 @@ void edit_temporary_file(char *filename,
int save_err = errno;
CTRACE((tfp, "ExtEditForm: system() returned %d (0x%x), %s\n",
- rv, rv,
+ rv, (unsigned) rv,
(save_err
? LYStrerror(save_err)
: "reason unknown")));
diff --git a/src/LYHistory.c b/src/LYHistory.c
index 1d7c84ae..4fd5567f 100644
--- a/src/LYHistory.c
+++ b/src/LYHistory.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYHistory.c,v 1.91 2020/01/21 21:34:20 tom Exp $
+ * $LynxId: LYHistory.c,v 1.94 2021/06/09 22:55:43 tom Exp $
*/
#include <HTUtils.h>
#include <HTTP.h>
@@ -82,7 +82,7 @@ static void Visited_Links_free(void)
static void trace_history(const char *tag)
{
if (TRACE) {
- CTRACE((tfp, "HISTORY %s %d/%d (%d extra)\n",
+ CTRACE((tfp, "HISTORY %s %d/%u (%d extra)\n",
tag, nhist, size_history, nhist_extra));
CTRACE_FLUSH(tfp);
}
@@ -338,29 +338,26 @@ static int are_identical(HistInfo * doc, DocInfo *doc1)
&& doc1->isHEAD == doc->hdoc.isHEAD);
}
-void LYAllocHistory(int entries)
+void LYAllocHistory(unsigned entries)
{
- CTRACE((tfp, "LYAllocHistory %d vs %d\n", entries, size_history));
+ CTRACE((tfp, "LYAllocHistory %u vs %u\n", entries, size_history));
if (entries + 1 >= size_history) {
- unsigned want;
- int save = size_history;
+ size_t want;
+ unsigned save = size_history;
- size_history = (entries + 2) * 2;
- want = (unsigned) size_history *(unsigned) sizeof(*history);
+ size_history += (entries + 2) * 2;
+ want = ((size_t) size_history) * sizeof(*history);
if (history == 0) {
- history = typeMallocn(HistInfo, want);
+ history = typecallocn(HistInfo, want);
} else {
history = typeRealloc(HistInfo, history, want);
+ memset(&history[save], 0, size_history - save);
}
if (history == 0)
outofmem(__FILE__, "LYAllocHistory");
-
- while (save < size_history) {
- memset(&history[save++], 0, sizeof(history[0]));
- }
}
- CTRACE((tfp, "...LYAllocHistory %d vs %d\n", entries, size_history));
+ CTRACE((tfp, "...LYAllocHistory %u vs %u\n", entries, size_history));
}
/*
@@ -410,7 +407,7 @@ int LYpush(DocInfo *doc, int force_push)
HDOC(nhist).link = doc->link;
HDOC(nhist).line = doc->line;
nhist_extra--;
- LYAllocHistory(nhist);
+ LYAllocHistory((unsigned) nhist);
nhist++;
trace_history("LYpush: just move the cursor");
return 1;
@@ -427,7 +424,7 @@ int LYpush(DocInfo *doc, int force_push)
/*
* OK, push it...
*/
- LYAllocHistory(nhist);
+ LYAllocHistory((unsigned) nhist);
HDOC(nhist).link = doc->link;
HDOC(nhist).line = doc->line;
@@ -571,7 +568,7 @@ void LYpop(DocInfo *doc)
void LYhist_prev(DocInfo *doc)
{
trace_history("LYhist_prev");
- if (nhist > 0 && (nhist_extra || nhist < size_history)) {
+ if (nhist > 0 && (nhist_extra || (unsigned) nhist < size_history)) {
nhist--;
nhist_extra++;
LYpop_num(nhist, doc);
@@ -608,7 +605,7 @@ int LYhist_next(DocInfo *doc, DocInfo *newdoc)
/* Store the new position */
HDOC(nhist).link = doc->link;
HDOC(nhist).line = doc->line;
- LYAllocHistory(nhist);
+ LYAllocHistory((unsigned) nhist);
nhist++;
nhist_extra--;
LYpop_num(nhist, newdoc);
diff --git a/src/LYHistory.h b/src/LYHistory.h
index 68ec5248..a8f2b1ca 100644
--- a/src/LYHistory.h
+++ b/src/LYHistory.h
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYHistory.h,v 1.21 2010/09/25 00:45:55 tom Exp $
+ * $LynxId: LYHistory.h,v 1.22 2021/06/09 22:33:06 tom Exp $
*/
#ifndef LYHISTORY_H
#define LYHISTORY_H
@@ -18,7 +18,7 @@ extern "C" {
extern int LYpush(DocInfo *doc, int force_push);
extern int showhistory(char **newfile);
extern void LYAddVisitedLink(DocInfo *doc);
- extern void LYAllocHistory(int entries);
+ extern void LYAllocHistory(unsigned entries);
extern void LYFreePostData(DocInfo *data);
extern void LYFreeDocInfo(DocInfo *data);
extern void LYhist_prev(DocInfo *doc);
diff --git a/src/LYKeymap.c b/src/LYKeymap.c
index b8bad31f..b05d0a3a 100644
--- a/src/LYKeymap.c
+++ b/src/LYKeymap.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYKeymap.c,v 1.120 2018/12/27 10:33:52 tom Exp $ */
+/* $LynxId: LYKeymap.c,v 1.122 2021/06/09 21:58:11 tom Exp $ */
#include <HTUtils.h>
#include <LYUtils.h>
#include <LYGlobalDefs.h>
@@ -633,6 +633,7 @@ static Kcmd revmap[] =
"")
};
+
#undef DATA
/* *INDENT-OFF* */
static const struct {
@@ -781,9 +782,9 @@ char *LYKeycodeToString(int c,
else if (TOASCII(c) < TOASCII(' '))
sprintf(buf, "^%c", FROMASCII(TOASCII(c) | 0100));
else if (c >= 0400)
- sprintf(buf, "key-0x%x", c);
+ sprintf(buf, "key-0x%x", (unsigned) c);
else
- sprintf(buf, "0x%x", c);
+ sprintf(buf, "0x%x", (unsigned) c);
}
return buf;
}
diff --git a/src/LYMain.c b/src/LYMain.c
index ad9c1fc2..14e015ec 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYMain.c,v 1.291 2021/03/22 22:52:58 tom Exp $
+ * $LynxId: LYMain.c,v 1.293 2021/06/09 20:55:53 tom Exp $
*/
#include <HTUtils.h>
#include <HTTP.h>
@@ -492,7 +492,7 @@ char *x_display = NULL; /* display environment variable */
HistInfo *history;
int nhist = 0; /* number of used history entries */
-int size_history; /* number of allocated history entries */
+unsigned size_history; /* number of allocated history entries */
LinkInfo links[MAXLINKS];
@@ -2367,7 +2367,7 @@ void reload_read_cfg(void)
return; /* can not write the very own file :( */
}
#ifdef USE_PERSISTENT_COOKIES
- if (LYCookieFile != 0 && LYCookieSaveFile != 0) {
+ if (LYCookieFile != NULL && LYCookieSaveFile != NULL) {
/* set few safe flags: */
BOOLEAN persistent_cookies_flag = persistent_cookies;
char *LYCookieFile_flag = NULL;
@@ -2422,7 +2422,7 @@ void reload_read_cfg(void)
persistent_cookies = persistent_cookies_flag;
HTAlert(gettext("persistent cookies state will be changed in next session only."));
}
- if (persistent_cookies) {
+ if (persistent_cookies && LYCookieFile_flag != NULL) {
if (strcmp(LYCookieFile, LYCookieFile_flag)) {
StrAllocCopy(LYCookieFile, LYCookieFile_flag);
CTRACE((tfp,
@@ -2500,17 +2500,17 @@ static int parse_authentication(char *next_arg,
/*
* Authentication information for protected documents.
*/
- char *auth_info = 0;
+ char *auth_info = NULL;
- if (next_arg != 0) {
+ if (next_arg != NULL) {
StrAllocCopy(auth_info, next_arg);
memset(next_arg, ' ', strlen(next_arg)); /* Let's not show too much */
}
- if (auth_info != 0) {
+ if (auth_info != NULL) {
char *cp;
- if ((cp = StrChr(auth_info, ':')) != 0) { /* Pw */
+ if ((cp = StrChr(auth_info, ':')) != NULL) { /* Pw */
*cp++ = '\0'; /* Terminate ID */
HTUnEscape(cp);
StrAllocCopy(result[1], cp);
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index b79e58da..18bc34cf 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYReadCFG.c,v 1.198 2020/02/23 23:09:33 Keith.Bowes Exp $
+ * $LynxId: LYReadCFG.c,v 1.199 2021/06/09 21:49:32 tom Exp $
*/
#ifndef NO_RULES
#include <HTRules.h>
@@ -815,7 +815,10 @@ static int keymap_fun(char *key)
if (!success)
fprintf(stderr,
gettext("setting of line-editor binding for key %s (0x%x) to 0x%x for %s failed\n"),
- key, lkc, lec, efunc);
+ key,
+ (unsigned) lkc,
+ (unsigned) lec,
+ efunc);
else
return 0;
}
@@ -827,11 +830,16 @@ static int keymap_fun(char *key)
if (lec != -1) {
fprintf(stderr,
gettext("setting of line-editor binding for key %s (0x%x) to 0x%x for %s failed\n"),
- key, lkc, lec, efunc);
+ key,
+ (unsigned) lkc,
+ (unsigned) lec,
+ efunc);
} else {
fprintf(stderr,
gettext("setting of line-editor binding for key %s (0x%x) for %s failed\n"),
- key, lkc, efunc);
+ key,
+ (unsigned) lkc,
+ efunc);
}
}
}
diff --git a/src/LYStrings.c b/src/LYStrings.c
index f4719f87..8cb33394 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYStrings.c,v 1.277 2020/09/04 00:34:02 tom Exp $ */
+/* $LynxId: LYStrings.c,v 1.278 2021/06/09 22:29:17 tom Exp $ */
#include <HTUtils.h>
#include <HTCJK.h>
#include <UCAux.h>
@@ -1353,10 +1353,11 @@ static int setkey_cmd(char *parse)
return 0; /* Trace the failure and continue. */
}
if (LYTraceLogFP == 0) {
- MY_TRACE((tfp, "KEYMAP(DEF) keysym=%#x\n", keysym));
+ MY_TRACE((tfp, "KEYMAP(DEF) keysym=%#x\n",
+ (unsigned) keysym));
} else {
MY_TRACE((tfp, "KEYMAP(DEF) keysym=%#x, seq='%s'\n",
- keysym, buf));
+ (unsigned) keysym, buf));
}
return define_key(buf, keysym);
} else {
@@ -1830,7 +1831,7 @@ static int LYgetch_for(int code)
}
#endif /* !USE_SLANG || VMS */
- CTRACE((tfp, "GETCH%d: Got %#x.\n", code, c));
+ CTRACE((tfp, "GETCH%d: Got %#x.\n", code, (unsigned) c));
if (LYNoZapKey > 1 && errno != EINTR &&
(c == EOF
#ifdef USE_SLANG
@@ -6200,7 +6201,7 @@ int LYReadCmdKey(int mode)
ch = LYgetch_for(mode);
}
CTRACE((tfp, "LYReadCmdKey(%d) ->%s (%#x)\n",
- mode, LYKeycodeToString(ch, TRUE), ch));
+ mode, LYKeycodeToString(ch, TRUE), (unsigned) ch));
LYWriteCmdKey(ch);
return ch;
}
diff --git a/src/LYStructs.h b/src/LYStructs.h
index 70f2c063..179914ac 100644
--- a/src/LYStructs.h
+++ b/src/LYStructs.h
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYStructs.h,v 1.31 2013/10/03 08:56:47 tom Exp $
+ * $LynxId: LYStructs.h,v 1.32 2021/06/09 20:56:05 tom Exp $
*/
#ifndef LYSTRUCTS_H
#define LYSTRUCTS_H
@@ -86,7 +86,7 @@ extern "C" {
extern HistInfo *history;
extern int nhist;
- extern int size_history;
+ extern unsigned size_history;
/******************************************************************************/
diff --git a/src/LYStyle.c b/src/LYStyle.c
index c7aa52b3..77be1884 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYStyle.c,v 1.110 2019/09/06 09:00:48 tom Exp $
+ * $LynxId: LYStyle.c,v 1.111 2021/06/09 22:00:35 tom Exp $
*
* character level styles for Lynx
* (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-)
@@ -238,7 +238,7 @@ static void parse_attributes(const char *mono,
int iBlink = !!((unsigned) cA & M_BLINK);
CTRACE2(TRACE_STYLE, (tfp, "parse_attributes %d/%d %d/%d %#x\n",
- fA, default_fg, bA, default_bg, cA));
+ fA, default_fg, bA, default_bg, (unsigned) cA));
if (fA < MAX_COLOR
&& bA < MAX_COLOR
#ifdef USE_CURSES_PAIR_0
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 752e9c0b..1378287d 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYUtils.c,v 1.298 2020/01/21 21:35:17 tom Exp $
+ * $LynxId: LYUtils.c,v 1.299 2021/06/09 21:46:53 tom Exp $
*/
#include <HTUtils.h>
#include <HTTCP.h>
@@ -6074,7 +6074,9 @@ FILE *LYOpenTemp(char *result,
make_it = TRUE;
CTRACE((tfp,
"lynx_temp_space is not our directory %s owner %d mode %03o\n",
- lynx_temp_space, (int) sb.st_uid, (int) sb.st_mode & 0777));
+ lynx_temp_space,
+ (int) sb.st_uid,
+ (unsigned) (sb.st_mode & 0777)));
}
} else {
make_it = TRUE;
diff --git a/src/UCAuto.c b/src/UCAuto.c
index 19e043c0..2b17591e 100644
--- a/src/UCAuto.c
+++ b/src/UCAuto.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: UCAuto.c,v 1.55 2018/03/18 18:51:29 tom Exp $
+ * $LynxId: UCAuto.c,v 1.56 2021/06/09 22:29:43 tom Exp $
*
* This file contains code for changing the Linux console mode.
* Currently some names for font files are hardwired in here.
@@ -173,7 +173,7 @@ static int call_setfont(const char *font,
FREE(T_setfont_cmd);
if (rv) {
CTRACE((tfp, "call_setfont: system returned %d (0x%x)!\n",
- rv, rv));
+ rv, (unsigned) rv));
if (rv == -1 || WIFSIGNALED(rv) || !WIFEXITED(rv)) {
return -1;
} else if ((WEXITSTATUS(rv) == EX_DATAERR ||
@@ -282,7 +282,8 @@ void UCChangeTerminalCodepage(int newcs,
CTRACE((tfp, "Restoring font: '%s'\n", tmpbuf1));
status = LYSystem(tmpbuf1);
if (status != 0) {
- CTRACE((tfp, "...system returned %d (0x%x)\n", status, status));
+ CTRACE((tfp, "...system returned %d (0x%x)\n", status,
+ (unsigned) status));
}
FREE(tmpbuf1);
}
@@ -328,7 +329,7 @@ void UCChangeTerminalCodepage(int newcs,
CTRACE((tfp, "Saving font: '%s'\n", tmpbuf1));
rv = LYSystem(tmpbuf1);
if (rv != 0) {
- CTRACE((tfp, "...system returned %d (0x%x)\n", rv, rv));
+ CTRACE((tfp, "...system returned %d (0x%x)\n", rv, (unsigned) rv));
}
FREE(tmpbuf1);
LYCloseTempFP(fp1);
diff --git a/src/UCAux.c b/src/UCAux.c
index fd3de5ff..5d7b70a4 100644
--- a/src/UCAux.c
+++ b/src/UCAux.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: UCAux.c,v 1.51 2016/04/17 22:18:15 tom Exp $
+ * $LynxId: UCAux.c,v 1.52 2021/06/09 22:29:39 tom Exp $
*/
#include <HTUtils.h>
@@ -394,8 +394,8 @@ void UCSetBoxChars(int cset,
CTRACE((tfp,
" map[%c] %#" PRI_UCode_t " -> %#x\n",
table[n].mapping,
- table[n].internal,
- table[n].external));
+ CAST_UCode_t (table[n].internal),
+ (unsigned)table[n].external));
break;
}
}
@@ -419,7 +419,8 @@ void UCSetBoxChars(int cset,
CTRACE((tfp,
"line-drawing map %c mismatch (have %#x, want %#x)\n",
table[n].mapping,
- test, table[n].external));
+ (unsigned) test,
+ (unsigned) table[n].external));
fix_lines = TRUE;
break;
}
diff --git a/src/UCdomap.c b/src/UCdomap.c
index a01da5fd..31623e5a 100644
--- a/src/UCdomap.c
+++ b/src/UCdomap.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: UCdomap.c,v 1.105 2021/03/14 17:14:26 emil Exp $
+ * $LynxId: UCdomap.c,v 1.106 2021/06/09 22:29:08 tom Exp $
*
* UCdomap.c
* =========
@@ -984,7 +984,7 @@ int UCTransUniCharStr(char *outbuf,
if ((pout - outbuf) == 3) {
CTRACE((tfp,
"It seems to be a JIS X 0201 code(%" PRI_UCode_t
- "). Not supported.\n", unicode));
+ "). Not supported.\n", CAST_UCode_t (unicode)));
pin = str;
inleft = 2;
pout = outbuf;
diff --git a/src/parsdate.c b/src/parsdate.c
index 17a6d8e2..a38f33c0 100644
--- a/src/parsdate.c
+++ b/src/parsdate.c
@@ -3,9 +3,9 @@
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
#define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-#define YYPATCH 20190617
+#define YYMAJOR 2
+#define YYMINOR 0
+#define YYPATCH 20210520
#define YYEMPTY (-1)
#define yyclearin (yychar = YYEMPTY)
@@ -22,7 +22,7 @@
#include <LYLeaks.h>
/*
- * $LynxId: parsdate.c,v 1.28 2019/08/28 23:01:49 tom Exp $
+ * $LynxId: parsdate.c,v 1.29 2021/06/08 23:03:24 tom Exp $
*
* This module is adapted and extended from tin, to use for LYmktime().
*
@@ -160,7 +160,7 @@ static void date_error(const char GCC_UNUSED *s)
#ifndef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
#line 139 "./parsdate.y"
-typedef union {
+typedef union YYSTYPE {
time_t Number;
enum _MERIDIAN Meridian;
} YYSTYPE;
@@ -213,7 +213,7 @@ extern int YYPARSE_DECL();
#define tZONE 265
#define tDST 266
#define YYERRCODE 256
-typedef short YYINT;
+typedef int YYINT;
static const YYINT yylhs[] = { -1,
0, 0, 4, 4, 4, 4, 4, 4, 5, 5,
5, 5, 5, 2, 2, 2, 2, 2, 1, 6,
@@ -929,6 +929,7 @@ static int GetTimeInfo(TIMEINFO * Now)
#endif /* !defined(DONT_HAVE_TM_GMTOFF) */
/* Get the basic time. */
+ memset(Now, 0, sizeof(TIMEINFO));
#if defined(HAVE_GETTIMEOFDAY)
if (gettimeofday(&tv, (struct timezone *) NULL) == -1)
return -1;
@@ -1048,7 +1049,7 @@ time_t parsedate(char *p,
* from the error return value. (Alternately could set errno on error.) */
return (Start == BAD_TIME) ? 0 : Start;
}
-#line 1052 "y.tab.c"
+#line 1053 "y.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -1533,7 +1534,7 @@ case 35:
yyval.Meridian = yystack.l_mark[0].Meridian;
}
break;
-#line 1537 "y.tab.c"
+#line 1538 "y.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/src/parsdate.y b/src/parsdate.y
index 282fa29b..d6655140 100644
--- a/src/parsdate.y
+++ b/src/parsdate.y
@@ -3,7 +3,7 @@
#include <LYLeaks.h>
/*
- * $LynxId: parsdate.y,v 1.30 2019/08/28 23:00:39 tom Exp $
+ * $LynxId: parsdate.y,v 1.31 2021/06/08 23:01:28 tom Exp $
*
* This module is adapted and extended from tin, to use for LYmktime().
*
@@ -869,6 +869,7 @@ static int GetTimeInfo(TIMEINFO * Now)
#endif /* !defined(DONT_HAVE_TM_GMTOFF) */
/* Get the basic time. */
+ memset(Now, 0, sizeof(TIMEINFO));
#if defined(HAVE_GETTIMEOFDAY)
if (gettimeofday(&tv, (struct timezone *) NULL) == -1)
return -1;