Thrift: Whitespace cleanup.

Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.

Reviewed By: mcslee

Test Plan: git diff -b

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/generate/t_cocoa_generator.h b/compiler/cpp/src/generate/t_cocoa_generator.h
index 9ceac31..79f3007 100644
--- a/compiler/cpp/src/generate/t_cocoa_generator.h
+++ b/compiler/cpp/src/generate/t_cocoa_generator.h
@@ -65,10 +65,10 @@
   void generate_cocoa_struct_result_writer(std::ofstream& out, t_struct* tstruct);
   void generate_cocoa_struct_writer(std::ofstream& out, t_struct* tstruct);
   void generate_cocoa_struct_description(std::ofstream& out, t_struct* tstruct);
-  
+
   std::string function_result_helper_struct_type(t_function* tfunction);
   void generate_function_helpers(t_function* tfunction);
-  
+
   /**
    * Service-level generation functions
    */
@@ -86,17 +86,17 @@
    */
 
   void generate_deserialize_field        (std::ofstream& out,
-                                          t_field*    tfield, 
+                                          t_field*    tfield,
                                           std::string fieldName);
-  
+
   void generate_deserialize_struct       (std::ofstream& out,
                                           t_struct*   tstruct,
                                           std::string prefix="");
-  
+
   void generate_deserialize_container    (std::ofstream& out,
                                           t_type*     ttype,
                                           std::string prefix="");
-  
+
   void generate_deserialize_set_element  (std::ofstream& out,
                                           t_set*      tset,
                                           std::string prefix="");
@@ -157,7 +157,7 @@
     ttype = get_true_type(ttype);
 
     return
-      ttype->is_container() || 
+      ttype->is_container() ||
       ttype->is_struct() ||
       ttype->is_xception() ||
       ttype->is_string();
diff --git a/compiler/cpp/src/generate/t_csharp_generator.cc b/compiler/cpp/src/generate/t_csharp_generator.cc
index fceec84..676125c 100644
--- a/compiler/cpp/src/generate/t_csharp_generator.cc
+++ b/compiler/cpp/src/generate/t_csharp_generator.cc
@@ -49,9 +49,9 @@
 string t_csharp_generator::csharp_type_usings() {
   return string() +
     "using System;\n" +
-    "using System.Collections;\n" + 
+    "using System.Collections;\n" +
     "using System.Collections.Generic;\n" +
-    "using System.Text;\n" + 
+    "using System.Text;\n" +
     "using Thrift;\n";
 }
 
@@ -95,7 +95,7 @@
   }
 
   scope_down(f_enum);
-  
+
   end_csharp_namespace(f_enum);
 
   f_enum.close();
@@ -332,7 +332,7 @@
     indent_down();
     indent(out) << "}" << endl << endl;
   }
-  
+
   indent(out) <<
     "public " << tstruct->get_name() << "() {" << endl;
   indent_up();
@@ -376,7 +376,7 @@
   indent(out) <<
     "TField field;" << endl <<
     indent() << "TStruct struc = iprot.ReadStructBegin();" << endl;
-  
+
   indent(out) <<
     "while (true)" << endl;
   scope_up(out);
