diff --git a/apps/buffering.c b/apps/buffering.c
index d891382..938cc95 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -190,7 +190,7 @@
 static struct queue_sender_list buffering_queue_sender_list;
 
 
-static void call_buffering_callbacks(const enum callback_event ev, const int value);
+static void call_buffering_callbacks(enum callback_event ev, int value);
 
 
 /*
@@ -225,8 +225,8 @@
            only potential side effect is to allocate space for the cur_handle
            if it returns NULL.
    */
-static struct memory_handle *add_handle(const size_t data_size, const bool can_wrap,
-                                        const bool alloc_all)
+static struct memory_handle *add_handle(size_t data_size, bool can_wrap,
+                                        bool alloc_all)
 {
     /* gives each handle a unique id */
     static int cur_handle_id = 0;
@@ -363,7 +363,7 @@
 
 /* Return a pointer to the memory handle of given ID.
    NULL if the handle wasn't found */
-static struct memory_handle *find_handle(const int handle_id)
+static struct memory_handle *find_handle(int handle_id)
 {
     if (handle_id < 0)
         return NULL;
@@ -407,7 +407,7 @@
            found in the linked list for adjustment.  This function has no side
            effects if NULL is returned. */
 static bool move_handle(struct memory_handle **h, size_t *delta,
-                        const size_t data_size, const bool can_wrap)
+                        size_t data_size, bool can_wrap)
 {
     struct memory_handle *dest;
     const struct memory_handle *src;
@@ -559,7 +559,7 @@
 
 /* Buffer data for the given handle.
    Return whether or not the buffering should continue explicitly.  */
-static bool buffer_handle(const int handle_id)
+static bool buffer_handle(int handle_id)
 {
     logf("buffer_handle(%d)", handle_id);
     struct memory_handle *h = find_handle(handle_id);
@@ -667,7 +667,7 @@
 
 /* Reset writing position and data buffer of a handle to its current offset.
    Use this after having set the new offset to use. */
-static void reset_handle(const int handle_id)
+static void reset_handle(int handle_id)
 {
     logf("reset_handle(%d)", handle_id);
 
@@ -687,7 +687,7 @@
 }
 
 /* Seek to a nonbuffered part of a handle by rebuffering the data. */
-static void rebuffer_handle(const int handle_id, const size_t newpos)
+static void rebuffer_handle(int handle_id, size_t newpos)
 {
     struct memory_handle *h = find_handle(handle_id);
     if (!h)
@@ -725,7 +725,7 @@
     h->ridx = h->data;
 }
 
-static bool close_handle(const int handle_id)
+static bool close_handle(int handle_id)
 {
     struct memory_handle *h = find_handle(handle_id);
 
@@ -830,7 +830,7 @@
 /* Given a file descriptor to a bitmap file, write the bitmap data to the
    buffer, with a struct bitmap and the actual data immediately following.
    Return value is the total size (struct + data). */
-static int load_bitmap(const int fd)
+static int load_bitmap(int fd)
 {
     int rc;
     struct bitmap *bmp = (struct bitmap *)&buffer[buf_widx];
@@ -873,7 +873,7 @@
    return value: <0 if the file cannot be opened, or one file already
    queued to be opened, otherwise the handle for the file in the buffer
 */
-int bufopen(const char *file, const size_t offset, const enum data_type type)
+int bufopen(const char *file, size_t offset, enum data_type type)
 {
     size_t adjusted_offset = offset;
 
@@ -957,7 +957,7 @@
    requested amount of data can entirely fit in the buffer without wrapping.
    Return value is the handle id for success or <0 for failure.
 */
-int bufalloc(const void *src, const size_t size, const enum data_type type)
+int bufalloc(const void *src, size_t size, enum data_type type)
 {
     struct memory_handle *h = add_handle(size, false, true);
 
@@ -992,7 +992,7 @@
 }
 
 /* Close the handle. Return true for success and false for failure */
-bool bufclose(const int handle_id)
+bool bufclose(int handle_id)
 {
     logf("bufclose(%d)", handle_id);
 
@@ -1006,7 +1006,7 @@
      -1 if the handle wasn't found
      -2 if the new requested position was beyond the end of the file
 */
-int bufseek(const int handle_id, const size_t newpos)
+int bufseek(int handle_id, size_t newpos)
 {
     struct memory_handle *h = find_handle(handle_id);
     if (!h)
@@ -1028,7 +1028,7 @@
 
 /* Advance the reading index in a handle (relatively to its current position).
    Return 0 for success and < 0 for failure */
-int bufadvance(const int handle_id, const off_t offset)
+int bufadvance(int handle_id, off_t offset)
 {
     const struct memory_handle *h = find_handle(handle_id);
     if (!h)
@@ -1042,8 +1042,8 @@
  * actual amount of data available for reading.  This function explicitly
  * does not check the validity of the input handle.  It does do range checks
  * on size and returns a valid (and explicit) amount of data for reading */
-static struct memory_handle *prep_bufdata(const int handle_id, size_t *size,
-                                          const bool guardbuf_limit)
+static struct memory_handle *prep_bufdata(int handle_id, size_t *size,
+                                          bool guardbuf_limit)
 {
     struct memory_handle *h = find_handle(handle_id);
     if (!h)
@@ -1096,7 +1096,7 @@
    Return the number of bytes copied or < 0 for failure (handle not found).
    The caller is blocked until the requested amount of data is available.
 */
-ssize_t bufread(const int handle_id, const size_t size, void *dest)
+ssize_t bufread(int handle_id, size_t size, void *dest)
 {
     const struct memory_handle *h;
     size_t adjusted_size = size;
@@ -1129,7 +1129,7 @@
    The guard buffer may be used to provide the requested size. This means it's
    unsafe to request more than the size of the guard buffer.
 */
-ssize_t bufgetdata(const int handle_id, const size_t size, void **data)
+ssize_t bufgetdata(int handle_id, size_t size, void **data)
 {
     const struct memory_handle *h;
     size_t adjusted_size = size;
@@ -1154,7 +1154,7 @@
     return adjusted_size;
 }
 
-ssize_t bufgettail(const int handle_id, const size_t size, void **data)
+ssize_t bufgettail(int handle_id, size_t size, void **data)
 {
     size_t tidx;
 
@@ -1184,7 +1184,7 @@
     return size;
 }
 
-ssize_t bufcuttail(const int handle_id, const size_t size)
+ssize_t bufcuttail(int handle_id, size_t size)
 {
     struct memory_handle *h;
     size_t adjusted_size = size;
@@ -1228,7 +1228,7 @@
 */
 
 /* Get a handle offset from a pointer */
-ssize_t buf_get_offset(const int handle_id, void *ptr)
+ssize_t buf_get_offset(int handle_id, void *ptr)
 {
     const struct memory_handle *h = find_handle(handle_id);
     if (!h)
@@ -1237,7 +1237,7 @@
     return (size_t)ptr - (size_t)&buffer[h->ridx];
 }
 
-ssize_t buf_handle_offset(const int handle_id)
+ssize_t buf_handle_offset(int handle_id)
 {
     const struct memory_handle *h = find_handle(handle_id);
     if (!h)
@@ -1245,13 +1245,13 @@
     return h->offset;
 }
 
-void buf_request_buffer_handle(const int handle_id)
+void buf_request_buffer_handle(int handle_id)
 {
     LOGFQUEUE("buffering >| Q_START_FILL %d",handle_id);
     queue_send(&buffering_queue, Q_START_FILL, handle_id);
 }
 
-void buf_set_base_handle(const int handle_id)
+void buf_set_base_handle(int handle_id)
 {
     LOGFQUEUE("buffering > Q_BASE_HANDLE %d", handle_id);
     queue_post(&buffering_queue, Q_BASE_HANDLE, handle_id);
@@ -1263,13 +1263,13 @@
     return BUF_USED;
 }
 
-void buf_set_watermark(const size_t bytes)
+void buf_set_watermark(size_t bytes)
 {
     LOGFQUEUE("buffering > Q_SET_WATERMARK %ld", (long)bytes);
     queue_post(&buffering_queue, Q_SET_WATERMARK, bytes);
 }
 
-bool register_buffering_callback(const buffering_callback func)
+bool register_buffering_callback(buffering_callback func)
 {
     int i;
     if (buffer_callback_count >= MAX_BUF_CALLBACKS)
@@ -1288,7 +1288,7 @@
     return false;
 }
 
-void unregister_buffering_callback(const buffering_callback func)
+void unregister_buffering_callback(buffering_callback func)
 {
     int i;
     for (i = 0; i < MAX_BUF_CALLBACKS; i++)
@@ -1302,7 +1302,7 @@
     return;
 }
 
-static void call_buffering_callbacks(const enum callback_event ev, const int value)
+static void call_buffering_callbacks(enum callback_event ev, int value)
 {
     logf("call_buffering_callbacks()");
     int i;
@@ -1471,7 +1471,7 @@
 }
 
 /* Initialise the buffering subsystem */
-bool buffering_reset(char *buf, const size_t buflen)
+bool buffering_reset(char *buf, size_t buflen)
 {
     if (!buf || !buflen)
         return false;
diff --git a/apps/buffering.h b/apps/buffering.h
index abe8f60..bc61ec5 100644
--- a/apps/buffering.h
+++ b/apps/buffering.h
@@ -56,7 +56,7 @@
 void buffering_init(void);
 
 /* Reset the buffering system */
-bool buffering_reset(char *buf, const size_t buflen);
+bool buffering_reset(char *buf, size_t buflen);
 
 
 /***************************************************************************
@@ -80,15 +80,15 @@
 
 #define BUF_MAX_HANDLES         256
 
-int bufopen(const char *file, size_t offset, const enum data_type type);
-int bufalloc(const void *src, const size_t size, const enum data_type type);
-bool bufclose(const int handle_id);
-int bufseek(const int handle_id, const size_t newpos);
-int bufadvance(const int handle_id, const off_t offset);
-ssize_t bufread(const int handle_id, size_t size, void *dest);
-ssize_t bufgetdata(const int handle_id, size_t size, void **data);
-ssize_t bufgettail(const int handle_id, const size_t size, void **data);
-ssize_t bufcuttail(const int handle_id, size_t size);
+int bufopen(const char *file, size_t offset, enum data_type type);
+int bufalloc(const void *src, size_t size, enum data_type type);
+bool bufclose(int handle_id);
+int bufseek(int handle_id, size_t newpos);
+int bufadvance(int handle_id, off_t offset);
+ssize_t bufread(int handle_id, size_t size, void *dest);
+ssize_t bufgetdata(int handle_id, size_t size, void **data);
+ssize_t bufgettail(int handle_id, size_t size, void **data);
+ssize_t bufcuttail(int handle_id, size_t size);
 
 
 /***************************************************************************
@@ -102,10 +102,10 @@
  * buf_used: Total amount of buffer space used (including allocated space)
  ****************************************************************************/
 
-ssize_t buf_get_offset(const int handle_id, void *ptr);
-ssize_t buf_handle_offset(const int handle_id);
-void buf_request_buffer_handle(const int handle_id);
-void buf_set_base_handle(const int handle_id);
+ssize_t buf_get_offset(int handle_id, void *ptr);
+ssize_t buf_handle_offset(int handle_id);
+void buf_request_buffer_handle(int handle_id);
+void buf_set_base_handle(int handle_id);
 size_t buf_used(void);
 
 
@@ -123,9 +123,9 @@
  ****************************************************************************/
 
 #define MAX_BUF_CALLBACKS 4
-typedef void (*buffering_callback)(const enum callback_event ev, const int value);
-bool register_buffering_callback(const buffering_callback func);
-void unregister_buffering_callback(const buffering_callback func);
+typedef void (*buffering_callback)(enum callback_event ev, int value);
+bool register_buffering_callback(buffering_callback func);
+void unregister_buffering_callback(buffering_callback func);
 
 /* Settings */
 enum {
diff --git a/apps/codecs.h b/apps/codecs.h
index 85b73a4..fb5675f 100644
--- a/apps/codecs.h
+++ b/apps/codecs.h
@@ -126,28 +126,28 @@
     void* (*get_codec_memory)(size_t *size);
     /* Insert PCM data into audio buffer for playback. Playback will start
        automatically. */
-    bool (*pcmbuf_insert)(const void *ch1, const void *ch2, const int count);
+    bool (*pcmbuf_insert)(const void *ch1, const void *ch2, int count);
     /* Set song position in WPS (value in ms). */
-    void (*set_elapsed)(const unsigned int value);
+    void (*set_elapsed)(unsigned int value);
     
     /* Read next <size> amount bytes from file buffer to <ptr>.
        Will return number of bytes read or 0 if end of file. */
-    size_t (*read_filebuf)(void *ptr, const size_t size);
+    size_t (*read_filebuf)(void *ptr, size_t size);
     /* Request pointer to file buffer which can be used to read
        <realsize> amount of data. <reqsize> tells the buffer system
        how much data it should try to allocate. If <realsize> is 0,
        end of file is reached. */
-    void* (*request_buffer)(size_t *realsize, const size_t reqsize);
+    void* (*request_buffer)(size_t *realsize, size_t reqsize);
     /* Advance file buffer position by <amount> amount of bytes. */
-    void (*advance_buffer)(const size_t amount);
+    void (*advance_buffer)(size_t amount);
     /* Advance file buffer to a pointer location inside file buffer. */
     void (*advance_buffer_loc)(void *ptr);
     /* Seek file buffer to position <newpos> beginning of file. */
-    bool (*seek_buffer)(const size_t newpos);
+    bool (*seek_buffer)(size_t newpos);
     /* Codec should call this function when it has done the seeking. */
     void (*seek_complete)(void);
     /* Calculate mp3 seek position from given time data in ms. */
-    off_t (*mp3_get_filepos)(const int newtime);
+    off_t (*mp3_get_filepos)(int newtime);
     /* Request file change from file buffer. Returns true is next
        track is available and changed. If return value is false,
        codec should exit immediately with PLUGIN_OK status. */
@@ -155,12 +155,12 @@
     /* Free the buffer area of the current codec after its loaded */
     void (*discard_codec)(void);
     
-    void (*set_offset)(const size_t value);
+    void (*set_offset)(size_t value);
     /* Configure different codec buffer parameters. */
-    void (*configure)(const int setting, const intptr_t value);
+    void (*configure)(int setting, intptr_t value);
 
     /* kernel/ system */
-    void (*PREFIX(sleep))(const int ticks);
+    void (*PREFIX(sleep))(int ticks);
     void (*yield)(void);
 
 #if NUM_CORES > 1
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index b9587d0..8f16c90 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -82,7 +82,7 @@
 static char *voicebuf IDATA_ATTR;
 
 static void (*pcmbuf_event_handler)(void) IDATA_ATTR;
-static void (*position_callback)(const size_t size) IDATA_ATTR;
+static void (*position_callback)(size_t size) IDATA_ATTR;
 
 /* Crossfade related state */
 static bool crossfade_enabled;
@@ -188,7 +188,7 @@
     }
 }
 
-void pcmbuf_set_position_callback(void (*callback)(const size_t size))
+void pcmbuf_set_position_callback(void (*callback)(size_t size))
 {
     position_callback = callback;
 }
@@ -938,7 +938,7 @@
 }
 
 #if 0
-bool pcmbuf_insert_buffer(char *buf, const int count)
+bool pcmbuf_insert_buffer(char *buf, int count)
 {
     size_t length = (size_t)(unsigned int)count << 2;
 
diff --git a/apps/pcmbuf.h b/apps/pcmbuf.h
index 9263285..0636245 100644
--- a/apps/pcmbuf.h
+++ b/apps/pcmbuf.h
@@ -63,7 +63,7 @@
 void pcmbuf_play_start(void);
 bool pcmbuf_crossfade_init(bool manual_skip);
 void pcmbuf_set_event_handler(void (*callback)(void));
-void pcmbuf_set_position_callback(void (*callback)(const size_t size));
+void pcmbuf_set_position_callback(void (*callback)(size_t size));
 size_t pcmbuf_free(void);
 unsigned int pcmbuf_get_latency(void);
 void pcmbuf_set_low_latency(bool state);
diff --git a/apps/playback.c b/apps/playback.c
index de58e8b..880c9ac 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -249,7 +249,7 @@
 
 /* Multiple threads */
 /* Set the watermark to trigger buffer fill (A/C) FIXME */
-static void set_filebuf_watermark(const int seconds, const size_t max);
+static void set_filebuf_watermark(int seconds, size_t max);
 
 /* Audio thread */
 static struct event_queue       audio_queue NOCACHEBSS_ATTR;
@@ -277,7 +277,7 @@
 /* Function to be called by pcm buffer callbacks.
  * Permissible Context(s): Audio interrupt
  */
-static void pcmbuf_callback_queue_post(const long id, intptr_t data)
+static void pcmbuf_callback_queue_post(long id, intptr_t data)
 {
     /* No lock since we're already in audio interrupt context */
     queue_post(&pcmbuf_queue, id, data);
@@ -313,7 +313,7 @@
 
 /* --- Helper functions --- */
 
-static struct mp3entry *bufgetid3(const int handle_id)
+static struct mp3entry *bufgetid3(int handle_id)
 {
     if (handle_id < 0)
         return NULL;
@@ -384,7 +384,7 @@
 #endif
 }
 
-bool audio_restore_playback(const int type)
+bool audio_restore_playback(int type)
 {
     switch (type)
     {
@@ -401,7 +401,7 @@
     }
 }
 
-unsigned char *audio_get_buffer(const bool talk_buf, size_t *buffer_size)
+unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size)
 {
     unsigned char *buf, *end;
 
@@ -621,7 +621,7 @@
     return false;
 }
 
-void audio_play(const long offset)
+void audio_play(long offset)
 {
     logf("audio_play");
 
@@ -710,7 +710,7 @@
     queue_post(&audio_queue, Q_AUDIO_PRE_FF_REWIND, 0);
 }
 
-void audio_ff_rewind(const long newpos)
+void audio_ff_rewind(long newpos)
 {
     LOGFQUEUE("audio > audio Q_AUDIO_FF_REWIND");
     queue_post(&audio_queue, Q_AUDIO_FF_REWIND, newpos);
@@ -753,7 +753,7 @@
 }
 
 #ifndef HAVE_FLASH_STORAGE
-void audio_set_buffer_margin(const int setting)
+void audio_set_buffer_margin(int setting)
 {
     static const int lookup[] = {5, 15, 30, 60, 120, 180, 300, 600};
     buffer_margin = lookup[setting];
@@ -763,7 +763,7 @@
 #endif
 
 /* Take necessary steps to enable or disable the crossfade setting */
-void audio_set_crossfade(const int enable)
+void audio_set_crossfade(int enable)
 {
     size_t offset;
     bool was_playing;
@@ -805,7 +805,7 @@
 
 /* --- Routines called from multiple threads --- */
 
-static void set_filebuf_watermark(const int seconds, const size_t max)
+static void set_filebuf_watermark(int seconds, size_t max)
 {
     size_t bytes;
 
@@ -817,7 +817,7 @@
     buf_set_watermark(bytes);
 }
 
-const char *get_codec_filename(const int cod_spec)
+const char *get_codec_filename(int cod_spec)
 {
     const char *fname;
 
@@ -838,11 +838,10 @@
         afmt, fname ? fname : "<unknown>");
 #else /* !HAVE_RECORDING */
     /* Always decoder */
-    int afmt = cod_spec;
-    if ((unsigned)afmt >= AFMT_NUM_CODECS)
-        afmt = AFMT_UNKNOWN;
-    fname = audio_formats[afmt].codec_root_fn;
-    logf("Codec: %d - %s",  afmt, fname ? fname : "<unknown>");
+    if ((unsigned)cod_spec >= AFMT_NUM_CODECS)
+        cod_spec = AFMT_UNKNOWN;
+    fname = audio_formats[cod_spec].codec_root_fn;
+    logf("Codec: %d - %s",  cod_spec, fname ? fname : "<unknown>");
 #endif /* HAVE_RECORDING */
 
     return fname;
@@ -850,14 +849,13 @@
 
 /* --- Codec thread --- */
 static bool codec_pcmbuf_insert_callback(
-        const void *ch1, const void *ch2, const int count)
+        const void *ch1, const void *ch2, int count)
 {
     const char *src[2] = { ch1, ch2 };
 
-    int remaining = count;
-    while (remaining > 0)
+    while (count > 0)
     {
-        int out_count = dsp_output_count(ci.dsp, remaining);
+        int out_count = dsp_output_count(ci.dsp, count);
         int inp_count;
         char *dest;
 
@@ -881,8 +879,8 @@
             return true;
 
         /* Input size has grown, no error, just don't write more than length */
-        if (inp_count > remaining)
-            inp_count = remaining;
+        if (inp_count > count)
+            inp_count = count;
 
         out_count = dsp_process(ci.dsp, dest, src, inp_count);
 
@@ -891,7 +889,7 @@
 
         pcmbuf_write_complete(out_count);
 
-        remaining -= inp_count;
+        count -= inp_count;
     }
 
     return true;
@@ -907,8 +905,8 @@
    "elapsed" value of the previous (to the codec, but current to the
    user/PCM/WPS) track, so that the progressbar reaches the end.
    During that transition, the WPS will display prevtrack_id3. */
-static void codec_pcmbuf_position_callback(const size_t size) ICODE_ATTR;
-static void codec_pcmbuf_position_callback(const size_t size)
+static void codec_pcmbuf_position_callback(size_t size) ICODE_ATTR;
+static void codec_pcmbuf_position_callback(size_t size)
 {
     /* This is called from an ISR, so be quick */
     unsigned int time = size * 1000 / 4 / NATIVE_FREQUENCY +
@@ -923,7 +921,7 @@
         prevtrack_id3.elapsed = time;
 }
 
-static void codec_set_elapsed_callback(const unsigned int value)
+static void codec_set_elapsed_callback(unsigned int value)
 {
     unsigned int latency;
     if (ci.seek_time)
@@ -943,7 +941,7 @@
     }
 }
 
-static void codec_set_offset_callback(const size_t value)
+static void codec_set_offset_callback(size_t value)
 {
     unsigned int latency;
 
@@ -957,14 +955,14 @@
         curtrack_id3.offset = value - latency;
 }
 
-static void codec_advance_buffer_counters(const size_t amount)
+static void codec_advance_buffer_counters(size_t amount)
 {
     bufadvance(CUR_TI->audio_hid, amount);
     ci.curpos += amount;
 }
 
 /* copy up-to size bytes into ptr and return the actual size copied */
-static size_t codec_filebuf_callback(void *ptr, const size_t size)
+static size_t codec_filebuf_callback(void *ptr, size_t size)
 {
     ssize_t copy_n;
 
@@ -984,7 +982,7 @@
     return copy_n;
 } /* codec_filebuf_callback */
 
-static void* codec_request_buffer_callback(size_t *realsize, const size_t reqsize)
+static void* codec_request_buffer_callback(size_t *realsize, size_t reqsize)
 {
     size_t copy_n = reqsize;
     ssize_t ret;
@@ -1023,7 +1021,7 @@
     return type;
 }
 
-static void codec_advance_buffer_callback(const size_t amount)
+static void codec_advance_buffer_callback(size_t amount)
 {
     codec_advance_buffer_counters(amount);
     codec_set_offset_callback(ci.curpos);
@@ -1090,7 +1088,7 @@
     return pos;
 }
 
-static off_t codec_mp3_get_filepos_callback(const int newtime)
+static off_t codec_mp3_get_filepos_callback(int newtime)
 {
     off_t newpos;
 
@@ -1116,7 +1114,7 @@
     ci.seek_time = 0;
 }
 
-static bool codec_seek_buffer_callback(const size_t newpos)
+static bool codec_seek_buffer_callback(size_t newpos)
 {
     logf("codec_seek_buffer_callback");
 
@@ -1130,7 +1128,7 @@
     }
 }
 
-static void codec_configure_callback(const int setting, const intptr_t value)
+static void codec_configure_callback(int setting, intptr_t value)
 {
     switch (setting) {
     case CODEC_SET_FILEBUF_WATERMARK:
@@ -1180,7 +1178,7 @@
     codec_track_changed();
 }
 
-static void codec_track_skip_done(const bool was_manual)
+static void codec_track_skip_done(bool was_manual)
 {
     /* Manual track change (always crossfade or flush audio). */
     if (was_manual)
@@ -1487,7 +1485,7 @@
     ci.taginfo_ready = &CUR_TI->taginfo_ready;
 }
 
-static void buffering_audio_callback(const enum callback_event ev, const int value)
+static void buffering_audio_callback(enum callback_event ev, int value)
 {
     (void)value;
     logf("buffering_audio_callback");
@@ -1551,7 +1549,7 @@
     return true;
 }
 
-static bool audio_loadcodec(const bool start_play)
+static bool audio_loadcodec(bool start_play)
 {
     int prev_track;
     char codec_path[MAX_PATH]; /* Full path to codec */
@@ -1669,7 +1667,7 @@
 
 /* Load one track by making the appropriate bufopen calls. Return true if
    everything required was loaded correctly, false if not. */
-static bool audio_load_track(const int offset, const bool start_play)
+static bool audio_load_track(int offset, bool start_play)
 {
     const char *trackname;
     char msgbuf[80];
@@ -1716,9 +1714,8 @@
 
     tracks[track_widx].filesize = filesize(fd);
 
-    int adjusted_offset = offset;
-    if ((unsigned)adjusted_offset > tracks[track_widx].filesize)
-        adjusted_offset = 0;
+    if ((unsigned)offset > tracks[track_widx].filesize)
+        offset = 0;
 
     /* Set default values */
     if (start_play)
@@ -1830,17 +1827,17 @@
     case AFMT_MPA_L1:
     case AFMT_MPA_L2:
     case AFMT_MPA_L3:
-        if (adjusted_offset > 0) {
-            file_offset = adjusted_offset;
-            track_id3->offset = adjusted_offset;
+        if (offset > 0) {
+            file_offset = offset;
+            track_id3->offset = offset;
             audio_set_elapsed(track_id3);
         }
         break;
 
     case AFMT_WAVPACK:
         if (offset > 0) {
-            file_offset = adjusted_offset;
-            track_id3->offset = adjusted_offset;
+            file_offset = offset;
+            track_id3->offset = offset;
             track_id3->elapsed = track_id3->length / 2;
         }
         break;
@@ -1853,8 +1850,8 @@
     case AFMT_AAC:
     case AFMT_MPC:
     case AFMT_APE:
-        if (adjusted_offset > 0)
-            track_id3->offset = adjusted_offset;
+        if (offset > 0)
+            track_id3->offset = offset;
         break;
 
     case AFMT_NSF:
@@ -1893,7 +1890,7 @@
     return true;
 }
 
-static void audio_fill_file_buffer(const bool start_play, const size_t offset)
+static void audio_fill_file_buffer(bool start_play, size_t offset)
 {
     struct queue_event ev;
     bool had_next_track = audio_next_track() != NULL;
@@ -2195,7 +2192,7 @@
     memset(&curtrack_id3, 0, sizeof(struct mp3entry));
 }
 
-static void audio_play_start(const size_t offset)
+static void audio_play_start(size_t offset)
 {
     int i;
 
@@ -2288,7 +2285,7 @@
 }
 
 /* Called on manual track skip */
-static void audio_initiate_track_change(const long direction)
+static void audio_initiate_track_change(long direction)
 {
     logf("audio_initiate_track_change(%ld)", direction);
 
@@ -2300,7 +2297,7 @@
 }
 
 /* Called on manual dir skip */
-static void audio_initiate_dir_change(const long direction)
+static void audio_initiate_dir_change(long direction)
 {
     playlist_end = false;
     dir_skip = true;
diff --git a/apps/playback.h b/apps/playback.h
index b65c572..9951cc2 100644
--- a/apps/playback.h
+++ b/apps/playback.h
@@ -38,13 +38,13 @@
 #define MAX_TRACK_MASK  (MAX_TRACK-1)
 
 /* Functions */
-const char *get_codec_filename(const int cod_spec);
+const char *get_codec_filename(int cod_spec);
 void voice_wait(void);
 void audio_wait_for_init(void);
 int audio_track_count(void);
 long audio_filebufused(void);
 void audio_pre_ff_rewind(void);
-void audio_set_crossfade(const int type);
+void audio_set_crossfade(int type);
 
 void audio_hard_stop(void); /* Stops audio from serving playback */
 
@@ -53,7 +53,7 @@
     AUDIO_WANT_PLAYBACK = 0,
     AUDIO_WANT_VOICE,
 };
-bool audio_restore_playback(const int type); /* Restores the audio buffer to handle the requested playback */
+bool audio_restore_playback(int type); /* Restores the audio buffer to handle the requested playback */
 
 #ifdef HAVE_ALBUMART
 int audio_current_aa_hid(void);
diff --git a/apps/plugin.h b/apps/plugin.h
index 148c84a..1753272 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -521,13 +521,13 @@
     int (*playlist_amount)(void);
     int (*playlist_resume)(void);
     int (*playlist_start)(int start_index, int offset);
-    void (*PREFIX(audio_play))(const long offset);
+    void (*PREFIX(audio_play))(long offset);
     void (*audio_stop)(void);
     void (*audio_pause)(void);
     void (*audio_resume)(void);
     void (*audio_next)(void);
     void (*audio_prev)(void);
-    void (*audio_ff_rewind)(const long newtime);
+    void (*audio_ff_rewind)(long newtime);
     struct mp3entry* (*audio_next_track)(void);
     int (*audio_status)(void);
     bool (*audio_has_changed_track)(void);
@@ -570,15 +570,15 @@
     bool (*option_screen)(struct settings_list *setting,
                           bool use_temp_var, unsigned char* option_title);
     bool (*set_option)(const char* string, const void* variable,
-                       const enum optiontype type, const struct opt_items* options,
-                       const int numoptions, void (*function)(int));
+                       enum optiontype type, const struct opt_items* options,
+                       int numoptions, void (*function)(int));
     bool (*set_bool_options)(const char* string, const bool* variable,
-                             const char* yes_str, const int yes_voice,
-                             const char* no_str, const int no_voice,
+                             const char* yes_str, int yes_voice,
+                             const char* no_str, int no_voice,
                              void (*function)(bool));
-    bool (*set_int)(const unsigned char* string, const char* unit, const int voice_unit,
-                    const int* variable, void (*function)(int), const int step, 
-                    const int min, const int max, 
+    bool (*set_int)(const unsigned char* string, const char* unit, int voice_unit,
+                    const int* variable, void (*function)(int), int step, 
+                    int min, int max, 
                     void (*formatter)(char*, size_t, int, const char*) );
     bool (*set_bool)(const char* string, const bool* variable );
 
@@ -684,20 +684,20 @@
 
 #if (CONFIG_CODEC == SWCODEC)
     /* buffering API */
-    int (*bufopen)(const char *file, size_t offset, const enum data_type type);
-    int (*bufalloc)(const void *src, const size_t size, const enum data_type type);
-    bool (*bufclose)(const int handle_id);
-    int (*bufseek)(const int handle_id, const size_t newpos);
-    int (*bufadvance)(const int handle_id, const off_t offset);
-    ssize_t (*bufread)(const int handle_id, size_t size, void *dest);
-    ssize_t (*bufgetdata)(const int handle_id, size_t size, void **data);
-    ssize_t (*bufgettail)(const int handle_id, const size_t size, void **data);
-    ssize_t (*bufcuttail)(const int handle_id, size_t size);
+    int (*bufopen)(const char *file, size_t offset, enum data_type type);
+    int (*bufalloc)(const void *src, size_t size, enum data_type type);
+    bool (*bufclose)(int handle_id);
+    int (*bufseek)(int handle_id, size_t newpos);
+    int (*bufadvance)(int handle_id, off_t offset);
+    ssize_t (*bufread)(int handle_id, size_t size, void *dest);
+    ssize_t (*bufgetdata)(int handle_id, size_t size, void **data);
+    ssize_t (*bufgettail)(int handle_id, size_t size, void **data);
+    ssize_t (*bufcuttail)(int handle_id, size_t size);
 
-    ssize_t (*buf_get_offset)(const int handle_id, void *ptr);
-    ssize_t (*buf_handle_offset)(const int handle_id);
-    void (*buf_request_buffer_handle)(const int handle_id);
-    void (*buf_set_base_handle)(const int handle_id);
+    ssize_t (*buf_get_offset)(int handle_id, void *ptr);
+    ssize_t (*buf_handle_offset)(int handle_id);
+    void (*buf_request_buffer_handle)(int handle_id);
+    void (*buf_set_base_handle)(int handle_id);
     size_t (*buf_used)(void);
 #endif
 
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c
index 7390318..f33d83f 100644
--- a/apps/plugins/test_codec.c
+++ b/apps/plugins/test_codec.c
@@ -197,7 +197,7 @@
 }
 
 /* Null output */
-static bool pcmbuf_insert_null(const void *ch1, const void *ch2, const int count)
+static bool pcmbuf_insert_null(const void *ch1, const void *ch2, int count)
 {
     /* Always successful - just discard data */
     (void)ch1;
@@ -310,7 +310,7 @@
 
 
 /* Set song position in WPS (value in ms). */
-static void set_elapsed(const unsigned int value)
+static void set_elapsed(unsigned int value)
 {
     elapsed = value;
 }
@@ -318,7 +318,7 @@
 
 /* Read next <size> amount bytes from file buffer to <ptr>.
    Will return number of bytes read or 0 if end of file. */
-static size_t read_filebuf(void *ptr, const size_t size)
+static size_t read_filebuf(void *ptr, size_t size)
 {
    if (ci.curpos > (off_t)track.filesize)
    {
@@ -336,7 +336,7 @@
    <realsize> amount of data. <reqsize> tells the buffer system
    how much data it should try to allocate. If <realsize> is 0,
    end of file is reached. */
-static void* request_buffer(size_t *realsize, const size_t reqsize)
+static void* request_buffer(size_t *realsize, size_t reqsize)
 {
     *realsize = MIN(track.filesize-ci.curpos,reqsize);
 
@@ -345,7 +345,7 @@
 
 
 /* Advance file buffer position by <amount> amount of bytes. */
-static void advance_buffer(const size_t amount)
+static void advance_buffer(size_t amount)
 {
     ci.curpos += amount;
 }
@@ -359,7 +359,7 @@
 
 
 /* Seek file buffer to position <newpos> beginning of file. */
-static bool seek_buffer(const size_t newpos)
+static bool seek_buffer(size_t newpos)
 {
     ci.curpos = newpos;
     return true;
@@ -374,7 +374,7 @@
 
 
 /* Calculate mp3 seek position from given time data in ms. */
-static off_t mp3_get_filepos(const int newtime)
+static off_t mp3_get_filepos(int newtime)
 {
     /* We don't ask the codec to seek, so no need to implement this. */
     (void)newtime;
@@ -399,7 +399,7 @@
 }
 
 
-static void set_offset(const size_t value)
+static void set_offset(size_t value)
 {
     /* ??? */
     (void)value;
diff --git a/apps/settings.c b/apps/settings.c
index 6e1aa3e..56d59f4 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -114,7 +114,7 @@
 #define NVRAM_FILE ROCKBOX_DIR "/nvram.bin"
 static char nvram_buffer[NVRAM_BLOCK_SIZE];
 
-static bool read_nvram_data(char* buf, const int max_len)
+static bool read_nvram_data(char* buf, int max_len)
 {
     unsigned crc32 = 0xffffffff;
     int var_count = 0, i = 0, buf_pos = 0;
@@ -164,7 +164,7 @@
     }
     return true;
 }
-static bool write_nvram_data(char* buf, const int max_len)
+static bool write_nvram_data(char* buf, int max_len)
 {
     unsigned crc32 = 0xffffffff;
     int i = 0, buf_pos = 0;
@@ -222,7 +222,7 @@
 /*
  * load settings from disk or RTC RAM
  */
-void settings_load(const int which)
+void settings_load(int which)
 {
     DEBUGF( "reload_all_settings()\n" );
     if (which&SETTINGS_RTC)
@@ -234,7 +234,7 @@
     }
 }
 
-static bool cfg_string_to_int(const int setting_id, int* out, const char* str)
+static bool cfg_string_to_int(int setting_id, int* out, const char* str)
 {
     const char* start = settings[setting_id].cfg_vals;
     char* end = NULL;
@@ -265,7 +265,7 @@
     return false;
 }
 
-bool settings_load_config(const char* file, const bool apply)
+bool settings_load_config(const char* file, bool apply)
 {
     int fd;
     char line[128];
@@ -363,7 +363,7 @@
 
 /** Writing to a config file and saving settings **/
 
-bool cfg_int_to_string(const int setting_id, const int val, char* buf, const int buf_len)
+bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len)
 {
     int flags = settings[setting_id].flags;
     const char* start = settings[setting_id].cfg_vals;
@@ -420,7 +420,7 @@
 }
 
 
-static bool is_changed(const int setting_id)
+static bool is_changed(int setting_id)
 {
     const struct settings_list *setting = &settings[setting_id];
     switch (setting->flags&F_T_MASK)
@@ -454,7 +454,7 @@
     return true;
 }
 
-static bool settings_write_config(const char* filename, const int options)
+static bool settings_write_config(const char* filename, int options)
 {
     int i;
     int fd;
@@ -609,7 +609,7 @@
     return 0;
 }
 
-bool settings_save_config(const int options)
+bool settings_save_config(int options)
 {
     char filename[MAX_PATH];
     char *folder;
@@ -719,7 +719,7 @@
 #endif
 }
 
-void settings_apply(const bool read_disk)
+void settings_apply(bool read_disk)
 {
     char buf[64];
 #if CONFIG_CODEC == SWCODEC
@@ -1009,8 +1009,8 @@
 
 
 bool set_bool_options(const char* string, const bool* variable,
-                      const char* yes_str, const int yes_voice,
-                      const char* no_str, const int no_voice,
+                      const char* yes_str, int yes_voice,
+                      const char* no_str, int no_voice,
                       void (*function)(bool))
 {
     struct opt_items names[] = {
@@ -1026,12 +1026,12 @@
 
 bool set_int(const unsigned char* string,
              const char* unit,
-             const int voice_unit,
+             int voice_unit,
              const int* variable,
              void (*function)(int),
-             const int step,
-             const int min,
-             const int max,
+             int step,
+             int min,
+             int max,
              void (*formatter)(char*, size_t, int, const char*) )
 {
     return set_int_ex(string, unit, voice_unit, variable, function,
@@ -1040,12 +1040,12 @@
 
 bool set_int_ex(const unsigned char* string,
                 const char* unit,
-                const int voice_unit,
+                int voice_unit,
                 const int* variable,
                 void (*function)(int),
-                const int step,
-                const int min,
-                const int max,
+                int step,
+                int min,
+                int max,
                 void (*formatter)(char*, size_t, int, const char*),
                 int32_t (*get_talk_id)(int, int))
 {
@@ -1076,9 +1076,9 @@
     (void)unit;
     return set_option_options[value].voice_id;
 }
-bool set_option(const char* string, const void* variable, const enum optiontype type,
+bool set_option(const char* string, const void* variable, enum optiontype type,
                 const struct opt_items* options, 
-                const int numoptions, void (*function)(int))
+                int numoptions, void (*function)(int))
 {
     int temp;
     struct settings_list item;
@@ -1108,7 +1108,7 @@
 }
 
 
-void set_file(const char* filename, char* setting, const int maxlen)
+void set_file(const char* filename, char* setting, int maxlen)
 {
     char* fptr = strrchr(filename,'/');
     int len;
diff --git a/apps/settings.h b/apps/settings.h
index 3523bca..d3fd068 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -195,8 +195,8 @@
 #define SETTINGS_RTC 1 /* only the settings from the RTC nonvolatile RAM */
 #define SETTINGS_HD  2 /* only the settings from the disk sector */
 #define SETTINGS_ALL 3 /* both */
-void settings_load(const int which);
-bool settings_load_config(const char* file, const bool apply);
+void settings_load(int which);
+bool settings_load_config(const char* file, bool apply);
 
 void status_save(void);
 int settings_save(void);
@@ -213,40 +213,40 @@
     SETTINGS_SAVE_EQPRESET,
 #endif
 };
-bool settings_save_config(const int options);
+bool settings_save_config(int options);
 
 void settings_reset(void);
 void sound_settings_apply(void);
-void settings_apply(const bool read_disk);
+void settings_apply(bool read_disk);
 void settings_apply_pm_range(void);
 void settings_display(void);
 
 enum optiontype { INT, BOOL };
 
 const struct settings_list* find_setting(const void* variable, int *id);
-bool cfg_int_to_string(const int setting_id, const int val, char* buf, const int buf_len);
+bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len);
 bool set_bool_options(const char* string, const bool* variable,
-                      const char* yes_str, const int yes_voice,
-                      const char* no_str, const int no_voice,
+                      const char* yes_str, int yes_voice,
+                      const char* no_str, int no_voice,
                       void (*function)(bool));
 
 bool set_bool(const char* string, const bool* variable);
-bool set_int(const unsigned char* string, const char* unit, const int voice_unit,
+bool set_int(const unsigned char* string, const char* unit, int voice_unit,
              const int* variable,
-             void (*function)(int), const int step, const int min, const int max,
+             void (*function)(int), int step, int min, int max,
              void (*formatter)(char*, size_t, int, const char*) );
 
 /* use this one if you need to create a lang from the value (i.e with TALK_ID()) */
-bool set_int_ex(const unsigned char* string, const char* unit, const int voice_unit,
+bool set_int_ex(const unsigned char* string, const char* unit, int voice_unit,
              const int* variable,
-             void (*function)(int), const int step, const int min, const int max,
+             void (*function)(int), int step, int min, int max,
              void (*formatter)(char*, size_t, int, const char*),
              int32_t (*get_talk_id)(int, int));
 
-void set_file(const char* filename, char* setting, const int maxlen);
+void set_file(const char* filename, char* setting, int maxlen);
 
-bool set_option(const char* string, const void* variable, const enum optiontype type,
-                const struct opt_items* options, const int numoptions, void (*function)(int));
+bool set_option(const char* string, const void* variable, enum optiontype type,
+                const struct opt_items* options, int numoptions, void (*function)(int));
 
 
 
