Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#12088 - Reduce warnings ('set but not used')

Attached to Project: Rockbox
Opened by Andree Buschmann (Buschel) - Saturday, 30 April 2011, 16:11 GMT+2
Last edited by Andree Buschmann (Buschel) - Tuesday, 03 May 2011, 22:30 GMT+2
Task Type Patches
Category Build environment
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Release 3.8.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

When using "-Wunused-but-set-variable" there occur several warnings when building rockbox. This patch resolves the most of them.

Please review and give feedback -- especially to the change to ffmpeg_get_bits.h as this gives the most overall warnings.
   reduce_warnings_v01.patch (11.3 KiB)
 apps/recorder/bmp.c                    |    4 ----
 apps/plugins/pictureflow/pictureflow.c |    3 +--
 apps/gui/quickscreen.c                 |    2 --
 apps/codecs/aiff.c                     |    5 ++++-
 apps/codecs/libasf/asf.c               |   24 ++++++++++++------------
 apps/codecs/speex.c                    |    4 ++--
 apps/codecs/lib/ffmpeg_get_bits.h      |    2 +-
 apps/codecs/libwma/wmadeci.c           |    3 +--
 apps/codecs/wmapro.c                   |    6 +++---
 apps/codecs/sid.c                      |    5 +----
 apps/codecs/libspeex/nb_celp.c         |   15 ++++++++-------
 apps/codecs/libspeex/cb_search.c       |    4 ++--
 12 files changed, 35 insertions(+), 42 deletions(-)

This task depends upon

Closed by  Andree Buschmann (Buschel)
Tuesday, 03 May 2011, 22:30 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  Submitted in several changes.
Comment by Bertrik Sikken (bertrik) - Saturday, 30 April 2011, 16:46 GMT+2
We don't really have to cast function return value to void when not using them, do we?
Also, not using // would be nice :)
Comment by Andree Buschmann (Buschel) - Saturday, 30 April 2011, 19:29 GMT+2
You are of course right for the //'s. That casting to void was intentional, as I like to use this to show that there is a return value that is intentionally not used (maybe an outcome of using Lint for several years). Nevertheless I removed it was well... I am not insisting on it ;)
   reduce_warnings_v02.patch (11.1 KiB)
 apps/recorder/bmp.c                    |    4 ----
 apps/plugins/pictureflow/pictureflow.c |    3 +--
 apps/gui/quickscreen.c                 |    2 --
 apps/codecs/aiff.c                     |    5 +++++
 apps/codecs/libasf/asf.c               |   18 ++++++++++++------
 apps/codecs/speex.c                    |    4 ++--
 apps/codecs/lib/ffmpeg_get_bits.h      |    2 +-
 apps/codecs/libwma/wmadeci.c           |    3 +--
 apps/codecs/wmapro.c                   |    5 -----
 apps/codecs/sid.c                      |    5 +----
 apps/codecs/libspeex/nb_celp.c         |   15 +++++++++------
 apps/codecs/libspeex/cb_search.c       |    3 +--
 12 files changed, 33 insertions(+), 36 deletions(-)

Comment by Andree Buschmann (Buschel) - Saturday, 30 April 2011, 22:51 GMT+2
I removed the change to codecs/lib/ffmpeg_get_bits.h.
   reduce_warnings_v03.patch (10.7 KiB)
 apps/recorder/bmp.c                    |    4 ----
 apps/plugins/pictureflow/pictureflow.c |    3 +--
 apps/gui/quickscreen.c                 |    2 --
 apps/codecs/aiff.c                     |    5 +++++
 apps/codecs/libasf/asf.c               |   18 ++++++++++++------
 apps/codecs/speex.c                    |    4 ++--
 apps/codecs/libwma/wmadeci.c           |    3 +--
 apps/codecs/wmapro.c                   |    5 -----
 apps/codecs/sid.c                      |    5 +----
 apps/codecs/libspeex/nb_celp.c         |   15 +++++++++------
 apps/codecs/libspeex/cb_search.c       |    3 +--
 11 files changed, 32 insertions(+), 35 deletions(-)