@@ -1070,7 +1070,7 @@
   } else if (type->is_base_type() || type->is_enum()) {
     indent(out) <<
       name << " = ";
-    
+
     if (type->is_enum())
     {
       out << "(" << type_name(type, false, true) << ")";
@@ -1157,7 +1157,7 @@
   indent(out) <<
     "for( int " << i << " = 0; " << i << " < " << obj << ".Count" << "; " << "++" << i << ")" << endl;
   scope_up(out);
-  
+
   if (ttype->is_map()) {
     generate_deserialize_map_element(out, (t_map*)ttype, prefix);
   } else if (ttype->is_set()) {
diff --git a/compiler/cpp/src/generate/t_hs_generator.cc b/compiler/cpp/src/generate/t_hs_generator.cc
index 6ef7a95..3be56b1 100644
--- a/compiler/cpp/src/generate/t_hs_generator.cc
+++ b/compiler/cpp/src/generate/t_hs_generator.cc
@@ -126,7 +126,7 @@
   f_types_.close();
   f_consts_.close();
 }
- 
+
 /**
  * Generates a typedef. Ez.
  *
@@ -138,7 +138,7 @@
 }
 
 /**
- * Generates code for an enumerated type. 
+ * Generates code for an enumerated type.
  * the values.
  *
  * @param tenum The enumeration
@@ -172,7 +172,7 @@
       ++value;
     }
     string name = capitalize((*c_iter)->get_name());
-    
+
     f_types_ <<
       indent() << name << " -> " << value << endl;
   }
@@ -187,7 +187,7 @@
       ++value;
     }
     string name = capitalize((*c_iter)->get_name());
-    
+
     f_types_ <<
       indent() << value << " -> " << name << endl;
   }
@@ -318,10 +318,10 @@
     t_type* etype = ((t_set*)type)->get_elem_type();
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
-    out << "(mkSet [";    
+    out << "(mkSet [";
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string val = render_const_value(etype, *v_iter);
-      out << val; 
+      out << val;
     }
     out << "])";
   }
@@ -342,7 +342,7 @@
  * @param txception The struct definition
  */
 void t_hs_generator::generate_xception(t_struct* txception) {
-  generate_hs_struct(txception, true);  
+  generate_hs_struct(txception, true);
 }
 
 /**
@@ -354,7 +354,7 @@
 }
 
 /**
- * Generates a struct definition for a thrift data type. 
+ * Generates a struct definition for a thrift data type.
  *
  * @param tstruct The struct definition
  */
@@ -365,7 +365,7 @@
   string tname = type_name(tstruct);
   string name = tstruct->get_name();
   const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter; 
+  vector<t_field*>::const_iterator m_iter;
 
   indent(out) << "data "<<tname<<" = "<<tname;
   if (members.size() > 0) {
@@ -405,7 +405,7 @@
 
   indent(out) << "read_" << sname << "_fields iprot rec = do" << endl;
   indent_up(); // do
-    
+
   // Read beginning field marker
   indent(out) << "(_," << t <<","<<id<<") <- readFieldBegin iprot" << endl;
   // Check for field STOP marker and break
@@ -443,7 +443,7 @@
   indent_down(); // -case
   indent_down(); // -if
   indent_down(); // -do
-  indent_down(); 
+  indent_down();
 
   // read
   indent(out) << "read_"<<sname<<" iprot = do" << endl;
@@ -526,11 +526,11 @@
 
 
   f_service_ <<
-     "import " << capitalize(program_name_) << "_Types" << endl << 
+     "import " << capitalize(program_name_) << "_Types" << endl <<
     "import qualified " << capitalize(service_name_) << "_Iface as Iface" << endl;
 
- 
-  // Generate the three main parts of the service 
+
+  // Generate the three main parts of the service
   generate_service_helpers(tservice);
   generate_service_interface(tservice);
   generate_service_client(tservice);
@@ -592,10 +592,10 @@
   indent(f_iface_) << "module " << capitalize(service_name_) << "_Iface where" << endl;
 
   indent(f_iface_) <<
-    hs_imports() << endl << 
-    "import " << capitalize(program_name_) << "_Types" << endl << 
+    hs_imports() << endl <<
+    "import " << capitalize(program_name_) << "_Types" << endl <<
     endl;
-  
+
   if (tservice->get_extends() != NULL) {
     string extends = type_name(tservice->get_extends());
     indent(f_iface_) << "import " << extends <<"_Iface" << endl;
@@ -606,7 +606,7 @@
   indent_up();
 
   vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter; 
+  vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     string ft = function_type(*f_iter,true,true,true);
     f_iface_ <<
@@ -628,7 +628,7 @@
   f_client_.open(f_client_name.c_str());
 
   vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;    
+  vector<t_function*>::const_iterator f_iter;
 
   string extends = "";
   string exports="";
@@ -653,7 +653,7 @@
   indent(f_client_) << "import " << capitalize(service_name_) << endl;
   // DATS RITE A GLOBAL VAR
   indent(f_client_) << "seqid = newIORef 0" << endl;
-   
+
 
   // Generate client method implementations
 
@@ -674,24 +674,24 @@
     indent(f_client_) <<  "send_" << funname << " op" << fargs;
 
     f_client_ << endl;
-    
+
     if (!(*f_iter)->is_async()) {
       f_client_ << indent();
       f_client_ <<
         "recv_" << funname << " ip" << endl;
     }
     indent_down();
-    
+
     indent(f_client_) <<
       "send_" << funname << " op" << fargs << " = do" << endl;
     indent_up();
     indent(f_client_) << "seq <- seqid" << endl;
     indent(f_client_) << "seqn <- readIORef seq" << endl;
     std::string argsname = capitalize((*f_iter)->get_name() + "_args");
-    
+
     // Serialize the request header
     f_client_ <<
-      indent() << "writeMessageBegin op (\"" << (*f_iter)->get_name() << "\", M_CALL, seqn)" << endl; 
+      indent() << "writeMessageBegin op (\"" << (*f_iter)->get_name() << "\", M_CALL, seqn)" << endl;
     f_client_ << indent() << "write_" << argsname << " op ("<<argsname<<"{";
     bool first = true;
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
@@ -702,12 +702,12 @@
       f_client_ << "f_" << argsname <<"_" << (*fld_iter)->get_name() << "=Just arg_" << (*fld_iter)->get_name();
     }
     f_client_ << "})" << endl;
-    
+
     // Write to the stream
     f_client_ <<
       indent() << "writeMessageEnd op" << endl <<
-      indent() << "pflush op" << endl;  
-    
+      indent() << "pflush op" << endl;
+
     indent_down();
 
     if (!(*f_iter)->is_async()) {
@@ -715,7 +715,7 @@
       t_struct noargs(program_);
 
       std::string funname = string("recv_") + (*f_iter)->get_name();
-      
+
       t_function recv_function((*f_iter)->get_returntype(),
                                funname,
                                &noargs);
@@ -753,8 +753,8 @@
         indent(f_client_) << "Nothing -> do" << endl;
         indent_up(); // none
       }
-      
-      
+
+
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         f_client_ <<
@@ -764,7 +764,7 @@
         indent(f_client_) << "Just _v -> throwDyn _v" << endl;
         indent_down(); //-case
       }
-      
+
       // Careful, only return _result if not a void function
       if ((*f_iter)->get_returntype()->is_void()) {
         indent(f_client_) <<
@@ -793,7 +793,7 @@
 void t_hs_generator::generate_service_server(t_service* tservice) {
   // Generate the dispatch methods
   vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter; 
+  vector<t_function*>::iterator f_iter;
 
   // Generate the process subfunctions
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -871,7 +871,7 @@
       n++;
     }
     indent(f_service_) << "rs <- return (" << resultname;
-      
+
     for(int i=0; i<n;i++){
       f_service_ << " Nothing";
     }
@@ -909,7 +909,7 @@
   }
   f_service_ << ")" << endl;
   indent_down();
-  
+
   if (xceptions.size() > 0 && !tfunction->is_async()) {
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       indent(f_service_) << "(\\e  -> " <<endl;
@@ -980,7 +980,7 @@
     case t_base_type::TYPE_VOID:
       throw "compiler error: cannot serialize void field in a struct";
       break;
-    case t_base_type::TYPE_STRING:        
+    case t_base_type::TYPE_STRING:
       out << "readString";
       break;
     case t_base_type::TYPE_BOOL:
@@ -1013,7 +1013,7 @@
            type->get_name().c_str());
   }
 }
