diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 14:33:30 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 14:33:30 +0000 |
commit | 05c989e58aeffcfb59cebaca6797cb69dd25cb1e (patch) | |
tree | 460bde28df51ea7b01109b56818b5880ac47ba66 /plugins/TipperYM/str_utils.cpp | |
parent | ac7bf920f219a7aed7eb163c8b3195e66c12e4da (diff) |
another portion of "#ifdef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM/str_utils.cpp')
-rw-r--r-- | plugins/TipperYM/str_utils.cpp | 78 |
1 files changed, 22 insertions, 56 deletions
diff --git a/plugins/TipperYM/str_utils.cpp b/plugins/TipperYM/str_utils.cpp index 0e9b67f73f..112cc2678b 100644 --- a/plugins/TipperYM/str_utils.cpp +++ b/plugins/TipperYM/str_utils.cpp @@ -70,60 +70,46 @@ bool utf2a(const char *us, char *buff, int bufflen) bool t2w(const TCHAR *ts, wchar_t *buff, int bufflen)
{
-#ifdef _UNICODE
+
wcsncpy(buff, ts, bufflen);
return true;
-#else
- return a2w(ts, buff, bufflen);
-#endif
+
}
bool w2t(const wchar_t *ws, TCHAR *buff, int bufflen)
{
-#ifdef _UNICODE
+
wcsncpy(buff, ws, bufflen);
return true;
-#else
- return w2a(ws, buff, bufflen);
-#endif
+
}
bool t2a(const TCHAR *ts, char *buff, int bufflen)
{
-#ifdef _UNICODE
+
return w2a(ts, buff, bufflen);
-#else
- strncpy(buff, ts, bufflen);
- return true;
-#endif
+
}
bool a2t(const char *as, TCHAR *buff, int bufflen)
{
-#ifdef _UNICODE
+
return a2w(as, buff, bufflen);
-#else
- strncpy(buff, as, bufflen);
- return true;
-#endif
+
}
bool t2utf(const TCHAR *ts, char *buff, int bufflen)
{
-#ifdef _UNICODE
+
return w2utf(ts, buff, bufflen);
-#else
- return a2utf(ts, buff, bufflen);
-#endif
+
}
bool utf2t(const char *us, TCHAR *buff, int bufflen)
{
-#ifdef _UNICODE
+
return utf2w(us, buff, bufflen);
-#else
- return utf2a(us, buff, bufflen);
-#endif
+
}
wchar_t *utf2w(const char *us)
@@ -190,63 +176,43 @@ char *a2utf(const char *as) TCHAR *w2t(const wchar_t *ws)
{
-#ifdef _UNICODE
+
return mir_wstrdup(ws);
-#else
- return w2a(ws);
-#endif
+
}
wchar_t *t2w(const TCHAR *ts)
{
-#ifdef _UNICODE
+
return mir_tstrdup(ts);
-#else
- return a2w(ts);
-#endif
+
}
char *t2a(const TCHAR *ts)
{
-#ifdef _UNICODE
+
return w2a(ts);
-#else
- return mir_strdup(ts);
-#endif
+
}
TCHAR *a2t(const char *as)
{
-#ifdef _UNICODE
+
return a2w(as);
-#else
- return mir_strdup(as);
-#endif
+
}
TCHAR *utf2t(const char *utfs)
{
-#ifdef _UNICODE
+
return utf2w(utfs);
-#else
- wchar_t *ws = utf2w(utfs);
- char *ret = w2a(ws);
- mir_free(ws);
- return ret;
-#endif
}
char *t2utf(const TCHAR *ts)
{
-#ifdef _UNICODE
+
return w2utf(ts);
-#else
- wchar_t *ws = a2w(ts);
- char *ret = w2utf(ws);
- mir_free(ws);
- return ret;
-#endif
}
TCHAR *myfgets(TCHAR *Buf, int MaxCount, FILE *File)
|