Changeset 575cbd4e53566d3e6c12dc75fd867a6bf10307c3

User picture

Commiter: Nikos Chantziaras

Author: Nikos Chantziaras

Parent: 4063bbd568

(2009/08/24 22:32) Over 2 years ago

Apply upstream-accepted patches, fixing ANSI-correctness

With GCC's "-ansi -pedantic" switches, this warning is issued a lot:

  warning: overflow in implicit constant conversion

due to signed 1-bit bitfields being assigned the value 1 (TRUE) while they
actually can only hold -1 and 0.  Making all those bitfields unsigned fixes
the issue.

Affected files

Updated t3compiler/tads3/tcpndrv.h Download diff

4063bbd56844345154c9701e8947d1cf18a0e731575cbd4e53566d3e6c12dc75fd867a6bf10307c3
743
    CTcConstVal const_val_;
743
    CTcConstVal const_val_;
744
744
745
    /* flag: all elements of the list are constant */
745
    /* flag: all elements of the list are constant */
746
    int is_const_ : 1;
746
    unsigned int is_const_ : 1;
747
};
747
};
748
748
749
/*
749
/*
...
...
2020
     *   flag: we are explicitly defined with the root object ('object') as
2020
     *   flag: we are explicitly defined with the root object ('object') as
2021
     *   our superclass 
2021
     *   our superclass 
2022
     */
2022
     */
2023
    int sc_is_root_ : 1;
2023
    unsigned int sc_is_root_ : 1;
2024
2024
2025
    /* flag: the object is transient */
2025
    /* flag: the object is transient */
2026
    uint transient_ : 1;
2026
    uint transient_ : 1;
...
...
2470
    int argc_;
2470
    int argc_;
2471
2471
2472
    /* flag: variable arguments (in which case argc_ is only a minimum) */
2472
    /* flag: variable arguments (in which case argc_ is only a minimum) */
2473
    int varargs_ : 1;
2473
    unsigned int varargs_ : 1;
2474
2474
2475
    /* flag: function has a return value (false -> void function) */
2475
    /* flag: function has a return value (false -> void function) */
2476
    int has_retval_ : 1;
2476
    unsigned int has_retval_ : 1;
2477
};
2477
};
2478
2478
2479
/*
2479
/*
...
...
2508
     *   track of this so that we warn when a label is defined but never
2508
     *   track of this so that we warn when a label is defined but never
2509
     *   used as a target) 
2509
     *   used as a target) 
2510
     */
2510
     */
2511
    int referenced_ : 1;
2511
    unsigned int referenced_ : 1;
2512
};
2512
};
2513
2513
2514
2514
...
...
2980
     *   flag: we have our own private symbol table (it's not the
2980
     *   flag: we have our own private symbol table (it's not the
2981
     *   enclosing scope's symbol table) 
2981
     *   enclosing scope's symbol table) 
2982
     */
2982
     */
2983
    int has_own_scope_ : 1;
2983
    unsigned int has_own_scope_ : 1;
2984
};
2984
};
2985
2985
2986
/* ------------------------------------------------------------------------ */
2986
/* ------------------------------------------------------------------------ */
...
...
3147
    class CTcPrsSymtab *symtab_;
3147
    class CTcPrsSymtab *symtab_;
3148
3148
3149
    /* flag: we have our own private symbol table (not our parent's) */
3149
    /* flag: we have our own private symbol table (not our parent's) */
3150
    int has_own_scope_ : 1;
3150
    unsigned int has_own_scope_ : 1;
3151
};
3151
};
3152
3152
3153
/* ------------------------------------------------------------------------ */
3153
/* ------------------------------------------------------------------------ */
...
...
3211
    int iter_local_id_;
3211
    int iter_local_id_;
3212
    
3212
    
3213
    /* flag: we have our own private symbol table (not our parent's) */
3213
    /* flag: we have our own private symbol table (not our parent's) */
3214
    int has_own_scope_ : 1;
3214
    unsigned int has_own_scope_ : 1;
3215
};
3215
};
3216
3216
3217
/* ------------------------------------------------------------------------ */
3217
/* ------------------------------------------------------------------------ */
...
...
4000
    int prop_cnt_;
4000
    int prop_cnt_;
4001
4001
4002
    /* flag: I'm a class */
