Browse Source

Substitution of deprecated C++ headers and namespaced std library things to fix gcc 3.2+ compile warnings'n'errors

master
waxfrenzy 22 years ago
parent
commit
2aad9ccdf8
4 changed files with 34 additions and 32 deletions
  1. +2
    -0
      SpiralSound/ChannelHandler.C
  2. +29
    -29
      SpiralSound/ChannelHandler.h
  3. +1
    -1
      SpiralSynthModular.h
  4. +2
    -2
      main.cpp

+ 2
- 0
SpiralSound/ChannelHandler.C View File

@@ -19,6 +19,8 @@
#include "ChannelHandler.h"
#include <unistd.h>

using namespace std;

//#define CHANNEL_DEBUG

ChannelHandler::ChannelHandler() :


+ 29
- 29
SpiralSound/ChannelHandler.h View File

@@ -22,7 +22,7 @@
#include <pthread.h>
#include <string>
#include <map>
#include <iostream.h>
#include <iostream>

class ChannelHandler
{
@@ -35,20 +35,20 @@ public:
// only call these from the audio thread

// don't call Register*() when the audio thread is running
void RegisterData(const string &ID, Type t, void *pData, int size);
void Register(const string &ID, bool* pData, Type t=ChannelHandler::INPUT)
void RegisterData(const std::string &ID, Type t, void *pData, int size);
void Register(const std::string &ID, bool* pData, Type t=ChannelHandler::INPUT)
{ RegisterData(ID, t,(bool*)pData,sizeof(bool)); }
void Register(const string &ID, char* pData, Type t=ChannelHandler::INPUT)
void Register(const std::string &ID, char* pData, Type t=ChannelHandler::INPUT)
{ RegisterData(ID, t,(char*)pData,sizeof(char)); }
void Register(const string &ID, int* pData, Type t=ChannelHandler::INPUT)
void Register(const std::string &ID, int* pData, Type t=ChannelHandler::INPUT)
{ RegisterData(ID, t,(int*)pData,sizeof(int)); }
void Register(const string &ID, long* pData, Type t=ChannelHandler::INPUT)
void Register(const std::string &ID, long* pData, Type t=ChannelHandler::INPUT)
{ RegisterData(ID, t,(long*)pData,sizeof(long)); }
void Register(const string &ID, short* pData, Type t=ChannelHandler::INPUT)
void Register(const std::string &ID, short* pData, Type t=ChannelHandler::INPUT)
{ RegisterData(ID, t,(short*)pData,sizeof(short)); }
void Register(const string &ID, float* pData, Type t=ChannelHandler::INPUT)
void Register(const std::string &ID, float* pData, Type t=ChannelHandler::INPUT)
{ RegisterData(ID, t,(float*)pData,sizeof(float)); }
void Register(const string &ID, double* pData, Type t=ChannelHandler::INPUT)
void Register(const std::string &ID, double* pData, Type t=ChannelHandler::INPUT)
{ RegisterData(ID, t,(double*)pData,sizeof(double)); }
void UpdateDataNow();
@@ -61,23 +61,23 @@ public:
// only call these from the gui thread
// the ID comes from the order the channel is registered in
void GetData(const string &ID, void *data);
const bool GetBool(const string &ID) { bool t; GetData(ID,&t); return t; }
const char GetChar(const string &ID) { char t; GetData(ID,&t); return t; }
const int GetInt(const string &ID) { int t; GetData(ID,&t); return t; }
const long GetLong(const string &ID) { long t; GetData(ID,&t); return t; }
const short GetShort(const string &ID) { short t; GetData(ID,&t); return t; }
const float GetFloat(const string &ID) { float t; GetData(ID,&t); return t; }
const double GetDouble(const string &ID) { double t; GetData(ID,&t); return t; }
void GetData(const std::string &ID, void *data);
const bool GetBool(const std::string &ID) { bool t; GetData(ID,&t); return t; }
const char GetChar(const std::string &ID) { char t; GetData(ID,&t); return t; }
const int GetInt(const std::string &ID) { int t; GetData(ID,&t); return t; }
const long GetLong(const std::string &ID) { long t; GetData(ID,&t); return t; }
const short GetShort(const std::string &ID) { short t; GetData(ID,&t); return t; }
const float GetFloat(const std::string &ID) { float t; GetData(ID,&t); return t; }
const double GetDouble(const std::string &ID) { double t; GetData(ID,&t); return t; }

void SetData(const string &ID, void *s);
void Set(const string &ID, const bool& s) { SetData(ID,(void*)&s); }
void Set(const string &ID, const char& s) { SetData(ID,(void*)&s); }
void Set(const string &ID, const int& s) { SetData(ID,(void*)&s); }
void Set(const string &ID, const long& s) { SetData(ID,(void*)&s); }
void Set(const string &ID, const short& s) { SetData(ID,(void*)&s); }
void Set(const string &ID, const float& s) { SetData(ID,(void*)&s); }
void Set(const string &ID, const double& s) { SetData(ID,(void*)&s); }
void SetData(const std::string &ID, void *s);
void Set(const std::string &ID, const bool& s) { SetData(ID,(void*)&s); }
void Set(const std::string &ID, const char& s) { SetData(ID,(void*)&s); }
void Set(const std::string &ID, const int& s) { SetData(ID,(void*)&s); }
void Set(const std::string &ID, const long& s) { SetData(ID,(void*)&s); }
void Set(const std::string &ID, const short& s) { SetData(ID,(void*)&s); }
void Set(const std::string &ID, const float& s) { SetData(ID,(void*)&s); }
void Set(const std::string &ID, const double& s) { SetData(ID,(void*)&s); }

void SetCommand(char command);

@@ -89,7 +89,7 @@ public:
// as it will block until complete, and for larger amounts of data, as
// it won't be doing the copy every update.
void RequestChannelAndWait(const string &ID);
void RequestChannelAndWait(const std::string &ID);
///////////////////////////////////////////
// Use for copying large variable sized data very infrequently.
@@ -99,7 +99,7 @@ public:
// to complete, depending on the size of the buffer channel and the
// total size of the transfer.
void BulkTransfer(const string &ID, void *dest, int size);
void BulkTransfer(const std::string &ID, void *dest, int size);
// delays for one or more updates. use for syncing commands
void Wait();
@@ -119,7 +119,7 @@ private:
bool updated;
};

map<string,Channel*> m_ChannelMap;
std::map<std::string,Channel*> m_ChannelMap;
char m_Command[2];
bool m_UpdateIndicator;
@@ -128,7 +128,7 @@ private:
int m_BulkSize;
int m_BulkPos;
string m_BulkID;
std::string m_BulkID;
pthread_mutex_t* m_Mutex;
};


+ 1
- 1
SpiralSynthModular.h View File

@@ -28,7 +28,7 @@
#include <FL/Fl_Scroll.H>
#include <FL/Fl_Pack.H>
#include <FL/Fl_Tile.H>
#include <strstream>
#include <sstream>
#include <iostream>
#include <map>
#include "SpiralSynthModularInfo.h"


+ 2
- 2
main.cpp View File

@@ -20,8 +20,8 @@
#include <config.h>
#endif

#include <iostream.h>
#include <stdlib.h>
#include <iostream>
#include <cstdlib>
#include <FL/Fl.H>
#include <FL/Fl_Tooltip.h>
#include <unistd.h>


Loading…
Cancel
Save