-  
+
 
 /**
  * Generates an unserializer for a struct, calling read()
@@ -1036,7 +1036,7 @@
   string vtype = tmp("_vtype");
   string etype = tmp("_etype");
   string con = tmp("_con");
-  
+
   t_field fsize(g_type_i32, size);
   t_field fktype(g_type_byte, ktype);
   t_field fvtype(g_type_byte, vtype);
@@ -1080,7 +1080,7 @@
 
   if(name.length() == 0){
     name = decapitalize(tfield->get_name());
-  }  
+  }
 
   if (type->is_struct() || type->is_xception()) {
     generate_serialize_struct(out,
@@ -1122,12 +1122,12 @@
       default:
         throw "compiler error: no hs name for base type " + t_base_type::t_base_name(tbase);
       }
-    
+
     } else if (type->is_enum()) {
       string ename = capitalize(type->get_name());
       out << "writeI32 oprot (fromEnum "<< name << ")";
     }
-    
+
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s' TYPE '%s'\n",
            tfield->get_name().c_str(),
@@ -1210,7 +1210,7 @@
 
 string t_hs_generator::function_type(t_function* tfunc, bool options, bool io, bool method){
   string result="";
-  
+
   const vector<t_field*>& fields = tfunc->get_arglist()->get_members();
   vector<t_field*>::const_iterator f_iter;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
@@ -1254,7 +1254,7 @@
  */
 string t_hs_generator::type_to_enum(t_type* type) {
   type = get_true_type(type);
-  
+
   if (type->is_base_type()) {
     t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
     switch (tbase) {
@@ -1295,7 +1295,7 @@
  */
 string t_hs_generator::render_hs_type(t_type* type) {
   type = get_true_type(type);
-  
+
   if (type->is_base_type()) {
     t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
     switch (tbase) {
diff --git a/compiler/cpp/src/generate/t_hs_generator.h b/compiler/cpp/src/generate/t_hs_generator.h
index bae507b..facefbe 100644
--- a/compiler/cpp/src/generate/t_hs_generator.h
+++ b/compiler/cpp/src/generate/t_hs_generator.h
@@ -74,13 +74,13 @@
   void generate_deserialize_field        (std::ofstream &out,
                                           t_field*    tfield,
                                           std::string prefix);
-  
+
   void generate_deserialize_struct       (std::ofstream &out,
                                           t_struct*   tstruct);
-  
+
   void generate_deserialize_container    (std::ofstream &out,
                                           t_type*     ttype);
-  
+
   void generate_deserialize_set_element  (std::ofstream &out,
                                           t_set*      tset);
 
diff --git a/compiler/cpp/src/generate/t_java_generator.h b/compiler/cpp/src/generate/t_java_generator.h
index d3b85d5..fe0a481 100644
--- a/compiler/cpp/src/generate/t_java_generator.h
+++ b/compiler/cpp/src/generate/t_java_generator.h
@@ -77,17 +77,17 @@
    */
 
   void generate_deserialize_field        (std::ofstream& out,
-                                          t_field*    tfield, 
+                                          t_field*    tfield,
                                           std::string prefix="");
-  
+
   void generate_deserialize_struct       (std::ofstream& out,
                                           t_struct*   tstruct,
                                           std::string prefix="");
-  
+
   void generate_deserialize_container    (std::ofstream& out,
                                           t_type*     ttype,
                                           std::string prefix="");
-  
+
   void generate_deserialize_set_element  (std::ofstream& out,
                                           t_set*      tset,
                                           std::string prefix="");
@@ -147,7 +147,7 @@
     ttype = get_true_type(ttype);
 
     return
-      ttype->is_container() || 
+      ttype->is_container() ||
       ttype->is_struct() ||
       ttype->is_xception() ||
       ttype->is_string();
diff --git a/compiler/cpp/src/generate/t_ocaml_generator.cc b/compiler/cpp/src/generate/t_ocaml_generator.cc
index f4f5c4a..eafda46 100644
--- a/compiler/cpp/src/generate/t_ocaml_generator.cc
+++ b/compiler/cpp/src/generate/t_ocaml_generator.cc
@@ -124,7 +124,7 @@
   // Close types file
   f_types_.close();
 }
- 
+
 /**
  * Generates a typedef. Ez.
  *
@@ -138,7 +138,7 @@
 }
 
 /**
- * Generates code for an enumerated type. 
+ * Generates code for an enumerated type.
  * the values.
  *
  * @param tenum The enumeration
@@ -170,7 +170,7 @@
       ++value;
     }
     string name = capitalize((*c_iter)->get_name());
-    
+
     f_types_ <<
       indent() << "| " << name << " -> " << value << endl;
   }
@@ -186,7 +186,7 @@
       ++value;
     }
     string name = capitalize((*c_iter)->get_name());
-    
+
     f_types_ <<
       indent() << "| " << value << " -> " << name << endl;
   }
@@ -352,7 +352,7 @@
  * @param txception The struct definition
  */
 void t_ocaml_generator::generate_xception(t_struct* txception) {
-  generate_ocaml_struct(txception, true);  
+  generate_ocaml_struct(txception, true);
 }
 
 /**
@@ -365,7 +365,7 @@
 }
 
 /**
- * Generates a struct definition for a thrift data type. 
+ * Generates a struct definition for a thrift data type.
  *
  * @param tstruct The struct definition
  */
@@ -373,7 +373,7 @@
                                                          t_struct* tstruct,
                                                          bool is_exception) {
   const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter; 
+  vector<t_field*>::const_iterator m_iter;
   string tname = type_name(tstruct);
   indent(out) << "class " << tname << " =" << endl;
   indent(out) << "object (self)" << endl;
@@ -402,7 +402,7 @@
 }
 
 /**
- * Generates a struct definition for a thrift data type. 
+ * Generates a struct definition for a thrift data type.
  *
  * @param tstruct The struct definition
  */
@@ -410,7 +410,7 @@
                                                   t_struct* tstruct,
                                                   bool is_exception) {
   const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter; 
+  vector<t_field*>::const_iterator m_iter;
   string tname = type_name(tstruct);
   indent(out) << "class " << tname << " :" << endl;
   indent(out) << "object" << endl;
@@ -454,18 +454,18 @@
   indent(out) << "let " << str << " = new " << sname << " in" << endl;
   indent_up();
   indent(out) <<
-    "ignore(iprot#readStructBegin);" << endl;   
+    "ignore(iprot#readStructBegin);" << endl;
 
   // Loop over reading in fields
   indent(out) <<
     "(try while true do" << endl;
   indent_up();
   indent_up();
-    
+
   // Read beginning field marker
   indent(out) <<
     "let (_," << t <<","<<id<<") = iprot#readFieldBegin in" << endl;
-  
+
   // Check for field STOP marker and break
   indent(out) <<
     "if " << t <<" = Protocol.T_STOP then" << endl;
@@ -474,7 +474,7 @@
       "raise Break" << endl;
     indent_down();
     indent(out) << "else ();" << endl;
-    
+
     indent(out) << "(match " << id<<" with " << endl;
     indent_up();
     // Generate deserialization code for known cases
@@ -494,7 +494,7 @@
     // In the default case we skip the field
     out <<
       indent() << "| _ -> " << "iprot#skip "<<t<<");" << endl;
-    indent_down();      
+    indent_down();
     // Read field end marker
     indent(out) << "iprot#readFieldEnd;" << endl;
     indent_down();
@@ -578,14 +578,14 @@
   }
   */
   f_service_ <<
-     "open " << capitalize(program_name_) << "_types" << endl << 
+     "open " << capitalize(program_name_) << "_types" << endl <<
     endl;
 
   f_service_i_ <<
-     "open " << capitalize(program_name_) << "_types" << endl << 
+     "open " << capitalize(program_name_) << "_types" << endl <<
     endl;
 
-  // Generate the three main parts of the service 
+  // Generate the three main parts of the service
   generate_service_helpers(tservice);
   generate_service_interface(tservice);
   generate_service_client(tservice);
@@ -657,7 +657,7 @@
   }
 
   vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter; 
+  vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     string ft = function_type(*f_iter,true,true);
     f_service_ <<
@@ -691,11 +691,11 @@
     indent(f_service_i_) << "inherit " << extends << ".client" << endl;
   }
   indent(f_service_) << "val mutable seqid = 0" << endl;
-   
+
 
   // Generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;    
+  vector<t_function*>::const_iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     t_struct* arg_struct = (*f_iter)->get_arglist();
     const vector<t_field*>& fields = arg_struct->get_members();
@@ -711,51 +711,51 @@
     indent(f_service_) <<
       "self#send_" << funname;
 
- 
+
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ << " " << decapitalize((*fld_iter)->get_name());
     }
     f_service_ << ";" << endl;
