Skip to content

Commit b33694e

Browse files
committed
add: Add const to read-only parameters for libsd
1 parent 71e8c33 commit b33694e

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

common/include/libsd-common.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ extern u32 sceSdGetSwitch(u16 entry);
174174
extern u16 sceSdNote2Pitch(u16 center_note, u16 center_fine, u16 note, s16 fine);
175175
extern u16 sceSdPitch2Note(u16 center_note, u16 center_fine, u16 pitch);
176176

177-
extern int sceSdSetEffectAttr(int core, sceSdEffectAttr *attr);
177+
extern int sceSdSetEffectAttr(int core, const sceSdEffectAttr *attr);
178178
extern void sceSdGetEffectAttr(int core, sceSdEffectAttr *attr);
179179

180-
extern int sceSdProcBatch(sceSdBatch *batch, u32 *rets, u32 num);
181-
extern int sceSdProcBatchEx(sceSdBatch *batch, u32 *rets, u32 num, u32 voice);
180+
extern int sceSdProcBatch(const sceSdBatch *batch, u32 *rets, u32 num);
181+
extern int sceSdProcBatchEx(const sceSdBatch *batch, u32 *rets, u32 num, u32 voice);
182182

183183
extern int sceSdVoiceTrans(s16 chan, u16 mode, u8 *iopaddr, u32 *spuaddr, u32 size);
184184
extern int sceSdBlockTrans(s16 chan, u16 mode, u8 *iopaddr, u32 size, ...);
@@ -195,8 +195,8 @@ extern void *sceSdGetSpu2IntrHandlerArgument();
195195
extern int sceSdStopTrans(int channel);
196196
// The following was added in module version 3.3, export version 1.5, SDK 2.5
197197
extern int sceSdCleanEffectWorkArea(int core, int channel, int effect_mode);
198-
extern int sceSdSetEffectMode(int core, sceSdEffectAttr *param);
199-
extern int sceSdSetEffectModeParams(int core, sceSdEffectAttr *attr);
198+
extern int sceSdSetEffectMode(int core, const sceSdEffectAttr *param);
199+
extern int sceSdSetEffectModeParams(int core, const sceSdEffectAttr *attr);
200200

201201
#ifdef __cplusplus
202202
}

ee/rpc/ps2snd/src/ps2snd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ u16 sceSdPitch2Note(u16 center_note, u16 center_fine, u16 pitch)
130130
return(0);
131131
}
132132

133-
int sceSdProcBatch(sceSdBatch* batch, u32 returns[], u32 num)
133+
int sceSdProcBatch(const sceSdBatch* batch, u32 returns[], u32 num)
134134
{
135135
(void)batch;
136136
(void)returns;
@@ -140,7 +140,7 @@ int sceSdProcBatch(sceSdBatch* batch, u32 returns[], u32 num)
140140
return(-1);
141141
}
142142

143-
int sceSdProcBatchEx(sceSdBatch* batch, u32 returns[], u32 num, u32 voice)
143+
int sceSdProcBatchEx(const sceSdBatch* batch, u32 returns[], u32 num, u32 voice)
144144
{
145145
(void)batch;
146146
(void)returns;
@@ -198,7 +198,7 @@ u32 sceSdBlockTransStatus (s16 channel, s16 flag)
198198
//void* sceSdSetTransCallback (u16 channel, void SD_TRANS_CBProc(void *) );
199199
//void *sceSdSetIRQCallback( void SD_IRQ_CBProc(void *) );
200200

201-
int sceSdSetEffectAttr (int core, sceSdEffectAttr *attr)
201+
int sceSdSetEffectAttr (int core, const sceSdEffectAttr *attr)
202202
{
203203
s32 buf[1+((sizeof(sceSdEffectAttr)+3)/4)] ALIGNED(64);
204204
buf[0] = core;

iop/sound/libsd/src/libsd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ void sceSdGetEffectAttr(int core, sceSdEffectAttr *attr)
985985
attr->depth_R = spu2_mmio_hwport->m_u.m_e.m_different_regs[core].m_evolr;
986986
}
987987

988-
int sceSdSetEffectAttr(int core, sceSdEffectAttr *attr)
988+
int sceSdSetEffectAttr(int core, const sceSdEffectAttr *attr)
989989
{
990990
int clearram;
991991
int channel;
@@ -1082,7 +1082,7 @@ static int GetEEA(int core)
10821082
return (spu2_mmio_hwport->m_u.m_m.m_core_regs[core].m_cregs.m_eea << 17) | 0x1FFFF;
10831083
}
10841084

1085-
int sceSdSetEffectMode(int core, sceSdEffectAttr *param)
1085+
int sceSdSetEffectMode(int core, const sceSdEffectAttr *param)
10861086
{
10871087
int clearram;
10881088
int channel;
@@ -1126,7 +1126,7 @@ int sceSdSetEffectMode(int core, sceSdEffectAttr *param)
11261126
return clearram ? sceSdCleanEffectWorkArea(core, channel, mode) : 0;
11271127
}
11281128

1129-
int sceSdSetEffectModeParams(int core, sceSdEffectAttr *attr)
1129+
int sceSdSetEffectModeParams(int core, const sceSdEffectAttr *attr)
11301130
{
11311131
int mode;
11321132
struct mode_data_struct mode_data;
@@ -1904,7 +1904,7 @@ static int SifDmaBatch(void *ee_addr, void *iop_addr, int size)
19041904
return (i < 0) ? -1 : 0;
19051905
}
19061906

1907-
int sceSdProcBatch(sceSdBatch *batch, u32 *rets, u32 num)
1907+
int sceSdProcBatch(const sceSdBatch *batch, u32 *rets, u32 num)
19081908
{
19091909
u32 cnt;
19101910

@@ -1958,7 +1958,7 @@ int sceSdProcBatch(sceSdBatch *batch, u32 *rets, u32 num)
19581958
return cnt;
19591959
}
19601960

1961-
int sceSdProcBatchEx(sceSdBatch *batch, u32 *rets, u32 num, u32 voice)
1961+
int sceSdProcBatchEx(const sceSdBatch *batch, u32 *rets, u32 num, u32 voice)
19621962
{
19631963
u32 cnt;
19641964
int loop;

0 commit comments

Comments
 (0)