]> diplodocus.org Git - nmh/commitdiff
sbr/dtime.c: Remove struct-assigning twscopy().
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 23 Apr 2017 08:48:13 +0000 (09:48 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 23 Apr 2017 08:48:13 +0000 (09:48 +0100)
Historically, twscopy() assigned all the struct's members individually,
but that was `#if 0'd as far back as the repository goes.  The one
caller now uses assignment, making clear the direction of data flow.

h/tws.h
sbr/dtime.c
uip/picksbr.c

diff --git a/h/tws.h b/h/tws.h
index 9e0f9b6..051ee4c 100644 (file)
--- a/h/tws.h
+++ b/h/tws.h
@@ -55,7 +55,6 @@ struct tws *dlocaltime (time_t *);
 struct tws *dgmtime (time_t *);
 char *dasctime (struct tws *, int);
 char *dtimezone (int, int);
-void twscopy (struct tws *, struct tws *);
 int twsort (struct tws *, struct tws *);
 time_t dmktime (struct tws *);
 void set_dotw (struct tws *);
index 52f3a79..14051b9 100644 (file)
@@ -393,17 +393,6 @@ set_dotw (struct tws *tw)
 }
 
 
-/*
- * Copy nmh time structure
- */
-
-void
-twscopy (struct tws *tb, struct tws *tw)
-{
-    *tb = *tw;  /* struct copy */
-}
-
-
 /*
  * Compare two nmh time structures
  */
index ba25e24..c29e669 100644 (file)
@@ -841,7 +841,7 @@ tcompile (char *ap, struct tws *tb, int isafter)
     if ((tw = tws_parse (ap, isafter)) == NULL)
        return 0;
 
-    twscopy (tb, tw);
+    *tb = *tw;
     return 1;
 }