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 bd1aaa8..4a9c0d3 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 3649981..e224d3b 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 6c654bd..82c0314 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 cd5a861..9415879 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 759a290..056fe17 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 4972643..ba717fc 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