diff --git a/src/ATCDCL/AIPlane.cxx b/src/ATCDCL/AIPlane.cxx index eecc070d9..0706fe367 100644 --- a/src/ATCDCL/AIPlane.cxx +++ b/src/ATCDCL/AIPlane.cxx @@ -24,6 +24,7 @@ #include #include #include +#include using std::string; @@ -200,8 +201,9 @@ void FGAIPlane::Render(const string& refname, const float volume, bool repeating if(voice) { string buf = vPtr->WriteMessage((char*)pending_transmission.c_str(), voice); if(voice && (volume > 0.05)) { + std::auto_ptr ptr( buf.c_str() ); SGSoundSample* simple = - new SGSoundSample((unsigned char*)buf.c_str(), buf.length(), 8000 ); + new SGSoundSample(ptr, buf.length(), 8000 ); // TODO - at the moment the volume can't be changed // after the transmission has started. simple->set_volume(volume); diff --git a/src/ATCDCL/ATC.cxx b/src/ATCDCL/ATC.cxx index 480257bc7..9a8d16028 100644 --- a/src/ATCDCL/ATC.cxx +++ b/src/ATCDCL/ATC.cxx @@ -25,6 +25,7 @@ #include "ATC.hxx" #include +#include #include #include @@ -237,8 +238,7 @@ void FGATC::Render(string& msg, const float volume, // >>> Beware: must pass a (new) object to the (add) method, // >>> because the (remove) method is going to do a (delete) // >>> whether that's what you want or not. - std::auto_ptr ptr; - ptr.reset((unsigned char*) buf.c_str()); + std::auto_ptr ptr( (unsigned char*)buf.c_str() ); SGSoundSample *simple = new SGSoundSample(ptr, buf.length(), 8000); // TODO - at the moment the volume can't be changed diff --git a/src/Sound/beacon.cxx b/src/Sound/beacon.cxx index 6de5f4624..497cbf032 100644 --- a/src/Sound/beacon.cxx +++ b/src/Sound/beacon.cxx @@ -21,6 +21,8 @@ // $Id$ +#include + #include "beacon.hxx" #include diff --git a/src/Sound/morse.cxx b/src/Sound/morse.cxx index c9195e78d..0943b8a86 100644 --- a/src/Sound/morse.cxx +++ b/src/Sound/morse.cxx @@ -21,6 +21,8 @@ // $Id$ +#include + #include #include "morse.hxx"