Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48994 - in trunk/tools/jam/src: . modules
From: grafikrobot_at_[hidden]
Date: 2008-09-28 20:05:25


Author: grafik
Date: 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
New Revision: 48994
URL: http://svn.boost.org/trac/boost/changeset/48994

Log:
Minor edits to remove -Wall warnings. (fixes 2207)
Text files modified:
   trunk/tools/jam/src/builtins.c | 15 +++++++--------
   trunk/tools/jam/src/compile.c | 8 +++++---
   trunk/tools/jam/src/debug.c | 2 +-
   trunk/tools/jam/src/expand.c | 6 +++---
   trunk/tools/jam/src/fileunix.c | 4 +---
   trunk/tools/jam/src/hash.c | 17 +++++++++--------
   trunk/tools/jam/src/hcache.c | 8 ++++----
   trunk/tools/jam/src/hdrmacro.c | 2 --
   trunk/tools/jam/src/headers.c | 2 ++
   trunk/tools/jam/src/jam.c | 10 +++++-----
   trunk/tools/jam/src/make.c | 15 ++++++++-------
   trunk/tools/jam/src/make1.c | 6 +++---
   trunk/tools/jam/src/modules/order.c | 2 +-
   trunk/tools/jam/src/modules/property-set.c | 2 ++
   trunk/tools/jam/src/output.c | 2 +-
   trunk/tools/jam/src/pathunix.c | 2 +-
   trunk/tools/jam/src/regexp.c | 2 +-
   trunk/tools/jam/src/rules.c | 2 --
   trunk/tools/jam/src/search.c | 4 ++--
   trunk/tools/jam/src/timestamp.c | 2 ++
   trunk/tools/jam/src/variable.c | 2 +-
   21 files changed, 59 insertions(+), 56 deletions(-)

Modified: trunk/tools/jam/src/builtins.c
==============================================================================
--- trunk/tools/jam/src/builtins.c (original)
+++ trunk/tools/jam/src/builtins.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -1135,7 +1135,7 @@
 void backtrace( FRAME * frame )
 {
     if ( !frame ) return;
- while ( frame = frame->prev )
+ while ( ( frame = frame->prev ) )
         backtrace_line( frame );
 }
 
@@ -1289,13 +1289,12 @@
 
     string in[ 1 ];
     string out[ 1 ];
- char * end; /* Last character of the part of string still to be
- * processed.
- */
- char * current; /* Working pointer. */
- int dotdots = 0; /* Number of '..' elements seen and not processed
- /* yet.
- */
+ /* Last character of the part of string still to be processed. */
+ char * end;
+ /* Working pointer. */
+ char * current;
+ /* Number of '..' elements seen and not processed yet. */
+ int dotdots = 0;
     int rooted = 0;
     char * result = 0;
 

Modified: trunk/tools/jam/src/compile.c
==============================================================================
--- trunk/tools/jam/src/compile.c (original)
+++ trunk/tools/jam/src/compile.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -295,7 +295,7 @@
 {
     LIST * r = 0;
     LIST * l;
- while ( l = parse_evaluate( p->left, frame ) )
+ while ( ( l = parse_evaluate( p->left, frame ) ) )
     {
         list_free( l );
         if ( r ) list_free( r );
@@ -753,12 +753,13 @@
     return locals;
 }
 
-static int python_instance_number = 0;
-
 RULE *
 enter_rule( char *rulename, module_t *target_module );
 
 #ifdef HAVE_PYTHON
+
+static int python_instance_number = 0;
+
 static LIST*
 call_python_function(RULE* r, FRAME* frame)
 {
@@ -863,6 +864,7 @@
         python = bindmodule("__python__");
     return python;
 }
+
 #endif
 
 

Modified: trunk/tools/jam/src/debug.c
==============================================================================
--- trunk/tools/jam/src/debug.c (original)
+++ trunk/tools/jam/src/debug.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -114,7 +114,7 @@
         profile_total.cumulative += p->net;
         profile_total.memory += p->memory;
     }
