lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: astyle 2.02


From: Devon Schudy
Subject: Re: astyle 2.02
Date: Mon, 23 Jun 2014 21:28:24 -0400

Janek Warchoł wrote:
> our fixcc scripts says that it requires astyle in version exactly
> 2.02.  However, the latest version is 2.04 and i didn't manage to find
> packaged 2.02 version - does anyone know where i could get it?  Or
> maye we could use 2.04 after all?

Sourceforge has all the old versions, and they build out of the box:
https://sourceforge.net/projects/astyle/files/astyle/

I just tried both 2.02 and 2.04. Either version makes about 400 lines
of changes, which are mostly identical. The differences are:

* 2.02 unnecessarily indents inside the toplevel extern block in file-cookie.hh.

* 2.04 recognizes type specifiers like 'char*' more reliably, so it
adjusts their whitespace in some places where 2.02 doesn't.

* 2.04 misspaces an && operator (maybe misinterpreting it as a C++11
rvalue reference?):

@@ -193,7 +193,7 @@ Midi_time_signature::to_string () const
 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)))

* 2.02 and 2.04 make slightly different mistakes here:

@@ -106,7 +106,7 @@ LY_DEFINE (ly_moment_mul, "ly:moment-mul",

   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
-  return (*ma * * mb).smobbed_copy ();
+  return (*ma **mb).smobbed_copy ();
 }

* 2.04 aligns ? and : when they're on separate lines:

@@ -1819,7 +1913,7 @@
                  ? (pure ? scm_car (inside) :
unpure_pure_container_unpure_part (scm_car (inside)))
-                   : scm_car (inside);
+                 : scm_car (inside);
       SCM args = scm_cons (delayed_argument,
                            evaluate_args (delayed_argument, scm_cdr (inside),
                                           pure, start, end));

The cases where 2.04 does worse than 2.02 are minor; I don't think
they're enough that fixcc.py should refuse to use it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]