Fixes that make Haiku build with gcc 4. Mainly out of the following

categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
  declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
  explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
  something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
  'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
  is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
  Otherwise the an inner class with that name is considered as friend.
  gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2005-11-12 23:27:14 +00:00
parent bcf95670a2
commit 758b1d0e05
167 changed files with 497 additions and 304 deletions
@@ -1,3 +1,5 @@
#include <string.h>
#include <MediaDefs.h>
#include <Locker.h>
#include <Path.h>
@@ -211,7 +211,7 @@ status_t MultiAudioAddOn::AutoStart(
}
status_t
MultiAudioAddOn::RecursiveScan(char* rootPath, BEntry *rootEntry = NULL)
MultiAudioAddOn::RecursiveScan(char* rootPath, BEntry *rootEntry)
{
CALLED();
@@ -954,7 +954,7 @@ MultiAudioNode::AdditionalBufferRequested(const media_source& source, media_buff
void MultiAudioNode::HandleEvent(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
//CALLED();
switch (event->type) {
@@ -994,7 +994,7 @@ void MultiAudioNode::HandleEvent(
status_t MultiAudioNode::HandleBuffer(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
//CALLED();
BBuffer * buffer = const_cast<BBuffer*>((BBuffer*)event->pointer);
@@ -1050,7 +1050,7 @@ status_t MultiAudioNode::HandleBuffer(
status_t MultiAudioNode::HandleDataStatus(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
//CALLED();
PRINT(("MultiAudioNode::HandleDataStatus status:%li, lateness:%li\n", event->data, lateness));
@@ -1070,7 +1070,7 @@ status_t MultiAudioNode::HandleDataStatus(
status_t MultiAudioNode::HandleStart(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
CALLED();
if (RunState() != B_STARTED) {
@@ -1082,7 +1082,7 @@ status_t MultiAudioNode::HandleStart(
status_t MultiAudioNode::HandleSeek(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
CALLED();
PRINT(("MultiAudioNode::HandleSeek(t=%lld,d=%li,bd=%lld)\n",event->event_time,event->data,event->bigdata));
@@ -1092,7 +1092,7 @@ status_t MultiAudioNode::HandleSeek(
status_t MultiAudioNode::HandleWarp(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
CALLED();
return B_OK;
@@ -1101,7 +1101,7 @@ status_t MultiAudioNode::HandleWarp(
status_t MultiAudioNode::HandleStop(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
CALLED();
// flush the queue so downstreamers don't get any more
@@ -1114,7 +1114,7 @@ status_t MultiAudioNode::HandleStop(
status_t MultiAudioNode::HandleParameter(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
CALLED();
return B_OK;
@@ -435,7 +435,7 @@ const mov_main_header *MOVFileReader::MovMainHeader()
return &theMainHeader;
}
const AudioMetaData *MOVFileReader::AudioFormat(uint32 stream_index, size_t *size = 0)
const AudioMetaData *MOVFileReader::AudioFormat(uint32 stream_index, size_t *size)
{
if (IsAudio(stream_index)) {
@@ -23,6 +23,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <DataIO.h>
@@ -4,6 +4,7 @@
*/
#include <stdio.h>
#include <string.h>
#include "MusePackDecoder.h"
#include "mpc/in_mpc.h"
@@ -20,6 +20,7 @@
#include "idtag.h"
#include <stdio.h>
#include <string.h>
//SettingsMPC PluginSettings; // AB: PluginSettings holds the parameters for the plugin-configuration
@@ -52,6 +52,7 @@ private:
// interface for OggStreams
ssize_t ReadPage(bool first_page = false);
public:
class StreamInterface {
public:
virtual ssize_t ReadPage() = 0;
@@ -201,7 +201,7 @@ VorbisDecoder::Decode(void *buffer, int64 *frameCount,
packet.granulepos = -1;
packet.packetno = 7;
}
packet.packet = static_cast<unsigned char *>(chunkBuffer);
packet.packet = (unsigned char *)chunkBuffer;
packet.bytes = chunkSize;
if (!synced) {
if (mh.start_time > 0) {