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

Re: [PATCH] Correct dir.c to compile on Solaris 9

From
Junio C Hamano <junkio@cox.net>
Date
Apr 15, 2007, 22:48 UTC
Message-ID
<7vbqhp2qzv.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200704152354.55097.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:
Show 27 quoted lines
> The table lookup *is* faster (meastured), but that doesn't make a big difference
> on the total CPU used. The muliple-case-per line thing (both versions, however makes is hard
> to read.  
>
> -- robin
>
> diff --git a/dir.c b/dir.c
> index 7426fde..0780f23 100644
> --- a/dir.c
> +++ b/dir.c
> @@ -423,12 +423,22 @@ static int cmp_name(const void *p1, const void *p2)
>   */
>  static int simple_length(const char *match)
>  {
> -       const char special[256] = {
> -               [0] = 1, ['?'] = 1,
> -               ['\\'] = 1, ['*'] = 1,
> -               ['['] = 1
> -       };
>         int len = -1;
> +       static const char special[256] = {
> +               1,0,0,0,0,0,0,0, /* nul */
> +               0,0,0,0,0,0,0,0,
> +               0,0,0,0,0,0,0,0,
> +               0,0,0,0,0,0,0,0,
> +               0,0,0,0,0,0,0,0,
> +               0,0,1,0,0,0,0,0, /* * */

I wonder if folding this into ctype.c::sane_ctype[] is an option...

Previous: Robin Rosenberg
Message 5 of 5 in “Correct dir.c to compile on Solaris 9”
  1. Correct dir.c to compile on Solaris 9Shawn O. Pearce, Apr 15, 2007
  2. Johannes SchindelinApr 15, 2007
  3. Josef WeidendorferApr 15, 2007
  4. Robin RosenbergApr 15, 2007
  5. Junio C HamanoApr 15, 2007

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.