On 2023/05/14 18:03:17 -0600, "Theo de Raadt" <[email protected]> wrote:
> Omar Polo <[email protected]> wrote:
> > On 2023/05/10 09:30:12 +0200, Theo Buehler <[email protected]> wrote:
> > > > I forgot to include one off_t cast since it was in a different
> > > > directory and -even if off topic because it's not in portable- instead
> > > > of "const"-ify only tz why don't mark as const also the two arrays day
> > > > and month?
> > >
> > > ok.
> > >
> > > The previous diff used (long long int) and this one now uses (long long).
> > > Would be nice to be consistent.
> >
> > Yes, indeed. smtpd uses `long long int', while for mail.local doesn't
> > have any. I'll go with `long long int' for consistency, typed `long
> > long' out of muscular memory.
>
> I think it is wrong for smtpd to use "long long int". It is pointless
> silliness, and there is more value in being idiomatically identical with
> the greater body of code.
ack (fwiw I prefer long long too). Here's s/long long int/long long/g,
ok?
Index: libexec/mail.local/mail.local.c
===================================================================
RCS file: /cvs/src/libexec/mail.local/mail.local.c,v
retrieving revision 1.40
diff -u -p -r1.40 mail.local.c
--- libexec/mail.local/mail.local.c 10 May 2023 08:03:49 -0000 1.40
+++ libexec/mail.local/mail.local.c 15 May 2023 06:59:09 -0000
@@ -244,7 +244,7 @@ retry:
curoff = lseek(mbfd, 0, SEEK_END);
(void)snprintf(biffmsg, sizeof biffmsg, "%s@%lld\n", name,
- (long long int)curoff);
+ (long long)curoff);
if (lseek(fd, 0, SEEK_SET) == (off_t)-1) {
mwarn("temporary file: %s", strerror(errno));
goto bad;
Index: usr.sbin/smtpd/bounce.c
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/bounce.c,v
retrieving revision 1.88
diff -u -p -r1.88 bounce.c
--- usr.sbin/smtpd/bounce.c 4 May 2023 12:43:44 -0000 1.88
+++ usr.sbin/smtpd/bounce.c 15 May 2023 06:59:29 -0000
@@ -305,7 +305,7 @@ bounce_send(struct bounce_session *s, co
}
static const char *
-bounce_duration(long long int d)
+bounce_duration(long long d)
{
static char buf[32];
Index: usr.sbin/smtpd/lka_filter.c
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/lka_filter.c,v
retrieving revision 1.69
diff -u -p -r1.69 lka_filter.c
--- usr.sbin/smtpd/lka_filter.c 10 May 2023 07:20:20 -0000 1.69
+++ usr.sbin/smtpd/lka_filter.c 15 May 2023 06:59:29 -0000
@@ -933,13 +933,13 @@ filter_protocol_query(struct filter *fil
n = io_printf(lka_proc_get_io(filter->proc),
"filter|%s|%lld.%06ld|smtp-in|%s|%016"PRIx64"|%016"PRIx64"|%s|%s\n",
PROTOCOL_VERSION,
- (long long int)tv.tv_sec, tv.tv_usec,
+ (long long)tv.tv_sec, tv.tv_usec,
phase, reqid, token, fs->rdns, param);
else
n = io_printf(lka_proc_get_io(filter->proc),
"filter|%s|%lld.%06ld|smtp-in|%s|%016"PRIx64"|%016"PRIx64"|%s\n",
PROTOCOL_VERSION,
- (long long int)tv.tv_sec, tv.tv_usec,
+ (long long)tv.tv_sec, tv.tv_usec,
phase, reqid, token, param);
if (n == -1)
fatalx("failed to write to processor");
@@ -957,7 +957,7 @@ filter_data_query(struct filter *filter,
"filter|%s|%lld.%06ld|smtp-in|data-line|"
"%016"PRIx64"|%016"PRIx64"|%s\n",
PROTOCOL_VERSION,
- (long long int)tv.tv_sec, tv.tv_usec,
+ (long long)tv.tv_sec, tv.tv_usec,
reqid, token, line);
if (n == -1)
fatalx("failed to write to processor");
@@ -1374,7 +1374,7 @@ report_smtp_broadcast(uint64_t reqid, co
va_start(ap, format);
if (io_printf(lka_proc_get_io(rp->name),
"report|%s|%lld.%06ld|%s|%s|%016"PRIx64"%s",
- PROTOCOL_VERSION, (long long int)tv->tv_sec, tv->tv_usec,
+ PROTOCOL_VERSION, (long long)tv->tv_sec, tv->tv_usec,
direction, event, reqid,
format[0] != '\n' ? "|" : "") == -1 ||
io_vprintf(lka_proc_get_io(rp->name), format, ap) == -1)
Index: usr.sbin/smtpd/mail.maildir.c
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/mail.maildir.c,v
retrieving revision 1.16
diff -u -p -r1.16 mail.maildir.c
--- usr.sbin/smtpd/mail.maildir.c 10 May 2023 07:19:49 -0000 1.16
+++ usr.sbin/smtpd/mail.maildir.c 15 May 2023 06:59:29 -0000
@@ -171,7 +171,7 @@ maildir_engine(const char *dirname, int
(void)strlcpy(hostname, "localhost", sizeof hostname);
(void)snprintf(filename, sizeof filename, "%lld.%08x.%s",
- (long long int) time(NULL),
+ (long long) time(NULL),
arc4random(),
hostname);
Index: usr.sbin/smtpd/mta_session.c
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/mta_session.c,v
retrieving revision 1.147
diff -u -p -r1.147 mta_session.c
--- usr.sbin/smtpd/mta_session.c 26 Sep 2022 08:48:52 -0000 1.147
+++ usr.sbin/smtpd/mta_session.c 15 May 2023 06:59:30 -0000
@@ -1157,7 +1157,7 @@ mta_response(struct mta_session *s, char
s->rcptcount = 0;
if (s->relay->limits->sessdelay_transaction) {
log_debug("debug: mta: waiting for %llds before
next transaction",
- (long long
int)s->relay->limits->sessdelay_transaction);
+ (long
long)s->relay->limits->sessdelay_transaction);
s->hangon =
s->relay->limits->sessdelay_transaction -1;
s->flags |= MTA_HANGON;
runq_schedule(hangon,
@@ -1177,7 +1177,7 @@ mta_response(struct mta_session *s, char
}
if (s->relay->limits->sessdelay_transaction) {
log_debug("debug: mta: waiting for %llds after reset",
- (long long
int)s->relay->limits->sessdelay_transaction);
+ (long long)s->relay->limits->sessdelay_transaction);
s->hangon = s->relay->limits->sessdelay_transaction -1;
s->flags |= MTA_HANGON;
runq_schedule(hangon,
Index: usr.sbin/smtpd/smtpctl.c
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/smtpctl.c,v
retrieving revision 1.170
diff -u -p -r1.170 smtpctl.c
--- usr.sbin/smtpd/smtpctl.c 25 Feb 2022 17:31:40 -0000 1.170
+++ usr.sbin/smtpd/smtpctl.c 15 May 2023 06:59:30 -0000
@@ -136,7 +136,7 @@ offline_file(void)
FILE *fp;
if (!bsnprintf(path, sizeof(path), "%s%s/%lld.XXXXXXXXXX", PATH_SPOOL,
- PATH_OFFLINE, (long long int) time(NULL)))
+ PATH_OFFLINE, (long long) time(NULL)))
err(EX_UNAVAILABLE, "snprintf");
if ((fd = mkstemp(path)) == -1 || (fp = fdopen(fd, "w+")) == NULL) {