]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/morse.cxx
MIPSpro 7.4 fixes
[flightgear.git] / src / Sound / morse.cxx
index ced5a02dba0e0e8bae66616260b9293ffa8630a0..aaec7f50ef724d3b74aa5421b20ebd9c82621778 100644 (file)
@@ -165,8 +165,8 @@ bool FGMorse::cust_init(const int freq ) {
 }
 
 
-// make a FGSimpleSound morse code transmission for the specified string
-FGSimpleSound *FGMorse::make_ident( const string& id, const int freq ) {
+// make a SGSimpleSound morse code transmission for the specified string
+SGSimpleSound *FGMorse::make_ident( const string& id, const int freq ) {
     char *idptr = (char *)id.c_str();
 
     int length = 0;
@@ -191,7 +191,7 @@ FGSimpleSound *FGMorse::make_ident( const string& id, const int freq ) {
     // 1. Determine byte length of message
     for ( i = 0; i < (int)id.length(); ++i ) {
        if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) {
-           char c = idptr[i] - 'A';
+           int c = (int)(idptr[i] - 'A');
            for ( j = 0; j < 4 || alphabet[c][j] == end; ++j ) {
                if ( alphabet[c][j] == DIT ) {
                    length += DIT_SIZE;
@@ -201,7 +201,7 @@ FGSimpleSound *FGMorse::make_ident( const string& id, const int freq ) {
            }
            length += SPACE_SIZE;
         } else if ( idptr[i] >= '0' && idptr[i] <= '9' ) {
-            char c = idptr[i] - '0';
+            int c = (int)(idptr[i] - '0');
             for ( j = 0; j < 5; ++j) {
                 if ( numerals[c][j] == DIT ) {
                     length += DIT_SIZE;
@@ -225,7 +225,7 @@ FGSimpleSound *FGMorse::make_ident( const string& id, const int freq ) {
 
     for ( i = 0; i < (int)id.length(); ++i ) {
        if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) {
-           char c = idptr[i] - 'A';
+           int c = (int)(idptr[i] - 'A');
            for ( j = 0; j < 4 || alphabet[c][j] == end; ++j ) {
                if ( alphabet[c][j] == DIT ) {
                    memcpy( buf_ptr, dit_ptr, DIT_SIZE );
@@ -238,7 +238,7 @@ FGSimpleSound *FGMorse::make_ident( const string& id, const int freq ) {
            memcpy( buf_ptr, space, SPACE_SIZE );
            buf_ptr += SPACE_SIZE;
         } else if ( idptr[i] >= '0' && idptr[i] <= '9' ) {
-            char c = idptr[i] - '0';
+            int c = (int)(idptr[i] - '0');
             for ( j = 0; j < 5; ++j ) {
                 if ( numerals[c][j] == DIT ) {
                     memcpy( buf_ptr, dit_ptr, DIT_SIZE );
@@ -260,7 +260,7 @@ FGSimpleSound *FGMorse::make_ident( const string& id, const int freq ) {
     buf_ptr += SPACE_SIZE;
 
     // 4. create the simple sound and return
-    FGSimpleSound *sample = new FGSimpleSound( buffer, length );
+    SGSimpleSound *sample = new SGSimpleSound( buffer, length );
 
     return sample;
 }