[alsa-devel] [PATCH 1/8] hdspmixer: Replace hardcoded 3 by MAX_CARDS

Adrian Knoth adi at drcomp.erfurt.thur.de
Mon Mar 7 19:03:02 CET 2011


We have a define for the number of cards. Use it.

Signed-off-by: Adrian Knoth <adi at drcomp.erfurt.thur.de>

diff --git a/hdspmixer/src/HDSPMixerIOMixer.cxx b/hdspmixer/src/HDSPMixerIOMixer.cxx
index a81f4a2..987be41 100644
--- a/hdspmixer/src/HDSPMixerIOMixer.cxx
+++ b/hdspmixer/src/HDSPMixerIOMixer.cxx
@@ -37,7 +37,7 @@ HDSPMixerIOMixer::HDSPMixerIOMixer(int x, int y, int w, int h, int ch, int type)
 	relative_num = channel_num-1;
 	p_iomixer_xpm = iomixer_r_xpm;
     }
-    for (int j = 0; j < 3; ++j) {
+    for (int j = 0; j < MAX_CARDS; ++j) {
 	for (int i = 0; i < 8; ++i) {
 	    data[j][0][i] = new HDSPMixerStripData();
 	    data[j][1][i] = new HDSPMixerStripData();
diff --git a/hdspmixer/src/HDSPMixerWindow.cxx b/hdspmixer/src/HDSPMixerWindow.cxx
index 27003a0..f52470f 100644
--- a/hdspmixer/src/HDSPMixerWindow.cxx
+++ b/hdspmixer/src/HDSPMixerWindow.cxx
@@ -344,7 +344,7 @@ void HDSPMixerWindow::save()
 	inputs->buttons->presets->save_preset(current_preset+1);
     }
     for (int speed = 0; speed < 3; ++speed) {
-	for (int card = 0; card < 3; ++card) {
+	for (int card = 0; card < MAX_CARDS; ++card) {
 	    for (int preset = 0; preset < 8; ++preset) {
 		for (int channel = 0; channel < HDSP_MAX_CHANNELS; ++channel) {
 		    /* inputs pans and volumes */
@@ -440,7 +440,7 @@ void HDSPMixerWindow::load()
 	return;
     }
     for (int speed = 0; speed < 3; ++speed) {
-	for (int card = 0; card < 3; ++card) {
+	for (int card = 0; card < MAX_CARDS; ++card) {
 	    for (int preset = 0; preset < 8; ++preset) {
 		for (int channel = 0; channel < HDSP_MAX_CHANNELS; ++channel) {
 		    /* inputs pans and volumes */
@@ -705,7 +705,7 @@ HDSPMixerWindow::HDSPMixerWindow(int x, int y, int w, int h, const char *label,
 	    prefs->flush();
 	}	
     }
-    for (int j = 0; j < 3; ++j) {
+    for (int j = 0; j < MAX_CARDS; j++) {
 	for (int i = 0; i < 8; ++i) {
 	    data[j][0][i] = new HDSPMixerPresetData();
 	    data[j][1][i] = new HDSPMixerPresetData();
-- 
1.7.4.1



More information about the Alsa-devel mailing list