Skip to contentSkip to conversation

AWACS driver, missing macro

PATCH In review Giuliano Pochini 2 participants 2 messages Aug 24, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 AWACS driver, missing macro

(Sorry if you already received this message, but all mail I send to alsa-devel from my ISP's smtp server bounces. I'm sending this through the server at work)

In the pmac AWACS driver of ALSA-1.0.6a there are two references to num_controls():

[Giu@Jay ppc]$ grep num_controls *

awacs.c:                err = build_mixers(chip, num_controls(snd_pmac_screamer_mixers2),
awacs.c:                err = build_mixers(chip, num_controls(snd_pmac_awacs_mixers2),

But it is not defined anywhere. The following patch restores that macro that I took from ALSA 1.0.5a. It looks fine here, too. Tested ok (dual G4-MDD with Snapper audio).

ppc/awacs.c Tue Aug 17 15:46:24 2004 renamed from ppc/awacs.c_orig Mon Aug 2 12:06:38 2004 +2 -0
@@ -45,6 +45,8 @@
 
 #endif /* PMAC_AMP_AVAIL */
 
+#define num_controls(ary) (sizeof(ary) / sizeof(snd_kcontrol_new_t))
+
 
 static void snd_pmac_screamer_wait(pmac_t *chip)
 {

--
Giuliano.

-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285

#1 lore raw

At Tue, 24 Aug 2004 14:45:47 +0200 (CEST),

Quoted 5 lines · Giuliano Pochini

(Sorry if you already received this message, but all mail I send to alsa-devel from my ISP's smtp server bounces. I'm sending this through the server at work)

It's already fixed. Replace num_controls() with ARRAY_SIZE().

Takashi

Quoted 35 lines

In the pmac AWACS driver of ALSA-1.0.6a there are two references to num_controls():

[Giu@Jay ppc]$ grep num_controls *

awacs.c:                err = build_mixers(chip, num_controls(snd_pmac_screamer_mixers2),
awacs.c:                err = build_mixers(chip, num_controls(snd_pmac_awacs_mixers2),

But it is not defined anywhere. The following patch restores that macro that I took from ALSA 1.0.5a. It looks fine here, too. Tested ok (dual G4-MDD with Snapper audio).

ppc/awacs.c Tue Aug 17 15:46:24 2004 renamed from ppc/awacs.c_orig Mon Aug 2 12:06:38 2004 +2 -1
@@ -45,6 +45,8 @@
 
 #endif /* PMAC_AMP_AVAIL */
 
+#define num_controls(ary) (sizeof(ary) / sizeof(snd_kcontrol_new_t))
+
 
 static void snd_pmac_screamer_wait(pmac_t *chip)
 {
 
 
 
 
--

Giuliano.

Quoted 10 lines

-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285