Index: src/ResolvExpr/ResolveTypeof.cc
===================================================================
--- src/ResolvExpr/ResolveTypeof.cc	(revision 14755e596c3349ae582c4ba327fbadd9f5c59770)
+++ src/ResolvExpr/ResolveTypeof.cc	(revision f431ab26466f0ec8aab6cdcca457b9384faaf366)
@@ -35,44 +35,43 @@
 
 struct ResolveTypeof : public ast::WithShortCircuiting {
-    const ResolveContext & context;
+	const ResolveContext & context;
 
-		ResolveTypeof( const ResolveContext & context ) :
-			context( context ) {}
+	ResolveTypeof( const ResolveContext & context ) : context( context ) {}
 
-		void previsit( const ast::TypeofType * ) { visit_children = false; }
+	void previsit( const ast::TypeofType * ) { visit_children = false; }
 
-        const ast::Type * postvisit( const ast::TypeofType * typeofType ) {
-        // pass on null expression
-            if ( ! typeofType->expr ) return typeofType;
+	const ast::Type * postvisit( const ast::TypeofType * typeofType ) {
+		// pass on null expression
+		if ( ! typeofType->expr ) return typeofType;
 
-            ast::ptr< ast::Type > newType;
-            if ( auto tyExpr = typeofType->expr.as< ast::TypeExpr >() ) {
-            // typeof wrapping type
-            newType = tyExpr->type;
-        } else {
-            // typeof wrapping expression
-            ast::TypeEnvironment dummy;
-            ast::ptr< ast::Expr > newExpr =
-                resolveInVoidContext( typeofType->expr, context, dummy );
-            assert( newExpr->result && ! newExpr->result->isVoid() );
-            newType = newExpr->result;
-        }
+		ast::ptr< ast::Type > newType;
+		if ( auto tyExpr = typeofType->expr.as< ast::TypeExpr >() ) {
+			// typeof wrapping type
+			newType = tyExpr->type;
+		} else {
+			// typeof wrapping expression
+			ast::TypeEnvironment dummy;
+			ast::ptr< ast::Expr > newExpr =
+				resolveInVoidContext( typeofType->expr, context, dummy );
+			assert( newExpr->result && ! newExpr->result->isVoid() );
+			newType = newExpr->result;
+		}
 
-        // clear qualifiers for base, combine with typeoftype quals regardless
-        if ( typeofType->kind == ast::TypeofType::Basetypeof ) {
-            // replace basetypeof(<enum>) by int
-				if ( newType.as< ast::EnumInstType >() ) {
-					newType = new ast::BasicType{
-						ast::BasicType::SignedInt, newType->qualifiers, copy(newType->attributes) };
-            }
-				reset_qualifiers(
-					newType,
-					( newType->qualifiers & ~ast::CV::EquivQualifiers ) | typeofType->qualifiers );
-        } else {
-				add_qualifiers( newType, typeofType->qualifiers );
-        }
+		// clear qualifiers for base, combine with typeoftype quals regardless
+		if ( typeofType->kind == ast::TypeofType::Basetypeof ) {
+			// replace basetypeof(<enum>) by int
+			if ( newType.as< ast::EnumInstType >() ) {
+				newType = new ast::BasicType(
+					ast::BasicType::SignedInt, newType->qualifiers, copy(newType->attributes) );
+			}
+			reset_qualifiers(
+				newType,
+				( newType->qualifiers & ~ast::CV::EquivQualifiers ) | typeofType->qualifiers );
+		} else {
+			add_qualifiers( newType, typeofType->qualifiers );
+		}
 
-        return newType.release();
-    }
+		return newType.release();
+	}
 };
 
@@ -111,83 +110,75 @@
 
 const ast::ObjectDecl * fixObjectType( const ast::ObjectDecl * decl , const ResolveContext & context ) {
-    if (decl->isTypeFixed) {
-        return decl;
-    }
+	if ( decl->isTypeFixed ) {
+		return decl;
+	}
 
-    auto mutDecl = mutate(decl);
-    fixObjectInit(decl, context);
-    {
-        auto resolvedType = resolveTypeof(decl->type, context);
-        resolvedType = fixArrayType(resolvedType, context);
-        mutDecl->type = resolvedType;
-    }
+	auto mutDecl = mutate(decl);
+	fixObjectInit(decl, context);
+	{
+		auto resolvedType = resolveTypeof(decl->type, context);
+		resolvedType = fixArrayType(resolvedType, context);
+		mutDecl->type = resolvedType;
+	}
 
-    // Do not mangle unnamed variables.
-    if (!mutDecl->name.empty()) {
-        mutDecl->mangleName = Mangle::mangle(mutDecl);
-    }
+	// Do not mangle unnamed variables.
+	if ( !mutDecl->name.empty() ) {
+		mutDecl->mangleName = Mangle::mangle(mutDecl);
+	}
 
-    mutDecl->type = renameTyVars(mutDecl->type, RenameMode::GEN_EXPR_ID);
-    mutDecl->isTypeFixed = true;
-    return mutDecl;
+	mutDecl->type = renameTyVars(mutDecl->type, RenameMode::GEN_EXPR_ID);
+	mutDecl->isTypeFixed = true;
+	return mutDecl;
 }
 
