From 1597ad9377460453845b48af69ea888e32297cc1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 1 Jul 2012 09:54:44 +0000 Subject: style cleanup --- intern/string/STR_String.h | 104 ++++++++--------- intern/string/intern/STR_String.cpp | 217 ++++++++++++++++++------------------ intern/utfconv/utf_winfunc.c | 2 +- 3 files changed, 160 insertions(+), 163 deletions(-) (limited to 'intern') diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h index ac8b855bbe9..1705d7855e0 100644 --- a/intern/string/STR_String.h +++ b/intern/string/STR_String.h @@ -115,23 +115,23 @@ public: void Replace(int pos, int num, rcSTR_String str); // Substrings - inline STR_String Left(int num) const { num = (num < Len ? num:Len ); return STR_String(pData, num); } - inline STR_String Right(int num) const { num = (num < Len ? num:Len ); return STR_String(pData+Len-num, num); } - inline STR_String Mid(int pos, int num = INT_MAX) const { pos = (pos < Len ? pos:Len ); num = (num < (Len - pos) ? num : (Len - pos)); return STR_String(pData+pos, num); } + inline STR_String Left(int num) const { num = (num < Len ? num:Len ); return STR_String(pData, num); } + inline STR_String Right(int num) const { num = (num < Len ? num:Len ); return STR_String(pData+Len-num, num); } + inline STR_String Mid(int pos, int num = INT_MAX) const { pos = (pos < Len ? pos:Len ); num = (num < (Len - pos) ? num : (Len - pos)); return STR_String(pData+pos, num); } // Comparison - int Compare(rcSTR_String rhs) const; - int CompareNoCase(rcSTR_String rhs) const; - inline bool IsEqual(rcSTR_String rhs) const { return (Compare(rhs)==0); } - inline bool IsEqualNoCase(rcSTR_String rhs) const { return (CompareNoCase(rhs)==0); } + int Compare(rcSTR_String rhs) const; + int CompareNoCase(rcSTR_String rhs) const; + inline bool IsEqual(rcSTR_String rhs) const { return (Compare(rhs)==0); } + inline bool IsEqualNoCase(rcSTR_String rhs) const { return (CompareNoCase(rhs)==0); } // Search/replace - int Find(char c, int pos = 0) const; - int Find(const char *str, int pos = 0) const; - int Find(rcSTR_String str, int pos = 0) const; - int RFind(char c) const; - int FindOneOf(const char *set, int pos = 0) const; - int RFindOneOf(const char *set, int pos = 0) const; + int Find(char c, int pos = 0) const; + int Find(const char *str, int pos = 0) const; + int Find(rcSTR_String str, int pos = 0) const; + int RFind(char c) const; + int FindOneOf(const char *set, int pos = 0) const; + int RFindOneOf(const char *set, int pos = 0) const; std::vector Explode(char c) const; @@ -148,42 +148,42 @@ public: STR_String& TrimQuotes(); // Conversions -// inline operator char*() { return pData; } - inline operator const char *() const { return pData; } - inline char *Ptr() { return pData; } - inline const char *ReadPtr() const { return pData; } - inline float ToFloat() const { float x=(float)(atof(pData)); return x; } - inline int ToInt() const { return atoi(pData); } +// inline operator char*() { return pData; } + inline operator const char *() const { return pData; } + inline char *Ptr() { return pData; } + inline const char *ReadPtr() const { return pData; } + inline float ToFloat() const { float x=(float)(atof(pData)); return x; } + inline int ToInt() const { return atoi(pData); } // Operators - inline rcSTR_String operator=(const byte *rhs) { return Copy((const char *)rhs, strlen((const char *)rhs)); } - inline rcSTR_String operator=(rcSTR_String rhs) { return Copy(rhs.ReadPtr(), rhs.Length()); } - inline rcSTR_String operator=(char rhs) { return Copy(&rhs, 1); } - inline rcSTR_String operator=(const char *rhs) { return Copy(rhs, strlen(rhs)); } - - inline rcSTR_String operator+=(const char *rhs) { return Concat(rhs, strlen(rhs)); } - inline rcSTR_String operator+=(rcSTR_String rhs) { return Concat(rhs.ReadPtr(), rhs.Length()); } - inline rcSTR_String operator+=(char rhs) { return Concat(&rhs, 1); } - - - inline friend bool operator<(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)<0); } - inline friend bool operator<(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)<0); }; - inline friend bool operator<(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)<0); } - inline friend bool operator>(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>0); } - inline friend bool operator>(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)>0); } - inline friend bool operator>(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>0); } - inline friend bool operator<=(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)<=0); } - inline friend bool operator<=(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)<=0); } - inline friend bool operator<=(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)<=0); } - inline friend bool operator>=(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>=0); } - inline friend bool operator>=(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)>=0); } - inline friend bool operator>=(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>=0); } - inline friend bool operator==(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() == rhs.Length()) && (memcmp(lhs, rhs, lhs.Length())==0)); } - inline friend bool operator==(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length()+1)==0); } - inline friend bool operator==(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length()+1)==0); } - inline friend bool operator!=(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() != rhs.Length()) || (memcmp(lhs, rhs, lhs.Length())!=0)); } - inline friend bool operator!=(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length()+1)!=0); } - inline friend bool operator!=(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length()+1)!=0); } + inline rcSTR_String operator=(const byte *rhs) { return Copy((const char *)rhs, strlen((const char *)rhs)); } + inline rcSTR_String operator=(rcSTR_String rhs) { return Copy(rhs.ReadPtr(), rhs.Length()); } + inline rcSTR_String operator=(char rhs) { return Copy(&rhs, 1); } + inline rcSTR_String operator=(const char *rhs) { return Copy(rhs, strlen(rhs)); } + + inline rcSTR_String operator+=(const char *rhs) { return Concat(rhs, strlen(rhs)); } + inline rcSTR_String operator+=(rcSTR_String rhs) { return Concat(rhs.ReadPtr(), rhs.Length()); } + inline rcSTR_String operator+=(char rhs) { return Concat(&rhs, 1); } + + + inline friend bool operator<(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)<0); } + inline friend bool operator<(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)<0); } + inline friend bool operator<(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)<0); } + inline friend bool operator>(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>0); } + inline friend bool operator>(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)>0); } + inline friend bool operator>(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>0); } + inline friend bool operator<=(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)<=0); } + inline friend bool operator<=(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)<=0); } + inline friend bool operator<=(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)<=0); } + inline friend bool operator>=(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>=0); } + inline friend bool operator>=(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)>=0); } + inline friend bool operator>=(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>=0); } + inline friend bool operator==(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() == rhs.Length()) && (memcmp(lhs, rhs, lhs.Length())==0)); } + inline friend bool operator==(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length()+1)==0); } + inline friend bool operator==(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length()+1)==0); } + inline friend bool operator!=(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() != rhs.Length()) || (memcmp(lhs, rhs, lhs.Length())!=0)); } + inline friend bool operator!=(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length()+1)!=0); } + inline friend bool operator!=(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length()+1)!=0); } // serializing //int Serialize(pCStream stream); @@ -198,7 +198,7 @@ protected: static bool isUpper(char c) { return (c>='A') && (c <= 'Z'); } static bool isSpace(char c) { return (c==' ') || (c=='\t'); } - char *pData; // -> STR_String data + char *pData; // -> STR_String data int Len; // Data length int Max; // Space in data buffer @@ -209,10 +209,10 @@ protected: }; inline STR_String operator+(rcSTR_String lhs, rcSTR_String rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), rhs.ReadPtr(), rhs.Length()); } -inline STR_String operator+(rcSTR_String lhs, char rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), &rhs, 1); } -inline STR_String operator+(char lhs, rcSTR_String rhs) { return STR_String(&lhs, 1, rhs.ReadPtr(), rhs.Length()); } -inline STR_String operator+(rcSTR_String lhs, const char *rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), rhs, strlen(rhs)); } -inline STR_String operator+(const char *lhs, rcSTR_String rhs) { return STR_String(lhs, strlen(lhs), rhs.ReadPtr(), rhs.Length()); } +inline STR_String operator+(rcSTR_String lhs, char rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), &rhs, 1); } +inline STR_String operator+(char lhs, rcSTR_String rhs) { return STR_String(&lhs, 1, rhs.ReadPtr(), rhs.Length()); } +inline STR_String operator+(rcSTR_String lhs, const char *rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), rhs, strlen(rhs)); } +inline STR_String operator+(const char *lhs, rcSTR_String rhs) { return STR_String(lhs, strlen(lhs), rhs.ReadPtr(), rhs.Length()); } #endif //__STR_STRING_H__ diff --git a/intern/string/intern/STR_String.cpp b/intern/string/intern/STR_String.cpp index 5ad41c696e3..bea6e88cfff 100644 --- a/intern/string/intern/STR_String.cpp +++ b/intern/string/intern/STR_String.cpp @@ -39,10 +39,10 @@ #include #include -#include +#include #include #include -#if defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__) || defined (_AIX) +#if defined(__sun__) || defined(__sun) || defined(__sparc) || defined(__sparc__) || defined(_AIX) # include #endif #include "STR_String.h" @@ -57,7 +57,7 @@ // Construct an empty string // STR_String::STR_String() : - pData(new char [32]), + pData(new char[32]), Len(0), Max(32) { @@ -70,7 +70,7 @@ STR_String::STR_String() : // Construct a string of one character // STR_String::STR_String(char c) : - pData(new char [9]), + pData(new char[9]), Len(1), Max(9) { @@ -84,9 +84,9 @@ STR_String::STR_String(char c) : // Construct a string of multiple repeating characters // STR_String::STR_String(char c, int len) : - pData(new char [len+8]), + pData(new char[len + 8]), Len(len), - Max(len+8) + Max(len + 8) { assertd(pData != NULL); memset(pData, c, len); @@ -104,7 +104,7 @@ STR_String::STR_String(const char *str) if (str) { Len = ::strlen(str); Max = Len + 8; - pData = new char [Max]; + pData = new char[Max]; assertd(pData != NULL); ::memcpy(pData, str, Len); pData[Len] = 0; @@ -122,9 +122,9 @@ STR_String::STR_String(const char *str) // Construct a string from a pointer-to-ASCII-string and a length // STR_String::STR_String(const char *str, int len) : - pData(new char [len+8]), + pData(new char[len + 8]), Len(len), - Max(len+8) + Max(len + 8) { assertd(pData != NULL); memcpy(pData, str, len); @@ -137,9 +137,9 @@ STR_String::STR_String(const char *str, int len) : // Construct a string from another string // STR_String::STR_String(rcSTR_String str) : - pData(new char [str.Length()+8]), + pData(new char[str.Length() + 8]), Len(str.Length()), - Max(str.Length()+8) + Max(str.Length() + 8) { assertd(pData != NULL); assertd(str.pData != NULL); @@ -153,9 +153,9 @@ STR_String::STR_String(rcSTR_String str) : // Construct a string from the first number of characters in another string // STR_String::STR_String(rcSTR_String str, int len) : - pData(new char [len+8]), + pData(new char[len + 8]), Len(len), - Max(len+8) + Max(len + 8) { assertd(pData != NULL); assertd(str.pData != NULL); @@ -169,14 +169,14 @@ STR_String::STR_String(rcSTR_String str, int len) : // Create a string by concatenating two sources // STR_String::STR_String(const char *src1, int len1, const char *src2, int len2) : - pData(new char [len1+len2+8]), - Len(len1+len2), - Max(len1+len2+8) + pData(new char[len1 + len2 + 8]), + Len(len1 + len2), + Max(len1 + len2 + 8) { assertd(pData != NULL); memcpy(pData, src1, len1); - memcpy(pData+len1, src2, len2); - pData[len1+len2] = 0; + memcpy(pData + len1, src2, len2); + pData[len1 + len2] = 0; } @@ -185,13 +185,13 @@ STR_String::STR_String(const char *src1, int len1, const char *src2, int len2) : // Create a string with an integer value // STR_String::STR_String(int val) : - pData(new char [32]), + pData(new char[32]), Max(32) { assertd(pData != NULL); - Len=sprintf(pData, "%d", val); + Len = sprintf(pData, "%d", val); } - + @@ -199,11 +199,11 @@ STR_String::STR_String(int val) : // Create a string with a dword value // STR_String::STR_String(dword val) : - pData(new char [32]), + pData(new char[32]), Max(32) { assertd(pData != NULL); - Len=sprintf(pData, "%lu", val); + Len = sprintf(pData, "%lu", val); } @@ -212,11 +212,11 @@ STR_String::STR_String(dword val) : // Create a string with a floating point value // STR_String::STR_String(float val) : - pData(new char [32]), + pData(new char[32]), Max(32) { assertd(pData != NULL); - Len=sprintf(pData, "%g", val); + Len = sprintf(pData, "%g", val); } @@ -225,11 +225,11 @@ STR_String::STR_String(float val) : // Create a string with a double value // STR_String::STR_String(double val) : - pData(new char [32]), + pData(new char[32]), Max(32) { assertd(pData != NULL); - Len=sprintf(pData, "%g", val); + Len = sprintf(pData, "%g", val); } @@ -246,19 +246,19 @@ STR_String::STR_String(double val) : void STR_String::AllocBuffer(int len, bool keep_contents) { // Check if we have enough space - if (len+1 <= Max) return; + if (len + 1 <= Max) return; // Reallocate string - char *new_data = new char [len+8]; + char *new_data = new char[len + 8]; if (keep_contents) memcpy(new_data, pData, Len); delete[] pData; // Accept new data - Max = len+8; + Max = len + 8; pData = new_data; assertd(pData != NULL); } - + /*------------------------------------------------------------------------------------------------- @@ -298,7 +298,7 @@ STR_String& STR_String::FormatAdd(const char *fmt, ...) // Expand arguments and format to string va_list args; va_start(args, fmt); - Len += vsprintf(pData+Len, fmt, args); + Len += vsprintf(pData + Len, fmt, args); assertd(Len <= 2048); va_end(args); @@ -318,7 +318,7 @@ STR_String& STR_String::FormatAdd(const char *fmt, ...) // bool STR_String::IsUpper() const { - for (int i=0; i= 0); - assertd(Len==0 || pos in the string // -int STR_String::Find(const char *str, int pos) const +int STR_String::Find(const char *str, int pos) const { assertd(pos >= 0); - assertd(Len==0 || pos in the string // -int STR_String::Find(rcSTR_String str, int pos) const +int STR_String::Find(rcSTR_String str, int pos) const { assertd(pos >= 0); - assertd(Len==0 || pos= 0); - assertd(Len==0 || pos0 if *this>rhs or 0 if *this==rhs // -int STR_String::Compare(rcSTR_String rhs) const +int STR_String::Compare(rcSTR_String rhs) const { return strcmp(pData, rhs.pData); } @@ -507,14 +505,14 @@ int STR_String::CompareNoCase(rcSTR_String rhs) const // // Capitalize string, "heLLo" -> "HELLO" // -STR_String& STR_String::Upper() +STR_String& STR_String::Upper() { assertd(pData != NULL); #ifdef WIN32 _strupr(pData); #else - for (int i=0;i= 'a' && pData[i] <= 'z')?pData[i]+'A'-'a':pData[i]; + for (int i = 0; i < Len; i++) + pData[i] = (pData[i] >= 'a' && pData[i] <= 'z') ? pData[i] + 'A' - 'a' : pData[i]; #endif return *this; } @@ -524,14 +522,14 @@ STR_String& STR_String::Upper() // // Lower string, "heLLo" -> "hello" // -STR_String& STR_String::Lower() +STR_String& STR_String::Lower() { assertd(pData != NULL); #ifdef WIN32 _strlwr(pData); #else - for (int i=0;i= 'A' && pData[i] <= 'Z')?pData[i]+'a'-'A':pData[i]; + for (int i = 0; i < Len; i++) + pData[i] = (pData[i] >= 'A' && pData[i] <= 'Z') ? pData[i] + 'a' - 'A' : pData[i]; #endif return *this; } @@ -541,17 +539,17 @@ STR_String& STR_String::Lower() // // Capitalize string, "heLLo" -> "Hello" // -STR_String& STR_String::Capitalize() +STR_String& STR_String::Capitalize() { assertd(pData != NULL); #ifdef WIN32 - if (Len>0) pData[0] = toupper(pData[0]); - if (Len>1) _strlwr(pData+1); + if (Len > 0) pData[0] = toupper(pData[0]); + if (Len > 1) _strlwr(pData + 1); #else if (Len > 0) - pData[0] = (pData[0] >= 'A' && pData[0] <= 'A')?pData[0]+'a'-'A':pData[0]; - for (int i=1;i= 'a' && pData[i] <= 'z')?pData[i]+'A'-'a':pData[i]; + pData[0] = (pData[0] >= 'A' && pData[0] <= 'A') ? pData[0] + 'a' - 'A' : pData[0]; + for (int i = 1; i < Len; i++) + pData[i] = (pData[i] >= 'a' && pData[i] <= 'z') ? pData[i] + 'A' - 'a' : pData[i]; #endif return *this; } @@ -561,13 +559,13 @@ STR_String& STR_String::Capitalize() // // Trim whitespace from the left side of the string // -STR_String& STR_String::TrimLeft() +STR_String& STR_String::TrimLeft() { int skip; assertd(pData != NULL); - for (skip=0; isSpace(pData[skip]); skip++, Len--) - {}; - memmove(pData, pData+skip, Len+1); + for (skip = 0; isSpace(pData[skip]); skip++, Len--) + {}; + memmove(pData, pData + skip, Len + 1); return *this; } @@ -576,11 +574,11 @@ STR_String& STR_String::TrimLeft() // // Trim whitespaces from the right side of the string // -STR_String& STR_String::TrimRight() +STR_String& STR_String::TrimRight() { assertd(pData != NULL); - while (Len && isSpace(pData[Len-1])) Len--; - pData[Len]=0; + while (Len && isSpace(pData[Len - 1])) Len--; + pData[Len] = 0; return *this; } @@ -589,7 +587,7 @@ STR_String& STR_String::TrimRight() // // Trim spaces from both sides of the character set // -STR_String& STR_String::Trim() +STR_String& STR_String::Trim() { TrimRight(); TrimLeft(); @@ -601,13 +599,13 @@ STR_String& STR_String::Trim() // // Trim characters from the character set from the left side of the string // -STR_String& STR_String::TrimLeft(char *set) +STR_String& STR_String::TrimLeft(char *set) { int skip; assertd(pData != NULL); - for (skip=0; Len && strchr(set, pData[skip]); skip++, Len--) - {}; - memmove(pData, pData+skip, Len+1); + for (skip = 0; Len && strchr(set, pData[skip]); skip++, Len--) + {}; + memmove(pData, pData + skip, Len + 1); return *this; } @@ -616,11 +614,11 @@ STR_String& STR_String::TrimLeft(char *set) // // Trim characters from the character set from the right side of the string // -STR_String& STR_String::TrimRight(char *set) +STR_String& STR_String::TrimRight(char *set) { assertd(pData != NULL); - while (Len && strchr(set, pData[Len-1])) Len--; - pData[Len]=0; + while (Len && strchr(set, pData[Len - 1])) Len--; + pData[Len] = 0; return *this; } @@ -629,7 +627,7 @@ STR_String& STR_String::TrimRight(char *set) // // Trim characters from the character set from both sides of the character set // -STR_String& STR_String::Trim(char *set) +STR_String& STR_String::Trim(char *set) { TrimRight(set); TrimLeft(set); @@ -641,14 +639,14 @@ STR_String& STR_String::Trim(char *set) // // Trim quotes from both sides of the string // -STR_String& STR_String::TrimQuotes() +STR_String& STR_String::TrimQuotes() { // Trim quotes if they are on both sides of the string assertd(pData != NULL); - if ((Len >= 2) && (pData[0] == '\"') && (pData[Len-1] == '\"')) + if ((Len >= 2) && (pData[0] == '\"') && (pData[Len - 1] == '\"')) { - memmove(pData, pData+1, Len-2+1); - Len-=2; + memmove(pData, pData + 1, Len - 2 + 1); + Len -= 2; } return *this; } @@ -666,7 +664,7 @@ STR_String& STR_String::TrimQuotes() // rcSTR_String STR_String::Copy(const char *src, int len) { - assertd(len>=0); + assertd(len >= 0); assertd(src); assertd(pData != NULL); @@ -685,23 +683,23 @@ rcSTR_String STR_String::Copy(const char *src, int len) // rcSTR_String STR_String::Concat(const char *data, int len) { - assertd(Len>=0); - assertd(len>=0); + assertd(Len >= 0); + assertd(len >= 0); assertd(data); assertd(pData != NULL); - AllocBuffer(Len+len, true); - memcpy(pData+Len, data, len); - Len+=len; + AllocBuffer(Len + len, true); + memcpy(pData + Len, data, len); + Len += len; pData[Len] = 0; return *this; } -std::vector STR_String::Explode(char c) const +std::vector STR_String::Explode(char c) const { - STR_String lcv = *this; + STR_String lcv = *this; std::vector uc; while (lcv.Length()) @@ -713,7 +711,7 @@ std::vector STR_String::Explode(char c) const } else { uc.push_back(lcv.Left(pos)); - lcv = lcv.Mid(pos+1); + lcv = lcv.Mid(pos + 1); } } @@ -723,25 +721,24 @@ std::vector STR_String::Explode(char c) const } -/* +#if 0 int STR_String::Serialize(pCStream stream) { - if (stream->GetAccess() == CStream::Access_Read) - { + if (stream->GetAccess() == CStream::Access_Read) { int ln; stream->Read(&ln, sizeof(ln)); AllocBuffer(ln, false); stream->Read(pData, ln); pData[ln] = '\0'; Len = ln; - } else - { + } + else { stream->Write(&Len, sizeof(Len)); stream->Write(pData, Len); } return Len + sizeof(Len); } -*/ +#endif diff --git a/intern/utfconv/utf_winfunc.c b/intern/utfconv/utf_winfunc.c index 68d1d6bb403..3840dc25648 100644 --- a/intern/utfconv/utf_winfunc.c +++ b/intern/utfconv/utf_winfunc.c @@ -67,7 +67,7 @@ int uopen(const char *filename, int oflag, int pmode) UTF16_UN_ENCODE(filename); if (f == -1) { - if ((f=open(filename,oflag, pmode)) != -1) { + if ((f = open(filename,oflag, pmode)) != -1) { printf("WARNING: %s is not utf path. Please update it.\n",filename); } } -- cgit v1.2.3