summaryrefslogtreecommitdiff
path: root/lib/rbcodec/dsp/dsp_core.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-12-03 15:24:41 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-12-22 18:00:37 -0500
commit34a092a99729dd4de014aa1f76c48660f28a9c97 (patch)
tree40bd89c62bb6b1b7da10ede5a744b83c9c29bee5 /lib/rbcodec/dsp/dsp_core.c
parentb96b7640de381757c5ceac182e01bc84f668e64a (diff)
downloadrockbox-34a092a99729dd4de014aa1f76c48660f28a9c97.tar.gz
rockbox-34a092a99729dd4de014aa1f76c48660f28a9c97.zip
rbcodec dsp: Replace enum dsp_ids arguments with unsigned int
Because casting to and from "enum dsp_id" just adds noise, change everything to unsigned int. Change-Id: I52a7ae55f406e673d5b811b29657fcdc4b62ab10
Diffstat (limited to 'lib/rbcodec/dsp/dsp_core.c')
-rw-r--r--lib/rbcodec/dsp/dsp_core.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/rbcodec/dsp/dsp_core.c b/lib/rbcodec/dsp/dsp_core.c
index 3e72322ea6..14bf228bd6 100644
--- a/lib/rbcodec/dsp/dsp_core.c
+++ b/lib/rbcodec/dsp/dsp_core.c
@@ -483,24 +483,19 @@ intptr_t dsp_configure(struct dsp_config *dsp, unsigned int setting,
483 return proc_broadcast(dsp, setting, value); 483 return proc_broadcast(dsp, setting, value);
484} 484}
485 485
486struct dsp_config * dsp_get_config(enum dsp_ids id) 486struct dsp_config *dsp_get_config(unsigned int dsp_id)
487{ 487{
488 if (id >= DSP_COUNT) 488 if (dsp_id >= DSP_COUNT)
489 return NULL; 489 return NULL;
490 490
491 return &dsp_conf[id]; 491 return &dsp_conf[dsp_id];
492} 492}
493 493
494/* Return the id given a dsp pointer (or even via something within 494/* Return the id given a dsp pointer (or even via something within
495 the struct itself) */ 495 the struct itself) */
496enum dsp_ids dsp_get_id(const struct dsp_config *dsp) 496unsigned int dsp_get_id(const struct dsp_config *dsp)
497{ 497{
498 ptrdiff_t id = dsp - dsp_conf; 498 return dsp - dsp_conf;
499
500 if (id < 0 || id >= DSP_COUNT)
501 return DSP_COUNT; /* obviously invalid */
502
503 return (enum dsp_ids)id;
504} 499}
505 500
506/* Do what needs initializing before enable/disable calls can be made. 501/* Do what needs initializing before enable/disable calls can be made.