[Scummvm-git-logs] scummvm master -> e4fa9174b8835cafb5a2427e264aab7ad68c6c9d

bluegr bluegr at gmail.com
Mon Feb 24 14:17:39 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e4fa9174b8 ULTIMA8: Clean up unused functions in istring


Commit: e4fa9174b8835cafb5a2427e264aab7ad68c6c9d
    https://github.com/scummvm/scummvm/commit/e4fa9174b8835cafb5a2427e264aab7ad68c6c9d
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2020-02-24T16:17:35+02:00

Commit Message:
ULTIMA8: Clean up unused functions in istring

Changed paths:
    engines/ultima/ultima8/misc/istring.cpp
    engines/ultima/ultima8/misc/istring.h


diff --git a/engines/ultima/ultima8/misc/istring.cpp b/engines/ultima/ultima8/misc/istring.cpp
index fc72606..fc8c0e6 100644
--- a/engines/ultima/ultima8/misc/istring.cpp
+++ b/engines/ultima/ultima8/misc/istring.cpp
@@ -27,42 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 namespace Ultima {
 namespace Ultima8 {
 
-int strncasecmp(const char *s1, const char *s2, uint32 length) {
-	uint32  c1, c2;
-
-	do {
-		c1 = *s1++;
-		c2 = *s2++;
-
-		if (!length--)
-			return 0;       // strings are equal until end point
-
-		if (c1 != c2) {
-			if (c1 >= 'a' && c1 <= 'z')
-				c1 -= ('a' - 'A');
-			if (c2 >= 'a' && c2 <= 'z')
-				c2 -= ('a' - 'A');
-			if (c1 != c2)
-				return (c1 < c2) ? -1 : 1; // strings not equal
-		}
-	} while (c1);
-
-	return 0;       // strings are equal
-}
-
-int strcasecmp(const char *s1, const char *s2) {
-	return strncasecmp(s1, s2, 2147483647);
-}
-
-void strcpy_s(char *dest, size_t size, const char *src) {
-	if (size == 0) return;
-	char *end = dest + size;
-	do {
-		if (!(*dest++ = *src++)) return;
-	} while (dest != end);
-	dest[-1] = 0;
-}
-
 void istring::split(Common::Array<istring> &arr) const {
 	const char *startP = _str, *endP;
 
diff --git a/engines/ultima/ultima8/misc/istring.h b/engines/ultima/ultima8/misc/istring.h
index e5ca3d5..a89fe77 100644
--- a/engines/ultima/ultima8/misc/istring.h
+++ b/engines/ultima/ultima8/misc/istring.h
@@ -27,40 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "ultima/shared/std/string.h"
 #include "common/array.h"
 
-#ifdef strcasecmp
-#undef strcasecmp
-#endif
-
-#ifdef strncasecmp
-#undef strncasecmp
-#endif
-
 namespace Ultima {
 namespace Ultima8 {
 
-extern int strcasecmp(const char *s1, const char *s2);
-extern int strncasecmp(const char *s1, const char *s2, uint32 length);
-
-//! Safe strcpy with size checking
-void strcpy_s(char *dest, size_t size, const char *src);
-//! Safe strcpy with size checking from dest array size
-template<size_t size> inline void strcpy_s(char (& dest)[size], const char *src) {
-	strcpy_s(dest, size, src);
-}
-
-//! Safe strcat with size checking
-inline char *strcat_s(char *dest, size_t size, const char *src) {
-	size_t cur = Std::strlen(dest);
-	if (cur < size) strcpy_s(dest + cur, size - cur, src);
-	return dest;
-}
-//! Safe strcat with size checking from dest array size
-template<size_t size> inline char (&strcat_s(char (& dest)[size], const char *src))[size]  {
-	size_t cur = Std::strlen(dest);
-	if (cur < size) strcpy_s(dest + cur, size - cur, src);
-	return dest;
-}
-
 class istring : public Std::string {
 public:
 	istring() : Std::string() {}




More information about the Scummvm-git-logs mailing list