4002
    /* flag: I'm a class */
4003
    int is_class_ : 1;
4003
    unsigned int is_class_ : 1;
4004
4004
4005
    /* flag: I've been replaced by another object */
4005
    /* flag: I've been replaced by another object */
4006
    int replaced_ : 1;
4006
    unsigned int replaced_ : 1;
4007
4007
4008
    /* flag: I've been modified by another object */
4008
    /* flag: I've been modified by another object */
4009
    int modified_ : 1;
4009
    unsigned int modified_ : 1;
4010
4010
4011
    /* flag: the object is transient */
4011
    /* flag: the object is transient */
4012
    int transient_ : 1;
4012
    unsigned int transient_ : 1;
4013
4013
4014
    /* flag: this object definition used a template that wasn't matched */
4014
    /* flag: this object definition used a template that wasn't matched */
4015
    int bad_template_ : 1;
4015
    unsigned int bad_template_ : 1;
4016
4016
4017
    /* 
4017
    /* 
4018
     *   Flag: this object definition includes an undescribed superclass.
4018
     *   Flag: this object definition includes an undescribed superclass.
...
...
4021
     *   a template, since we know nothing about the class other than that it
4021
     *   a template, since we know nothing about the class other than that it
4022
     *   is indeed a class.  
4022
     *   is indeed a class.  
4023
     */
4023
     */
4024
    int undesc_sc_ : 1;
4024
    unsigned int undesc_sc_ : 1;
4025
};
4025
};
4026
4026
4027
/*
4027
/*

Updated t3compiler/tads3/tctok.h Download diff

4063bbd56844345154c9701e8947d1cf18a0e731575cbd4e53566d3e6c12dc75fd867a6bf10307c3
1470
    void clear_linebuf();
1470
    void clear_linebuf();
1471
1471
1472
    /* flag: ALL_ONCE mode - we include each file only once */
1472
    /* flag: ALL_ONCE mode - we include each file only once */
1473
    int all_once_ : 1;
1473
    unsigned int all_once_ : 1;
1474
1474
1475
    /* flag: warn on ignoring a redundant #include file */
1475
    /* flag: warn on ignoring a redundant #include file */
1476
    int warn_on_ignore_incl_ : 1;
1476
    unsigned int warn_on_ignore_incl_ : 1;
1477
1477
1478
    /*
1478
    /*
1479
     *   Flag: in preprocess-only mode.  In this mode, we'll leave certain
1479
     *   Flag: in preprocess-only mode.  In this mode, we'll leave certain
...
...
1482
     *   For example, we'll leave #line directives, #pragma C, #error, and
1482
     *   For example, we'll leave #line directives, #pragma C, #error, and
1483
     *   #pragma message directives in the preprocessed result.  
1483
     *   #pragma message directives in the preprocessed result.  
1484
     */
1484
     */
1485
    int pp_only_mode_ : 1;
1485
    unsigned int pp_only_mode_ : 1;
1486
1486
1487
    /* 
1487
    /* 
1488
     *   Flag: in test reporting mode.  In this mode, we'll expand __FILE__
1488
     *   Flag: in test reporting mode.  In this mode, we'll expand __FILE__
1489
     *   macros with the root name only. 
1489
     *   macros with the root name only. 
1490
     */
1490
     */
1491
    int test_report_mode_ : 1;
1491
    unsigned int test_report_mode_ : 1;
1492
1492
1493
    /*
1493
    /*
1494
     *   Flag: in preprocess-for-includes mode.  In this mode, we'll do
1494
     *   Flag: in preprocess-for-includes mode.  In this mode, we'll do
...
...
1496
     *   header files that are included, along with header files they
1496
     *   header files that are included, along with header files they
1497
     *   include, and so on.  
1497
     *   include, and so on.  
1498
     */
1498
     */
1499
    int list_includes_mode_ : 1;
1499
    unsigned int list_includes_mode_ : 1;
1500
1500
1501
    /*
1501
    /*
1502
     *   Flag: treat newlines in strings as whitespace.  When this is true,
1502
     *   Flag: treat newlines in strings as whitespace.  When this is true,
...
...
1508
     *   whitespace is not conventionally used as a token separator in
1508
     *   whitespace is not conventionally used as a token separator in
1509
     *   ordinary text.  
1509
     *   ordinary text.  
1510
     */
