Changeset 551 for trunk/libjdkmidi/trunk

Show
Ignore:
Timestamp:
04/10/08 08:39:46 (8 months ago)
Author:
jeffk@…
Message:

const fixes for char *

Location:
trunk/libjdkmidi/trunk
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/libjdkmidi/trunk/include/jdkmidi/fileread.h

    r101 r551  
    142142// 
    143143       
    144       virtual void    mf_error( char * ); 
     144      virtual void    mf_error( const char * ); 
    145145       
    146146      virtual void    mf_starttrack( int trk ); 
     
    178178      virtual  int  ReadHeader(); 
    179179       
    180       virtual void    mf_error( char * ); 
     180      virtual void    mf_error( const char * ); 
    181181       
    182182    protected: 
  • trunk/libjdkmidi/trunk/include/jdkmidi/filereadmultitrack.h

    r101 r551  
    7373// 
    7474       
    75       virtual void    mf_error( char * ); 
     75      virtual void    mf_error( const char * ); 
    7676       
    7777      virtual void    mf_starttrack( int trk ); 
  • trunk/libjdkmidi/trunk/include/jdkmidi/fileshow.h

    r101 r551  
    5050      virtual  void  show_time( MIDIClockTime time ); 
    5151       
    52       virtual void    mf_error( char * ); 
     52      virtual void    mf_error( const char * ); 
    5353       
    5454      virtual void    mf_starttrack( int trk ); 
  • trunk/libjdkmidi/trunk/include/jdkmidi/msg.h

    r101 r551  
    8484      //@} 
    8585 
    86       char *   MsgToText( char *txt ) const; ///< Create a human readable ascii string describing the message.  This is potentially unsafe as the 'txt' param must point to a buffer of at least 64 chars long. 
     86      const char *   MsgToText( char *txt ) const; ///< Create a human readable ascii string describing the message.  This is potentially unsafe as the 'txt' param must point to a buffer of at least 64 chars long. 
    8787             
    8888      ///@name The Query methods. 
     
    315315    protected: 
    316316       
    317       static   char *   chan_msg_name[16]; ///< Simple ascii text strings describing each channel message type (0x8X to 0xeX) 
    318       static   char *   sys_msg_name[16]; ///< Simple ascii text strings describing each system message type (0xf0 to 0xff) 
     317      static   const char *   chan_msg_name[16]; ///< Simple ascii text strings describing each channel message type (0x8X to 0xeX) 
     318      static   const char *   sys_msg_name[16]; ///< Simple ascii text strings describing each system message type (0xf0 to 0xff) 
    319319       
    320320      unsigned char  status; 
  • trunk/libjdkmidi/trunk/src/jdkmidi_fileread.cpp

    r449 r551  
    175175  }  
    176176   
    177   void    MIDIFileEvents::mf_error( char *s )    
     177  void    MIDIFileEvents::mf_error( const char *s )    
    178178  { 
    179179     
     
    342342  }  
    343343   
    344   void MIDIFileRead::mf_error( char *e )   
     344  void MIDIFileRead::mf_error( const char *e )   
    345345  { 
    346346    event_handler->mf_error(e); 
     
    496496      else 
    497497      { 
    498         // Special thanks to "Peter Schwind" <pschwind@gmx.de>  
    499         // for the answer to the question and the fix for: 
    500         // "is running status to be cleared or not when meta event happens?" 
    501         // the answer is no. 
    502  
     498        // TO DO: is running status to be cleared or not when meta event happens? 
     499         
     500#if MIDIFRD_ALLOW_STATUS_ACROSS_META_EVENT 
    503501        if(  c!=0xff ) 
    504502        { 
    505503          status=c; 
     504          running=0; 
     505          needed=0; 
    506506        } 
    507  
     507         
     508#else 
     509        status=c; 
    508510        running=0; 
    509         needed = chantype[ (c>>4) & 0xf ];         
    510       } 
     511        needed = chantype[ (status>>4) & 0xf ];  
     512#endif 
     513         
     514      } 
     515       
     516       
    511517       
    512518      if( needed )            // ie. is it a channel message? 
  • trunk/libjdkmidi/trunk/src/jdkmidi_filereadmultitrack.cpp

    r8 r551  
    5252  } 
    5353   
    54   void    MIDIFileReadMultiTrack::mf_error( char * )   
     54  void    MIDIFileReadMultiTrack::mf_error( const char * )   
    5555  { 
    5656  }    
  • trunk/libjdkmidi/trunk/src/jdkmidi_fileshow.cpp

    r8 r551  
    6363  }  
    6464   
    65   void    MIDIFileShow::mf_error( char *e )   
     65  void    MIDIFileShow::mf_error( const char *e )   
    6666  { 
    6767    fprintf( out, "\nParse Error: %s\n", e ); 
     
    293293  void    MIDIFileShow::mf_text(MIDIClockTime time, int type, int len, unsigned char *txt )   
    294294  { 
    295     static char * text_event_names[16] = 
     295    static const char * text_event_names[16] = 
    296296      { 
    297297        "SEQ. #    ", 
  • trunk/libjdkmidi/trunk/src/jdkmidi_msg.cpp

    r8 r551  
    4242   
    4343   
    44   char *    MIDIMessage::chan_msg_name[16] =  
     44  const char *    MIDIMessage::chan_msg_name[16] =  
    4545  { 
    4646    "ERROR 00    ",     // 0x00 
     
    6262  };  
    6363   
    64   char *    MIDIMessage::sys_msg_name[16] =  
     64  const char *    MIDIMessage::sys_msg_name[16] =  
    6565  { 
    6666    "SYSEX       ",     // 0xf0 
     
    8383   
    8484   
    85   char * MIDIMessage::MsgToText( char *txt ) const  
     85  const char * MIDIMessage::MsgToText( char *txt ) const  
    8686  { 
    8787    char buf[64];