|
From: <sag...@us...> - 2010-07-10 18:30:16
|
Revision: 640
http://modplug.svn.sourceforge.net/modplug/?rev=640&view=rev
Author: saga-games
Date: 2010-07-10 18:30:08 +0000 (Sat, 10 Jul 2010)
Log Message:
-----------
[Ref] Added more const modifiers to the loader functions.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/LOAD_AMF.CPP
trunk/OpenMPT/soundlib/LOAD_DBM.CPP
trunk/OpenMPT/soundlib/LOAD_DMF.CPP
trunk/OpenMPT/soundlib/LOAD_DSM.CPP
trunk/OpenMPT/soundlib/Load_669.cpp
trunk/OpenMPT/soundlib/Load_ams.cpp
trunk/OpenMPT/soundlib/Load_far.cpp
trunk/OpenMPT/soundlib/Load_imf.cpp
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_mdl.cpp
trunk/OpenMPT/soundlib/Load_med.cpp
trunk/OpenMPT/soundlib/Load_ptm.cpp
trunk/OpenMPT/soundlib/Load_s3m.cpp
trunk/OpenMPT/soundlib/Load_stm.cpp
trunk/OpenMPT/soundlib/Load_ult.cpp
trunk/OpenMPT/soundlib/Load_umx.cpp
trunk/OpenMPT/soundlib/Load_wav.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/soundlib/LOAD_AMF.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2010-07-10 18:30:08 UTC (rev 640)
@@ -171,8 +171,8 @@
-bool CSoundFile::ReadAMF(LPCBYTE lpStream, const DWORD dwMemLength)
-//-----------------------------------------------------------
+bool CSoundFile::ReadAMF(const LPCBYTE lpStream, const DWORD dwMemLength)
+//-----------------------------------------------------------------------
{
const AMFFILEHEADER *pfh = (AMFFILEHEADER *)lpStream;
DWORD dwMemPos;
Modified: trunk/OpenMPT/soundlib/LOAD_DBM.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2010-07-10 18:30:08 UTC (rev 640)
@@ -107,7 +107,7 @@
void ConvertDBMEffect(uint8 *command, uint8 *param)
-//----------------------------------
+//-------------------------------------------------
{
if(*command < ARRAYELEMCOUNT(dbm_efftrans))
*command = dbm_efftrans[*command];
@@ -176,8 +176,8 @@
}
-bool CSoundFile::ReadDBM(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadDBM(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
const DBMFILEHEADER *pfh = (DBMFILEHEADER *)lpStream;
DWORD dwMemPos;
Modified: trunk/OpenMPT/soundlib/LOAD_DMF.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2010-07-10 18:30:08 UTC (rev 640)
@@ -86,8 +86,8 @@
#endif
-bool CSoundFile::ReadDMF(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadDMF(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
const DMFHEADER *pfh = (DMFHEADER *)lpStream;
DMFINFO *psi;
Modified: trunk/OpenMPT/soundlib/LOAD_DSM.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_DSM.CPP 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/LOAD_DSM.CPP 2010-07-10 18:30:08 UTC (rev 640)
@@ -85,8 +85,8 @@
#pragma pack()
-bool CSoundFile::ReadDSM(LPCBYTE lpStream, DWORD dwMemLength)
-//-----------------------------------------------------------
+bool CSoundFile::ReadDSM(const LPCBYTE lpStream, const DWORD dwMemLength)
+//-----------------------------------------------------------------------
{
DSMFILEHEADER *pfh = (DSMFILEHEADER *)lpStream;
DSMSONG *psong;
Modified: trunk/OpenMPT/soundlib/Load_669.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_669.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_669.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -39,8 +39,8 @@
} SAMPLE669;
-bool CSoundFile::Read669(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::Read669(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
BOOL b669Ext;
const FILEHEADER669 *pfh = (const FILEHEADER669 *)lpStream;
Modified: trunk/OpenMPT/soundlib/Load_ams.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_ams.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_ams.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -45,8 +45,8 @@
-bool CSoundFile::ReadAMS(LPCBYTE lpStream, DWORD dwMemLength)
-//-----------------------------------------------------------
+bool CSoundFile::ReadAMS(const LPCBYTE lpStream, const DWORD dwMemLength)
+//-----------------------------------------------------------------------
{
BYTE pkinf[MAX_SAMPLES];
AMSFILEHEADER *pfh = (AMSFILEHEADER *)lpStream;
Modified: trunk/OpenMPT/soundlib/Load_far.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_far.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_far.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -58,8 +58,8 @@
#pragma pack()
-bool CSoundFile::ReadFAR(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadFAR(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
if(dwMemLength < sizeof(FARHEADER1))
return false;
Modified: trunk/OpenMPT/soundlib/Load_imf.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_imf.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_imf.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -239,11 +239,11 @@
}
}
-static void load_imf_envelope(INSTRUMENTENVELOPE *env, IMFINSTRUMENT *imfins, int e)
-//----------------------------------------------------------------------------------
+static void load_imf_envelope(INSTRUMENTENVELOPE *env, const IMFINSTRUMENT *imfins, const int e)
+//----------------------------------------------------------------------------------------------
{
UINT min = 0; // minimum tick value for next node
- int shift = (e == IMF_ENV_VOL) ? 0 : 2;
+ const int shift = (e == IMF_ENV_VOL) ? 0 : 2;
env->dwFlags = ((imfins->env[e].flags & 1) ? ENV_ENABLED : 0) | ((imfins->env[e].flags & 2) ? ENV_SUSTAIN : 0) | ((imfins->env[e].flags & 4) ? ENV_LOOP : 0);
env->nNodes = CLAMP(imfins->env[e].points, 2, 25);
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -287,7 +287,7 @@
//BOOL CSoundFile::ITInstrToMPT(const void *p, MODINSTRUMENT *pIns, UINT trkvers)
long CSoundFile::ITInstrToMPT(const void *p, MODINSTRUMENT *pIns, UINT trkvers) //rewbs.modularInstData
-//--------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
{
// Envelope point count. Limited to 25 in IT format.
const int iEnvMax = (m_nType & MOD_TYPE_MPT) ? MAX_ENVPOINTS : 25;
@@ -457,7 +457,7 @@
// -> CODE#0023
// -> DESC="IT project files (.itp)"
bool CSoundFile::ReadITProject(LPCBYTE lpStream, const DWORD dwMemLength)
-//-----------------------------------------------------------------
+//-----------------------------------------------------------------------
{
UINT i,n,nsmp;
DWORD id,len,size;
Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mdl.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_mdl.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -226,8 +226,8 @@
-bool CSoundFile::ReadMDL(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadMDL(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
DWORD dwMemPos, dwPos, blocklen, dwTrackPos;
const MDLSONGHEADER *pmsh = (const MDLSONGHEADER *)lpStream;
Modified: trunk/OpenMPT/soundlib/Load_med.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_med.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_med.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -474,8 +474,8 @@
}
-bool CSoundFile::ReadMed(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadMed(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
const MEDMODULEHEADER *pmmh;
const MMD0SONGHEADER *pmsh;
Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -62,8 +62,8 @@
#pragma pack()
-bool CSoundFile::ReadPTM(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadPTM(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
if(lpStream == nullptr || dwMemLength < sizeof(PTMFILEHEADER))
return false;
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -217,8 +217,8 @@
}
-bool CSoundFile::ReadS3M(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadS3M(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
if ((!lpStream) || (dwMemLength <= sizeof(S3MFILEHEADER) + 64)) return false;
Modified: trunk/OpenMPT/soundlib/Load_stm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_stm.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_stm.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -59,8 +59,8 @@
-bool CSoundFile::ReadSTM(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadSTM(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
STMHEADER *phdr = (STMHEADER *)lpStream;
DWORD dwMemPos = 0;
Modified: trunk/OpenMPT/soundlib/Load_ult.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_ult.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_ult.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -303,8 +303,8 @@
};
-bool CSoundFile::ReadUlt(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadUlt(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
DWORD dwMemPos = 0;
uint8 ult_version;
Modified: trunk/OpenMPT/soundlib/Load_umx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_umx.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_umx.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -12,8 +12,8 @@
#define MODMAGIC_OFFSET (20+31*30+130)
-bool CSoundFile::ReadUMX(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadUMX(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
if ((!lpStream) || (dwMemLength < 0x800)) return false;
// Rip Mods from UMX
Modified: trunk/OpenMPT/soundlib/Load_wav.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_wav.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_wav.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -17,8 +17,8 @@
/////////////////////////////////////////////////////////////
// WAV file support
-bool CSoundFile::ReadWav(const BYTE *lpStream, DWORD dwMemLength)
-//---------------------------------------------------------------
+bool CSoundFile::ReadWav(const BYTE *lpStream, const DWORD dwMemLength)
+//---------------------------------------------------------------------
{
DWORD dwMemPos = 0;
WAVEFILEHEADER *phdr = (WAVEFILEHEADER *)lpStream;
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-07-10 18:30:08 UTC (rev 640)
@@ -235,8 +235,8 @@
return dwMemPos;
}
-bool CSoundFile::ReadXM(const BYTE *lpStream, DWORD dwMemLength)
-//--------------------------------------------------------------
+bool CSoundFile::ReadXM(const BYTE *lpStream, const DWORD dwMemLength)
+//--------------------------------------------------------------------
{
XMFILEHEADER xmheader;
XMSAMPLEHEADER xmsh;
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2010-07-10 17:35:43 UTC (rev 639)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2010-07-10 18:30:08 UTC (rev 640)
@@ -660,7 +660,7 @@
void SetRepeatCount(int n) { m_nRepeatCount = n; }
int GetRepeatCount() const { return m_nRepeatCount; }
- BOOL IsPaused() const { return (m_dwSongFlags & SONG_PAUSED) ? TRUE : FALSE; }
+ bool IsPaused() const { return (m_dwSongFlags & SONG_PAUSED) ? true : false; }
void LoopPattern(PATTERNINDEX nPat, ROWINDEX nRow = 0);
void CheckCPUUsage(UINT nCPU);
BOOL SetPatternName(PATTERNINDEX nPat, LPCSTR lpszName);
@@ -672,38 +672,38 @@
void ResetChannelState(CHANNELINDEX chn, BYTE resetStyle);
// Module Loaders
- bool ReadXM(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadS3M(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadMod(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadMed(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadMTM(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadSTM(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadIT(LPCBYTE lpStream, const DWORD dwMemLength);
- //bool ReadMPT(LPCBYTE lpStream, const DWORD dwMemLength);
- bool ReadITProject(LPCBYTE lpStream, const DWORD dwMemLength); // -> CODE#0023 -> DESC="IT project files (.itp)" -! NEW_FEATURE#0023
- bool Read669(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadUlt(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadWav(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadDSM(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadFAR(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadAMS(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadAMS2(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadMDL(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadOKT(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadDMF(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadPTM(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadDBM(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadAMF(LPCBYTE lpStream, const DWORD dwMemLength);
- bool ReadMT2(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadPSM(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadPSM16(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadUMX(LPCBYTE lpStream, DWORD dwMemLength);
- bool ReadMO3(LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadXM(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadS3M(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadMod(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadMed(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadMTM(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadSTM(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadIT(const LPCBYTE lpStream, const DWORD dwMemLength);
+ //bool ReadMPT(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadITProject(const LPCBYTE lpStream, const DWORD dwMemLength); // -> CODE#0023 -> DESC="IT project files (.itp)" -! NEW_FEATURE#0023
+ bool Read669(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadUlt(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadWav(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadDSM(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadFAR(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadAMS(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadAMS2(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadMDL(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadOKT(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadDMF(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadPTM(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadDBM(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadAMF(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadMT2(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadPSM(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadPSM16(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadUMX(const LPCBYTE lpStream, const DWORD dwMemLength);
+ bool ReadMO3(const LPCBYTE lpStream, const DWORD dwMemLength);
bool ReadGDM(const LPCBYTE lpStream, const DWORD dwMemLength);
bool ReadIMF(const LPCBYTE lpStream, const DWORD dwMemLength);
bool ReadAM(const LPCBYTE lpStream, const DWORD dwMemLength);
bool ReadJ2B(const LPCBYTE lpStream, const DWORD dwMemLength);
- bool ReadMID(LPCBYTE lpStream, DWORD dwMemLength);
+ bool ReadMID(const LPCBYTE lpStream, DWORD dwMemLength);
// Save Functions
#ifndef MODPLUG_NO_FILESAVE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|