Ticket #2207: jam-wall-clean.patch

File jam-wall-clean.patch, 15.8 KB (added by Steven Robbins <smr@…>, 14 years ago)
  • tools/jam/src/builtins.c

    old new  
    157157                    builtin_flags, T_FLAG_TEMP, 0 ) );
    158158
    159159    {
    160         char * args[] = { "targets", "*", 0 };
    161160        bind_builtin(
    162161            "ISFILE",
    163162            builtin_flags, T_FLAG_ISFILE, 0 );
     
    11571156void backtrace( FRAME *frame )
    11581157{
    11591158        if ( !frame ) return;
    1160     while ( frame = frame->prev )
     1159    while ( ( frame = frame->prev ) )
    11611160    {
    11621161        backtrace_line( frame );
    11631162    }
     
    13681367            *(current+2) = '\1';                   
    13691368            ++dotdots;
    13701369        } else if (dotdots) {
    1371             char* p = current;
    13721370            memset(current, '\1', end-current+1);
    13731371            --dotdots;
    13741372        }                 
  • tools/jam/src/class.c

    old new  
    5252    RULE* ir2;
    5353    struct import_base_data* d = (struct import_base_data*)d_;
    5454    string qualified_name[1];
    55     int basename_lenght = strlen(d->base_name)+1;
    5655
    5756    string_new(qualified_name);
    5857    string_append(qualified_name, d->base_name);
     
    6766
    6867    /* If we're importing class method, localize it. */
    6968    if (r->module == d->base_module
    70         || r->module->class_module && r->module->class_module == d->base_module) {
     69        || ( r->module->class_module && r->module->class_module == d->base_module ) ) {
    7170        ir1->module = ir2->module = d->class_module;       
    7271    }
    7372       
     
    107106        printf("Class %s already defined\n", xname->string);
    108107        abort();
    109108    } else {
    110         hashenter(classes, (HASHDATA**)&pp);
     109        (void)hashenter(classes, (HASHDATA**)&pp);
    111110    }
    112111    check_defined(bases);
    113112   
  • tools/jam/src/compile.c

    old new  
    326326{
    327327    LIST *r = 0;
    328328    LIST *l;
    329     while ( l = parse_evaluate( p->left, frame ) )
     329    while ( ( l = parse_evaluate( p->left, frame ) ) )
    330330    {
    331331        list_free( l );
    332332        if( r ) list_free( r );
     
    800800    return locals;
    801801}
    802802
    803 static int python_instance_number = 0;
    804 
    805803RULE *
    806804enter_rule( char *rulename, module_t *target_module );
    807805
    808806#ifdef HAVE_PYTHON
     807
     808static int python_instance_number = 0;
     809
    809810static LIST*
    810811call_python_function(RULE* r, FRAME* frame)
    811812{
  • tools/jam/src/debug.c

    old new  
    111111        profile_total.cumulative += p->net;
    112112        profile_total.memory += p->memory;
    113113    }
    114     printf("%10d %12.6f %12.6f %12.8f %10d %10d %s\n",
     114    printf("%10ld %12.6f %12.6f %12.8f %10ld %10ld %s\n",
    115115        p->num_entries,
    116116        cumulative,net,q,
    117117        p->memory, mem_each,
  • tools/jam/src/expand.c

    # 
    # Pointer difference is long int on amd64; cast to int
    old new  
    8787    int depth;
    8888
    8989    if( DEBUG_VAREXP )
    90         printf( "expand '%.*s'\n", end - in, in );
     90        printf( "expand '%.*s'\n", (int) (end - in), in );
    9191
    9292    /* This gets alot of cases: $(<) and $(>) */
    9393
     
    276276            string_copy( variable, vars->string );
    277277            varname = variable->value;
    278278
    279             if( colon = strchr( varname, MAGIC_COLON ) )
     279            if( ( colon = strchr( varname, MAGIC_COLON ) ) )
    280280            {
    281281                string_truncate( variable, colon - varname );
    282282                var_edit_parse( colon + 1, &edits );
     
    285285            /* Look for [x-y] subscripting */
    286286            /* sub1 and sub2 are x and y. */
    287287
    288             if ( bracket = strchr( varname, MAGIC_LEFT ) )
     288            if ( ( bracket = strchr( varname, MAGIC_LEFT ) ) )
    289289            {
    290290                /*
    291291                ** Make all syntax errors in [] subscripting
     
    607607                fp->ptr = "";
    608608                fp->len = 0;
    609609            }
    610             else if( p = strchr( mods, MAGIC_COLON ) )
     610            else if( ( p = strchr( mods, MAGIC_COLON ) ) )
    611611            {
    612612                *p = 0;
    613613                fp->ptr = ++mods;
  • tools/jam/src/fileunix.c

    old new  
    170170            printf( "scan directory %s\n", dir );
    171171
    172172        string_new( filename );
    173         while( dirent = readdir( dd ) )
     173        while( ( dirent = readdir( dd ) ) )
    174174        {
    175             file_info_t * ff = 0;
    176            
    177175            # ifdef old_sinix
    178176            /* Broken structure definition on sinix. */
    179177            f.f_base.ptr = dirent->d_name - 2;
  • tools/jam/src/hash.c

    #
    # Hunk 3: sizeof( ITEM ** ) is long unsigned int on amd64 and s390
    # cast to int.
    old new  
    336336        hp->items.size = sizeof( struct hashhdr ) + ALIGNED( datalen );
    337337        hp->items.list = -1;
    338338        hp->items.nel = 0;
    339         hp->inel = /* */ 11 /*/ 47 /* */;
     339        hp->inel = /* */ 11 /* 47 */;
    340340        hp->name = name;
    341341
    342342        return hp;
     
    412412
    413413        for( i = nel; i > 0; i-- )
    414414        {
    415                 if( here = ( *tab++ != (ITEM *)0 ) )
     415                if( ( here = ( *tab++ != (ITEM *)0 ) ) )
    416416                        count++;
    417417                if( here && !run )
    418418                        sets++;
     
    425425                hp->items.nel,
    426426                hp->tab.nel,
    427427                hp->items.nel * hp->items.size / 1024,
    428                 hp->tab.nel * sizeof( ITEM ** ) / 1024,
     428                hp->tab.nel * (int) sizeof( ITEM ** ) / 1024,
    429429                (float)count / (float)sets );
    430430}
  • tools/jam/src/hdrmacro.c

    old new  
    4646 *              just to invoke a rule.
    4747 */
    4848
    49 static LIST *header_macros1( LIST *l, char *file, int rec, regexp *re[] );
    50 
    5149/* this type is used to store a dictionary of file header macros */
    5250typedef struct header_macro
    5351{
  • tools/jam/src/jam.c

    old new  
    308308
    309309    /* Turn on/off debugging */
    310310
    311     for( n = 0; s = getoptval( optv, 'd', n ); n++ )
     311    for( n = 0; ( s = getoptval( optv, 'd', n ) ); n++ )
    312312    {
    313313        int i;
    314314
     
    426426
    427427    /* Load up variables set on command line. */
    428428
    429     for( n = 0; s = getoptval( optv, 's', n ); n++ )
     429    for( n = 0; ( s = getoptval( optv, 's', n ) ); n++ )
    430430    {
    431431        char *symv[2];
    432432        symv[0] = s;
     
    469469    {
    470470        FRAME frame[1];
    471471        frame_init( frame );
    472         for( n = 0; s = getoptval( optv, 'f', n ); n++ )
     472        for( n = 0; ( s = getoptval( optv, 'f', n ) ); n++ )
    473473            parse_file( s, frame );
    474474
    475475        if( !n )
     
    480480
    481481    /* Manually touch -t targets */
    482482
    483     for( n = 0; s = getoptval( optv, 't', n ); n++ )
     483    for( n = 0; ( s = getoptval( optv, 't', n ) ); n++ )
    484484        touchtarget( s );
    485485
    486486    /* If an output file is specified, set globs.cmdout to that */
    487487
    488     if( s = getoptval( optv, 'o', 0 ) )
     488    if( ( s = getoptval( optv, 'o', 0 ) ) )
    489489    {
    490490        if( !( globs.cmdout = fopen( s, "w" ) ) )
    491491        {
  • tools/jam/src/make.c

    old new  
    201201            if (DEBUG_FATE)
    202202            {
    203203                printf( "fate change  %s from %s to %s (as dependent of %s)\n",
    204                         p->name, target_fate[fate0], target_fate[p->fate], t->name);
     204                        p->name, target_fate[(int)fate0], target_fate[(int)p->fate], t->name);
    205205            }
    206206   
    207207            /* If we're done visiting it, go back and make sure its
     
    226226        {
    227227            if (DEBUG_FATE)
    228228                printf( "fate change  %s from %s to %s (by rebuild)\n",
    229                         r->name, target_fate[r->fate], target_fate[T_FATE_REBUILD]);
     229                        r->name, target_fate[(int)r->fate], target_fate[(int)T_FATE_REBUILD]);
    230230           
    231231            /* Force rebuild it */
    232232            r->fate = T_FATE_REBUILD;
     
    251251        COUNTS  *counts,        /* for reporting */
    252252        int     anyhow )        /* forcibly touch all (real) targets */
    253253{
    254         TARGETS *c, *d, *incs;
     254        TARGETS *c, *incs;
    255255        TARGET  *ptime = t;
    256256        time_t  last, leaf, hlast;
    257257        int     fate;
     
    365365            case T_BIND_MISSING:
    366366            case T_BIND_PARENTS:
    367367                printf( "time\t--\t%s%s: %s\n",
    368                         spaces( depth ), t->name, target_bind[ t->binding ] );
     368                        spaces( depth ), t->name, target_bind[ (int)t->binding ] );
    369369                break;
    370370
    371371            case T_BIND_EXISTS:
     
    447447                if( fate < c->target->fate )
    448448                    printf( "fate change  %s from %s to %s by dependency %s\n",
    449449                            t->name,
    450                             target_fate[fate], target_fate[c->target->fate],
     450                            target_fate[(int)fate], target_fate[(int)c->target->fate],
    451451                            c->target->name);
    452452#endif
    453453
     
    571571            fate = T_FATE_STABLE;
    572572        }
    573573#ifdef OPT_GRAPH_DEBUG_EXT
    574         if( DEBUG_FATE && fate != savedFate )
     574        if( DEBUG_FATE && ( fate != savedFate ) )
     575        {
    575576            if( savedFate == T_FATE_STABLE )
    576577                printf( "fate change  %s set to %s%s\n",
    577578                       t->name, target_fate[fate],
     
    580581                printf( "fate change  %s from %s to %s%s\n",
    581582                       t->name, target_fate[savedFate], target_fate[fate],
    582583                       oldTimeStamp ? " (by timestamp)" : "" );
     584        }
    583585#endif
    584586
    585587        /* Step 4e: handle missing files */
     
    667669
    668670        if( DEBUG_MAKEPROG )
    669671            printf( "made%s\t%s\t%s%s\n",
    670                 flag, target_fate[ t->fate ],
     672                    flag, target_fate[ (int)t->fate ],
    671673                spaces( depth ), t->name );
    672674
    673675/* We don't have DEBUG_CAUSES.
     
    776778    for( c = t->depends; c; c = c->next )
    777779    {
    778780        printf( "  %s       : Depends on %s (%s)", spaces(depth),
    779                target_name(c->target), target_fate[ c->target->fate ] );
     781                target_name(c->target), target_fate[ (int)c->target->fate ] );
    780782    if (c->target->time == t->time)
    781783        printf( " (max time)");
    782784    printf("\n");
  • tools/jam/src/make1.c

    old new  
    6565
    6666# include <stdlib.h>
    6767
    68 #if defined(sun) || defined(__sun)
     68#if defined(sun) || defined(__sun) || defined(linux)
    6969#include <unistd.h> /* for unlink */
    7070#endif
    7171
     
    506506        {
    507507            char *rule_name = 0;
    508508            char *target = 0;
    509                 if( DEBUG_MAKEQ ||
    510             ! ( cmd->rule->actions->flags & RULE_QUIETLY ) && DEBUG_MAKE)
     509            if( DEBUG_MAKEQ ||
     510                ( ! ( cmd->rule->actions->flags & RULE_QUIETLY ) && DEBUG_MAKE ) )
    511511            {
    512             rule_name = cmd->rule->name;
    513             target = lol_get(&cmd->args, 0)->string;
    514             if ( globs.noexec )
    515             {
    516                 out_action(rule_name,target,cmd->buf,"","",EXIT_OK);
    517             }
     512                rule_name = cmd->rule->name;
     513                target = lol_get(&cmd->args, 0)->string;
     514                if ( globs.noexec )
     515                {
     516                    out_action(rule_name,target,cmd->buf,"","",EXIT_OK);
     517                }
    518518            }
    519519
    520520            if( globs.noexec )
  • tools/jam/src/modules.c

    old new  
    135135        char* s = module_names->string;
    136136        char** ss = &s;
    137137       
    138         hashenter(h, (HASHDATA**)&ss);
     138        (void)hashenter(h, (HASHDATA**)&ss);
    139139    }
    140140   
    141141    PROFILE_EXIT(IMPORT_MODULE);
  • tools/jam/src/modules/order.c

    old new  
    7777    LIST* arg = lol_get( frame->args, 0 ); 
    7878    LIST* tmp;
    7979    LIST* result = 0;
    80     int src, dst;
     80    int src;
    8181
    8282    /* We need to create a graph of order dependencies between
    8383       the passed objects. We assume that there are no duplicates
  • tools/jam/src/modules/property-set.c

    old new  
    4545{
    4646    LIST* properties = lol_get( frame->args, 0 );   
    4747    LIST* sorted = 0;
     48#if 0
    4849    LIST* order_sensitive = 0;
     50#endif
    4951    LIST* unique;
    5052    LIST* tmp;
    5153    LIST* val;
  • tools/jam/src/native.c

    old new  
    3232        }
    3333        n.procedure = parse_make( f, P0, P0, P0, C0, C0, 0 );       
    3434        n.version = version;
    35         hashenter(m->native_rules, (HASHDATA**)&np);
     35        (void)hashenter(m->native_rules, (HASHDATA**)&np);
    3636    }
    3737}
    3838
  • tools/jam/src/output.c

    old new  
    6767            if ( action )
    6868            {
    6969                /* but only output for non-quietly actions */
    70                 fprintf(bjam_out, "%d second time limit exceeded\n", globs.timeout);
     70                fprintf(bjam_out, "%ld second time limit exceeded\n", globs.timeout);
    7171            }
    7272            break;
    7373        }
  • tools/jam/src/pathunix.c

    old new  
    124124        p = 0;
    125125        q = file;
    126126
    127         while( q = (char *)memchr( q, '.', end - q ) )
     127        while( ( q = (char *)memchr( q, '.', end - q ) ) )
    128128            p = q++;
    129129
    130130        if( p )
  • tools/jam/src/rules.c

    old new  
    342342        TARGETS *chain,
    343343        TARGETS *targets )
    344344{
    345         TARGETS *c;
    346 
    347345        if( !targets )
    348346            return chain;
    349347        else if( !chain )
  • tools/jam/src/search.c

    old new  
    115115    f->f_grist.ptr = 0;
    116116    f->f_grist.len = 0;
    117117
    118     if( varlist = var_get( "LOCATE" ) )
     118    if( ( varlist = var_get( "LOCATE" ) ) )
    119119      {
    120120        f->f_root.ptr = varlist->string;
    121121        f->f_root.len = strlen( varlist->string );
     
    130130        timestamp( buf->value, time );
    131131        found = 1;
    132132    }
    133     else if( varlist = var_get( "SEARCH" ) )
     133    else if( ( varlist = var_get( "SEARCH" ) ) )
    134134    {
    135135        while( varlist )
    136136        {
     
    198198        /* CONSIDER: we probably should issue a warning is another file
    199199           is explicitly bound to the same location. This might break
    200200           compatibility, though. */
    201         hashenter(explicit_bindings, (HASHDATA**)&ba);
     201        (void)hashenter(explicit_bindings, (HASHDATA**)&ba);
    202202    }
    203203       
    204204    /* prepare a call to BINDRULE if the variable is set */
  • tools/jam/src/timestamp.c

    old new  
    7575        PATHNAME f1, f2;
    7676        BINDING binding, *b = &binding;
    7777        string buf[1];
    78     string path;
    79         char *p;
    8078
    8179# ifdef DOWNSHIFT_PATHS
     80        string path;
     81        char *p;
    8282
    8383        string_copy( &path, target );
    8484        p = path.value;
  • tools/jam/src/variable.c

    old new  
    109109       
    110110            if( ( val = strchr( *e, '=' ) ) || ( val = *e + strlen( *e ) ) )
    111111# else
    112             if( val = strchr( *e, '=' ) )
     112            if( ( val = strchr( *e, '=' ) ) )
    113113# endif
    114114            {
    115115                LIST *l = L0;
  • tools/jam/src/hcache.c

    old new  
    162162{
    163163    if (!s)
    164164        s = "";
    165     fprintf(f, "%lu\t%s\n", strlen(s), s);
     165    fprintf(f, "%zu\t%s\n", strlen(s), s);
    166166}
    167167
    168168void
     
    314314        else if (c->age > maxage)
    315315            continue;
    316316
    317         sprintf(includes_count_str, "%lu", list_length(c->includes));
    318         sprintf(hdrscan_count_str, "%lu", list_length(c->hdrscan));
     317        sprintf(includes_count_str, "%d", list_length(c->includes));
     318        sprintf(hdrscan_count_str, "%d", list_length(c->hdrscan));
    319319        sprintf(time_str, "%lu", c->time);
    320         sprintf(age_str, "%lu", c->age);
     320        sprintf(age_str, "%d", c->age);
    321321
    322322        write_netstring(f, CACHE_RECORD_HEADER);
    323323        write_netstring(f, c->boundname);
  • tools/jam/src/headers.c

    old new  
    6060{
    6161    LIST        *hdrscan;
    6262    LIST        *hdrrule;
    63     LIST        *headlist = 0;
    6463    regexp      *re[ MAXINC ];
    6564    int rec = 0;
    6665       
     
    8887#ifdef OPT_HEADER_CACHE_EXT
    8988        lol_add( frame->args, hcache( t, rec, re, hdrscan ) );
    9089#else
    91         lol_add( frame->args, headers1( headlist, t->boundname, rec, re ) );
     90        {
     91            LIST        *headlist = 0;
     92            lol_add( frame->args, headers1( headlist, t->boundname, rec, re ) );
     93        }
    9294#endif
    9395
    9496        if( lol_get( frame->args, 1 ) )
  • tools/jam/src/regexp.c

    old new  
    307307        register char *ret;
    308308        register char *br;
    309309        register char *ender;
    310         register int parno;
     310        register int parno = 0;
    311311        int flags;
    312312
    313313        *flagp = HASWIDTH;      /* Tentatively. */