Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision e551c694786a9c6aeacf3d063592a5011967933a)
+++ src/CodeGen/CodeGenerator.cc	(revision 567bb17400a3658779a3781ade2c0676eaa956c4)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Thu Sep 17 15:24:08 2015
-// Update Count     : 231
+// Last Modified On : Wed Jan 20 12:54:50 2016
+// Update Count     : 241
 //
 
@@ -392,20 +392,19 @@
 
 	void CodeGenerator::visit( CastExpr *castExpr ) {
-		// if the cast is to an lvalue type, then the cast
-		// should be dropped, since the result of a cast is
-		// never an lvalue in C
-		if ( castExpr->get_results().front()->get_isLvalue() ) {
-			castExpr->get_arg()->accept( *this );
-		} else {
-			output << "((";
-			if ( castExpr->get_results().empty() ) {
-				output << "void" ;
-			} else {
-				output << genType( castExpr->get_results().front(), "" );
-			} // if
+		output << "(";
+		if ( castExpr->get_results().empty() ) {
+			output << "(void)" ;
+		} else if ( ! castExpr->get_results().front()->get_isLvalue() ) {
+			// at least one result type of cast, but not an lvalue
+			output << "(";
+			output << genType( castExpr->get_results().front(), "" );
 			output << ")";
-			castExpr->get_arg()->accept( *this );
-			output << ")";			
+		} else {
+			// otherwise, the cast is to an lvalue type, so the cast
+			// should be dropped, since the result of a cast is
+			// never an lvalue in C
 		}
+		castExpr->get_arg()->accept( *this );
+		output << ")";
 	}
   