-    
+
     if (!(*f_iter)->is_async()) {
       f_service_ << indent();
       f_service_ <<
         "self#recv_" << funname << endl;
     }
     indent_down();
-    
+
     indent(f_service_) <<
       "method private send_" << function_signature(*f_iter) << " = " << endl;
     indent_up();
-    
+
     std::string argsname = decapitalize((*f_iter)->get_name() + "_args");
-    
+
     // Serialize the request header
     f_service_ <<
       indent() << "oprot#writeMessageBegin (\"" << (*f_iter)->get_name() << "\", Protocol.CALL, seqid);" << endl;
-    
+
     f_service_ <<
       indent() << "let args = new " << argsname << " in" << endl;
     indent_up();
-    
+
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ <<
         indent() << "args#set_" << (*fld_iter)->get_name() << " " << (*fld_iter)->get_name() << ";" << endl;
     }
-    
+
     // Write to the stream
     f_service_ <<
       indent() << "args#write oprot;" << endl <<
       indent() << "oprot#writeMessageEnd;" << endl <<
-      indent() << "oprot#getTransport#flush" << endl;  
-    
+      indent() << "oprot#getTransport#flush" << endl;
+
     indent_down();
     indent_down();
 
     if (!(*f_iter)->is_async()) {
       std::string resultname = decapitalize((*f_iter)->get_name() + "_result");
       t_struct noargs(program_);
-      
+
       t_function recv_function((*f_iter)->get_returntype(),
                                string("recv_") + (*f_iter)->get_name(),
                                &noargs);
@@ -798,15 +798,15 @@
           indent() << "match result#get_success with Some v -> v | None -> (" << endl;
         indent_up();
       }
