Skip site navigation (1)Skip section navigation (2)
Date:      17 Apr 2002 08:00:17 -0700
From:      Max Okumoto <okumoto@ucsd.edu>
To:        freebsd-libh@FreeBSD.ORG
Subject:   cleanup of HSystem 2nd try (stage 10)
Message-ID:  <hfsn5u4bge.fsf@multivac.sdsc.edu>

next in thread | raw e-mail | index | archive | help

* Cleanup some white space in main, and for function declarations


--- lib/tcl/tcl_interface_gen.cc	Wed Apr 17 07:29:41 2002
+++ lib/tcl/tcl_interface_gen.cc.stage1	Wed Apr 17 07:41:44 2002
@@ -50,11 +50,12 @@
  *		1 for incorrect number of args,
  *		2 for some an exception.
  */
-int main( int argc, char** argv )
+int
+main(int argc, char** argv)
 {
 	const string	progname = argv[0];
 
-	if ( argc != 3 ) {
+	if (argc != 3) {
 		cerr << "Usage: " << progname << " <system-name> <file-to-generate>" << endl;
 		return 1;
 	}
@@ -64,21 +65,21 @@
 
 	try {
 		Systems systems;
-		build_systems( systems );
+		build_systems(systems);
 
 		Systems::const_iterator system = systems.find(HSystem(name));
-		if ( system == systems.end() )
+		if (system == systems.end())
 			throw runtime_error("System " + name + " is unknown");
 
 		ofstream out(ofile.c_str());
-		if ( !out )
+		if (!out)
 			throw runtime_error("Unable to create " + ofile +
 					    ": " + ::strerror(errno));
 
-		HSystem& s = const_cast<HSystem&>( *system );
-		s.gen_file( out );
+		HSystem& s = const_cast<HSystem&>(*system);
+		s.gen_file(out);
 	}
-	catch ( exception& err ) {
+	catch (exception& err) {
 		cerr << "Error: " << err.what() << endl;
 		return 2;
 	}
@@ -96,7 +97,8 @@
     gen_footer(out);
 }
 
-void HSystem::gen_header( ostream& out )
+void
+HSystem::gen_header(ostream& out)
 {
 	time_t t = time( 0 );
 	out << "/*" << endl;
@@ -125,7 +127,8 @@
 
 } /* HSystem::gen_header */
 
-void HSystem::gen_class_header( ostream& out, const ClassDesc *aClassDescription )
+void
+HSystem::gen_class_header(ostream& out, const ClassDesc *aClassDescription)
 {
 	out << "class " << replace_chars( aClassDescription->name, ':', '_' ) << "Access : ";
 	if ( aClassDescription->parents[0] ) {
@@ -144,7 +147,9 @@
 
 } /* HSystem::gen_class_header */
 
-void HSystem::gen_callback_interfaces( ostream& out, const ClassDesc *aClassDescription )
+void
+HSystem::gen_callback_interfaces(ostream& out,
+				 const ClassDesc *aClassDescription)
 {
 	if ( aClassDescription->has_callbacks() ) {
 		out << "	virtual void activate_callback( Tcl_Interp* interp, Tcl_Obj* aCommand, Tcl_Obj* aUserData, Tcl_Obj* aArg, LanguageInterface::SpecificCallbackData& aSpecificCallbackData )\n"
@@ -185,7 +190,9 @@
 
 } /* HSystem::gen_callback_interfaces */
 
-void HSystem::gen_dynamic_methods_interfaces( ostream& out, const ClassDesc *aClassDescription )
+void
+HSystem::gen_dynamic_methods_interfaces(ostream& out,
+					const ClassDesc *aClassDescription)
 {
 	out << "	static int methodCommand( ClientData obj, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[] )\n"
 	<< "		{\n"
@@ -362,7 +369,9 @@
 
 } /* HSystem::gen_dynamic_methods_interfaces */
 
-void HSystem::gen_static_method_interfaces( ostream& out, const ClassDesc *aClassDescription )
+void
+HSystem::gen_static_method_interfaces(ostream& out,
+				      const ClassDesc *aClassDescription)
 {
 	if ( aClassDescription->staticMethods() > 0 ) {
 		out << "  public:\n";
@@ -427,7 +436,8 @@
 
 } /* HSystem::gen_static_method_interfaces */
 
-void HSystem::gen_classes_interfaces( ostream& out )
+void
+HSystem::gen_classes_interfaces(ostream& out)
 {
 	for ( Descriptions::const_iterator di = descriptions.begin(); di != descriptions.end(); ++di ) {
 		cout << (*di)->name << endl;
@@ -446,7 +456,8 @@
 } /* HSystem::gen_dynamic_methods_interfaces */
 
 
-void HSystem::gen_register_command_access( ostream& out )
+void
+HSystem::gen_register_command_access(ostream& out)
 {
 	out << "void register_command_access_tcl()\n"
 	<< "{\n";
@@ -470,7 +481,8 @@
 } /* HSystem::gen_register_command_access */
 
 
-void HSystem::gen_footer( ostream& out )
+void
+HSystem::gen_footer(ostream& out)
 {
 	out << "/* end */" << endl;
 	out << endl;
@@ -478,7 +490,8 @@
 } /* HSystem::gen_footer */
 
 
-string HSystem::gen_result_to_obj( MethodDesc::Value t )
+string
+HSystem::gen_result_to_obj(MethodDesc::Value t)
 {
 	switch ( (MethodDesc::ValueType)t ) {
 	case MethodDesc::vtVoid:
@@ -515,7 +528,9 @@
 } /* HSystem::gen_result_to_obj */
 
 
-string HSystem::gen_method_argument( MethodDesc::Value t, int argno, int method_argno, bool last_arg_in_set_method )
+string
+HSystem::gen_method_argument(MethodDesc::Value t, int argno,
+			     int method_argno, bool last_arg_in_set_method)
 {
 	string result;
 	if ( t.optional() && t != MethodDesc::vtList && t != MethodDesc::vtListRef && t != MethodDesc::vtListPtr && !last_arg_in_set_method ) {

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-libh" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?hfsn5u4bge.fsf>