git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Sven Strickroth <email@cs-ware.de>
Cc: git@vger.kernel.org, peff@peff.net, Johannes.Schindelin@gmx.de
Subject: Re: [PATCH] msvc: Directly use MS version (_stricmp) of strcasecmp
Date: Tue, 20 Nov 2018 10:58:50 +0900	[thread overview]
Message-ID: <xmqqefbgcxwl.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <15a7df69-25d8-c168-dd43-a43b7f0d34c1@cs-ware.de> (Sven Strickroth's message of "Mon, 19 Nov 2018 16:14:42 +0100")

Sven Strickroth <email@cs-ware.de> writes:

> This also removes an implicit conversion from size_t (unsigned) to int (signed).
>
> _stricmp as well as _strnicmp are both available since VS2012.
>
> Signed-off-by: Sven Strickroth <email@cs-ware.de>
> ---
>  compat/msvc.h | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)

Will apply, thanks.

The substition from ftello with _ftelli64 does not appear in our
codebase yet, but it was easy enough to adjust the patch myself, so
no need to resend this patch.

> diff --git a/compat/msvc.h b/compat/msvc.h
> index e6e1a6bbf7..2d558bae14 100644
> --- a/compat/msvc.h
> +++ b/compat/msvc.h
> @@ -14,18 +14,12 @@
>  #define inline __inline
>  #define __inline__ __inline
>  #define __attribute__(x)
> +#define strcasecmp   _stricmp
>  #define strncasecmp  _strnicmp
>  #define ftruncate    _chsize
>  #define strtoull     _strtoui64
>  #define strtoll      _strtoi64
>  
> -static __inline int strcasecmp (const char *s1, const char *s2)
> -{
> -	int size1 = strlen(s1);
> -	int sisz2 = strlen(s2);
> -	return _strnicmp(s1, s2, sisz2 > size1 ? sisz2 : size1);
> -}
> -
>  #undef ERROR
>  
>  #define ftello _ftelli64

  reply	other threads:[~2018-11-20  1:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-18 21:02 [PATCH] msvc: Directly use MS version (_stricmp) of strcasecmp Sven Strickroth
2018-11-18 21:58 ` Jeff King
2018-11-19  2:02   ` Junio C Hamano
2018-11-19 15:14     ` Sven Strickroth
2018-11-20  1:58       ` Junio C Hamano [this message]
2018-11-20 20:52         ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqefbgcxwl.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=email@cs-ware.de \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).