summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-24 13:59:04 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-24 13:59:04 +0000
commit107471fac771abe5774d10769e36c0903a908685 (patch)
treead0a9d14281c1c017b3f4c6f95d41d65e738a985
parentd499d067c4e901c3d8750726405002fe033f4771 (diff)
mir_sntprintf & mir_snvtprintf renamed to mir_snwprintf & mir_snwprintf respectively
mir_sntprintf & mir_snvtprintf are now macros, as they should be from the very beginning git-svn-id: http://svn.miranda-ng.org/main/trunk@5466 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--bin10/lib/mir_core.libbin44528 -> 44528 bytes
-rw-r--r--bin10/lib/mir_core64.libbin40498 -> 40498 bytes
-rw-r--r--bin11/lib/mir_core.libbin44528 -> 44528 bytes
-rw-r--r--bin11/lib/mir_core64.libbin40498 -> 40498 bytes
-rw-r--r--include/delphi/m_core.inc8
-rw-r--r--include/m_core.h10
-rw-r--r--plugins/SendScreenshotPlus/src/mir_string.cpp28
-rw-r--r--plugins/SendScreenshotPlus/src/mir_string.h3
-rw-r--r--plugins/UserInfoEx/src/mir_string.cpp28
-rw-r--r--plugins/UserInfoEx/src/mir_string.h3
-rw-r--r--src/mir_core/memory.cpp4
-rw-r--r--src/mir_core/mir_core.def4
12 files changed, 16 insertions, 72 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib
index a9d15b95ce..6f0a88799a 100644
--- a/bin10/lib/mir_core.lib
+++ b/bin10/lib/mir_core.lib
Binary files differ
diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib
index 0cfbd1b1a3..243e6c01ff 100644
--- a/bin10/lib/mir_core64.lib
+++ b/bin10/lib/mir_core64.lib
Binary files differ
diff --git a/bin11/lib/mir_core.lib b/bin11/lib/mir_core.lib
index c1288e866a..f4719e3372 100644
--- a/bin11/lib/mir_core.lib
+++ b/bin11/lib/mir_core.lib
Binary files differ
diff --git a/bin11/lib/mir_core64.lib b/bin11/lib/mir_core64.lib
index cfb841ed22..243e6c01ff 100644
--- a/bin11/lib/mir_core64.lib
+++ b/bin11/lib/mir_core64.lib
Binary files differ
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc
index 921f3e64b2..94ac1a7089 100644
--- a/include/delphi/m_core.inc
+++ b/include/delphi/m_core.inc
@@ -514,12 +514,12 @@ function PathToRelativeW(const pSrc:pWideChar; pOut:pWideChar):int; stdcall;
function mir_snprintf(buffer:pAnsiChar;count:size_t;fmt:pAnsiChar{, ...}):int; stdcall;
external CoreDLL name 'mir_snprintf';
-function mir_sntprintf(buffer:pWideChar;count:size_t;fmt:pWideChar{, ...}):int; stdcall;
- external CoreDLL name 'mir_sntprintf';
+function mir_snwprintf(buffer:pWideChar;count:size_t;fmt:pWideChar{, ...}):int; stdcall;
+ external CoreDLL name 'mir_snwprintf';
function mir_vsnprintf(buffer:pAnsiChar;count:size_t;fmt:pAnsiChar;va:va_list):int; stdcall;
external CoreDLL name 'mir_vsnprintf';
-function mir_vsntprintf(buffer:pWideChar;count:size_t;fmt:pWideChar;va:va_list):int; stdcall;
- external CoreDLL name 'mir_vsntprintf';
+function mir_vsnwprintf(buffer:pWideChar;count:size_t;fmt:pWideChar;va:va_list):int; stdcall;
+ external CoreDLL name 'mir_vsnwprintf';
///////////////////////////////////////////////////////////////////////////////
diff --git a/include/m_core.h b/include/m_core.h
index b0bc86a244..3167bc514b 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -588,9 +588,9 @@ MIR_CORE_DLL(int) PathToRelativeW(const WCHAR *pSrc, WCHAR *pOut);
// print functions
MIR_CORE_DLL(int) mir_snprintf(char *buffer, size_t count, const char* fmt, ...);
-MIR_CORE_DLL(int) mir_sntprintf(TCHAR *buffer, size_t count, const TCHAR* fmt, ...);
+MIR_CORE_DLL(int) mir_snwprintf(WCHAR *buffer, size_t count, const WCHAR* fmt, ...);
MIR_CORE_DLL(int) mir_vsnprintf(char *buffer, size_t count, const char* fmt, va_list va);
-MIR_CORE_DLL(int) mir_vsntprintf(TCHAR *buffer, size_t count, const TCHAR* fmt, va_list va);
+MIR_CORE_DLL(int) mir_vsnwprintf(WCHAR *buffer, size_t count, const WCHAR* fmt, va_list va);
///////////////////////////////////////////////////////////////////////////////
// protocol functions
@@ -733,6 +733,9 @@ __forceinline char* lrtrimp(char *str) { return ltrimp(rtrim(str)); };
#define wildcmpt wildcmpw
#define wildcmpit wildcmpiw
+
+ #define mir_sntprintf mir_snwprintf
+ #define mir_vsntprintf mir_vsnwprintf
#else
#define mir_t2a(s) mir_strdup(s)
#define mir_a2t(s) mir_strdup(s)
@@ -754,6 +757,9 @@ __forceinline char* lrtrimp(char *str) { return ltrimp(rtrim(str)); };
#define wildcmpt wildcmp
#define wildcmpit wildcmpi
+
+ #define mir_sntprintf mir_snprintf
+ #define mir_vsntprintf mir_vsnprintf
#endif
MIR_CORE_DLL(WCHAR*) mir_a2u_cp(const char* src, int codepage);
diff --git a/plugins/SendScreenshotPlus/src/mir_string.cpp b/plugins/SendScreenshotPlus/src/mir_string.cpp
index 362b09067f..251b5fd45e 100644
--- a/plugins/SendScreenshotPlus/src/mir_string.cpp
+++ b/plugins/SendScreenshotPlus/src/mir_string.cpp
@@ -103,34 +103,6 @@ char *mir_strnerase(char *pszDest, size_t sizeFrom, size_t sizeTo) {
return pszDest;
}
-size_t mir_vsnwprintf(wchar_t *pszDest, const size_t cchDest, const wchar_t *pszFormat, va_list& argList)
-{
- size_t iRet, cchMax;
-
- if (!pszDest || !pszFormat || !*pszFormat)
- return -1;
-
- cchMax = cchDest - 1;
- iRet = _vsnwprintf(pszDest, cchMax, pszFormat, argList);
- if (iRet < 0) pszDest[0] = 0;
- else if (iRet >= cchMax) {
- pszDest[cchMax] = 0;
- iRet = cchMax;
- }
- return iRet;
-}
-
-size_t mir_snwprintf(wchar_t *pszDest, const size_t cchDest, const wchar_t *pszFormat, ...)
-{
- size_t iRet;
- va_list argList;
-
- va_start(argList, pszFormat);
- iRet = mir_vsnwprintf(pszDest, cchDest, pszFormat, argList);
- va_end(argList);
- return iRet;
-}
-
//---------------------------------------------------------------------------
void mir_stradd(char* &pszDest, const char *pszSrc)
{
diff --git a/plugins/SendScreenshotPlus/src/mir_string.h b/plugins/SendScreenshotPlus/src/mir_string.h
index 00f4088056..c560048147 100644
--- a/plugins/SendScreenshotPlus/src/mir_string.h
+++ b/plugins/SendScreenshotPlus/src/mir_string.h
@@ -76,9 +76,6 @@ wchar_t * mir_wcsncat(wchar_t *pszDest, const wchar_t *pszSrc, const size_t cchD
char * mir_strncat_c(char *pszDest, const char cSrc);
char * mir_wcsncat_c(char *pszDest, const char cSrc);
-size_t mir_vsnwprintf(wchar_t *pszDest, const size_t cchDest, const wchar_t *pszFormat, va_list& argList);
-size_t mir_snwprintf(wchar_t *pszDest, const size_t cchDest, const wchar_t *pszFormat, ...);
-
char * mir_strnerase(char *pszDest, size_t sizeFrom, size_t sizeTo);
void mir_stradd(char * &pszDest, const char *pszSrc);
diff --git a/plugins/UserInfoEx/src/mir_string.cpp b/plugins/UserInfoEx/src/mir_string.cpp
index c538c110ad..206b16a609 100644
--- a/plugins/UserInfoEx/src/mir_string.cpp
+++ b/plugins/UserInfoEx/src/mir_string.cpp
@@ -98,34 +98,6 @@ char *mir_strnerase(char *pszDest, size_t sizeFrom, size_t sizeTo) {
return pszDest;
}
-size_t mir_vsnwprintf(wchar_t *pszDest, const size_t cchDest, const wchar_t *pszFormat, va_list& argList)
-{
- size_t iRet, cchMax;
-
- if (!pszDest || !pszFormat || !*pszFormat)
- return -1;
-
- cchMax = cchDest - 1;
- iRet = _vsnwprintf(pszDest, cchMax, pszFormat, argList);
- if (iRet < 0) pszDest[0] = 0;
- else if (iRet >= cchMax) {
- pszDest[cchMax] = 0;
- iRet = cchMax;
- }
- return iRet;
-}
-
-size_t mir_snwprintf(wchar_t *pszDest, const size_t cchDest, const wchar_t *pszFormat, ...)
-{
- size_t iRet;
- va_list argList;
-
- va_start(argList, pszFormat);
- iRet = mir_vsnwprintf(pszDest, cchDest, pszFormat, argList);
- va_end(argList);
- return iRet;
-}
-
int mir_IsEmptyA(char *str)
{
if (str == NULL || str[0] == 0)
diff --git a/plugins/UserInfoEx/src/mir_string.h b/plugins/UserInfoEx/src/mir_string.h
index 61a1b623a6..3282e767e2 100644
--- a/plugins/UserInfoEx/src/mir_string.h
+++ b/plugins/UserInfoEx/src/mir_string.h
@@ -68,9 +68,6 @@ wchar_t * mir_wcsncat(wchar_t *pszDest, const wchar_t *pszSrc, const size_t cchD
char * mir_strncat_c(char *pszDest, const char cSrc);
char * mir_wcsncat_c(char *pszDest, const char cSrc);
-size_t mir_vsnwprintf(wchar_t *pszDest, const size_t cchDest, const wchar_t *pszFormat, va_list& argList);
-size_t mir_snwprintf (wchar_t *pszDest, const size_t cchDest, const wchar_t *pszFormat, ...);
-
char * mir_strnerase(char *pszDest, size_t sizeFrom, size_t sizeTo);
int mir_IsEmptyA(char *str);
diff --git a/src/mir_core/memory.cpp b/src/mir_core/memory.cpp
index 2f7467ccc4..ef3006aad3 100644
--- a/src/mir_core/memory.cpp
+++ b/src/mir_core/memory.cpp
@@ -208,7 +208,7 @@ MIR_CORE_DLL(int) mir_snprintf(char *buffer, size_t count, const char* fmt, ...)
/******************************************************************************/
-MIR_CORE_DLL(int) mir_sntprintf(TCHAR *buffer, size_t count, const TCHAR* fmt, ...)
+MIR_CORE_DLL(int) mir_snwprintf(WCHAR *buffer, size_t count, const WCHAR* fmt, ...)
{
va_list va;
int len;
@@ -233,7 +233,7 @@ MIR_CORE_DLL(int) mir_vsnprintf(char *buffer, size_t count, const char* fmt, va_
/******************************************************************************/
-MIR_CORE_DLL(int) mir_vsntprintf(TCHAR *buffer, size_t count, const TCHAR* fmt, va_list va)
+MIR_CORE_DLL(int) mir_vsnwprintf(WCHAR *buffer, size_t count, const WCHAR* fmt, va_list va)
{
int len = _vsntprintf(buffer, count-1, fmt, va);
buffer[count-1] = 0;
diff --git a/src/mir_core/mir_core.def b/src/mir_core/mir_core.def
index 35b7af1ad1..1423a8a086 100644
--- a/src/mir_core/mir_core.def
+++ b/src/mir_core/mir_core.def
@@ -99,13 +99,13 @@ mir_strndup @96
mir_u2a @97
mir_u2a_cp @98
mir_vsnprintf @99
-mir_vsntprintf @100
+mir_vsnwprintf @100
mir_wstrdup @101
rtrim @102
wildcmp @103
rtrimw @104
mir_snprintf @105
-mir_sntprintf @106
+mir_snwprintf @106
db_unset @107
db_free @108
db_get @109