-      
-      
+
+
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         f_service_ <<
           indent() << "(match result#get_" << (*x_iter)->get_name() << " with None -> () | Some _v ->" << endl;
         indent(f_service_) << "  raise (" << capitalize(type_name((*x_iter)->get_type())) << " _v));" << endl;
       }
-      
+
       // Careful, only return _result if not a void function
       if ((*f_iter)->get_returntype()->is_void()) {
         indent(f_service_) <<
@@ -815,7 +815,7 @@
         f_service_ <<
           indent() << "raise (Application_Exn.E (Application_Exn.create Application_Exn.MISSING_RESULT \"" << (*f_iter)->get_name() << " failed: unknown result\")))" << endl;
         indent_down();
-      }     
+      }
 
       // Close function
       indent_down();
@@ -837,7 +837,7 @@
 void t_ocaml_generator::generate_service_server(t_service* tservice) {
   // Generate the dispatch methods
   vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter; 
+  vector<t_function*>::iterator f_iter;
 
 
   // Generate the header portion
@@ -854,7 +854,7 @@
      indent() << "inherit Processor.t" << endl <<
     endl;
   string extends = "";
- 
+
   if (tservice->get_extends() != NULL) {
     extends = type_name(tservice->get_extends());
     indent(f_service_) << "inherit " + extends + ".processor (handler :> " + extends + ".iface)" << endl;
@@ -865,7 +865,7 @@
     indent(f_service_) << "val processMap = Hashtbl.create " << functions.size() << endl;
   }
   indent(f_service_i_) << "val processMap : (string, int * Protocol.t * Protocol.t -> unit) Hashtbl.t" << endl;
- 
+
   // Generate the server implementation
   indent(f_service_) <<
     "method process iprot oprot =" << endl;
@@ -907,7 +907,7 @@
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     f_service_ <<
       indent() << "Hashtbl.add processMap \"" << (*f_iter)->get_name() << "\" self#process_" << (*f_iter)->get_name() << ";" << endl;
-  } 
+  }
   indent_down();
 
   indent_down();
@@ -964,10 +964,10 @@
       indent() << "(try" << endl;
     indent_up();
   }
- 
 
 
- 
+
+
   f_service_ << indent();
   if (!tfunction->is_async() && !tfunction->get_returntype()->is_void()) {
     f_service_ << "result#set_success ";
@@ -979,7 +979,7 @@
   }
   f_service_ << ");" << endl;
 
-  
+
   if (xceptions.size() > 0) {
     indent_down();
     indent(f_service_) << "with" <<endl;
@@ -1065,7 +1065,7 @@
     case t_base_type::TYPE_VOID:
       throw "compiler error: cannot serialize void field in a struct";
       break;
-    case t_base_type::TYPE_STRING:        
+    case t_base_type::TYPE_STRING:
       out << "readString";
       break;
     case t_base_type::TYPE_BOOL:
@@ -1097,7 +1097,7 @@
            type->get_name().c_str());
   }
 }