1510
     */
1511
    int string_newline_spacing_ : 1;
1511
    unsigned int string_newline_spacing_ : 1;
1512
1512
1513
    /* 
1513
    /* 
1514
     *   flag: we're parsing a preprocessor constant expression (for a
1514
     *   flag: we're parsing a preprocessor constant expression (for a
1515
     *   #if, for example; this doesn't apply to simple macro expansion) 
1515
     *   #if, for example; this doesn't apply to simple macro expansion) 
1516
     */
1516
     */
1517
    int in_pp_expr_ : 1;
1517
    unsigned int in_pp_expr_ : 1;
1518
1518
1519
    /* resource loader */
1519
    /* resource loader */
1520
    class CResLoader *res_loader_;
1520
    class CResLoader *res_loader_;

Updated tads3/vmconsol.h Download diff

4063bbd56844345154c9701e8947d1cf18a0e731575cbd4e53566d3e6c12dc75fd867a6bf10307c3
628
     *   Flag: the log stream is enabled.  We can temporarily disable the
628
     *   Flag: the log stream is enabled.  We can temporarily disable the
629
     *   log stream, such as when writing to the statusline stream.  
629
     *   log stream, such as when writing to the statusline stream.  
630
     */
630
     */
631
    int log_enabled_ : 1;
631
    unsigned int log_enabled_ : 1;
632
    
632
    
633
    /*
633
    /*
634
     *   Flag: display two spaces after a period-like punctuation mark.
634
     *   Flag: display two spaces after a period-like punctuation mark.

Updated tads3/vmdbg.h Download diff

4063bbd56844345154c9701e8947d1cf18a0e731575cbd4e53566d3e6c12dc75fd867a6bf10307c3
603
603
604
private:
604
private:
605
    /* flag: debugger has control */
605
    /* flag: debugger has control */
606
    int in_debugger_ : 1;
606
    unsigned int in_debugger_ : 1;
607
    
607
    
608
    /* 
608
    /* 
609
     *   single-step mode - if this is true, we're stepping through code;
609
     *   single-step mode - if this is true, we're stepping through code;
610
     *   otherwise, we're running until we hit a breakpoint 
610
     *   otherwise, we're running until we hit a breakpoint 
611
     */
611
     */
612
    int single_step_ : 1;
612
    unsigned int single_step_ : 1;
613
613
614
    /* 
614
    /* 
615
     *   step-in mode - if this is true, and single_step_ is true, we'll
615
     *   step-in mode - if this is true, and single_step_ is true, we'll
...
...
618
     *   level as the current statement (in other words, we're stepping
618
     *   level as the current statement (in other words, we're stepping
619
     *   over subroutine calls made by the current statement) 
619
     *   over subroutine calls made by the current statement) 
620
     */
620
     */
621
    int step_in_ : 1 ;
621
    unsigned int step_in_ : 1 ;
622
622
623
    /* 
623
    /* 
624
     *   Step-out mode - if this is true, and single_step_ is true, we'll
624
     *   Step-out mode - if this is true, and single_step_ is true, we'll
...
...
627
     *   native code interaction, because we actually know to stop on a
627
     *   native code interaction, because we actually know to stop on a
628
     *   step-out using step-over with an enclosing stack level.)  
628
     *   step-out using step-over with an enclosing stack level.)  
629
     */
629
     */
630
    int step_out_ : 1;
630
    unsigned int step_out_ : 1;
631
631
632
    /* 
632
    /* 
633
     *   step-over-breakpoint mode - if this is true, we're stepping over
633
     *   step-over-breakpoint mode - if this is true, we're stepping over
634
     *   a breakpoint 
634
     *   a breakpoint 
635
     */
635
     */
636
    int step_over_bp_ : 1;
636
    unsigned int step_over_bp_ : 1;
637
637
638
    /* 
638
    /* 
639
     *   Original step flags - these store the step flags that will be in
639
     *   Original step flags - these store the step flags that will be in
640
     *   effect after we finish a step_over_bp operation 
640
     *   effect after we finish a step_over_bp operation 
641
     */
641
     */
642
    int orig_single_step_ : 1;
642
    unsigned int orig_single_step_ : 1;
643
    int orig_step_in_ : 1;