-const ast::ObjectDecl *fixObjectInit(const ast::ObjectDecl *decl,
-                                     const ResolveContext &context) {
-    if (decl->isTypeFixed) {
-        return decl;
-    }
+const ast::ObjectDecl *fixObjectInit(
+		const ast::ObjectDecl *decl, const ResolveContext &context) {
+	if ( decl->isTypeFixed ) {
+		return decl;
+	}
 
-    auto mutDecl = mutate(decl);
+	if ( auto listInit = decl->init.as<ast::ListInit>() ) {
+		for ( size_t k = 0; k < listInit->designations.size(); k++ ) {
+			const ast::Designation *des = listInit->designations[k].get();
+			// Desination here
+			ast::Designation * newDesignation = new ast::Designation(des->location);
+			std::deque<ast::ptr<ast::Expr>> newDesignators;
 
-    if ( auto mutListInit = mutDecl->init.as<ast::ListInit>() ) {
-        // std::list<ast::Designation *> newDesignations;        
-
-        for ( size_t k = 0; k < mutListInit->designations.size(); k++ ) {
-            const ast::Designation *des = mutListInit->designations[k].get();
-            // Desination here
-            ast::Designation * newDesignation = new ast::Designation(des->location);
-            std::deque<ast::ptr<ast::Expr>> newDesignators;
-
-            for ( ast::ptr<ast::Expr> designator : des->designators ) {
-                // Stupid flag variable for development, to be removed
-                // bool mutated = false;
-                if ( const ast::NameExpr * designatorName = designator.as<ast::NameExpr>() ) {
-                    auto candidates = context.symtab.lookupId(designatorName->name);
-                    // Does not work for the overloading case currently
-                    // assert( candidates.size() == 1 );
-                    if ( candidates.size() != 1 ) return mutDecl;
-                    auto candidate = candidates.at(0);
-                    if ( const ast::EnumInstType * enumInst = dynamic_cast<const ast::EnumInstType *>(candidate.id->get_type())) {
-                        // determine that is an enumInst, swap it with its const value
-                        assert( candidates.size() == 1 );
-                        const ast::EnumDecl * baseEnum = enumInst->base;
-                        // Need to iterate over all enum value to find the initializer to swap
-                        for ( size_t m = 0; m < baseEnum->members.size(); ++m ) {
-                            const ast::ObjectDecl * mem = baseEnum->members.at(m).as<const ast::ObjectDecl>();
-                            if ( baseEnum->members.at(m)->name == designatorName->name ) {
-                                assert(mem);
-                                newDesignators.push_back( ast::ConstantExpr::from_int(designator->location, m) );
-                                // mutated = true;
-                                break;
-                            }
-                        }
-                    } else {
-                        newDesignators.push_back( des->designators.at(0) );
-                    }
-                } else {
-                    newDesignators.push_back( des->designators.at(0) );
-                }
-            }            
-            
-            newDesignation->designators = newDesignators;
-            mutListInit = ast::mutate_field_index(mutListInit, &ast::ListInit::designations, k, newDesignation);
-            
-        }
-    }
-    return mutDecl;
+			for ( ast::ptr<ast::Expr> designator : des->designators ) {
+				// Stupid flag variable for development, to be removed
+				if ( const ast::NameExpr * designatorName = designator.as<ast::NameExpr>() ) {
+					auto candidates = context.symtab.lookupId(designatorName->name);
+					// Does not work for the overloading case currently
+					// assert( candidates.size() == 1 );
+					if ( candidates.size() != 1 ) return decl;
+					auto candidate = candidates.at(0);
+					if ( const ast::EnumInstType * enumInst = dynamic_cast<const ast::EnumInstType *>(candidate.id->get_type())) {
+						// determine that is an enumInst, swap it with its const value
+						assert( candidates.size() == 1 );
+						const ast::EnumDecl * baseEnum = enumInst->base;
+						// Need to iterate over all enum value to find the initializer to swap
+						for ( size_t m = 0; m < baseEnum->members.size(); ++m ) {
+							const ast::ObjectDecl * mem = baseEnum->members.at(m).as<const ast::ObjectDecl>();
+							if ( baseEnum->members.at(m)->name == designatorName->name ) {
+								assert( mem );
+								newDesignators.push_back( ast::ConstantExpr::from_int(designator->location, m) );
+								break;
+							}
+						}
+					} else {
+						newDesignators.push_back( des->designators.at(0) );
+					}
+				} else {
+					newDesignators.push_back( des->designators.at(0) );
+				}
+			}
+			newDesignation->designators = newDesignators;
+			listInit = ast::mutate_field_index(listInit, &ast::ListInit::designations, k, newDesignation);
+		}
+	}
+	return decl;
 }
 
-}  // namespace ResolvExpr
+} // namespace ResolvExpr
 
 // Local Variables: //