-  
+
 
 /**
  * Generates an unserializer for a struct, calling read()
@@ -1120,7 +1120,7 @@
   string vtype = tmp("_vtype");
   string etype = tmp("_etype");
   string con = tmp("_con");
-  
+
   t_field fsize(g_type_i32, size);
   t_field fktype(g_type_byte, ktype);
   t_field fvtype(g_type_byte, vtype);
@@ -1132,7 +1132,7 @@
   if (ttype->is_map()) {
     indent(out) << "(let ("<<ktype<<","<<vtype<<","<<size<<") = iprot#readMapBegin in" << endl;
     indent(out) << "let "<<con<<" = Hashtbl.create "<<size<<" in" << endl;
-    indent_up(); 
+    indent_up();
     indent(out) << "for i = 1 to "<<size<<" do" <<endl;
     indent_up();
     indent(out) << "let _k = ";
@@ -1150,7 +1150,7 @@
   } else if (ttype->is_set()) {
     indent(out) << "(let ("<<etype<<","<<size<<") = iprot#readSetBegin in" << endl;
     indent(out) << "let "<<con<<" = Hashtbl.create "<<size<<" in" << endl;
-    indent_up(); 
+    indent_up();
     indent(out) << "for i = 1 to "<<size<<" do" <<endl;
     indent_up();
     indent(out) << "Hashtbl.add "<<con<<" ";
@@ -1162,7 +1162,7 @@
   } else if (ttype->is_list()) {
     indent(out) << "(let ("<<etype<<","<<size<<") = iprot#readListBegin in" << endl;
     indent_up();
-    indent(out) << "let "<<con<<" = (Array.to_list (Array.init "<<size<<" (fun _ -> "; 
+    indent(out) << "let "<<con<<" = (Array.to_list (Array.init "<<size<<" (fun _ -> ";
     generate_deserialize_type(out,((t_list*)ttype)->get_elem_type());
     out << "))) in" << endl;
     indent_up();
@@ -1194,7 +1194,7 @@
 
   if(name.length() == 0){
     name = decapitalize(tfield->get_name());
-  }  
+  }
 
   if (type->is_struct() || type->is_xception()) {
     generate_serialize_struct(out,
@@ -1209,7 +1209,7 @@
 
     indent(out) <<
       "oprot#";
-    
+
     if (type->is_base_type()) {
       t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
       switch (tbase) {
@@ -1245,7 +1245,7 @@
       string ename = capitalize(type->get_name());
       out << "writeI32("<<ename<<".to_i " << name << ")";
     }
-    
+
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s' TYPE '%s'\n",
            tfield->get_name().c_str(),
@@ -1306,7 +1306,7 @@
     indent_down();
     indent(out) << ") " << prefix << ";" <<  endl;
   }
-    
+
   if (ttype->is_map()) {
     indent(out) <<
       "oprot#writeMapEnd";
@@ -1371,7 +1371,7 @@
 
 string t_ocaml_generator::function_type(t_function* tfunc, bool method, bool options){
   string result="";
-  
+
   const vector<t_field*>& fields = tfunc->get_arglist()->get_members();
   vector<t_field*>::const_iterator f_iter;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
@@ -1430,7 +1430,7 @@
  */
 string t_ocaml_generator::type_to_enum(t_type* type) {
   type = get_true_type(type);
-  
+
   if (type->is_base_type()) {
     t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
     switch (tbase) {
@@ -1471,7 +1471,7 @@
  */
 string t_ocaml_generator::render_ocaml_type(t_type* type) {
   type = get_true_type(type);
-  
+
   if (type->is_base_type()) {
     t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
     switch (tbase) {
diff --git a/compiler/cpp/src/generate/t_ocaml_generator.h b/compiler/cpp/src/generate/t_ocaml_generator.h
index 331cf22..56f2a89 100644
--- a/compiler/cpp/src/generate/t_ocaml_generator.h
+++ b/compiler/cpp/src/generate/t_ocaml_generator.h
@@ -74,13 +74,13 @@
   void generate_deserialize_field        (std::ofstream &out,
                                           t_field*    tfield,
                                           std::string prefix);
-  
+
   void generate_deserialize_struct       (std::ofstream &out,
                                           t_struct*   tstruct);
-  
+
   void generate_deserialize_container    (std::ofstream &out,
                                           t_type*     ttype);
-  
+
   void generate_deserialize_set_element  (std::ofstream &out,
                                           t_set*      tset);
 
diff --git a/compiler/cpp/src/generate/t_perl_generator.h b/compiler/cpp/src/generate/t_perl_generator.h
index dcb2e5e..689cf1c 100644
--- a/compiler/cpp/src/generate/t_perl_generator.h
+++ b/compiler/cpp/src/generate/t_perl_generator.h
@@ -23,7 +23,7 @@
  public:
   t_perl_generator(t_program* program) :
     t_oop_generator(program) {
-    
+
     out_dir_base_ = "gen-perl";
   }
 
diff --git a/compiler/cpp/src/generate/t_py_generator.cc b/compiler/cpp/src/generate/t_py_generator.cc
index ca192ce..febeafd 100644
--- a/compiler/cpp/src/generate/t_py_generator.cc
+++ b/compiler/cpp/src/generate/t_py_generator.cc
@@ -1040,7 +1040,7 @@
         | S_IROTH
         | S_IXOTH
 #endif
-		);
+  );
 }
 
 /**
diff --git a/compiler/cpp/src/generate/t_rb_generator.h b/compiler/cpp/src/generate/t_rb_generator.h
index d2b7265..e0463ef 100644
--- a/compiler/cpp/src/generate/t_rb_generator.h
+++ b/compiler/cpp/src/generate/t_rb_generator.h
@@ -77,18 +77,18 @@
    */
 
   void generate_deserialize_field        (std::ofstream &out,
-                                          t_field*    tfield, 
+                                          t_field*    tfield,
                                           std::string prefix="",
                                           bool inclass=false);
-  
+
   void generate_deserialize_struct       (std::ofstream &out,
                                           t_struct*   tstruct,
                                           std::string prefix="");
-  
+
   void generate_deserialize_container    (std::ofstream &out,
                                           t_type*     ttype,
                                           std::string prefix="");
-  
+
   void generate_deserialize_set_element  (std::ofstream &out,
                                           t_set*      tset,
                                           std::string prefix="");
@@ -140,24 +140,24 @@
   std::string type_to_enum(t_type* ttype);
 
 
-  
+
   std::string ruby_namespace(t_program* p) {
     std::string ns = p->get_ruby_namespace();
     return ns.size() ? ns : "";
   }
-  
+
   std::vector<std::string> ruby_modules(t_program* p) {
     std::string ns = p->get_ruby_namespace();
     boost::tokenizer<> tok(ns);
     std::vector<std::string> modules;
-    
+
     for(boost::tokenizer<>::iterator beg=tok.begin(); beg != tok.end(); ++beg) {
       modules.push_back(*beg);
     }
-    
+
     return modules;
   }
-  
+
   void begin_namespace(std::ofstream&, std::vector<std::string>);
   void end_namespace(std::ofstream&, std::vector<std::string>);
 
@@ -168,7 +168,7 @@
    */
 
   std::ofstream f_types_;
-  std::ofstream f_consts_; 
+  std::ofstream f_consts_;
   std::ofstream f_service_;
 
 };
diff --git a/compiler/cpp/src/generate/t_st_generator.cc b/compiler/cpp/src/generate/t_st_generator.cc
index fa7d851..34da15b 100644
--- a/compiler/cpp/src/generate/t_st_generator.cc
+++ b/compiler/cpp/src/generate/t_st_generator.cc
@@ -609,7 +609,7 @@
   //This is nasty, but without it we'll break things by prefixing TResult.
   string name = ((capitalize(clsName) == "TResult") ? capitalize(clsName) : prefix(clsName));
   out << indent() << val << " := " << name << " new." << endl;
-    
+
   out << indent() << "iprot readStructBegin." << endl <<
     indent() << "[" << desc << " := iprot readFieldBegin." << endl <<
     indent() << desc << " type = TType stop] whileFalse: [|" << found << "|" << endl;
diff --git a/compiler/cpp/src/generate/t_xsd_generator.cc b/compiler/cpp/src/generate/t_xsd_generator.cc
index 7bab56d..3b67f1a 100644
--- a/compiler/cpp/src/generate/t_xsd_generator.cc
+++ b/compiler/cpp/src/generate/t_xsd_generator.cc
@@ -56,10 +56,10 @@
 }
 
 void t_xsd_generator::generate_struct(t_struct* tstruct) {
-  vector<t_field*>::const_iterator m_iter; 
+  vector<t_field*>::const_iterator m_iter;
   const vector<t_field*>& members = tstruct->get_members();
   bool xsd_all = tstruct->get_xsd_all();
-  
+
   indent(s_xsd_types_) << "<xsd:complexType name=\"" << tstruct->get_name() << "\">" << endl;
   indent_up();
   if (xsd_all) {
@@ -68,10 +68,10 @@
     indent(s_xsd_types_) << "<xsd:sequence>" << endl;
   }
   indent_up();
-  
+
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     generate_element(s_xsd_types_, (*m_iter)->get_name(), (*m_iter)->get_type(), (*m_iter)->get_xsd_attrs(), (*m_iter)->get_xsd_optional() || xsd_all, (*m_iter)->get_xsd_nillable());
-  } 
+  }
 
   indent_down();
   if (xsd_all) {
@@ -102,12 +102,12 @@
       "<xsd:element name=\"" << name << "\"" << soptional << snillable << ">" << endl;
     indent_up();
     if (attrs == NULL && ttype->is_void()) {
-      indent(out) << 
+      indent(out) <<
         "<xsd:complexType />" << endl;
     } else {
       indent(out) <<
         "<xsd:complexType>" << endl;
-      indent_up();    
+      indent_up();
       if (ttype->is_list()) {
         indent(out) << "<xsd:sequence minOccurs=\"0\" maxOccurs=\"unbounded\">" << endl;
         indent_up();
@@ -176,7 +176,7 @@
 
   string ns = program_->get_xsd_namespace();
   if (ns.size() > 0) {
-    ns = " targetNamespace=\"" + ns + "\" xmlns=\"" + ns + "\" " + 
+    ns = " targetNamespace=\"" + ns + "\" xmlns=\"" + ns + "\" " +
       "elementFormDefault=\"qualified\"";
   }
 
@@ -196,7 +196,7 @@
 
   // List the elements that you might actually get
   vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter; 
+  vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     string elemname = (*f_iter)->get_name() + "_response";
     t_type* returntype = (*f_iter)->get_returntype();
@@ -237,7 +237,7 @@
   if (ttype->is_struct() || ttype->is_xception()) {
     return ttype->get_name();
   }
-  
+
   return "container";
 }
 
diff --git a/compiler/cpp/src/parse/t_const_value.h b/compiler/cpp/src/parse/t_const_value.h
index fec2acc..ee658f0 100644
--- a/compiler/cpp/src/parse/t_const_value.h
+++ b/compiler/cpp/src/parse/t_const_value.h
@@ -75,7 +75,7 @@
 
   const std::map<t_const_value*, t_const_value*>& get_map() const {
     return mapVal_;
-  } 
+  }
 
   void set_list() {
     valType_ = CV_LIST;
diff --git a/compiler/cpp/src/parse/t_doc.h b/compiler/cpp/src/parse/t_doc.h
index bfa66ef..6bdcc29 100644
--- a/compiler/cpp/src/parse/t_doc.h
+++ b/compiler/cpp/src/parse/t_doc.h
@@ -21,15 +21,15 @@
     doc_ = doc;
     has_doc_ = true;
   }
-  
+
   const std::string& get_doc() const {
     return doc_;
   }
-  
+
   bool has_doc() {
     return has_doc_;
   }
-  
+
  private:
   std::string doc_;
   bool has_doc_;
diff --git a/compiler/cpp/src/parse/t_enum_value.h b/compiler/cpp/src/parse/t_enum_value.h
index aa332c7..c732656 100644
--- a/compiler/cpp/src/parse/t_enum_value.h
+++ b/compiler/cpp/src/parse/t_enum_value.h
@@ -34,19 +34,19 @@
   const std::string& get_name() {
     return name_;
   }
-  
+
   bool has_value() {
     return has_value_;
   }
-  
+
   int get_value() {
     return value_;
   }
-  
+
  private:
   std::string name_;
   bool has_value_;
   int value_;
-};  
+};
 
 #endif
