From: <tj...@us...> - 2008-12-29 02:32:16
|
Revision: 11368 http://alleg.svn.sourceforge.net/alleg/?rev=11368&view=rev Author: tjaden Date: 2008-12-29 02:32:06 +0000 (Mon, 29 Dec 2008) Log Message: ----------- Avoid type-punning warnings. Modified Paths: -------------- allegro/branches/4.9/addons/kcm_audio/kcm_stream.c allegro/branches/4.9/examples/ex_saw.c Modified: allegro/branches/4.9/addons/kcm_audio/kcm_stream.c =================================================================== --- allegro/branches/4.9/addons/kcm_audio/kcm_stream.c 2008-12-29 02:31:09 UTC (rev 11367) +++ allegro/branches/4.9/addons/kcm_audio/kcm_stream.c 2008-12-29 02:32:06 UTC (rev 11368) @@ -547,6 +547,7 @@ stream->quit_feed_thread = false; while (!stream->quit_feed_thread) { + void *fragment_void; char *fragment; ALLEGRO_EVENT event; @@ -558,10 +559,11 @@ unsigned long bytes_written; if (al_get_stream_ptr(stream, ALLEGRO_AUDIOPROP_BUFFER, - (void**)&fragment) != 0) { + &fragment_void) != 0) { TRACE(PREFIX_E "Error getting stream buffer.\n"); continue; } + fragment = fragment_void; bytes = (stream->spl.spl_data.len >> MIXER_FRAC_SHIFT) * al_get_channel_count(stream->spl.spl_data.chan_conf) * Modified: allegro/branches/4.9/examples/ex_saw.c =================================================================== --- allegro/branches/4.9/examples/ex_saw.c 2008-12-29 02:31:09 UTC (rev 11367) +++ allegro/branches/4.9/examples/ex_saw.c 2008-12-29 02:32:06 UTC (rev 11368) @@ -13,6 +13,7 @@ void saw(ALLEGRO_STREAM *stream) { ALLEGRO_EVENT_QUEUE *queue; + void *buf_void; int8_t *buf; int pitch = 0x10000; int val = 0; @@ -30,7 +31,8 @@ al_wait_for_event(queue, &event); if (event.type == ALLEGRO_EVENT_STREAM_EMPTY_FRAGMENT) { - al_get_stream_ptr(stream, ALLEGRO_AUDIOPROP_BUFFER, (void**)&buf); + al_get_stream_ptr(stream, ALLEGRO_AUDIOPROP_BUFFER, &buf_void); + buf = buf_void; for (i = 0; i < SAMPLES_PER_BUFFER; i++) { buf[i] = ((val >> 16) & 0xff) >> 4; /* not so loud please */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |