This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

get rid of strict-aliasing warnings with -Os

By: a guest on Jun 3rd, 2010  |  syntax: C  |  size: 1.65 KB  |  views: 125  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Index: pcm-as3525.c
  2. ===================================================================
  3. --- pcm-as3525.c        (revision 26482)
  4. +++ pcm-as3525.c        (working copy)
  5. @@ -35,7 +35,7 @@
  6.                                        * and the number of 32bits words has to
  7.                                        * fit in 11 bits of DMA register */
  8.  
  9. -static unsigned char *dma_start_addr;
  10. +static void *dma_start_addr;
  11.  static size_t      dma_size;   /* in 4*32 bits */
  12.  static void dma_callback(void);
  13.  static int locked = 0;
  14. @@ -89,7 +89,7 @@
  15.  
  16.      if(!dma_size)
  17.      {
  18. -        pcm_play_get_more_callback((void **)&dma_start_addr, &dma_size);
  19. +        pcm_play_get_more_callback(&dma_start_addr, &dma_size);
  20.  
  21.          if (!dma_size)
  22.              return;
  23. @@ -188,7 +188,7 @@
  24.  const void * pcm_play_dma_get_peak_buffer(int *count)
  25.  {
  26.      pcm_play_lock();
  27. -    unsigned char *addr = (void*)DMAC_CH_SRC_ADDR(1);
  28. +    void *addr = (void*)DMAC_CH_SRC_ADDR(1);
  29.      *count = (dma_size - (addr - dma_start_addr)) >> 2;
  30.      pcm_play_unlock();
  31.      return AS3525_UNCACHED_ADDR(addr);
  32. @@ -212,7 +212,7 @@
  33.  static int rec_locked = 0;
  34.  static bool is_recording = false;
  35.  static bool rec_callback_pending = false;
  36. -static unsigned char *rec_dma_start_addr;
  37. +static void *rec_dma_start_addr;
  38.  static size_t rec_dma_size, rec_dma_transfer_size;
  39.  static void rec_dma_callback(void);
  40.  #if CONFIG_CPU == AS3525
  41. @@ -315,7 +315,7 @@
  42.  
  43.      if(!rec_dma_size)
  44.      {
  45. -        pcm_rec_more_ready_callback(0, (void **)&rec_dma_start_addr,
  46. +        pcm_rec_more_ready_callback(0, &rec_dma_start_addr,
  47.                                      &rec_dma_size);
  48.  
  49.          if(rec_dma_size == 0)
clone this paste RAW Paste Data