Commit 51753ab1 authored by Erik Faye-Lund's avatar Erik Faye-Lund
Browse files

remove PIMP_GET_PTR and PIMP_GET_PTR



These macros doesn't add much value, and are not consistently used.
Signed-off-by: default avatarErik Faye-Lund <kusmabite@gmail.com>
parent 6a0e5c6d
......@@ -41,19 +41,19 @@ struct pimp_instrument
static INLINE struct pimp_sample *pimp_instrument_get_sample(const struct pimp_instrument *instr, int i)
{
ASSERT(instr != NULL);
return &((struct pimp_sample*)PIMP_GET_PTR(instr->sample_ptr))[i];
return &((struct pimp_sample*)pimp_get_ptr(&instr->sample_ptr))[i];
}
static INLINE struct pimp_envelope *pimp_instrument_get_vol_env(const struct pimp_instrument *instr)
{
ASSERT(instr != NULL);
return (struct pimp_envelope*)(instr->vol_env_ptr == 0 ? NULL : PIMP_GET_PTR(instr->vol_env_ptr));
return (struct pimp_envelope*)(instr->vol_env_ptr == 0 ? NULL : pimp_get_ptr(&instr->vol_env_ptr));
}
static INLINE struct pimp_envelope *pimp_instrument_get_pan_env(const struct pimp_instrument *instr)
{
ASSERT(instr != NULL);
return (struct pimp_envelope*)(instr->pan_env_ptr == 0 ? NULL : PIMP_GET_PTR(instr->pan_env_ptr));
return (struct pimp_envelope*)(instr->pan_env_ptr == 0 ? NULL : pimp_get_ptr(&instr->pan_env_ptr));
}
#endif /* PIMP_INSTRUMENT_H */
......@@ -17,8 +17,6 @@ static INLINE void *pimp_get_ptr(const pimp_rel_ptr *offset)
return (char*)offset + *offset;
}
#define PIMP_GET_PTR(offset) pimp_get_ptr(&offset)
static INLINE void pimp_set_ptr(pimp_rel_ptr *dst, const void *ptr)
{
ASSERT(NULL != dst);
......@@ -26,7 +24,6 @@ static INLINE void pimp_set_ptr(pimp_rel_ptr *dst, const void *ptr)
else *dst = (pimp_rel_ptr)ptr - (pimp_rel_ptr)dst;
}
#define PIMP_SET_PTR(dst, ptr) pimp_set_ptr(&dst, ptr)
#define KEY_OFF 121
typedef enum
......
......@@ -56,7 +56,7 @@ typedef struct pimp_module
static INLINE struct pimp_pattern_entry *pimp_pattern_get_data(const struct pimp_pattern *pat)
{
ASSERT(pat != NULL);
return (struct pimp_pattern_entry*)PIMP_GET_PTR(pat->data_ptr);
return (struct pimp_pattern_entry*)pimp_get_ptr(&pat->data_ptr);
}
static INLINE int pimp_module_get_order(const pimp_module *mod, int i)
......@@ -73,13 +73,13 @@ static INLINE int pimp_module_get_order(const pimp_module *mod, int i)
static INLINE struct pimp_pattern *pimp_module_get_pattern(const pimp_module *mod, int i)
{
ASSERT(mod != NULL);
return &((struct pimp_pattern*)PIMP_GET_PTR(mod->pattern_ptr))[i];
return &((struct pimp_pattern*)pimp_get_ptr(&mod->pattern_ptr))[i];
}
static INLINE struct pimp_channel *pimp_module_get_channel(const pimp_module *mod, int i)
{
ASSERT(mod != NULL);
return &((struct pimp_channel*)PIMP_GET_PTR(mod->channel_ptr))[i];
return &((struct pimp_channel*)pimp_get_ptr(&mod->channel_ptr))[i];
}
static INLINE struct pimp_instrument *pimp_module_get_instrument(const pimp_module *mod, int i)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment