Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision 150ec335b7adf4676c0cdefdf1c5851bb87eba35)
+++ src/ResolvExpr/ConversionCost.cc	(revision 4f748c526a24ee1180354967a91c27edd9dda5ce)
@@ -28,10 +28,10 @@
 
 namespace ResolvExpr {
-	const Cost Cost::zero = Cost( 0, 0, 0, 0 );
-	const Cost Cost::infinity = Cost( -1, -1, -1, -1 );
-	const Cost Cost::unsafe = Cost( 1, 0, 0, 0 );
-	const Cost Cost::poly = Cost( 0, 1, 0, 0 );
-	const Cost Cost::safe = Cost( 0, 0, 1, 0 );
-	const Cost Cost::reference = Cost( 0, 0, 0, 1 );
+	const Cost Cost::zero =      Cost(  0,  0,  0,  0 );
+	const Cost Cost::infinity =  Cost( -1, -1, -1, -1 );
+	const Cost Cost::unsafe =    Cost(  1,  0,  0,  0 );
+	const Cost Cost::poly =      Cost(  0,  1,  0,  0 );
+	const Cost Cost::safe =      Cost(  0,  0,  1,  0 );
+	const Cost Cost::reference = Cost(  0,  0,  0,  1 );
 
 #if 0
@@ -113,7 +113,7 @@
 					int assignResult = func( srcAsRef->get_base(), destAsRef->get_base(), env, indexer );
 					PRINT( std::cerr << "comparing references: " << assignResult << " " << srcAsRef << " " << destAsRef << std::endl; )
-					if ( assignResult < 0 ) {
+					if ( assignResult > 0 ) {
 						return Cost::safe;
-					} else if ( assignResult > 0 ) {
+					} else if ( assignResult < 0 ) {
 						return Cost::unsafe;
 					} // if
@@ -269,5 +269,5 @@
 	}
 
-	void ConversionCost::visit(PointerType *pointerType) {
+	void ConversionCost::visit( PointerType * pointerType ) {
 		if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) {
 			PRINT( std::cerr << pointerType << " ===> " << destAsPtr; )
@@ -284,21 +284,21 @@
 				}
 			} else {  // xxx - this discards qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right?
-				int assignResult = ptrsAssignable( pointerType->get_base(), destAsPtr->get_base(), env );
+				int assignResult = ptrsAssignable( pointerType->base, destAsPtr->base, env );
 				PRINT( std::cerr << " :: " << assignResult << std::endl; )
-				if ( assignResult < 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) {
+				if ( assignResult > 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) {
 					cost = Cost::safe;
-				} else if ( assignResult > 0 ) {
+				} else if ( assignResult < 0 ) {
 					cost = Cost::unsafe;
 				} // if
 				// assignResult == 0 means Cost::Infinity
 			} // if
-		} else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) {
+		} else if ( dynamic_cast< ZeroType * >( dest ) ) {
 			cost = Cost::unsafe;
 		} // if
 	}
 
-	void ConversionCost::visit(__attribute((unused)) ArrayType *arrayType) {}
-
-	void ConversionCost::visit(ReferenceType *refType) {
+	void ConversionCost::visit( ArrayType * ) {}
+
+	void ConversionCost::visit( ReferenceType * refType ) {
 		// Note: dest can never be a reference, since it would have been caught in an earlier check
 		assert( ! dynamic_cast< ReferenceType * >( dest ) );
@@ -317,7 +317,7 @@
 	}
 
-	void ConversionCost::visit(__attribute((unused)) FunctionType *functionType) {}
-
-	void ConversionCost::visit(StructInstType *inst) {
+	void ConversionCost::visit( FunctionType * ) {}
+
+	void ConversionCost::visit( StructInstType * inst ) {
 		if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) {
 			if ( inst->name == destAsInst->name ) {
@@ -327,5 +327,5 @@
 	}
 
-	void ConversionCost::visit(UnionInstType *inst) {
+	void ConversionCost::visit( UnionInstType * inst ) {
 		if ( UnionInstType *destAsInst = dynamic_cast< UnionInstType* >( dest ) ) {
 			if ( inst->name == destAsInst->name ) {
@@ -335,5 +335,5 @@
 	}
 
-	void ConversionCost::visit( __attribute((unused)) EnumInstType *inst ) {
+	void ConversionCost::visit( EnumInstType * ) {
 		static Type::Qualifiers q;
 		static BasicType integer( q, BasicType::SignedInt );
@@ -344,8 +344,7 @@
 	}
 
-	void ConversionCost::visit( __attribute((unused)) TraitInstType *inst) {
-	}
-
-	void ConversionCost::visit(TypeInstType *inst) {
+	void ConversionCost::visit( TraitInstType * ) {}
+
+	void ConversionCost::visit( TypeInstType *inst ) {
 		EqvClass eqvClass;
 		NamedTypeDecl *namedType;
@@ -366,9 +365,9 @@
 	}
 
-	void ConversionCost::visit( __attribute((unused)) TupleType *tupleType) {
+	void ConversionCost::visit( TupleType * tupleType ) {
 		Cost c = Cost::zero;
-		if ( TupleType *destAsTuple = dynamic_cast< TupleType* >( dest ) ) {
-			std::list< Type* >::const_iterator srcIt = tupleType->get_types().begin();
-			std::list< Type* >::const_iterator destIt = destAsTuple->get_types().begin();
+		if ( TupleType * destAsTuple = dynamic_cast< TupleType * >( dest ) ) {
+			std::list< Type * >::const_iterator srcIt = tupleType->get_types().begin();
+			std::list< Type * >::const_iterator destIt = destAsTuple->get_types().begin();
 			while ( srcIt != tupleType->get_types().end() && destIt != destAsTuple->get_types().end() ) {
 				Cost newCost = conversionCost( *srcIt++, *destIt++, indexer, env );
@@ -386,5 +385,5 @@
 	}
 
-	void ConversionCost::visit( __attribute((unused)) VarArgsType *varArgsType) {
+	void ConversionCost::visit( VarArgsType * ) {
 		if ( dynamic_cast< VarArgsType* >( dest ) ) {
 			cost = Cost::zero;
@@ -392,6 +391,6 @@
 	}
 
-	void ConversionCost::visit( __attribute((unused)) ZeroType *zeroType) {
-		if ( dynamic_cast< ZeroType* >( dest ) ) {
+	void ConversionCost::visit( ZeroType * ) {
+		if ( dynamic_cast< ZeroType * >( dest ) ) {
 			cost = Cost::zero;
 		} else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
@@ -409,6 +408,6 @@
 	}
 
-	void ConversionCost::visit( __attribute((unused)) OneType *oneType) {
-		if ( dynamic_cast< OneType* >( dest ) ) {
+	void ConversionCost::visit( OneType * ) {
+		if ( dynamic_cast< OneType * >( dest ) ) {
 			cost = Cost::zero;
 		} else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
