git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] connect.c: remove a few globals by using git_config callback data

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 11, 2009, 13:28 UTC
Message-ID
<alpine.DEB.1.00.0903111427120.10498@intel-tinevez-2-302>
In-Reply-To
<40aa078e0903110617g60e0d7d0x1e0d94e44ef89f40@mail.gmail.com>
Hi,
On Wed, 11 Mar 2009, Erik Faye-Lund wrote:
Show 19 quoted lines
> On Wed, Mar 11, 2009 at 12:52 PM, Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
> >> @@ -383,6 +381,8 @@ static int git_proxy_command_options(const char *var, const char *value,
> >>               const char *for_pos;
> >>               int matchlen = -1;
> >>               int hostlen;
> >> +             const char *rhost_name = cb;
> >> +             int rhost_len = strlen(rhost_name);
> >
> > I see that you still calculate the length everytime
> > git_proxy_command_options() is called -- which is for every config
> > variable.
> 
> Actually, the length-calculation is now moved inside the check for
> "core.gitproxy", so it should only trigger for each config variable
> that is "core.gitproxy". Hopefully, this should usually be just once
> ;)
> 
> This change was suggested as a compromise by Junio.

Ah, okay, I am lacking time to read all emails today, so I missed that one.

Show 8 quoted lines
> >> +     git_config(git_proxy_command_options, (void*)host);
> >
> > The (void *) should not be needed.
> 
> Actually, it is - it casts away the const-ness of the string. Removing
> the cast generates a warning on my installation of GCC. Perhaps I
> should have made that clearer by casting to "char*" instead of
> "void*"?

Oh, that's why... Thanks for the clarification! Now only a space between the void and the star, and I am happy!

Ciao, Dscho

Previous: Erik Faye-Lund
Message 4 of 4 in “connect.c: remove a few globals by using git_config callback data”
  1. connect.c: remove a few globals by using git_config callback dataErik Faye-Lund, Mar 11, 2009
  2. Johannes SchindelinMar 11, 2009
  3. Erik Faye-LundMar 11, 2009
  4. Johannes SchindelinMar 11, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.