#290 logical AND and --align-pointer=name

closed-fixed
None
7
2015-01-03
2014-06-28
No

astyle mistakenly moves logical AND operator when using --align-pointer=name option, so that

(foo && bar)

becomes

(foo &&bar)

Discussion

  • Janek Warchoł

    Janek Warchoł - 2014-06-28

    (this is with version 2.04)

     
  • Devon Schudy

    Devon Schudy - 2014-06-28

    This happens in member initializers, but not in expressions in general. So, for example:

    class X {
        X() : x(a && b) {
            foo(a && b);
        }
    };
    

    becomes:

    class X {
        X() : x(a  &&b) {
            foo(a && b);
        }
    };
    
     
  • Jim Pattee

    Jim Pattee - 2014-09-28

    I need more of an example with (foo && bar).
    What is before and after it?

     
  • Janek Warchoł

    Janek Warchoł - 2014-10-07

    Hello,

    sorry for long delay. Here's an actual diff of a real-life case:

         Midi_note::Midi_note (Audio_note *a)
           : Midi_channel_item (a),
             audio_ (a),
        -    dynamic_byte_ (min (max (Byte ((a->dynamic_ && a->dynamic_->volume_ >= 0
        +    dynamic_byte_ (min (max (Byte ((a->dynamic_  &&a->dynamic_->volume_ >= 0
                                             ? a->dynamic_->volume_ * 0x7f : 0x5a)
                                            + a->extra_velocity_),
                                      Byte (0)), Byte (0x7f)))
    

    does it help you?

     
  • Jim Pattee

    Jim Pattee - 2014-10-29

    Fixed initializers.

     
  • Jim Pattee

    Jim Pattee - 2014-10-29
     
  • Jim Pattee

    Jim Pattee - 2014-11-04
    • status: open --> open-fixed
    • assigned_to: Jim Pattee
    • Priority: 5 --> 7
     
  • Jim Pattee

    Jim Pattee - 2014-11-20
    • Status: open-fixed --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks