Skip to contentSkip to conversation

question about implicit decl in pcm_direct.c

PATCH Benoit Fouet 2 participants 4 messages Jan 8, 2007

lore
Share & tools
lore
#0 lore raw

when compiling, i got:

pcm_direct.c:898: warning: implicit declaration of function `snd_pcm_hw_params_set_format_first'
I don't know how to fix it properly, so i ask if someone knows :)

there is also another warning about a comparison between int and unsigned int that i "fixed" like in the attached patch.

Cheers,

Ben

src/pcm/pcm_direct.c +1 -1
diff -r 8803655da809 src/pcm/pcm_direct.c
@@ -887,7 +887,7 @@ int snd_pcm_direct_initialize_slave(snd_
 		snd_pcm_format_t format;
 		int i;
 
-		for (i = 0; i < sizeof dmix_formats / sizeof dmix_formats[0]; ++i) {
+		for (i = 0; i < (int)(sizeof dmix_formats / sizeof dmix_formats[0]); ++i) {
 			format = dmix_formats[i];
 			ret = snd_pcm_hw_params_set_format(spcm, hw_params, format);
 			if (ret >= 0)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#1 lore raw

At Mon, 08 Jan 2007 15:41:21 +0100,

Quoted 6 lines · Benoit Fouet

when compiling, i got:

pcm_direct.c:898: warning: implicit declaration of function `snd_pcm_hw_params_set_format_first'
I don't know how to fix it properly, so i ask if someone knows :)

The patch below should fix. Give it a try.

Quoted 2 lines

there is also another warning about a comparison between int and unsigned int that i "fixed" like in the attached patch.

Well, this is a kind of GCC bug (not 100% but partially). I guess the latest version of gcc won't complain about it.

Takashi

src/pcm/pcm_direct.c +1 -1
diff -r 8803655da809 src/pcm/pcm_direct.c
@@ -895,7 +895,7 @@ int snd_pcm_direct_initialize_slave(snd_
 		}
 		if (ret < 0 && dmix->type != SND_PCM_TYPE_DMIX) {
 			/* TODO: try to choose a good format */
-			ret = snd_pcm_hw_params_set_format_first(spcm, hw_params, &format);
+			ret = INTERNAL(snd_pcm_hw_params_set_format_first)(spcm, hw_params, &format);
 		}
 		if (ret < 0) {
 			SNDERR("requested or auto-format is not available");

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#2 lore raw
Quoted 12 lines · Takashi Iwai

At Mon, 08 Jan 2007 15:41:21 +0100,

Quoted 6 lines · Benoit Fouet

when compiling, i got:

pcm_direct.c:898: warning: implicit declaration of function `snd_pcm_hw_params_set_format_first'
I don't know how to fix it properly, so i ask if someone knows :)

The patch below should fix. Give it a try.

it fixes (at least the compilation warning ;) )

Quoted 7 lines
Quoted 3 lines

there is also another warning about a comparison between int and unsigned int that i "fixed" like in the attached patch.

Well, this is a kind of GCC bug (not 100% but partially). I guess the latest version of gcc won't complain about it.

ok, i can't try latest gcc's version, though.

Thanks,
Ben

Quoted 7 lines

Takashi

diff -r 8803655da809 src/pcm/pcm_direct.c

src/pcm/pcm_direct.c int snd_pcm_direct_initialize_slave(snd_ · line 901

Quoted 8 lines
src/pcm/pcm_direct.c +1 -1
@@ -895,7 +895,7 @@ int snd_pcm_direct_initialize_slave(snd_
 		}
 		if (ret < 0 && dmix->type != SND_PCM_TYPE_DMIX) {
 			/* TODO: try to choose a good format */
-			ret = snd_pcm_hw_params_set_format_first(spcm, hw_params, &format);
+			ret = INTERNAL(snd_pcm_hw_params_set_format_first)(spcm, hw_params, &format);
 		}
 		if (ret < 0) {
 			SNDERR("requested or auto-format is not available");

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#3 lore raw

At Mon, 08 Jan 2007 16:35:27 +0100,

Quoted 7 lines · Benoit Fouet
Quoted 5 lines · Takashi Iwai

At Mon, 08 Jan 2007 15:41:21 +0100,

Quoted 2 lines · Benoit Fouet

when compiling, i got:

Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

pcm_direct.c:898: warning: implicit declaration of function `snd_pcm_hw_params_set_format_first'
I don't know how to fix it properly, so i ask if someone knows :)

The patch below should fix. Give it a try.

it fixes (at least the compilation warning ;) )

OK, now committed to HG tree. Thanks for checking.

Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV