aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/adlmidi.cpp8
-rw-r--r--src/adlmidi_load.cpp8
-rw-r--r--src/adlmidi_private.hpp12
3 files changed, 14 insertions, 14 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp
index 18e5243..e96c757 100644
--- a/src/adlmidi.cpp
+++ b/src/adlmidi.cpp
@@ -222,7 +222,7 @@ ADLMIDI_EXPORT void adl_setVolumeRangeModel(struct ADL_MIDIPlayer *device, int v
play->opl.ChangeVolumeRangesModel(static_cast<ADLMIDI_VolumeModels>(volumeModel));
}
-ADLMIDI_EXPORT int adl_openBankFile(struct ADL_MIDIPlayer *device, char *filePath)
+ADLMIDI_EXPORT int adl_openBankFile(struct ADL_MIDIPlayer *device, const char *filePath)
{
if(device && device->adl_midiPlayer)
{
@@ -243,7 +243,7 @@ ADLMIDI_EXPORT int adl_openBankFile(struct ADL_MIDIPlayer *device, char *filePat
return -1;
}
-ADLMIDI_EXPORT int adl_openBankData(struct ADL_MIDIPlayer *device, void *mem, long size)
+ADLMIDI_EXPORT int adl_openBankData(struct ADL_MIDIPlayer *device, const void *mem, unsigned long size)
{
if(device && device->adl_midiPlayer)
{
@@ -264,7 +264,7 @@ ADLMIDI_EXPORT int adl_openBankData(struct ADL_MIDIPlayer *device, void *mem, lo
return -1;
}
-ADLMIDI_EXPORT int adl_openFile(ADL_MIDIPlayer *device, char *filePath)
+ADLMIDI_EXPORT int adl_openFile(ADL_MIDIPlayer *device, const char *filePath)
{
if(device && device->adl_midiPlayer)
{
@@ -285,7 +285,7 @@ ADLMIDI_EXPORT int adl_openFile(ADL_MIDIPlayer *device, char *filePath)
return -1;
}
-ADLMIDI_EXPORT int adl_openData(ADL_MIDIPlayer *device, void *mem, long size)
+ADLMIDI_EXPORT int adl_openData(ADL_MIDIPlayer *device, const void *mem, unsigned long size)
{
if(device && device->adl_midiPlayer)
{
diff --git a/src/adlmidi_load.cpp b/src/adlmidi_load.cpp
index 60c4151..1d4a193 100644
--- a/src/adlmidi_load.cpp
+++ b/src/adlmidi_load.cpp
@@ -55,10 +55,10 @@ bool MIDIplay::LoadBank(const std::string &filename)
return LoadBank(file);
}
-bool MIDIplay::LoadBank(void *data, unsigned long size)
+bool MIDIplay::LoadBank(const void *data, size_t size)
{
fileReader file;
- file.openData(data, (size_t)size);
+ file.openData(data, size);
return LoadBank(file);
}
@@ -346,10 +346,10 @@ bool MIDIplay::LoadMIDI(const std::string &filename)
return true;
}
-bool MIDIplay::LoadMIDI(void *data, unsigned long size)
+bool MIDIplay::LoadMIDI(const void *data, size_t size)
{
fileReader file;
- file.openData(data, (size_t)size);
+ file.openData(data, size);
return LoadMIDI(file);
}
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp
index 39ec298..4d7251b 100644
--- a/src/adlmidi_private.hpp
+++ b/src/adlmidi_private.hpp
@@ -342,7 +342,7 @@ public:
mp_tell = 0;
}
- void openData(void *mem, size_t lenght)
+ void openData(const void *mem, size_t lenght)
{
fp = NULL;
mp = mem;
@@ -392,7 +392,7 @@ public:
while((pos < maxSize) && (mp_tell < mp_size))
{
- reinterpret_cast<unsigned char *>(buf)[pos] = reinterpret_cast<unsigned char *>(mp)[mp_tell];
+ reinterpret_cast<unsigned char *>(buf)[pos] = reinterpret_cast<unsigned const char *>(mp)[mp_tell];
mp_tell++;
pos++;
}
@@ -408,7 +408,7 @@ public:
else
{
if(mp_tell >= mp_size) return -1;
- int x = reinterpret_cast<unsigned char *>(mp)[mp_tell];
+ int x = reinterpret_cast<unsigned const char *>(mp)[mp_tell];
mp_tell++;
return x;
}
@@ -446,7 +446,7 @@ public:
}
std::string _fileName;
std::FILE *fp;
- void *mp;
+ const void *mp;
size_t mp_size;
size_t mp_tell;
};
@@ -812,11 +812,11 @@ public:
uint64_t ReadVarLenEx(uint8_t **ptr, uint8_t *end, bool &ok);
bool LoadBank(const std::string &filename);
- bool LoadBank(void *data, unsigned long size);
+ bool LoadBank(const void *data, size_t size);
bool LoadBank(fileReader &fr);
bool LoadMIDI(const std::string &filename);
- bool LoadMIDI(void *data, unsigned long size);
+ bool LoadMIDI(const void *data, size_t size);
bool LoadMIDI(fileReader &fr);
/**