fix a variety of warnings/errors
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 29 Mar 2005 02:28:21 +0000 (02:28 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 29 Mar 2005 02:28:21 +0000 (02:28 +0000)
src/mesa/shader/slang/Include/Common.h
src/mesa/shader/slang/Include/PoolAlloc.h
src/mesa/shader/slang/Include/ShHandle.h
src/mesa/shader/slang/Include/Types.h
src/mesa/shader/slang/MachineIndependent/Intermediate.cpp
src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp

index bd1aaa8fcf44f4adb6f2959900b26f61df0fbdc8..4a9c0d34a74c5b980c86d6f1d315e4dd7d834bde 100755 (executable)
@@ -230,7 +230,10 @@ public:
     typedef pool_allocator<std::pair <K, D> > tAllocator;\r
 \r
     TMap() : TBaseMap<K, D, CMP, tAllocator >() {}\r
+/*\r
     TMap(const tAllocator& a) : TBaseMap<K, D, CMP, tAllocator >(key_compare(), a) {}\r
+*/\r
+    TMap(const tAllocator& a) : TBaseMap<K, D, CMP, tAllocator >() {}\r
 };\r
 \r
 //\r
@@ -275,7 +278,7 @@ __inline TPersistString FormatSourceLoc(const TSourceLoc loc)
     if (line)\r
         sprintf(locText, "%d:%d", string, line);\r
     else\r
-        sprintf(locText, "%d:? ", string, line);\r
+        sprintf(locText, "%d:? ", string);\r
 \r
     return TPersistString(locText);\r
 }\r
index 3649981ef2cf9985ff96a1804d75f9cde6ae2d50..e224d3b8676602e23457918628399244759919f3 100755 (executable)
@@ -287,7 +287,7 @@ public:
     pool_allocator(const pool_allocator<T>& p) : allocator(p.allocator) { }\r
 #endif\r
 \r
-#if _MSC_VER >= 1300\r
+#if defined(_MSC_VER) && _MSC_VER >= 1300\r
     template<class Other>\r
 #ifdef USING_SGI_STL\r
         pool_allocator(const pool_allocator<Other>& p) /*: allocator(p.getAllocator())*/ { }\r
index 6c654bdde2f87905992897a002817ca565c2476c..82c0314f3480134ece0e95aaea8bf0863ad89f3b 100755 (executable)
@@ -53,7 +53,7 @@ namespace Lf {
     class TBindingList;\r
     class TLinker;\r
     class TLibrary;\r
-};\r
+}\r
 \r
 //\r
 // The base class used to back handles returned to the driver.\r
index cd5a8617cb768c4ab4f690eb85054f50cdb7f536..9415879afe31af3e26069aa7c23fc8d4a6c81c1e 100755 (executable)
@@ -83,12 +83,12 @@ class TType {
 public:\r
     POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)\r
     explicit TType(TBasicType t, TQualifier q = EvqTemporary, int s = 1, bool m = false, bool a = false) :\r
-                            type(t), qualifier(q), size(s), matrix(m), array(a), arraySize(0),\r
-                            structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), typeName(0), mangled(0), fieldName(0)\r
+                            type(t), qualifier(q), size(s), matrix(m), array(a), arraySize(0), structure(0),\r
+                            structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), typeName(0), mangled(0)\r
                             { }\r
     explicit TType(TPublicType p) :  \r
                             type(p.type), qualifier(p.qualifier), size(p.size), matrix(p.matrix), array(p.array), arraySize(0), \r
-                            structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), mangled(0), typeName(0)\r
+                            structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), typeName(0), mangled(0)\r
                             {\r
                               if (p.userDef) {\r
                                   structure = p.userDef->getStruct();\r
@@ -277,20 +277,21 @@ public:
 protected:\r
     void buildMangledName(TString&);\r
 \r
+       TBasicType type      : 6;\r
+       TQualifier qualifier : 7;\r
+       int size             : 8; // size of vector or matrix, not size of array\r
+       unsigned int matrix  : 1;\r
+       unsigned int array   : 1;\r
+\r
     int arraySize;\r
     TTypeList* structure;      // 0 unless this is a struct\r
-       TString *fieldName;         // for structure field names\r
-       TString *typeName;          // for structure field type name\r
-    TString *mangled;\r
     int structureSize;\r
     int maxArraySize;\r
     TType* arrayInformationType;\r
+    TString *fieldName;         // for structure field names\r
+    TString *typeName;          // for structure field type name\r
+    TString *mangled;\r
 \r
-       TQualifier qualifier : 7;\r
-       TBasicType type      : 6;\r
-       int size             : 8; // size of vector or matrix, not size of array\r
-       unsigned int matrix  : 1;\r
-       unsigned int array   : 1;\r
 };\r
 \r
 #endif // _TYPES_INCLUDED_\r
index 759a290262989c39328e6acdcd4881c6a621e505..056fe17de02df6eee5723e90ee9e2201311e628b 100755 (executable)
@@ -1670,7 +1670,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, TIntermTyped* constantNod
                     //\r
                     int rightValue = constantNode->getAsConstantUnion()->getUnionArrayPointer()->iConst;\r
                     int leftValue = this->getUnionArrayPointer()->iConst;\r
-                    int line = this->getLine();\r
+                    //int line = this->getLine();\r
 \r
                     switch(op) {\r
                     //?? add constant intrinsics\r
@@ -2085,6 +2085,7 @@ bool TIntermediate::removeMatrixConstNode(TIntermSequence &parentSequence, TType
                     case EbtInt:   constantUnion->iConst = 0;     break;\r
                     case EbtFloat: constantUnion->fConst = 0.0;   break;\r
                     case EbtBool:  constantUnion->bConst = false; break;\r
+                    default: ; /* default added by BrianP */\r
                     }\r
                 }\r
                 TIntermConstantUnion *constant = new TIntermConstantUnion(constantUnion,\r
index 497264348b77a7f3df64de187b45fa2274667a21..ba717fce12b7dff1466d2b6d9f3822fbbc2457c1 100755 (executable)
@@ -203,7 +203,7 @@ void TAllocation::checkGuardBlock(unsigned char* blockMem, unsigned char val, ch
             char assertMsg[80];\r
 \r
             // We don't print the assert message.  It's here just to be helpful.\r
-            sprintf(assertMsg, "PoolAlloc: Damage %s %lu byte allocation at 0x%p\n",\r
+            sprintf(assertMsg, "PoolAlloc: Damage %s %u byte allocation at 0x%p\n",\r
                     locText, size, data());\r
             assert(0 && "PoolAlloc: Damage in guard block");\r
         }\r