]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/morse.cxx
Change of thoughts since it makes life easier:
[flightgear.git] / src / Sound / morse.cxx
index 0943b8a8613e50c50f0e54d98c1c84f01fee3d96..942b637a5a2ae46ecf1687994fdd2e82983ce386 100644 (file)
@@ -21,8 +21,6 @@
 // $Id$
 
 
-#include <memory>
-
 #include <simgear/constants.h>
 
 #include "morse.hxx"
@@ -221,10 +219,10 @@ SGSoundSample *FGMorse::make_ident( const string& id, const int freq ) {
     length += 2 * SPACE_SIZE;
 
     // 2. Allocate space for the message
-    std::auto_ptr<unsigned char>buffer( new unsigned char[length] );
+    const unsigned char* buffer = (const unsigned char *)malloc(length);
 
     // 3. Assemble the message;
-    unsigned char *buf_ptr = buffer.get();
+    unsigned char *buf_ptr = (unsigned char*)buffer;
 
     for ( i = 0; i < (int)id.length(); ++i ) {
        if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) {
@@ -263,7 +261,7 @@ SGSoundSample *FGMorse::make_ident( const string& id, const int freq ) {
     buf_ptr += SPACE_SIZE;
 
     // 4. create the simple sound and return
-    SGSoundSample *sample = new SGSoundSample( buffer, length,
+    SGSoundSample *sample = new SGSoundSample( &buffer, length,
                                                BYTES_PER_SECOND );
 
     sample->set_reference_dist( 10.0 );