Cleanup Operator padding

This commit is contained in:
Schmoozerd 2012-07-20 17:38:23 +02:00
parent 9141299127
commit e32b9953a1
264 changed files with 6715 additions and 6715 deletions

View file

@ -101,7 +101,7 @@ inline void ApplyPercentModFloatVar(float& var, float val, bool apply)
{
if (val == -100.0f) // prevent set var to zero
val = -99.99f;
var *= (apply?(100.0f+val)/100.0f : 100.0f / (100.0f+val));
var *= (apply ? (100.0f + val) / 100.0f : 100.0f / (100.0f + val));
}
bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr);
@ -117,7 +117,7 @@ bool WStrToUtf8(std::wstring wstr, std::string& utf8str);
bool WStrToUtf8(wchar_t* wstr, size_t size, std::string& utf8str);
size_t utf8length(std::string& utf8str); // set string to "" if invalid utf8 sequence
void utf8truncate(std::string& utf8str,size_t len);
void utf8truncate(std::string& utf8str, size_t len);
inline bool isBasicLatinCharacter(wchar_t wchar)
{
@ -186,12 +186,12 @@ inline bool isWhiteSpace(char c)
inline bool isNumeric(wchar_t wchar)
{
return (wchar >= L'0' && wchar <=L'9');
return (wchar >= L'0' && wchar <= L'9');
}
inline bool isNumeric(char c)
{
return (c >= '0' && c <='9');
return (c >= '0' && c <= '9');
}
inline bool isNumericOrSpace(wchar_t wchar)
@ -271,20 +271,20 @@ inline void strToLower(std::string& str)
inline wchar_t wcharToUpper(wchar_t wchar)
{
if (wchar >= L'a' && wchar <= L'z') // LATIN SMALL LETTER A - LATIN SMALL LETTER Z
return wchar_t(uint16(wchar)-0x0020);
return wchar_t(uint16(wchar) - 0x0020);
if (wchar == 0x00DF) // LATIN SMALL LETTER SHARP S
return wchar_t(0x1E9E);
if (wchar >= 0x00E0 && wchar <= 0x00F6) // LATIN SMALL LETTER A WITH GRAVE - LATIN SMALL LETTER O WITH DIAERESIS
return wchar_t(uint16(wchar)-0x0020);
return wchar_t(uint16(wchar) - 0x0020);
if (wchar >= 0x00F8 && wchar <= 0x00FE) // LATIN SMALL LETTER O WITH STROKE - LATIN SMALL LETTER THORN
return wchar_t(uint16(wchar)-0x0020);
return wchar_t(uint16(wchar) - 0x0020);
if (wchar >= 0x0101 && wchar <= 0x012F) // LATIN SMALL LETTER A WITH MACRON - LATIN SMALL LETTER I WITH OGONEK (only %2=1)
{
if (wchar % 2 == 1)
return wchar_t(uint16(wchar)-0x0001);
return wchar_t(uint16(wchar) - 0x0001);
}
if (wchar >= 0x0430 && wchar <= 0x044F) // CYRILLIC SMALL LETTER A - CYRILLIC SMALL LETTER YA
return wchar_t(uint16(wchar)-0x0020);
return wchar_t(uint16(wchar) - 0x0020);
if (wchar == 0x0451) // CYRILLIC SMALL LETTER IO
return wchar_t(0x0401);
@ -299,22 +299,22 @@ inline wchar_t wcharToUpperOnlyLatin(wchar_t wchar)
inline wchar_t wcharToLower(wchar_t wchar)
{
if (wchar >= L'A' && wchar <= L'Z') // LATIN CAPITAL LETTER A - LATIN CAPITAL LETTER Z
return wchar_t(uint16(wchar)+0x0020);
return wchar_t(uint16(wchar) + 0x0020);
if (wchar >= 0x00C0 && wchar <= 0x00D6) // LATIN CAPITAL LETTER A WITH GRAVE - LATIN CAPITAL LETTER O WITH DIAERESIS
return wchar_t(uint16(wchar)+0x0020);
return wchar_t(uint16(wchar) + 0x0020);
if (wchar >= 0x00D8 && wchar <= 0x00DE) // LATIN CAPITAL LETTER O WITH STROKE - LATIN CAPITAL LETTER THORN
return wchar_t(uint16(wchar)+0x0020);
return wchar_t(uint16(wchar) + 0x0020);
if (wchar >= 0x0100 && wchar <= 0x012E) // LATIN CAPITAL LETTER A WITH MACRON - LATIN CAPITAL LETTER I WITH OGONEK (only %2=0)
{
if (wchar % 2 == 0)
return wchar_t(uint16(wchar)+0x0001);
return wchar_t(uint16(wchar) + 0x0001);
}
if (wchar == 0x1E9E) // LATIN CAPITAL LETTER SHARP S
return wchar_t(0x00DF);
if (wchar == 0x0401) // CYRILLIC CAPITAL LETTER IO
return wchar_t(0x0451);
if (wchar >= 0x0410 && wchar <= 0x042F) // CYRILLIC CAPITAL LETTER A - CYRILLIC CAPITAL LETTER YA
return wchar_t(uint16(wchar)+0x0020);
return wchar_t(uint16(wchar) + 0x0020);
return wchar;
}
@ -332,7 +332,7 @@ inline void wstrToLower(std::wstring& str)
std::wstring GetMainPartOfName(std::wstring wname, uint32 declension);
bool utf8ToConsole(const std::string& utf8str, std::string& conStr);
bool consoleToUtf8(const std::string& conStr,std::string& utf8str);
bool consoleToUtf8(const std::string& conStr, std::string& utf8str);
bool Utf8FitTo(const std::string& str, std::wstring search);
void utf8printf(FILE* out, const char* str, ...);
void vutf8printf(FILE* out, const char* str, va_list* ap);