Bring up to date with VS 10 express.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@19945 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2012-12-12 21:21:23 +00:00
parent a0af473a8b
commit 200b2734d7
15 changed files with 96 additions and 77 deletions

View file

@ -158,7 +158,7 @@ inline const TString String(const int i, const int base = 10)
char text[16]; // 32 bit ints are at most 10 digits in base 10
#ifdef _WIN32
itoa(i, text, base);
_itoa_s(i, text, base);
#else
// we assume base 10 for all cases
sprintf(text, "%d", i);
@ -172,15 +172,16 @@ const unsigned int SourceLocStringShift = 16;
__inline TPersistString FormatSourceLoc(const TSourceLoc loc)
{
char locText[64];
const int maxSize = 64;
char locText[maxSize];
int string = loc >> SourceLocStringShift;
int line = loc & SourceLocLineMask;
if (line)
sprintf(locText, "%d:%d", string, line);
sprintf_s(locText, maxSize, "%d:%d", string, line);
else
sprintf(locText, "%d:? ", string);
sprintf_s(locText, maxSize, "%d:? ", string);
return TPersistString(locText);
}

View file

@ -72,11 +72,11 @@ public:
TInfoSinkBase& operator<<(const char* s) { append(s); return *this; }
TInfoSinkBase& operator<<(int n) { append(String(n)); return *this; }
TInfoSinkBase& operator<<(const unsigned int n) { append(String(n)); return *this; }
TInfoSinkBase& operator<<(float n) { char buf[40];
sprintf(buf, (fabs(n) > 1e-8 && fabs(n) < 1e8) || n == 0.0f ?
"%f" : "%g", n);
append(buf);
return *this; }
TInfoSinkBase& operator<<(float n) { const int size = 40; char buf[size];
sprintf_s(buf, size, (fabs(n) > 1e-8 && fabs(n) < 1e8) || n == 0.0f ?
"%f" : "%g", n);
append(buf);
return *this; }
TInfoSinkBase& operator+(const TPersistString& t) { append(t); return *this; }
TInfoSinkBase& operator+(const TString& t) { append(t); return *this; }
TInfoSinkBase& operator<<(const TString& t) { append(t); return *this; }