- printf( "%10d %12.6f %12.6f %12.8f %10d %10d %s\n", p->num_entries,
+ printf( "%10ld %12.6f %12.6f %12.8f %10ld %10ld %s\n", p->num_entries,
         cumulative, net, q, p->memory, mem_each, p->name );
 }
 

Modified: trunk/tools/jam/src/expand.c
==============================================================================
--- trunk/tools/jam/src/expand.c (original)
+++ trunk/tools/jam/src/expand.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -267,14 +267,14 @@
             string_copy( variable, vars->string );
             varname = variable->value;
 
- if ( colon = strchr( varname, MAGIC_COLON ) )
+ if ( ( colon = strchr( varname, MAGIC_COLON ) ) )
             {
                 string_truncate( variable, colon - varname );
                 var_edit_parse( colon + 1, &edits );
             }
 
             /* Look for [x-y] subscripting. sub1 and sub2 are x and y. */
- if ( bracket = strchr( varname, MAGIC_LEFT ) )
+ if ( ( bracket = strchr( varname, MAGIC_LEFT ) ) )
             {
                 /* Make all syntax errors in [] subscripting result in the same
                  * behavior: silenty return an empty expansion (by setting sub2
@@ -577,7 +577,7 @@
             fp->ptr = "";
             fp->len = 0;
         }
- else if ( p = strchr( mods, MAGIC_COLON ) )
+ else if ( ( p = strchr( mods, MAGIC_COLON ) ) )
         {
             *p = 0;
             fp->ptr = ++mods;

Modified: trunk/tools/jam/src/fileunix.c
==============================================================================
--- trunk/tools/jam/src/fileunix.c (original)
+++ trunk/tools/jam/src/fileunix.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -167,10 +167,8 @@
             printf( "scan directory %s\n", dir );
 
         string_new( filename );
- while ( dirent = readdir( dd ) )
+ while ( ( dirent = readdir( dd ) ) )
         {
- file_info_t * ff = 0;
-
             # ifdef old_sinix
             /* Broken structure definition on sinix. */
             f.f_base.ptr = dirent->d_name - 2;

Modified: trunk/tools/jam/src/hash.c
==============================================================================
--- trunk/tools/jam/src/hash.c (original)
+++ trunk/tools/jam/src/hash.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -103,7 +103,6 @@
 static unsigned int jenkins_one_at_a_time_hash(const unsigned char *key)
 {
     unsigned int hash = 0;
- size_t i;
 
     while ( *key )
     {
@@ -114,9 +113,11 @@
     hash += (hash << 3);
     hash ^= (hash >> 11);
     hash += (hash << 15);
+
     return hash;
 }
 
+/*
 static unsigned int knuth_hash(const unsigned char *key)
 {
     unsigned int keyval = *key;
@@ -124,14 +125,14 @@
         keyval = keyval * 2147059363 + *key++;
     return keyval;
 }
+*/
 
 static unsigned int hash_keyval( const char * key_ )
 {
- /**
- return knuth_hash((const unsigned char *)key_);
- /*/
+ /*
+ return knuth_hash((const unsigned char *)key_);
+ */
     return jenkins_one_at_a_time_hash((const unsigned char *)key_);
- /**/
 }
 
 #define hash_bucket(hp,keyval) ((hp)->tab.base + ( (keyval) % (hp)->tab.nel ))
@@ -364,7 +365,7 @@
     hp->items.size = sizeof( struct hashhdr ) + ALIGNED( datalen );
     hp->items.list = -1;
     hp->items.nel = 0;
- hp->inel = /* */ 11 /*/ 47 /* */;
+ hp->inel = 11 /* 47 */;
     hp->name = name;
 
     return hp;
@@ -440,14 +441,14 @@
 
     for ( i = nel; i > 0; --i )
     {
- if ( here = ( *tab++ != (ITEM *)0 ) )
+ if ( ( here = ( *tab++ != (ITEM *)0 ) ) )
             count++;
         if ( here && !run )
             sets++;
         run = here;
     }
 
- printf( "%s table: %d+%d+%d (%dK+%dK) items+table+hash, %f density\n",
+ printf( "%s table: %d+%d+%d (%dK+%ldK) items+table+hash, %f density\n",
         hp->name,
         count,
         hp->items.nel,

Modified: trunk/tools/jam/src/hcache.c
==============================================================================
--- trunk/tools/jam/src/hcache.c (original)
+++ trunk/tools/jam/src/hcache.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -327,10 +327,10 @@
         else if ( c->age > maxage )
             continue;
 
- sprintf( includes_count_str, "%lu", list_length( c->includes ) );
- sprintf( hdrscan_count_str, "%lu", list_length( c->hdrscan ) );
- sprintf( time_str, "%lu", c->time );
- sprintf( age_str, "%lu", c->age );
+ sprintf( includes_count_str, "%lu", (long unsigned) list_length( c->includes ) );
+ sprintf( hdrscan_count_str, "%lu", (long unsigned) list_length( c->hdrscan ) );
+ sprintf( time_str, "%lu", (long unsigned) c->time );
+ sprintf( age_str, "%lu", (long unsigned) c->age );
 
         write_netstring( f, CACHE_RECORD_HEADER );
         write_netstring( f, c->boundname );

Modified: trunk/tools/jam/src/hdrmacro.c
==============================================================================
--- trunk/tools/jam/src/hdrmacro.c (original)
+++ trunk/tools/jam/src/hdrmacro.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -46,8 +46,6 @@
  * just to invoke a rule.
  */
 
-static LIST * header_macros1( LIST * l, char * file, int rec, regexp * re[] );
-
 /* this type is used to store a dictionary of file header macros */
 typedef struct header_macro
 {

Modified: trunk/tools/jam/src/headers.c
==============================================================================
--- trunk/tools/jam/src/headers.c (original)
+++ trunk/tools/jam/src/headers.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -60,7 +60,9 @@
 {
     LIST * hdrscan;
     LIST * hdrrule;
+ #ifndef OPT_HEADER_CACHE_EXT
     LIST * headlist = 0;
+ #endif
     regexp * re[ MAXINC ];
     int rec = 0;
 

Modified: trunk/tools/jam/src/jam.c
==============================================================================
--- trunk/tools/jam/src/jam.c (original)
+++ trunk/tools/jam/src/jam.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -300,7 +300,7 @@
         globs.timeout = atoi( s );
 
     /* Turn on/off debugging */
- for ( n = 0; s = getoptval( optv, 'd', n ); ++n )
+ for ( n = 0; ( s = getoptval( optv, 'd', n ) ); ++n )
     {
         int i;
 
@@ -414,7 +414,7 @@
         var_defines( othersyms, 1 );
 
         /* Load up variables set on command line. */
- for ( n = 0; s = getoptval( optv, 's', n ); ++n )
+ for ( n = 0; ( s = getoptval( optv, 's', n ) ); ++n )
         {
             char *symv[2];
             symv[ 0 ] = s;
@@ -452,7 +452,7 @@
         {
             FRAME frame[ 1 ];
             frame_init( frame );
- for ( n = 0; s = getoptval( optv, 'f', n ); ++n )
+ for ( n = 0; ( s = getoptval( optv, 'f', n ) ); ++n )
                 parse_file( s, frame );
 
             if ( !n )
@@ -462,11 +462,11 @@
         status = yyanyerrors();
 
         /* Manually touch -t targets. */
- for ( n = 0; s = getoptval( optv, 't', n ); ++n )
+ for ( n = 0; ( s = getoptval( optv, 't', n ) ); ++n )
             touch_target( s );
 
         /* If an output file is specified, set globs.cmdout to that. */
- if ( s = getoptval( optv, 'o', 0 ) )
+ if ( ( s = getoptval( optv, 'o', 0 ) ) )
         {
             if ( !( globs.cmdout = fopen( s, "w" ) ) )
             {

Modified: trunk/tools/jam/src/make.c
==============================================================================
--- trunk/tools/jam/src/make.c (original)
+++ trunk/tools/jam/src/make.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -195,7 +195,7 @@
             if ( DEBUG_FATE )
             {
                 printf( "fate change %s from %s to %s (as dependant of %s)\n",
- p->name, target_fate[ fate0 ], target_fate[ p->fate ], t->name );
+ p->name, target_fate[ (int) fate0 ], target_fate[ (int) p->fate ], t->name );
             }
 
             /* If we are done visiting it, go back and make sure its dependants
@@ -224,7 +224,7 @@
         {
             if ( DEBUG_FATE )
                 printf( "fate change %s from %s to %s (by rebuild)\n",
- r->name, target_fate[ r->fate ], target_fate[ T_FATE_REBUILD ] );
+ r->name, target_fate[ (int) r->fate ], target_fate[ T_FATE_REBUILD ] );
 
             /* Force rebuild it. */
             r->fate = T_FATE_REBUILD;
@@ -253,7 +253,6 @@
 ) /* forcibly touch all (real) targets */
 {
     TARGETS * c;
- TARGETS * d;
     TARGET * ptime = t;
     time_t last;
     time_t leaf;
@@ -352,7 +351,7 @@
         case T_BIND_MISSING:
         case T_BIND_PARENTS:
             printf( "time\t--\t%s%s: %s\n",
- spaces( depth ), t->name, target_bind[ t->binding ] );
+ spaces( depth ), t->name, target_bind[ (int) t->binding ] );
             break;
 
         case T_BIND_EXISTS:
@@ -421,7 +420,7 @@
         if ( DEBUG_FATE )
             if ( fate < c->target->fate )
                 printf( "fate change %s from %s to %s by dependency %s\n",
- t->name, target_fate[fate], target_fate[c->target->fate],
+ t->name, target_fate[(int) fate], target_fate[(int) c->target->fate],
                     c->target->name );
 #endif
     }
@@ -540,6 +539,7 @@
     }
 #ifdef OPT_GRAPH_DEBUG_EXT
     if ( DEBUG_FATE && ( fate != savedFate ) )
+ {
         if ( savedFate == T_FATE_STABLE )
             printf( "fate change %s set to %s%s\n", t->name,
                 target_fate[ fate ], oldTimeStamp ? " (by timestamp)" : "" );
@@ -547,6 +547,7 @@
             printf( "fate change %s from %s to %s%s\n", t->name,
                 target_fate[ savedFate ], target_fate[ fate ],
                 oldTimeStamp ? " (by timestamp)" : "" );
+ }
 #endif
 
     /* Step 4e: handle missing files */
@@ -635,7 +636,7 @@
         flag = "*";
 
     if ( DEBUG_MAKEPROG )
- printf( "made%s\t%s\t%s%s\n", flag, target_fate[ t->fate ],
+ printf( "made%s\t%s\t%s%s\n", flag, target_fate[ (int) t->fate ],
             spaces( depth ), t->name );
 }
 
@@ -735,7 +736,7 @@
     for ( c = t->depends; c; c = c->next )
     {
         printf( " %s : Depends on %s (%s)", spaces( depth ),
- target_name( c->target ), target_fate[ c->target->fate ] );
+ target_name( c->target ), target_fate[ (int) c->target->fate ] );
         if ( c->target->time == t->time )
             printf( " (max time)");
         printf( "\n" );

Modified: trunk/tools/jam/src/make1.c
==============================================================================
--- trunk/tools/jam/src/make1.c (original)
+++ trunk/tools/jam/src/make1.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -66,7 +66,7 @@
 
 #include <stdlib.h>
 
-#if defined(sun) || defined(__sun)
+#if ! defined(NT) || defined(__GNUC__)
     #include <unistd.h> /* for unlink */
 #endif
 
@@ -914,8 +914,8 @@
     ACTIONS * a0;
 
     /* Step through actions. Actions may be shared with other targets or grouped
- /* using RULE_TOGETHER, so actions already seen are skipped.
- */
+ * using RULE_TOGETHER, so actions already seen are skipped.
+ */
     for ( a0 = t->actions ; a0; a0 = a0->next )
     {
         RULE * rule = a0->action->rule;

Modified: trunk/tools/jam/src/modules/order.c
==============================================================================
--- trunk/tools/jam/src/modules/order.c (original)
+++ trunk/tools/jam/src/modules/order.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -77,7 +77,7 @@
     LIST* arg = lol_get( frame->args, 0 );
     LIST* tmp;
     LIST* result = 0;
- int src, dst;
+ int src;
 
     /* We need to create a graph of order dependencies between
        the passed objects. We assume that there are no duplicates

Modified: trunk/tools/jam/src/modules/property-set.c
==============================================================================
--- trunk/tools/jam/src/modules/property-set.c (original)
+++ trunk/tools/jam/src/modules/property-set.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -45,7 +45,9 @@
 {
     LIST* properties = lol_get( frame->args, 0 );
     LIST* sorted = 0;
+#if 0
     LIST* order_sensitive = 0;
+#endif
     LIST* unique;
     LIST* tmp;
     LIST* val;

Modified: trunk/tools/jam/src/output.c
==============================================================================
--- trunk/tools/jam/src/output.c (original)
+++ trunk/tools/jam/src/output.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -71,7 +71,7 @@
             if ( action )
             {
                 /* But only output for non-quietly actions. */
- fprintf( bjam_out, "%d second time limit exceeded\n", globs.timeout );
+ fprintf( bjam_out, "%ld second time limit exceeded\n", globs.timeout );
             }
             break;
         }

Modified: trunk/tools/jam/src/pathunix.c
==============================================================================
--- trunk/tools/jam/src/pathunix.c (original)
+++ trunk/tools/jam/src/pathunix.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -122,7 +122,7 @@
     p = 0;
     q = file;
 
- while ( q = (char *)memchr( q, '.', end - q ) )
+ while ( ( q = (char *)memchr( q, '.', end - q ) ) )
         p = q++;
 
     if ( p )

Modified: trunk/tools/jam/src/regexp.c
==============================================================================
--- trunk/tools/jam/src/regexp.c (original)
+++ trunk/tools/jam/src/regexp.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -309,7 +309,7 @@
     register char *ret;
     register char *br;
     register char *ender;
- register int parno;
+ register int parno = 0;
     int flags;
 
     *flagp = HASWIDTH; /* Tentatively. */

Modified: trunk/tools/jam/src/rules.c
==============================================================================
--- trunk/tools/jam/src/rules.c (original)
+++ trunk/tools/jam/src/rules.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -358,8 +358,6 @@
 
 TARGETS * targetchain( TARGETS * chain, TARGETS * targets )
 {
- TARGETS * c;
-
     if ( !targets ) return chain;
     if ( !chain ) return targets;
 

Modified: trunk/tools/jam/src/search.c
==============================================================================
--- trunk/tools/jam/src/search.c (original)
+++ trunk/tools/jam/src/search.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -124,7 +124,7 @@
     f->f_grist.ptr = 0;
     f->f_grist.len = 0;
 
- if ( varlist = var_get( "LOCATE" ) )
+ if ( ( varlist = var_get( "LOCATE" ) ) )
       {
         f->f_root.ptr = varlist->string;
         f->f_root.len = strlen( varlist->string );
@@ -139,7 +139,7 @@
         timestamp( buf->value, time );
         found = 1;
     }
- else if ( varlist = var_get( "SEARCH" ) )
+ else if ( ( varlist = var_get( "SEARCH" ) ) )
     {
         while ( varlist )
         {

Modified: trunk/tools/jam/src/timestamp.c
==============================================================================
--- trunk/tools/jam/src/timestamp.c (original)
+++ trunk/tools/jam/src/timestamp.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -74,8 +74,10 @@
     BINDING binding;
     BINDING * b = &binding;
     string buf[ 1 ];
+#ifdef DOWNSHIFT_PATHS
     string path;
     char * p;
+#endif
 
 #ifdef DOWNSHIFT_PATHS
     string_copy( &path, target );

Modified: trunk/tools/jam/src/variable.c
==============================================================================
--- trunk/tools/jam/src/variable.c (original)
+++ trunk/tools/jam/src/variable.c 2008-09-28 20:05:22 EDT (Sun, 28 Sep 2008)
@@ -110,7 +110,7 @@
 
         if ( ( val = strchr( *e, '=' ) ) || ( val = *e + strlen( *e ) ) )
 # else
- if ( val = strchr( *e, '=' ) )
+ if ( ( val = strchr( *e, '=' ) ) )
 # endif
         {
             LIST * l = L0;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk