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

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(-)

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
-- 
2.19.1.windows.1

  reply	other threads:[~2018-11-19 15:15 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 [this message]
2018-11-20  1:58       ` Junio C Hamano
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=15a7df69-25d8-c168-dd43-a43b7f0d34c1@cs-ware.de \
    --to=email@cs-ware.de \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.