$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r80181 - trunk/tools/build/v2/engine
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-24 21:29:48
Author: jurko
Date: 2012-08-24 21:29:47 EDT (Fri, 24 Aug 2012)
New Revision: 80181
URL: http://svn.boost.org/trac/boost/changeset/80181
Log:
Boost Jam native.c module cleanup - stylistic changes.
Text files modified: 
   trunk/tools/build/v2/engine/native.c |    41 +++++++++++++++++---------------------- 
   trunk/tools/build/v2/engine/native.h |    39 +++++++++++++++++--------------------   
   2 files changed, 36 insertions(+), 44 deletions(-)
Modified: trunk/tools/build/v2/engine/native.c
==============================================================================
--- trunk/tools/build/v2/engine/native.c	(original)
+++ trunk/tools/build/v2/engine/native.c	2012-08-24 21:29:47 EDT (Fri, 24 Aug 2012)
@@ -1,36 +1,31 @@
-/* Copyright Vladimir Prus 2003. Distributed under the Boost */
-/* Software License, Version 1.0. (See accompanying */
-/* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */
+/* Copyright 2003. Vladimir Prus
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ */
 
 #include "native.h"
+
 #include "hash.h"
-#include "object.h"
-#include "assert.h"
 
-void declare_native_rule( const char * module, const char * rule, const char * * args,
-                          LIST * (*f)( FRAME *, int ), int version )
+#include <assert.h>
+
+
+void declare_native_rule( char const * module, char const * rule,
+    char const * * args, LIST * (*f)( FRAME *, int ), int version )
 {
-    OBJECT * module_obj = 0;
-    module_t * m;
-    if ( module )
-    {
-        module_obj = object_new( module );
-    }
-    m = bindmodule( module_obj );
+    OBJECT * const module_obj = module ? object_new( module ) : 0 ;
+    module_t * m = bindmodule( module_obj );
     if ( module_obj )
-    {
         object_free( module_obj );
-    }
-    if (m->native_rules == 0)
-    {
-        m->native_rules = hashinit( sizeof( native_rule_t ), "native rules");
-    }
+    if ( !m->native_rules )
+        m->native_rules = hashinit( sizeof( native_rule_t ), "native rules" );
 
     {
-        native_rule_t *np;
-        OBJECT * name = object_new( rule );
+        OBJECT * const name = object_new( rule );
         int found;
-        np = (native_rule_t *)hash_insert( m->native_rules, name, &found );
+        native_rule_t * const np = (native_rule_t *)hash_insert(
+            m->native_rules, name, &found );
         np->name = name;
         assert( !found );
         np->procedure = function_builtin( f, 0, args );
Modified: trunk/tools/build/v2/engine/native.h
==============================================================================
--- trunk/tools/build/v2/engine/native.h	(original)
+++ trunk/tools/build/v2/engine/native.h	2012-08-24 21:29:47 EDT (Fri, 24 Aug 2012)
@@ -1,37 +1,34 @@
-/* Copyright David Abrahams 2003. Distributed under the Boost */
-/* Software License, Version 1.0. (See accompanying */
-/* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */
+/* Copyright 2003. David Abrahams
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ */
 
 #ifndef NATIVE_H_VP_2003_12_09
 #define NATIVE_H_VP_2003_12_09
 
+#include "function.h"
+#include "frames.h"
 #include "lists.h"
 #include "object.h"
-#include "frames.h"
-#include "function.h"
-#include "rules.h"
 
-struct native_rule_t
+typedef struct native_rule_t
 {
     OBJECT * name;
     FUNCTION * procedure;
-    /* Version of the interface that the native rule provides.
-       It's possible that we want to change the set parameter
-       for existing native rule. In that case, version number
-       should be incremented so that Boost.Build can check for
-       version it relies on.
 
-       Versions are numbered from 1.
+    /* Version of the interface that the native rule provides. It is possible
+     * that we want to change the set parameter for existing native rule. In
+     * that case, version number should be incremented so Boost.Build can check
+     * for the version it relies on.
+     *
+     * Versions are numbered from 1.
     */
     int version;
-};
-
-/* MSVC debugger gets confused unless this is provided */
-typedef struct native_rule_t native_rule_t ;
-
-void declare_native_rule( const char * module, const char * rule, const char * * args,
-                          LIST * (*f)( FRAME *, int ), int version );
-
+} native_rule_t;
+/* MSVC debugger gets confused unless the native_rule_t typedef is provided. */
 
+void declare_native_rule( char const * module, char const * rule,
+    char const * * args, LIST * (*f)( FRAME *, int ), int version );
 
 #endif