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

Victor Toso victortoso at redhat.com
Tue Apr 30 08:13:39 UTC 2019


Hi,

On Fri, Apr 26, 2019 at 08:20:33AM +0100, Frediano Ziglio wrote:
> _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>

Not used since commit ae4a4f0 in 2015-04-30
Sure,
Acked-by: Victor Toso <victortoso 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
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190430/1f0e6c96/attachment.sig>


More information about the Spice-devel mailing list