diff --git a/compiler/cpp/src/parse/t_list.h b/compiler/cpp/src/parse/t_list.h
index 23a006a..0ff83c5 100644
--- a/compiler/cpp/src/parse/t_list.h
+++ b/compiler/cpp/src/parse/t_list.h
@@ -22,7 +22,7 @@
   t_type* get_elem_type() const {
     return elem_type_;
   }
-  
+
   bool is_list() const {
     return true;
   }
diff --git a/compiler/cpp/src/parse/t_scope.h b/compiler/cpp/src/parse/t_scope.h
index c97f2d6..e03956e 100644
--- a/compiler/cpp/src/parse/t_scope.h
+++ b/compiler/cpp/src/parse/t_scope.h
@@ -59,7 +59,7 @@
   }
 
  private:
-  
+
   // Map of names to types
   std::map<std::string, t_type*> types_;
 
@@ -67,8 +67,8 @@
   std::map<std::string, t_const*> constants_;
 
   // Map of names to services
-  std::map<std::string, t_service*> services_; 
- 
+  std::map<std::string, t_service*> services_;
+
 };
 
 #endif
diff --git a/compiler/cpp/src/platform.h b/compiler/cpp/src/platform.h
index df64e9a..38a4aa1 100644
--- a/compiler/cpp/src/platform.h
+++ b/compiler/cpp/src/platform.h
@@ -1,22 +1,22 @@
-// Distributed under the Thrift Software License

-//

-// See accompanying file LICENSE or visit the Thrift site at:

-// http://developers.facebook.com/thrift/

-

-/**

- * define for mkdir,since the method signature 

- * is different for the non-POSIX MinGW

- */

-

-#ifdef MINGW

-#include <io.h>

-#else

-#include <sys/types.h>

-#include <sys/stat.h>

-#endif

-

-#if defined MINGW

-#define MKDIR(x) mkdir(x)

-#else

-#define MKDIR(x) mkdir(x, S_IRWXU | S_IRWXG | S_IRWXO)

-#endif

+// Distributed under the Thrift Software License
+//
+// See accompanying file LICENSE or visit the Thrift site at:
+// http://developers.facebook.com/thrift/
+
+/**
+ * define for mkdir,since the method signature
+ * is different for the non-POSIX MinGW
+ */
+
+#ifdef MINGW
+#include <io.h>
+#else
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+
+#if defined MINGW
+#define MKDIR(x) mkdir(x)
+#else
+#define MKDIR(x) mkdir(x, S_IRWXU | S_IRWXG | S_IRWXO)
+#endif