summaryrefslogtreecommitdiffstats
path: root/compat
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-14 07:04:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-14 07:04:09 (GMT)
commitbe3995f91a73707ad23aa2454b143f6ee0301005 (patch)
tree2a7de20e57494b77dec01639bf2a871d9573a514 /compat
parente05045246f6a09ad6c214cd7045e431e7c07a9fd (diff)
parentc9376306301e578615cfee52d2121f78cb31a225 (diff)
downloadtcl-be3995f91a73707ad23aa2454b143f6ee0301005.zip
tcl-be3995f91a73707ad23aa2454b143f6ee0301005.tar.gz
tcl-be3995f91a73707ad23aa2454b143f6ee0301005.tar.bz2
Merge 8.7
Diffstat (limited to 'compat')
-rw-r--r--compat/fake-rfc2553.c3
-rw-r--r--compat/gettod.c3
-rw-r--r--compat/mkstemp.c13
-rw-r--r--compat/opendir.c12
-rw-r--r--compat/strstr.c4
-rw-r--r--compat/strtol.c2
-rw-r--r--compat/strtoul.c6
-rw-r--r--compat/waitpid.c2
8 files changed, 24 insertions, 21 deletions
diff --git a/compat/fake-rfc2553.c b/compat/fake-rfc2553.c
index c8e69400..29e2b56 100644
--- a/compat/fake-rfc2553.c
+++ b/compat/fake-rfc2553.c
@@ -73,6 +73,7 @@ int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
struct hostent *hp;
char tmpserv[16];
+ (void)salen;
if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET)
return (EAI_FAMILY);
@@ -153,7 +154,7 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
{
struct addrinfo *ai;
- ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
+ ai = (struct addrinfo *)malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
if (ai == NULL)
return (NULL);
diff --git a/compat/gettod.c b/compat/gettod.c
index ca20cf8..f6651d4 100644
--- a/compat/gettod.c
+++ b/compat/gettod.c
@@ -21,10 +21,11 @@ gettimeofday(
struct timezone *tz)
{
struct timeb t;
+ (void)tz;
ftime(&t);
tp->tv_sec = t.time;
- tp->tv_usec = t. millitm * 1000;
+ tp->tv_usec = t.millitm * 1000;
return 0;
}
diff --git a/compat/mkstemp.c b/compat/mkstemp.c
index 1a44dfa..feccfbb 100644
--- a/compat/mkstemp.c
+++ b/compat/mkstemp.c
@@ -13,6 +13,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
/*
*----------------------------------------------------------------------
@@ -32,19 +33,19 @@
int
mkstemp(
- char *template) /* Template for filename. */
+ char *tmpl) /* Template for filename. */
{
static const char alphanumerics[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- register char *a, *b;
+ char *a, *b;
int fd, count, alphanumericsLen = strlen(alphanumerics); /* == 62 */
- a = template + strlen(template);
- while (a > template && *(a-1) == 'X') {
+ a = tmpl + strlen(tmpl);
+ while (a > tmpl && *(a-1) == 'X') {
a--;
}
- if (a == template) {
+ if (a == tmpl) {
errno = ENOENT;
return -1;
}
@@ -71,7 +72,7 @@ mkstemp(
* Template is now realized; try to open (with correct options).
*/
- fd = open(template, O_RDWR|O_CREAT|O_EXCL, 0600);
+ fd = open(tmpl, O_RDWR|O_CREAT|O_EXCL, 0600);
} while (fd == -1 && errno == EEXIST && --count > 0);
return fd;
diff --git a/compat/opendir.c b/compat/opendir.c
index 3525093..13eb974 100644
--- a/compat/opendir.c
+++ b/compat/opendir.c
@@ -20,9 +20,9 @@ DIR *
opendir(
char *name)
{
- register DIR *dirp;
- register int fd;
- char *myname;
+ DIR *dirp;
+ int fd;
+ const char *myname;
myname = ((*name == '\0') ? "." : name);
if ((fd = open(myname, 0, 0)) == -1) {
@@ -65,9 +65,9 @@ struct olddirect {
struct dirent *
readdir(
- register DIR *dirp)
+ DIR *dirp)
{
- register struct olddirect *dp;
+ struct olddirect *dp;
static struct dirent dir;
for (;;) {
@@ -101,7 +101,7 @@ readdir(
void
closedir(
- register DIR *dirp)
+ DIR *dirp)
{
close(dirp->dd_fd);
dirp->dd_fd = -1;
diff --git a/compat/strstr.c b/compat/strstr.c
index e3b9b8d..206dca9 100644
--- a/compat/strstr.c
+++ b/compat/strstr.c
@@ -36,10 +36,10 @@
char *
strstr(
- register char *string, /* String to search. */
+ char *string, /* String to search. */
char *substring) /* Substring to try to find in string. */
{
- register char *a, *b;
+ char *a, *b;
/*
* First scan quickly through the two strings looking for a
diff --git a/compat/strtol.c b/compat/strtol.c
index b7f6919..22cc1eb 100644
--- a/compat/strtol.c
+++ b/compat/strtol.c
@@ -45,7 +45,7 @@ strtol(
* hex, "0" means octal, anything else means
* decimal. */
{
- register const char *p;
+ const char *p;
long result;
/*
diff --git a/compat/strtoul.c b/compat/strtoul.c
index e37eb05..bf16f7a 100644
--- a/compat/strtoul.c
+++ b/compat/strtoul.c
@@ -62,9 +62,9 @@ strtoul(
* hex, "0" means octal, anything else means
* decimal. */
{
- register const char *p;
- register unsigned long int result = 0;
- register unsigned digit;
+ const char *p;
+ unsigned long int result = 0;
+ unsigned digit;
int anyDigits = 0;
int negative=0;
int overflow=0;
diff --git a/compat/waitpid.c b/compat/waitpid.c
index 707018d..cf025b0 100644
--- a/compat/waitpid.c
+++ b/compat/waitpid.c
@@ -70,7 +70,7 @@ waitpid(
int options) /* OR'ed combination of WNOHANG and
* WUNTRACED. */
{
- register WaitInfo *waitPtr, *prevPtr;
+ WaitInfo *waitPtr, *prevPtr;
pid_t result;
WAIT_STATUS_TYPE status;