diff options
author | Michal Krol <[email protected]> | 2005-03-18 14:28:02 +0000 |
---|---|---|
committer | Michal Krol <[email protected]> | 2005-03-18 14:28:02 +0000 |
commit | 2fb2e27e28569371bd0d12aa74504d53bb04edc0 (patch) | |
tree | 87fd04629f66c78767e68ed8fe9ea2d552771042 /src/mesa/shader/slang/Include/Common.h | |
parent | 5b641a516ecde984027d4fc1fe198195b7b861a7 (diff) |
update against 03-Feb-2005 release
Diffstat (limited to 'src/mesa/shader/slang/Include/Common.h')
-rwxr-xr-x | src/mesa/shader/slang/Include/Common.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mesa/shader/slang/Include/Common.h b/src/mesa/shader/slang/Include/Common.h index ea37ccd3889..bd1aaa8fcf4 100755 --- a/src/mesa/shader/slang/Include/Common.h +++ b/src/mesa/shader/slang/Include/Common.h @@ -1,5 +1,5 @@ //
-//Copyright (C) 2002-2004 3Dlabs Inc. Ltd.
+//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
//All rights reserved.
//
//Redistribution and use in source and binary forms, with or without
@@ -45,8 +45,6 @@ #define UINT_PTR uintptr_t
#endif
-#include <assert.h>
-
/* windows only pragma */
#ifdef _MSC_VER
#pragma warning(disable : 4786) // Don't warn about too long identifiers
@@ -73,6 +71,7 @@ typedef int TSourceLoc;
+#include <assert.h>
#include "PoolAlloc.h"
//
@@ -194,7 +193,7 @@ public : //
typedef pool_allocator<char> TStringAllocator;
typedef std::basic_string <char, std::char_traits<char>, TStringAllocator > TString;
-inline TString* NewPoolTString(char* s)
+inline TString* NewPoolTString(const char* s)
{
void* memory = GlobalPoolAllocator.allocate(sizeof(TString));
return new(memory) TString(s);
@@ -253,13 +252,12 @@ 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
- // we assume base 10 or 16 for all cases
- if (base == 10)
- sprintf(text, "%d", i);
- else if (base == 16)
- sprintf(text, "%x", i);
- else
- assert (!"String(int): unsupported base");
+ #ifdef _WIN32
+ itoa(i, text, base);
+ #else
+ // we assume base 10 for all cases
+ sprintf(text, "%d", i);
+ #endif
return text;
}
@@ -281,5 +279,7 @@ __inline TPersistString FormatSourceLoc(const TSourceLoc loc) return TPersistString(locText);
}
+typedef TMap<TString, TString> TPragmaTable;
+typedef TMap<TString, TString>::tAllocator TPragmaTableAllocator;
#endif // _COMMON_INCLUDED_
|