Skip to content

Commit

Permalink
fixed -Wincompatible-pointer-types compilation warnings onsubstdio.h
Browse files Browse the repository at this point in the history
  • Loading branch information
sagredo-dev committed Apr 6, 2024
1 parent bfad8fe commit 67bdb4b
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion condredirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

struct qmail qqt;

int mywrite(fd,buf,len) int fd; char *buf; int len;
ssize_t mywrite(fd,buf,len) int fd; char *buf; int len;
{
qmail_put(&qqt,buf,len);
return len;
Expand Down
2 changes: 1 addition & 1 deletion conf-spawn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1000
509

This is a silent concurrency limit. You can't set it above 255. On some
systems you can't set it above 125. qmail will refuse to compile if the
Expand Down
2 changes: 1 addition & 1 deletion forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

struct qmail qqt;

int mywrite(fd,buf,len) int fd; char *buf; int len;
ssize_t mywrite(fd,buf,len) int fd; char *buf; int len;
{
qmail_put(&qqt,buf,len);
return len;
Expand Down
4 changes: 2 additions & 2 deletions qmail-pop3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@

void die() { _exit(0); }

int saferead(fd,buf,len) int fd; char *buf; int len;
ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
{
int r;
r = timeoutread(1200,fd,buf,len);
if (r <= 0) die();
return r;
}

int safewrite(fd,buf,len) int fd; char *buf; int len;
ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
{
int r;
r = timeoutwrite(1200,fd,buf,len);
Expand Down
4 changes: 2 additions & 2 deletions qmail-popup.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

void die() { _exit(1); }

int saferead(fd,buf,len) int fd; char *buf; int len;
ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
{
int r;
r = timeoutread(1200,fd,buf,len);
if (r <= 0) die();
return r;
}

int safewrite(fd,buf,len) int fd; char *buf; int len;
ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
{
int r;
r = timeoutwrite(1200,fd,buf,len);
Expand Down
4 changes: 2 additions & 2 deletions qmail-qmqpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ void die_format() { _exit(91); }
int lasterror = 55;
int qmqpfd;

int saferead(fd,buf,len) int fd; char *buf; int len;
ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
{
int r;
r = timeoutread(60,qmqpfd,buf,len);
if (r <= 0) die_conn();
return r;
}
int safewrite(fd,buf,len) int fd; char *buf; int len;
ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
{
int r;
r = timeoutwrite(60,qmqpfd,buf,len);
Expand Down
4 changes: 2 additions & 2 deletions qmail-qmqpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

void resources() { _exit(111); }

int safewrite(fd,buf,len) int fd; char *buf; int len;
ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
{
int r;
r = write(fd,buf,len);
if (r <= 0) _exit(0);
return r;
}
int saferead(fd,buf,len) int fd; char *buf; int len;
ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
{
int r;
r = read(fd,buf,len);
Expand Down
4 changes: 2 additions & 2 deletions qmail-qmtpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
void badproto() { _exit(100); }
void resources() { _exit(111); }

int safewrite(fd,buf,len) int fd; char *buf; int len;
ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
{
int r;
r = write(fd,buf,len);
Expand All @@ -28,7 +28,7 @@ int safewrite(fd,buf,len) int fd; char *buf; int len;
char ssoutbuf[256];
substdio ssout = SUBSTDIO_FDBUF(safewrite,1,ssoutbuf,sizeof ssoutbuf);

int saferead(fd,buf,len) int fd; char *buf; int len;
ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
{
int r;
substdio_flush(&ssout);
Expand Down
4 changes: 2 additions & 2 deletions qmail-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int timeoutconnect = 60;
int smtpfd;
int timeout = 1200;

int saferead(fd,buf,len) int fd; char *buf; int len;
ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
{
int r;
#ifdef TLS
Expand All @@ -155,7 +155,7 @@ int saferead(fd,buf,len) int fd; char *buf; int len;
if (r <= 0) dropped();
return r;
}
int safewrite(fd,buf,len) int fd; char *buf; int len;
ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
{
int r;
#ifdef TLS
Expand Down
4 changes: 2 additions & 2 deletions qmail-smtpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static const char *protocol = "SMTP";
char *remoteip4;
/* end spf ipv6 fix */

int safewrite(fd,buf,len) int fd; char *buf; int len;
ssize_t safewrite(fd,buf,len) int fd; char *buf; int len;
{
int r;
#ifdef TLS
Expand Down Expand Up @@ -1680,7 +1680,7 @@ void smtp_rcpt(arg) char *arg; {
*/
}

int saferead(fd,buf,len) int fd; char *buf; int len;
ssize_t saferead(fd,buf,len) int fd; char *buf; int len;
{
int r;
flush();
Expand Down
2 changes: 1 addition & 1 deletion srsfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void printheader() {
if (!stralloc_copys(&line,"")) die_nomem();
}

int mywrite(fd,buf,len) int fd; char *buf; int len;
ssize_t mywrite(fd,buf,len) int fd; char *buf; int len;
{
int i;
if (flagbody) {
Expand Down
4 changes: 2 additions & 2 deletions subfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extern substdio *subfdout;
extern substdio *subfdoutsmall;
extern substdio *subfderr;

extern int subfd_read();
extern int subfd_readsmall();
extern ssize_t subfd_read();
extern ssize_t subfd_readsmall();

#endif
2 changes: 1 addition & 1 deletion subfdin.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "substdio.h"
#include "subfd.h"

int subfd_read(fd,buf,len) int fd; char *buf; int len;
ssize_t subfd_read(fd,buf,len) int fd; char *buf; int len;
{
if (substdio_flush(subfdout) == -1) return -1;
return read(fd,buf,len);
Expand Down
2 changes: 1 addition & 1 deletion subfdins.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "substdio.h"
#include "subfd.h"

int subfd_readsmall(fd,buf,len) int fd; char *buf; int len;
ssize_t subfd_readsmall(fd,buf,len) int fd; char *buf; int len;
{
if (substdio_flush(subfdoutsmall) == -1) return -1;
return read(fd,buf,len);
Expand Down
2 changes: 1 addition & 1 deletion substdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

void substdio_fdbuf(s,op,fd,buf,len)
register substdio *s;
register int (*op)();
register ssize_t (*op)();
register int fd;
register char *buf;
register int len;
Expand Down
4 changes: 3 additions & 1 deletion substdio.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <sys/types.h>

#ifndef SUBSTDIO_H
#define SUBSTDIO_H

Expand All @@ -6,7 +8,7 @@ typedef struct substdio {
int p;
int n;
int fd;
int (*op)();
ssize_t (*op)();
} substdio;

#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
Expand Down

0 comments on commit 67bdb4b

Please sign in to comment.