From 1f030017a9b551a6b6734e6bb9bf5ec3fba087ec Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 16 Dec 2024 20:36:09 +0100 Subject: [PATCH] hcxmod: fix shadow warning, rename sample into a_sample --- 3rd-party/hxcmod-player/hxcmod.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/3rd-party/hxcmod-player/hxcmod.c b/3rd-party/hxcmod-player/hxcmod.c index 753c70388..7035becf8 100644 --- a/3rd-party/hxcmod-player/hxcmod.c +++ b/3rd-party/hxcmod-player/hxcmod.c @@ -480,16 +480,17 @@ static void worknote( note * nptr, channel * cptr,char t,modcontext * mod ) { // BK4BSTACK_CHANGE START (void) t; + // we rename sample into a_sample to avoid shadowing typedef struct { .. } sample; from hxcmod.h // BK4BSTACK_CHANGE END - muint sample, period, effect, operiod; + muint a_sample, period, effect, operiod; muint curnote, arpnote; muchar effect_op; muchar effect_param,effect_param_l,effect_param_h; muint enable_nxt_smp; const short * period_table_ptr; - sample = (nptr->sampperiod & 0xF0) | (nptr->sampeffect >> 4); + a_sample = (nptr->sampperiod & 0xF0) | (nptr->sampeffect >> 4); period = ((nptr->sampperiod & 0xF) << 8) | nptr->period; effect = ((nptr->sampeffect & 0xF) << 8) | nptr->effect; effect_op = nptr->sampeffect & 0xF; @@ -501,14 +502,14 @@ static void worknote( note * nptr, channel * cptr,char t,modcontext * mod ) operiod = cptr->period; - if ( period || sample ) + if ( period || a_sample ) { - if( sample && ( sample < 32 ) ) + if( a_sample && ( a_sample < 32 ) ) { - cptr->sampnum = sample - 1; + cptr->sampnum = a_sample - 1; } - if( period || sample ) + if( period || a_sample ) { if( period ) { @@ -572,7 +573,7 @@ static void worknote( note * nptr, channel * cptr,char t,modcontext * mod ) } } - if( (sample != 0) && ( effect_op != EFFECT_VOLSLIDE_TONEPORTA ) ) + if( (a_sample != 0) && ( effect_op != EFFECT_VOLSLIDE_TONEPORTA ) ) { cptr->volume = mod->song.samples[cptr->sampnum].volume; cptr->volumeslide = 0;