]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.44
authorfred <fred>
Sun, 24 Mar 2002 20:02:15 +0000 (20:02 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:02:15 +0000 (20:02 +0000)
flower/scalar.cc
flower/test/main.cc
flower/test/pqtest.cc

index 9d7ef229570c1076470645444e05224af8cdc226..f28e7699ed0a5718d70289f78ffa726f8a73e2e1 100644 (file)
@@ -22,7 +22,7 @@ Scalar::operator Rational ()
   if (p == -1)
     return int (*this);
   
-  String s2 = right_str (len()-p-1);
+  String s2 = right_str (length_i ()-p-1);
   String s1 = left_str (p);
 
   return Rational (s1.value_i (), s2.value_i ());
@@ -32,12 +32,12 @@ bool
 Scalar::isnum_b () const
 {
   int conv = false;
-  if (len ())
+  if (length_i ())
     {
       long l =0;
       conv = sscanf (strh_.ch_C (), "%ld", &l);
     }
-  return len() && conv;
+  return length_i () && conv;
 }
 
 Scalar::operator Real()
@@ -58,7 +58,7 @@ Scalar::operator int()
 
 Scalar::operator bool () const
 {
-  if (!len ())
+  if (!length_i ())
     return false;
   if (*this == "0")
     return false;
index 5d2e6db18fd7d4abe572b3cde7c46b22ead6c422..8cd10797c50e6682b9ee7474cf6a58a547d8a38f 100644 (file)
@@ -5,16 +5,16 @@ Array< fptr > *test_arr_p;
 
 void reg_test (fptr f)
 {
 if (!test_arr_p)
-    test_arr_p = new Array<fptr>;
 test_arr_p->push(f);
+ if (!test_arr_p)
+  test_arr_p = new Array<fptr>;
test_arr_p->push (f);
 }
 
 int
-main()
+main ()
 {
 if (test_arr_p) {
-    for (int i=0; i < test_arr_p->size(); i++)
-      (*test_arr_p)[i] ();
 }
+ if (test_arr_p) {
+  for (int i=0; i < test_arr_p->size (); i++)
+    (*test_arr_p)[i] ();
+ }
 }
index 66838d41802372f8955919195b08ea5cdb48c424..ea28bcb0fa27a380e9dd6759e97275d7ec118ff0 100644 (file)
@@ -2,25 +2,25 @@
 #include "pqueue.hh"
 #include <stdlib.h>
 
-int compare(int i, int j)
+int compare (int i, int j)
 {
   return i-j;
 }
 
 void
-pqtest()
+pqtest ()
 {
   PQueue<int> pq;
 
-  for (int i=0; i < 10; i++) {
-    int r = rand()/10000;
-    pq.insert(r);
+  for  (int i=0; i < 10; i++) {
+    int r = rand ()/10000;
+    pq.insert (r);
     cout << "adding: " << r<< endl;
   }
-  while (pq.size()) {
+  while  (pq.size ()) {
     cout << "getting : "<< flush;
-    cout << pq.get() << "\n";
+    cout << pq.get () << "\n";
   }
 }
 
-ADD_TEST(pqtest);
+ADD_TEST (pqtest);