]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.9
authorfred <fred>
Sun, 24 Mar 2002 19:51:36 +0000 (19:51 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:51:36 +0000 (19:51 +0000)
lib/file-storage.cc
lib/includable-lexer.cc
lib/input.cc
lib/simple-file-storage.cc
lib/source-file.cc
lib/source.cc

index 16bee29c68d3e4600e289294f6aad47e6427491d..849c27c994caa80be71d7508781c9f8f5509137d 100644 (file)
@@ -55,10 +55,11 @@ Mapped_file_storage::open(String name_str)
 {
     fildes_i_ = ::open( name_str, O_RDONLY );  
            
-    if ( fildes_i_ == -1 ) {
+    if ( fildes_i_ == -1 ) 
+      {
        warning( String( "can't open: " ) + name_str + String( ": " ) + strerror( errno )); 
         return;
-    }
+      }
 
     struct stat file_stat;
     fstat( fildes_i_, &file_stat );
@@ -69,21 +70,23 @@ Mapped_file_storage::open(String name_str)
 void
 Mapped_file_storage::unmap()
 {
-    if ( data_caddr_ ) {
+    if ( data_caddr_ ) 
+      {
        munmap( data_caddr_, size_off_ );
        data_caddr_ = 0;
        size_off_ = 0;
-    }
+      }
 }
 
 void
 Mapped_file_storage::close()
 {
     unmap();
-    if ( fildes_i_ ) {
+    if ( fildes_i_ ) 
+      {
        ::close( fildes_i_ );
        fildes_i_ = 0;
-    }
+      }
 }
 
 int
index 6b4348d5f2a9a6e49b9a0f439af1cc5d692b8ddb..73d00498a80fa00b7333ff5b5580e41ac792648e 100644 (file)
@@ -24,10 +24,11 @@ void
 Includable_lexer::new_input(String s, Sources  * global_sources)
 {
     Source_file * sl = global_sources->get_file_l(s);
-    if (!sl) {
+    if (!sl) 
+      {
        LexerError("Can't find file `" + s+ "'");
        return; 
-    }
+      }
 
     
     char_count_stack_.push(0);
@@ -59,12 +60,14 @@ Includable_lexer::close_input()
     cout << "]"<<flush;
     yy_delete_buffer(yy_current_buffer );
     yy_current_buffer = 0;
-    if (state_stack_.empty()) {
+    if (state_stack_.empty()) 
+      {
        return false;
-    }else {
+    }else 
+      {
        yy_switch_to_buffer(state_stack_.pop());
        return true;
-    }    
+      }
 }
 
 char const*
@@ -77,7 +80,8 @@ Includable_lexer::here_ch_C()
 
 Includable_lexer::~Includable_lexer()
 {
-    while (!include_stack_.empty()) {
+    while (!include_stack_.empty()) 
+      {
        close_input();
     };
 }
index 84788100528629696e7909e089d999d3c9cccb70..6f05290422b128aae18787e0f00495395e091121 100644 (file)
@@ -40,15 +40,17 @@ Input::message(String message_str)const
 {
     String str = "";
     
-    if ( source_file_l_ ) {
+    if ( source_file_l_ ) 
+      {
        str += location_str() + String(": ");
-    }
+      }
     
     str += message_str;
-    if ( source_file_l_ ) {
+    if ( source_file_l_ ) 
+      {
        str += ":\n";
        str += source_file_l_->error_str( defined_ch_C_);
-    }
+      }
     cerr << str << endl;
 }
 
index be022cee02db95d8ae283187f2a1dcf327e03c9f..d66c2c2d9b1b34dfd6c254d628d88eadfa90d387 100644 (file)
@@ -29,10 +29,11 @@ Simple_file_storage::Simple_file_storage(String s)
 {
     data_p_ =0;
     FILE * f = fopen ( s.ch_C(), "r");
-    if ( !f ) {
+    if ( !f ) 
+      {
        warning("can't open file\n");
        return ;
-    }
+      }
 
     int ret = fseek( f, 0, SEEK_END);
     len_i_ = ftell(f);
index ffc7a341ed1d3004b1e93a82c95b474ef4890ee4..a67b46630016a03a21c33bcb564901d6a3e26ed2 100644 (file)
@@ -32,14 +32,16 @@ Source_file::istream_l()
     if ( !name_str_.length_i())
        return &cin;
     
-    if ( !istream_p_ ) {
+    if ( !istream_p_ ) 
+      {
        if ( length_i() ) // can-t this be done without such a hack?
            istream_p_ = new istrstream( ch_C(), length_i() );
-        else {
+        else 
+          {
            istream_p_ = new istrstream( "", 0 );
            istream_p_->set(ios::eofbit);
-       }
-    }
+         }
+      }
     return istream_p_;
 }
 
@@ -74,17 +76,19 @@ Source_file::error_str( char const* pos_ch_C )const
        pos_ch_C --;
     char const* begin_ch_C = pos_ch_C;
     while ( begin_ch_C > data_ch_C )
-        if ( *--begin_ch_C == '\n' ) {
+        if ( *--begin_ch_C == '\n' ) 
+          {
            begin_ch_C++;
            break;
-       }
+         }
 
     char const* end_ch_C = pos_ch_C;
     while ( end_ch_C < eof_C_ )
-        if ( *end_ch_C++ == '\n' ) {
+        if ( *end_ch_C++ == '\n' ) 
+          {
          end_ch_C--;
          break;
-       }
+         }
   
        //    String( char const* p, int length ) is missing!?
     String line_str( (Byte const*)begin_ch_C, end_ch_C - begin_ch_C );
index ec490f17e727fed3142d70c04ef86009d6b9bf3b..e60041553c84050e6237ce1e6ed35a5a714bdb2c 100644 (file)
@@ -34,12 +34,13 @@ Sources::set_path(File_path *f_C)
 Source_file*
 Sources::get_file_l(String &file_str ) //UGH
 {
-    if (path_C_){
+    if (path_C_)
+      {
        String file_str_o = path_C_->find(file_str); 
        if ( ( file_str_o == "" ) && ( file_str != "" ) )
            return 0;
        file_str = file_str_o;
-    }
+      }
     Source_file * f_p= (!binary_b_) ?
        new Source_file(file_str) : new Binary_source_file(file_str);
     add(f_p);