From 7dfb3eacd8f7f32a3338c28a0f9286360878dc44 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 24 Apr 2019 21:07:38 +0300 Subject: warning fix --- include/m_core.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/m_core.h b/include/m_core.h index 71a414de83..086b78cbb7 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -304,10 +304,10 @@ MIR_CORE_DLL(wchar_t*) mir_wstrndup(const wchar_t *str, size_t len); /////////////////////////////////////////////////////////////////////////////// // print functions -MIR_CORE_DLL(int) mir_snprintf(char *buffer, size_t count, _Printf_format_string_ const char* fmt, ...); -MIR_CORE_DLL(int) mir_snwprintf(wchar_t *buffer, size_t count, _Printf_format_string_ const wchar_t* fmt, ...); -MIR_CORE_DLL(int) mir_vsnprintf(char *buffer, size_t count, _Printf_format_string_ const char* fmt, va_list va); -MIR_CORE_DLL(int) mir_vsnwprintf(wchar_t *buffer, size_t count, _Printf_format_string_ const wchar_t* fmt, va_list va); +MIR_CORE_DLL(int) mir_snprintf(_Pre_notnull_ _Always_(_Post_z_) char *buffer, size_t count, _Printf_format_string_ const char* fmt, ...); +MIR_CORE_DLL(int) mir_snwprintf(_Pre_notnull_ _Always_(_Post_z_) wchar_t *buffer, size_t count, _Printf_format_string_ const wchar_t* fmt, ...); +MIR_CORE_DLL(int) mir_vsnprintf(_Pre_notnull_ _Always_(_Post_z_) char *buffer, size_t count, _Printf_format_string_ const char* fmt, va_list va); +MIR_CORE_DLL(int) mir_vsnwprintf(_Pre_notnull_ _Always_(_Post_z_) wchar_t *buffer, size_t count, _Printf_format_string_ const wchar_t* fmt, va_list va); /////////////////////////////////////////////////////////////////////////////// // protocol functions @@ -549,7 +549,7 @@ HANDLE mir_forkThread(void(__cdecl *pFunc)(T* param), T *arg) } template -inline int mir_snprintf(char(&buffer)[_Size], _Printf_format_string_ const char* fmt, ...) +inline int mir_snprintf(_Pre_notnull_ _Always_(_Post_z_) char(&buffer)[_Size], _In_z_ _Printf_format_string_ const char* fmt, ...) { va_list args; va_start(args, fmt); @@ -559,7 +559,7 @@ inline int mir_snprintf(char(&buffer)[_Size], _Printf_format_string_ const char* } template -inline int mir_snwprintf(wchar_t(&buffer)[_Size], _Printf_format_string_ const wchar_t* fmt, ...) +inline int mir_snwprintf(_Pre_notnull_ _Always_(_Post_z_) wchar_t(&buffer)[_Size], _In_z_ _Printf_format_string_ const wchar_t* fmt, ...) { va_list args; va_start(args, fmt); @@ -569,13 +569,13 @@ inline int mir_snwprintf(wchar_t(&buffer)[_Size], _Printf_format_string_ const w } template -inline int mir_vsnprintf(char(&buffer)[_Size], _Printf_format_string_ const char* fmt, va_list va) +inline int mir_vsnprintf(_Pre_notnull_ _Always_(_Post_z_) char(&buffer)[_Size], _In_z_ _Printf_format_string_ const char* fmt, va_list va) { return mir_vsnprintf(buffer, _Size, fmt, va); } template -inline int mir_vsnwprintf(wchar_t(&buffer)[_Size], _Printf_format_string_ const wchar_t* fmt, va_list va) +inline int mir_vsnwprintf(_Pre_notnull_ _Always_(_Post_z_) wchar_t(&buffer)[_Size], _In_z_ _Printf_format_string_ const wchar_t* fmt, va_list va) { return mir_vsnwprintf(buffer, _Size, fmt, va); } -- cgit v1.2.3