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: Sun, 18 Nov 2018 22:02:02 +0100 [thread overview]
Message-ID: <ad85731f-2c47-f455-c9d3-d47a5fj1e29@cs-ware.de> (raw)
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 580bb55bf4..ea6527f8b6 100644
--- a/compat/msvc.h
+++ b/compat/msvc.h
@@ -14,13 +14,7 @@
#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);
-}
+#define strcasecmp _stricmp
#undef ERROR
--
2.19.1.windows.1
next reply other threads:[~2018-11-18 21:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-18 21:02 Sven Strickroth [this message]
2018-11-18 21:58 ` [PATCH] msvc: Directly use MS version (_stricmp) of strcasecmp 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
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad85731f-2c47-f455-c9d3-d47a5fj1e29@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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).