643
    unsigned int orig_step_in_ : 1;
644
    int orig_step_out_ : 1;
644
    unsigned int orig_step_out_ : 1;
645
645
646
    /* 
646
    /* 
647
     *   flag: we've been initialized during program load; when this flag is
647
     *   flag: we've been initialized during program load; when this flag is
648
     *   set, we'll have to make corresponding uninitializations when the
648
     *   set, we'll have to make corresponding uninitializations when the
649
     *   program terminates 
649
     *   program terminates 
650
     */
650
     */
651
    int program_inited_ : 1;
651
    unsigned int program_inited_ : 1;
652
652
653
    /* breakpoint being stepped over */
653
    /* breakpoint being stepped over */
654
    CVmDebugBp *step_over_bp_bp_;
654
    CVmDebugBp *step_over_bp_bp_;
...
...
673
     *   functions might not have debug tables at all.  
673
     *   functions might not have debug tables at all.  
674
     */
674
     */
675
    CVmDbgTablePtr dbg_ptr_;
675
    CVmDbgTablePtr dbg_ptr_;
676
    int dbg_ptr_valid_ : 1;
676
    unsigned int dbg_ptr_valid_ : 1;
677
677
678
    /* function header pointer for current function */
678
    /* function header pointer for current function */
679
    pool_ofs_t entry_ofs_;
679
    pool_ofs_t entry_ofs_;

Updated tads3/vmobj.h Download diff

4063bbd56844345154c9701e8947d1cf18a0e731575cbd4e53566d3e6c12dc75fd867a6bf10307c3
1380
    CVmObject *get_vm_obj() const { return (CVmObject *)ptr_.obj_; }
1380
    CVmObject *get_vm_obj() const { return (CVmObject *)ptr_.obj_; }
1381
1381
1382
    /* flag: the object is in the free list */
1382
    /* flag: the object is in the free list */
1383
    int free_ : 1;
1383
    unsigned int free_ : 1;
1384
1384
1385
    /* 
1385
    /* 
1386
     *   flag: the object is part of the root set (that is, there's a
1386
     *   flag: the object is part of the root set (that is, there's a
1387
     *   reference to this object from some static location outside of the
1387
     *   reference to this object from some static location outside of the
1388
     *   root set, such as in p-code or in a constant list) 
1388
     *   root set, such as in p-code or in a constant list) 
1389
     */
1389
     */
1390
    int in_root_set_ : 1;
1390
    unsigned int in_root_set_ : 1;
1391
1391
1392
    /*
1392
    /*
1393
     *   Reachability state.  This indicates whether the object is
1393
     *   Reachability state.  This indicates whether the object is

Updated tads3/vmregex.h Download diff

4063bbd56844345154c9701e8947d1cf18a0e731575cbd4e53566d3e6c12dc75fd867a6bf10307c3
299
     *   case-sensitive, so alphabetic characters in the pattern are matched
299
     *   case-sensitive, so alphabetic characters in the pattern are matched
300
     *   without regard to case.  
300
     *   without regard to case.  
301
     */
301
     */
302
    int case_sensitive : 1;
302
    unsigned int case_sensitive : 1;
303
303
304
    /* 
304
    /* 
305
     *   <MIN> or <MAX> match mode -- if this flag is set, we match the
305
     *   <MIN> or <MAX> match mode -- if this flag is set, we match the
306
     *   longest string in case of ambiguity; otherwise we match the
306
     *   longest string in case of ambiguity; otherwise we match the
307
     *   shortest.  
307
     *   shortest.  
308
     */
308
     */
309
    int longest_match : 1;
309
    unsigned int longest_match : 1;
310
310
311
    /* 
311
    /* 
312
     *   <FirstEnd> or <FirstBeg> match mode -- if this flag is set, we
312
     *   <FirstEnd> or <FirstBeg> match mode -- if this flag is set, we
313
     *   match (in a search) the string that starts first in case of
313
     *   match (in a search) the string that starts first in case of
314
     *   ambiguity; otherwise, we match the string that ends first 
314
     *   ambiguity; otherwise, we match the string that ends first 
315
     */
315
     */
316
    int first_begin : 1;
316
    unsigned int first_begin : 1;
317
};
317
};
318
318
319
/*
319
/*