tidying
authorJeremy Harris <jgh146exb@wizmail.org>
Sat, 26 Feb 2022 16:40:15 +0000 (16:40 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sat, 26 Feb 2022 16:41:43 +0000 (16:41 +0000)
src/exim_monitor/em_TextPop.c
src/src/dbfn.c
src/src/deliver.c
src/src/lookups/readsock.c
src/src/smtp_in.c
src/src/transports/smtp.c

index 7e8a2eba14489b80501f511667600a02132d9b9e..f8fdefbf3a324a88815a3c6e27c34ae36e7575f0 100644 (file)
@@ -246,7 +246,7 @@ Cardinal * num_params;
   Arg args[1];
 
 #ifdef notdef
-  if (ctx->text.source->Search == NULL) {
+  if (!ctx->text.source->Search) {
       XBell(XtDisplay(w), 0);
       return;
   }
@@ -279,16 +279,15 @@ Cardinal * num_params;
     return;
   }
 
-  if (ctx->text.search== NULL) {
+  if (!ctx->text.search) {
     ctx->text.search = XtNew(struct SearchAndReplace);
     ctx->text.search->search_popup = CreateDialog(w, ptr, "search",
                                                  AddSearchChildren);
     XtRealizeWidget(ctx->text.search->search_popup);
     SetWMProtocolTranslations(ctx->text.search->search_popup);
   }
-  else if (*num_params > 1) {
+  else if (*num_params > 1)
     XtVaSetValues(ctx->text.search->search_text, XtNstring, ptr, NULL);
-  }
 
   XtSetArg(args[0], XtNeditType,&edit_mode);
   XtGetValues(ctx->text.source, args, ONE);
index 29cd9e8b92d9d6774a07bcc808a794800fd4967b..9c64d6a525b11dfee57f32c707f8636bf6e838e1 100644 (file)
@@ -49,14 +49,14 @@ at DB release 4.3. */
 
 #if defined(USE_DB) && defined(DB_VERSION_STRING)
 void
-#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
+# if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
 dbfn_bdb_error_callback(const DB_ENV *dbenv, const char *pfx, const char *msg)
 {
 dbenv = dbenv;
-#else
+# else
 dbfn_bdb_error_callback(const char *pfx, char *msg)
 {
-#endif
+# endif
 pfx = pfx;
 log_write(0, LOG_MAIN, "Berkeley DB error: %s", msg);
 }
@@ -286,7 +286,7 @@ store the taint status with the data. */
 
 yield = store_get(EXIM_DATUM_SIZE(result_datum), TRUE);
 memcpy(yield, EXIM_DATUM_DATA(result_datum), EXIM_DATUM_SIZE(result_datum));
-if (length != NULL) *length = EXIM_DATUM_SIZE(result_datum);
+if (length) *length = EXIM_DATUM_SIZE(result_datum);
 
 EXIM_DATUM_FREE(result_datum);    /* Some DBM libs require freeing */
 return yield;
index 8db768dc9ae3cb91688692e087cbf498cfeeccbb..8322a367c16a25d459eaa1034ab600d4fb6c1e44 100644 (file)
@@ -5348,10 +5348,10 @@ Returns:       nothing
 */
 
 static void
-print_address_error(address_item *addr, FILE *f, uschar *t)
+print_address_error(address_item * addr, FILE * f, const uschar * t)
 {
 int count = Ustrlen(t);
-uschar *s = testflag(addr, af_pass_message) ? addr->message : NULL;
+uschar * s = testflag(addr, af_pass_message) ? addr->message : NULL;
 
 if (!s && !(s = addr->user_message))
   return;
@@ -5892,7 +5892,7 @@ if (message_logs)
     return continue_closedown();   /* yields DELIVER_NOT_ATTEMPTED */
     }
 
-  /* Make a C stream out of it. */
+  /* Make a stdio stream out of it. */
 
   if (!(message_log = fdopen(fd, "a")))
     {
@@ -6420,10 +6420,8 @@ while (addr_new)           /* Loop until all addresses dealt with */
   while (addr_new)
     {
     int rc;
-    uschar *p;
-    tree_node *tnode;
-    dbdata_retry *domain_retry_record;
-    dbdata_retry *address_retry_record;
+    tree_node * tnode;
+    dbdata_retry * domain_retry_record, * address_retry_record;
 
     addr = addr_new;
     addr_new = addr->next;
@@ -6640,8 +6638,7 @@ while (addr_new)           /* Loop until all addresses dealt with */
     /* Ensure that the domain in the unique field is lower cased, because
     domains are always handled caselessly. */
 
-    p = Ustrrchr(addr->unique, '@');
-    while (*p != 0) { *p = tolower(*p); p++; }
+    for (uschar * p = Ustrrchr(addr->unique, '@'); *p; p++) *p = tolower(*p);
 
     DEBUG(D_deliver|D_route) debug_printf("unique = %s\n", addr->unique);
 
index 61f7296188972b71bd22b8d98ad010328b26c156..44159455d9448d14bfac9f0453b2841604ee485e 100644 (file)
@@ -96,7 +96,7 @@ else
 
   sigalrm_seen = FALSE;
   ALARM(timeout);
-  rc = connect(cctx->sock, (struct sockaddr *)(&sockun), sizeof(sockun));
+  rc = connect(cctx->sock, (struct sockaddr *) &sockun, sizeof(sockun));
   ALARM_CLR(0);
   if (sigalrm_seen)
     {
index a48fac605c3f7b3d6eba45c608ea4d5e58df066d..9efc816fa8e56b91fdc537ed2ba25df30aa43340 100644 (file)
@@ -5440,7 +5440,7 @@ while (done <= 0)
        ACL may have delayed.  To handle cutthrough delivery enforce a dummy call
        to get the DATA command sent. */
 
-       if (acl_smtp_predata == NULL && cutthrough.cctx.sock < 0)
+       if (!acl_smtp_predata && cutthrough.cctx.sock < 0)
          rc = OK;
        else
          {
index 2f109a97f4ca1133ece3359126f4ae12404b839c..7d5eb35a5245c6e6ba5eadfff7c2f834107a91fd 100644 (file)
@@ -2015,44 +2015,31 @@ int yield = OK;
 uschar * tls_errstr;
 #endif
 
+/* Many lines of clearing individual elements of *sx that used to
+be here have been replaced by a full memset to zero (de41aff051).
+There are two callers, this file and verify.c .  Now we only set
+up nonzero elements. */
+
 sx->conn_args.ob = ob;
 
 sx->lmtp = strcmpic(ob->protocol, US"lmtp") == 0;
 sx->smtps = strcmpic(ob->protocol, US"smtps") == 0;
-/* sx->ok = FALSE; */
 sx->send_rset = TRUE;
 sx->send_quit = TRUE;
 sx->setting_up = TRUE;
 sx->esmtp = TRUE;
-/* sx->esmtp_sent = FALSE; */
-#ifdef SUPPORT_I18N
-/* sx->utf8_needed = FALSE; */
-#endif
 sx->dsn_all_lasthop = TRUE;
 #ifdef SUPPORT_DANE
-/* sx->conn_args.dane = FALSE; */
 sx->dane_required =
   verify_check_given_host(CUSS &ob->hosts_require_dane, sx->conn_args.host) == OK;
 #endif
-#ifndef DISABLE_PIPE_CONNECT
-/* sx->early_pipe_active = sx->early_pipe_ok = FALSE; */
-/* sx->ehlo_resp.cleartext_features = sx->ehlo_resp.crypted_features = 0; */
-/* sx->pending_BANNER = sx->pending_EHLO = sx->pending_MAIL = FALSE; */
-#endif
 
 if ((sx->max_mail = sx->conn_args.tblock->connection_max_messages) == 0) sx->max_mail = 999999;
 if ((sx->max_rcpt = sx->conn_args.tblock->max_addresses) == 0)           sx->max_rcpt = 999999;
-/* sx->peer_offered = 0; */
-/* sx->avoid_option = 0; */
 sx->igquotstr = US"";
 if (!sx->helo_data) sx->helo_data = ob->helo_data;
-#ifdef EXPERIMENTAL_DSN_INFO
-/* sx->smtp_greeting = NULL; */
-/* sx->helo_response = NULL; */
-#endif
 
 smtp_command = US"initial connection";
-/* sx->buffer[0] = '\0'; */
 
 /* Set up the buffer for reading SMTP response packets. */
 
@@ -2066,9 +2053,6 @@ sx->inblock.ptrend = sx->inbuffer;
 sx->outblock.buffer = sx->outbuffer;
 sx->outblock.buffersize = sizeof(sx->outbuffer);
 sx->outblock.ptr = sx->outbuffer;
-/* sx->outblock.cmd_count = 0; */
-/* sx->outblock.authenticating = FALSE; */
-/* sx->outblock.conn_args = NULL; */
 
 /* Reset the parameters of a TLS session. */
 
@@ -3716,12 +3700,11 @@ BOOL tcw_done = FALSE, tcw = FALSE;
 memset(sx, 0, sizeof(*sx));
 sx->addrlist = addrlist;
 sx->conn_args.host = host;
-sx->conn_args.host_af = host_af,
+sx->conn_args.host_af = host_af;
 sx->port = defport;
 sx->conn_args.interface = interface;
 sx->helo_data = NULL;
 sx->conn_args.tblock = tblock;
-/* sx->verify = FALSE; */
 gettimeofday(&sx->delivery_start, NULL);
 sx->sync_addr = sx->first_addr = addrlist;