X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fmisc.cc;h=bb8a05201c103904bd3a3e2aa8900c5db260e855;hb=205203e856ba125f43b9caa66fc7177db16a6db9;hp=7199cac19742872239384e5520c4df35ca850089;hpb=e24df7c27635dc996c466295eacf2981bddccaf7;p=lilypond.git diff --git a/lily/misc.cc b/lily/misc.cc index 7199cac197..bb8a05201c 100644 --- a/lily/misc.cc +++ b/lily/misc.cc @@ -4,7 +4,7 @@ source file of the GNU LilyPond music typesetter (c) 1997--2005 Han-Wen Nienhuys - Jan Nieuwenhuizen + Jan Nieuwenhuizen */ #include @@ -12,47 +12,46 @@ #include "misc.hh" #include "string.hh" - /* - Return the 2-log, rounded down - */ + Return the 2-log, rounded down +*/ int intlog2 (int d) { assert (d); int i = 0; - while ((d != 1)) + while ((d != 1)) { d /= 2; i++; } - - assert (! (d/2)); + + assert (! (d / 2)); return i; } double log_2 (double x) { - return log (x) /log (2.0); + return log (x) / log (2.0); } Array split_string (String s, char c) { - Array rv; + Array rv; while (s.length ()) { int i = s.index (c); - + if (i == 0) { s = s.nomid_string (0, 1); continue; } - + if (i < 0) - i = s.length () ; + i = s.length (); rv.push (s.cut_string (0, i)); s = s.nomid_string (0, i);