mirror of
				https://github.com/alsa-project/alsa-tools.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	hdspmixer: Beautification; Lower nesting depth
Exit the loop if card < 0. No need to nest the actual code in the else branch. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									4c63a6b7be
								
							
						
					
					
						commit
						5d4bcc44ce
					
				
					 1 changed files with 38 additions and 38 deletions
				
			
		| 
						 | 
				
			
			@ -49,45 +49,45 @@ int main(int argc, char **argv)
 | 
			
		|||
    while (snd_card_next(&card) >= 0) {
 | 
			
		||||
        if (card < 0) {
 | 
			
		||||
            break;
 | 
			
		||||
        } else {
 | 
			
		||||
            snd_card_get_longname(card, &name);
 | 
			
		||||
            printf("Card %d : %s\n", card, name);
 | 
			
		||||
            if (!strncmp(name, "RME Hammerfall DSP + Multiface", 30)) {
 | 
			
		||||
                printf("Multiface found !\n");
 | 
			
		||||
                hdsp_cards[cards] = new HDSPMixerCard(Multiface, card);
 | 
			
		||||
                cards++;
 | 
			
		||||
            } else if (!strncmp(name, "RME Hammerfall DSP + Digiface", 29)) {
 | 
			
		||||
                printf("Digiface found !\n");
 | 
			
		||||
                hdsp_cards[cards] = new HDSPMixerCard(Digiface, card);
 | 
			
		||||
                cards++;
 | 
			
		||||
            } else if (!strncmp(name, "RME Hammerfall HDSP 9652", 24)) {
 | 
			
		||||
                printf("HDSP 9652 found !\n");
 | 
			
		||||
                hdsp_cards[cards] = new HDSPMixerCard(H9652, card);
 | 
			
		||||
                cards++;
 | 
			
		||||
            } else if (!strncmp(name, "RME Hammerfall HDSP 9632", 24)) {
 | 
			
		||||
                printf("HDSP 9632 found !\n");
 | 
			
		||||
                hdsp_cards[cards] = new HDSPMixerCard(H9632, card);
 | 
			
		||||
                cards++;
 | 
			
		||||
            } else if (!strncmp(name, "RME MADIface", 12)) {
 | 
			
		||||
                printf("RME MADIface found !\n");
 | 
			
		||||
                hdsp_cards[cards] = new HDSPMixerCard(HDSPeMADI, card);
 | 
			
		||||
                cards++;
 | 
			
		||||
            } else if (!strncmp(name, "RME MADI", 8)) {
 | 
			
		||||
                printf("RME MADI found !\n");
 | 
			
		||||
                hdsp_cards[cards] = new HDSPMixerCard(HDSPeMADI, card);
 | 
			
		||||
                cards++;
 | 
			
		||||
            } else if (!strncmp(name, "RME RayDAT", 10)) {
 | 
			
		||||
                printf("RME RayDAT found !\n");
 | 
			
		||||
                hdsp_cards[cards] = new HDSPMixerCard(HDSPeRayDAT, card);
 | 
			
		||||
                cards++;
 | 
			
		||||
            } else if (!strncmp(name, "RME AIO", 7)) {
 | 
			
		||||
                printf("RME AIO found !\n");
 | 
			
		||||
                hdsp_cards[cards] = new HDSPMixerCard(HDSPeAIO, card);
 | 
			
		||||
                cards++;
 | 
			
		||||
            } else if (!strncmp(name, "RME Hammerfall DSP", 18)) {
 | 
			
		||||
                printf("Uninitialized HDSP card found.\nUse hdsploader to upload configuration data to the card.\n");
 | 
			
		||||
            } 
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        snd_card_get_longname(card, &name);
 | 
			
		||||
        printf("Card %d : %s\n", card, name);
 | 
			
		||||
        if (!strncmp(name, "RME Hammerfall DSP + Multiface", 30)) {
 | 
			
		||||
            printf("Multiface found !\n");
 | 
			
		||||
            hdsp_cards[cards] = new HDSPMixerCard(Multiface, card);
 | 
			
		||||
            cards++;
 | 
			
		||||
        } else if (!strncmp(name, "RME Hammerfall DSP + Digiface", 29)) {
 | 
			
		||||
            printf("Digiface found !\n");
 | 
			
		||||
            hdsp_cards[cards] = new HDSPMixerCard(Digiface, card);
 | 
			
		||||
            cards++;
 | 
			
		||||
        } else if (!strncmp(name, "RME Hammerfall HDSP 9652", 24)) {
 | 
			
		||||
            printf("HDSP 9652 found !\n");
 | 
			
		||||
            hdsp_cards[cards] = new HDSPMixerCard(H9652, card);
 | 
			
		||||
            cards++;
 | 
			
		||||
        } else if (!strncmp(name, "RME Hammerfall HDSP 9632", 24)) {
 | 
			
		||||
            printf("HDSP 9632 found !\n");
 | 
			
		||||
            hdsp_cards[cards] = new HDSPMixerCard(H9632, card);
 | 
			
		||||
            cards++;
 | 
			
		||||
        } else if (!strncmp(name, "RME MADIface", 12)) {
 | 
			
		||||
            printf("RME MADIface found !\n");
 | 
			
		||||
            hdsp_cards[cards] = new HDSPMixerCard(HDSPeMADI, card);
 | 
			
		||||
            cards++;
 | 
			
		||||
        } else if (!strncmp(name, "RME MADI", 8)) {
 | 
			
		||||
            printf("RME MADI found !\n");
 | 
			
		||||
            hdsp_cards[cards] = new HDSPMixerCard(HDSPeMADI, card);
 | 
			
		||||
            cards++;
 | 
			
		||||
        } else if (!strncmp(name, "RME RayDAT", 10)) {
 | 
			
		||||
            printf("RME RayDAT found !\n");
 | 
			
		||||
            hdsp_cards[cards] = new HDSPMixerCard(HDSPeRayDAT, card);
 | 
			
		||||
            cards++;
 | 
			
		||||
        } else if (!strncmp(name, "RME AIO", 7)) {
 | 
			
		||||
            printf("RME AIO found !\n");
 | 
			
		||||
            hdsp_cards[cards] = new HDSPMixerCard(HDSPeAIO, card);
 | 
			
		||||
            cards++;
 | 
			
		||||
        } else if (!strncmp(name, "RME Hammerfall DSP", 18)) {
 | 
			
		||||
            printf("Uninitialized HDSP card found.\nUse hdsploader to upload configuration data to the card.\n");
 | 
			
		||||
        } 
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    free(name);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue