src/player-events.c
void
kk_player_event_seek (kk_event_queue_t *queue, float perc)
{
  kk_player_event_seek_t event;

  memset (&event, 0, sizeof (kk_player_event_seek_t));
  event.type = KK_PLAYER_SEEK;
  event.perc = perc;
  kk_event_queue_write (queue, (void *) &event, sizeof (kk_player_event_seek_t));
}
/**
 * The way the following functions initialize the event structs is the only way
 * gcc/clang don't complain about type punning and valgrind doesn't report some
 * mysterious uninitialized bytes.
 */
The way the following functions initialize the event structs is the only way
gcc/clang don't complain about type punning and valgrind doesn't report some
mysterious uninitialized bytes.
The way the following functions initialize the event structs is the only way gcc / clang don ' t complain about type punning and valgrind doesn ' t report some mysterious uninitialized bytes .
void
kk_player_event_seek (kk_event_queue_t *queue, float perc)
{
  kk_player_event_seek_t event;
  memset (&event, 0, sizeof (kk_player_event_seek_t));
  event.type = KK_PLAYER_SEEK;
  event.perc = perc;
  kk_event_queue_write (queue, (void *) &event, sizeof (kk_player_event_seek_t));
}
void kk_player_event_seek ( kk_event_queue_t * queue , float perc ) { kk_player_event_seek_t event ; memset ( & event , 0 , sizeof ( kk_player_event_seek_t ) ) ; event . type = KK_PLAYER_SEEK ; event . perc = perc ; kk_event_queue_write ( queue , ( void * ) & event , sizeof ( kk_player_event_seek_t ) ) ; }
The way the following functions initialize the event structs is the only way
 gcc/clang don't complain about type punning and valgrind doesn't report some
 mysterious uninitialized bytes.
The way the following functions initialize the event structs is the only way gcc / clang don ' t complain about type punning and valgrind doesn ' t report some mysterious uninitialized bytes .