From 9a54843a94801a2253a05e2b4b93fbaf09b59e96 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Mar 2005 02:28:21 +0000 Subject: fix a variety of warnings/errors --- src/mesa/shader/slang/Include/Common.h | 5 ++++- src/mesa/shader/slang/Include/PoolAlloc.h | 2 +- src/mesa/shader/slang/Include/ShHandle.h | 2 +- src/mesa/shader/slang/Include/Types.h | 23 +++++++++++----------- .../slang/MachineIndependent/Intermediate.cpp | 3 ++- .../shader/slang/MachineIndependent/PoolAlloc.cpp | 2 +- 6 files changed, 21 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/Include/Common.h b/src/mesa/shader/slang/Include/Common.h index bd1aaa8fcf..4a9c0d34a7 100755 --- a/src/mesa/shader/slang/Include/Common.h +++ b/src/mesa/shader/slang/Include/Common.h @@ -230,7 +230,10 @@ public: typedef pool_allocator > tAllocator; TMap() : TBaseMap() {} +/* TMap(const tAllocator& a) : TBaseMap(key_compare(), a) {} +*/ + TMap(const tAllocator& a) : TBaseMap() {} }; // @@ -275,7 +278,7 @@ __inline TPersistString FormatSourceLoc(const TSourceLoc loc) if (line) sprintf(locText, "%d:%d", string, line); else - sprintf(locText, "%d:? ", string, line); + sprintf(locText, "%d:? ", string); return TPersistString(locText); } diff --git a/src/mesa/shader/slang/Include/PoolAlloc.h b/src/mesa/shader/slang/Include/PoolAlloc.h index 3649981ef2..e224d3b867 100755 --- a/src/mesa/shader/slang/Include/PoolAlloc.h +++ b/src/mesa/shader/slang/Include/PoolAlloc.h @@ -287,7 +287,7 @@ public: pool_allocator(const pool_allocator& p) : allocator(p.allocator) { } #endif -#if _MSC_VER >= 1300 +#if defined(_MSC_VER) && _MSC_VER >= 1300 template #ifdef USING_SGI_STL pool_allocator(const pool_allocator& p) /*: allocator(p.getAllocator())*/ { } diff --git a/src/mesa/shader/slang/Include/ShHandle.h b/src/mesa/shader/slang/Include/ShHandle.h index 6c654bdde2..82c0314f34 100755 --- a/src/mesa/shader/slang/Include/ShHandle.h +++ b/src/mesa/shader/slang/Include/ShHandle.h @@ -53,7 +53,7 @@ namespace Lf { class TBindingList; class TLinker; class TLibrary; -}; +} // // The base class used to back handles returned to the driver. diff --git a/src/mesa/shader/slang/Include/Types.h b/src/mesa/shader/slang/Include/Types.h index cd5a8617cb..9415879afe 100755 --- a/src/mesa/shader/slang/Include/Types.h +++ b/src/mesa/shader/slang/Include/Types.h @@ -83,12 +83,12 @@ class TType { public: POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator) explicit TType(TBasicType t, TQualifier q = EvqTemporary, int s = 1, bool m = false, bool a = false) : - type(t), qualifier(q), size(s), matrix(m), array(a), arraySize(0), - structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), typeName(0), mangled(0), fieldName(0) + type(t), qualifier(q), size(s), matrix(m), array(a), arraySize(0), structure(0), + structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), typeName(0), mangled(0) { } explicit TType(TPublicType p) : type(p.type), qualifier(p.qualifier), size(p.size), matrix(p.matrix), array(p.array), arraySize(0), - structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), mangled(0), typeName(0) + structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), typeName(0), mangled(0) { if (p.userDef) { structure = p.userDef->getStruct(); @@ -277,20 +277,21 @@ public: protected: void buildMangledName(TString&); + TBasicType type : 6; + TQualifier qualifier : 7; + int size : 8; // size of vector or matrix, not size of array + unsigned int matrix : 1; + unsigned int array : 1; + int arraySize; TTypeList* structure; // 0 unless this is a struct - TString *fieldName; // for structure field names - TString *typeName; // for structure field type name - TString *mangled; int structureSize; int maxArraySize; TType* arrayInformationType; + TString *fieldName; // for structure field names + TString *typeName; // for structure field type name + TString *mangled; - TQualifier qualifier : 7; - TBasicType type : 6; - int size : 8; // size of vector or matrix, not size of array - unsigned int matrix : 1; - unsigned int array : 1; }; #endif // _TYPES_INCLUDED_ diff --git a/src/mesa/shader/slang/MachineIndependent/Intermediate.cpp b/src/mesa/shader/slang/MachineIndependent/Intermediate.cpp index 759a290262..056fe17de0 100755 --- a/src/mesa/shader/slang/MachineIndependent/Intermediate.cpp +++ b/src/mesa/shader/slang/MachineIndependent/Intermediate.cpp @@ -1670,7 +1670,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, TIntermTyped* constantNod // int rightValue = constantNode->getAsConstantUnion()->getUnionArrayPointer()->iConst; int leftValue = this->getUnionArrayPointer()->iConst; - int line = this->getLine(); + //int line = this->getLine(); switch(op) { //?? add constant intrinsics @@ -2085,6 +2085,7 @@ bool TIntermediate::removeMatrixConstNode(TIntermSequence &parentSequence, TType case EbtInt: constantUnion->iConst = 0; break; case EbtFloat: constantUnion->fConst = 0.0; break; case EbtBool: constantUnion->bConst = false; break; + default: ; /* default added by BrianP */ } } TIntermConstantUnion *constant = new TIntermConstantUnion(constantUnion, diff --git a/src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp b/src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp index 497264348b..ba717fce12 100755 --- a/src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp +++ b/src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp @@ -203,7 +203,7 @@ void TAllocation::checkGuardBlock(unsigned char* blockMem, unsigned char val, ch char assertMsg[80]; // We don't print the assert message. It's here just to be helpful. - sprintf(assertMsg, "PoolAlloc: Damage %s %lu byte allocation at 0x%p\n", + sprintf(assertMsg, "PoolAlloc: Damage %s %u byte allocation at 0x%p\n", locText, size, data()); assert(0 && "PoolAlloc: Damage in guard block"); } -- cgit v1.2.3