"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Tracey Emery <tracey@traceyemery.net>
Subject:
Re: const-ify more tables
To:
Christian Weisgerber <naddy@mips.inka.de>, gameoftrees@openbsd.org
Date:
Thu, 17 Mar 2022 15:00:56 -0600

Download raw body.

Thread
On Thu, Mar 17, 2022 at 09:26:41PM +0100, Stefan Sperling wrote:
> On Thu, Mar 17, 2022 at 12:32:14PM -0600, Tracey Emery wrote:
> > On Thu, Mar 17, 2022 at 06:51:44PM +0100, Christian Weisgerber wrote:
> > > The ongoing const-ification commits for the OpenBSD kernel made me
> > > look again at got; this const-ifies some more tables.
> > > 
> > > OK?
> > > 
> > > (tracey, gotweb doesn't build because of a write-only variable
> > > warning.)
> > 
> > Thanks. I'll look when I get some time. I think we're up to at least
> > three users. :D
> 
> This makes gotweb compile.

Apologies, I already committed this fix.

> 
> The variables were indeed unused in this loop. I don't understand what
> this code does, but it does not produce any output for the rendered page.
> 
> The main loop above this one contains the same variables and is using
> them as part of data rendered to the page. I guess this was a copy-pasto?
> 
> ok?
> 
> diff d58ddaf3fc10239711ae7a88664e3a100567ba3c /home/stsp/src/got
> blob - 3d41e56213bc4d3fd6b1706e030dcca8520d7b4f
> file + gotweb/gotweb.c
> --- gotweb/gotweb.c
> +++ gotweb/gotweb.c
> @@ -3386,8 +3386,6 @@ prev:
>  	commit_found = 0;
>  	TAILQ_FOREACH_REVERSE(re, &refs, got_reflist_head, entry) {
>  		const char *refname;
> -		const char *tagger;
> -		time_t tagger_time;
>  		struct got_object_id *id;
>  		struct got_commit_object *commit = NULL;
>  
> @@ -3413,15 +3411,10 @@ prev:
>  				free(id);
>  				goto done;
>  			}
> -			tagger = got_object_commit_get_committer(commit);
> -			tagger_time =
> -			    got_object_commit_get_committer_time(commit);
>  			error = got_object_id_str(&id_str, id);
>  			free(id);
>  		} else {
>  			free(id);
> -			tagger = got_object_tag_get_tagger(tag);
> -			tagger_time = got_object_tag_get_tagger_time(tag);
>  			error = got_object_id_str(&id_str,
>  			    got_object_tag_get_object_id(tag));
>  		}
> 

-- 

Tracey Emery