Comment by Andree Buschmann (Buschel) - Sunday, 01 May 2011, 12:01 GMT+2
Resync against svn.
   reduce_warnings_v04.patch (10.8 KiB)
 apps/recorder/bmp.c                    |    4 ----
 apps/plugins/pictureflow/pictureflow.c |    3 +--
 apps/gui/quickscreen.c                 |    2 --
 apps/codecs/aiff.c                     |    5 +++++
 apps/codecs/libasf/asf.c               |   18 ++++++++++++------
 apps/codecs/speex.c                    |    4 +++-
 apps/codecs/libwma/wmadeci.c           |    3 +--
 apps/codecs/wmapro.c                   |    7 +------
 apps/codecs/sid.c                      |    5 +----
 apps/codecs/libspeex/nb_celp.c         |   15 +++++++++------
 apps/codecs/libspeex/cb_search.c       |    3 +--
 11 files changed, 34 insertions(+), 35 deletions(-)

Comment by Andree Buschmann (Buschel) - Sunday, 01 May 2011, 13:49 GMT+2
v05 was submitted with r29805.
   reduce_warnings_v05.patch (11.8 KiB)
 apps/recorder/bmp.c                    |    4 ----
 apps/plugins/pictureflow/pictureflow.c |    3 +--
 apps/gui/quickscreen.c                 |    2 --
 apps/codecs/aiff.c                     |    5 +++++
 apps/codecs/libasf/asf.c               |   20 ++++++++++++--------
 apps/codecs/speex.c                    |    4 +++-
 apps/codecs/libwma/wmadeci.c           |    3 +--
 apps/codecs/wmapro.c                   |    7 +------
 apps/codecs/sid.c                      |    5 +----
 apps/codecs/libspeex/nb_celp.c         |   15 ++++++---------
 apps/codecs/libspeex/cb_search.c       |    3 +--
 apps/codecs/wavpack.c                  |    7 +++++--
 12 files changed, 36 insertions(+), 42 deletions(-)

Comment by Andree Buschmann (Buschel) - Sunday, 01 May 2011, 15:53 GMT+2
Next submit with r29809.
   reduce_warnings_v06.patch (38.5 KiB)
 apps/metadata/rm.c                         |    2 
 apps/plugins/mp3_encoder.c                 |    6 
 apps/plugins/plasma.c                      |    5 
 apps/plugins/chessbox/chessbox.c           |    3 
 apps/plugins/frotz/fastmem.c               |  612 ++++++++++++++---------------
 apps/plugins/pitch_detector.c              |    4 
 apps/plugins/keybox.c                      |    3 
 apps/plugins/zxbox/zxbox_keyb.c            |   22 -
 apps/plugins/star.c                        |    4 
 apps/plugins/imageviewer/png/png_decoder.c |    3 
 apps/plugins/sokoban.c                     |    4 
 apps/plugins/lrcplayer.c                   |    2 
 apps/plugins/chopper.c                     |    7 
 apps/plugins/bubbles.c                     |    3 
 apps/gui/option_select.c                   |   13 
 apps/codecs/raac.c                         |    3 
 lib/skin_parser/skin_parser.c              |    3 
 17 files changed, 344 insertions(+), 355 deletions(-)

Comment by Andree Buschmann (Buschel) - Sunday, 01 May 2011, 16:31 GMT+2
Should fix nearly all residual warnings -- except the one from the ffmpeg code.

Edit: Submitted after slight modifications with r29810.
   reduce_warnings_v07.patch (8.1 KiB)
 apps/plugins/sliding_puzzle.c          |    4 ++++
 apps/plugins/flipit.c                  |    6 ++++++
 apps/plugins/chessbox/chessbox.c       |    7 ++++++-
 apps/plugins/oscilloscope.c            |    6 +++++-
 apps/plugins/cube.c                    |    8 ++++++++
 apps/plugins/fractals/fractal.c        |   11 ++++++++++-
 apps/plugins/text_viewer/text_viewer.c |    4 ++++
 apps/plugins/rockblox.c                |    4 ++++
 apps/plugins/star.c                    |    8 ++++++++
 apps/plugins/vu_meter.c                |    4 ++++
 apps/codecs/libwmapro/wmaprodec.c      |    2 +-
 11 files changed, 60 insertions(+), 4 deletions(-)

Loading...