[Spice-devel] [vdagent-win PATCH] Remove some unused definitions

Frediano Ziglio fziglio at redhat.com
Fri Apr 26 07:20:33 UTC 2019


_ftime_s, vdagent_strcat_s and vdagent_strcpy_s are not used.
Code is using different string functions.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 common/vdcommon.cpp | 42 ------------------------------------------
 common/vdcommon.h   | 24 ------------------------
 2 files changed, 66 deletions(-)

diff --git a/common/vdcommon.cpp b/common/vdcommon.cpp
index 36faa2d..bd746bd 100644
--- a/common/vdcommon.cpp
+++ b/common/vdcommon.cpp
@@ -37,48 +37,6 @@ SystemVersion supported_system_version()
     return SYS_VER_UNSUPPORTED;
 }
 
-#ifndef HAVE_STRCAT_S
-errno_t vdagent_strcat_s(char *strDestination,
-                         size_t numberOfElements,
-                         const char *strSource)
-{
-    if (strDestination == NULL)
-        return EINVAL;
-    if (strSource == NULL) {
-        strDestination[0] = '\0';
-        return EINVAL;
-    }
-    if (strlen(strDestination) + strlen(strSource) + 1 > numberOfElements) {
-        strDestination[0] = '\0';
-        return ERANGE;
-    }
-
-    strcat(strDestination, strSource);
-
-    return 0;
-}
-#endif
-
-#ifndef HAVE_STRCPY_S
-errno_t vdagent_strcpy_s(char *strDestination,
-                         size_t numberOfElements,
-                         const char *strSource)
-{
-    if (strDestination == NULL)
-        return EINVAL;
-    strDestination[0] = '\0';
-    if (strSource == NULL)
-        return EINVAL;
-    if (strlen(strSource) + 1 > numberOfElements) {
-        return ERANGE;
-    }
-
-    strcpy(strDestination, strSource);
-
-    return 0;
-}
-#endif
-
 #ifndef HAVE_SWPRINTF_S
 int vdagent_swprintf_s(wchar_t *buf, size_t len, const wchar_t *format, ...)
 {
diff --git a/common/vdcommon.h b/common/vdcommon.h
index ac58efe..c846a7b 100644
--- a/common/vdcommon.h
+++ b/common/vdcommon.h
@@ -84,34 +84,10 @@ typedef Mutex mutex_t;
  * Currently Visual Studio builds are built with /MT (static mode) such that
  * those functions are not required to be in that dll on the guest.
  */
-#ifdef OLDMSVCRT
-#ifndef _ftime_s
-#define _ftime_s(timeb) _ftime(timeb)
-#endif
-#endif /* OLDMSVCRT */
-
 #ifdef _MSC_VER // compiling with Visual Studio
-#define HAVE_STRCAT_S 1
-#define HAVE_STRCPY_S 1
 #define HAVE_SWPRINTF_S 1
 #endif
 
-#ifdef HAVE_STRCAT_S
-#define vdagent_strcat_s strcat_s
-#else
-errno_t vdagent_strcat_s(char *strDestination,
-                         size_t numberOfElements,
-                         const char *strSource);
-#endif
-
-#ifdef HAVE_STRCPY_S
-#define vdagent_strcpy_s strcpy_s
-#else
-errno_t vdagent_strcpy_s(char *strDestination,
-                         size_t numberOfElements,
-                         const char *strSource);
-#endif
-
 #ifndef HAVE_SWPRINTF_S
 int vdagent_swprintf_s(wchar_t *buf, size_t len, const wchar_t *format, ...);
 #define swprintf_s vdagent_swprintf_s
-- 
2.20.1



More information about the Spice-devel mailing list