From: Brian Paul Date: Tue, 29 Mar 2005 02:28:21 +0000 (+0000) Subject: fix a variety of warnings/errors X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a54843a94801a2253a05e2b4b93fbaf09b59e96;p=mesa.git fix a variety of warnings/errors --- diff --git a/src/mesa/shader/slang/Include/Common.h b/src/mesa/shader/slang/Include/Common.h index bd1aaa8fcf4..4a9c0d34a74 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 3649981ef2c..e224d3b8676 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 6c654bdde2f..82c0314f348 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 cd5a8617cb7..9415879afe3 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 759a2902629..056fe17de02 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 497264348b7..ba717fce12b 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"); }