zsh-workers
 help / color / mirror / code / Atom feed
* Another unused function argument in sched.c
@ 2016-01-29 15:06 Jun T.
  2016-02-03 15:17 ` Jun T.
  0 siblings, 1 reply; 3+ messages in thread
From: Jun T. @ 2016-01-29 15:06 UTC (permalink / raw)
  To: zsh-workers

In function schedaddtimed(time_t t) (Src/Builtins/sched.c, line 61)
the argument 't' is not used.

When this function is called (4 times in this file), the argument is
always equal to schedcmds->time, so the function should work fine.

But it would better to either modify line 72 to use 't',
or remove the argument from the function.
# I don't know which is better.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Another unused function argument in sched.c
  2016-01-29 15:06 Another unused function argument in sched.c Jun T.
@ 2016-02-03 15:17 ` Jun T.
  2016-02-03 15:44   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Jun T. @ 2016-02-03 15:17 UTC (permalink / raw)
  To: zsh-workers


2016/01/30 00:06, I wrote:

> In function schedaddtimed(time_t t) (Src/Builtins/sched.c, line 61)
> the argument 't' is not used.

Is this OK? (i.e., remove the argument 't')

diff --git a/Src/Builtins/sched.c b/Src/Builtins/sched.c
index 1b9c68f..70625ed 100644
--- a/Src/Builtins/sched.c
+++ b/Src/Builtins/sched.c
@@ -58,7 +58,7 @@ static int schedcmdtimed;
 
 /**/
 static void
-schedaddtimed(time_t t)
+schedaddtimed(void)
 {
     /*
      * The following code shouldn't be necessary and indicates
@@ -140,7 +140,7 @@ checksched(void)
 	     */
 	    DPUTS(timedfns && firstnode(timedfns),
 		  "BUG: already timed fn (1)");
-	    schedaddtimed(schedcmds->time);
+	    schedaddtimed();
 	}
     }
 }
@@ -180,7 +180,7 @@ bin_sched(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func))
 		schedcmds = sch->next;
 		if (schedcmds) {
 		    DPUTS(timedfns && firstnode(timedfns), "BUG: already timed fn (2)");
-		    schedaddtimed(schedcmds->time);
+		    schedaddtimed();
 		}
 	    }
 	    zsfree(sch->cmd);
@@ -317,7 +317,7 @@ bin_sched(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func))
 	    sch->next = schedcmds;
 	    schedcmds = sch;
 	    DPUTS(timedfns && firstnode(timedfns), "BUG: already timed fn (3)");
-	    schedaddtimed(t);
+	    schedaddtimed();
 	} else {
 	    for (sch2 = schedcmds;
 		 sch2->next && sch2->next->time < sch->time;
@@ -330,7 +330,7 @@ bin_sched(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func))
 	sch->next = NULL;
 	schedcmds = sch;
 	DPUTS(timedfns && firstnode(timedfns), "BUG: already timed fn (4)");
-	schedaddtimed(t);
+	schedaddtimed();
     }
     return 0;
 }




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Another unused function argument in sched.c
  2016-02-03 15:17 ` Jun T.
@ 2016-02-03 15:44   ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2016-02-03 15:44 UTC (permalink / raw)
  To: zsh-workers

On Thu, 4 Feb 2016 00:17:02 +0900
Jun T. <takimoto-j@kba.biglobe.ne.jp> wrote:
> 2016/01/30 00:06, I wrote:
> 
> > In function schedaddtimed(time_t t) (Src/Builtins/sched.c, line 61)
> > the argument 't' is not used.
> 
> Is this OK? (i.e., remove the argument 't')

Seems OK to me.

pws


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-03 15:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29 15:06 Another unused function argument in sched.c Jun T.
2016-02-03 15:17 ` Jun T.
2016-02-03 15:44   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).