D15314: Fix warnings in fitsviewer code in fpack and fpackutil due to const qualifier and unused variables

Thomas Stibor noreply at phabricator.kde.org
Thu Sep 6 13:49:09 BST 2018


tstibor created this revision.
tstibor added reviewers: mutlaqja, lancaster.
Herald added a project: KDE Edu.
Herald added a subscriber: kde-edu.
tstibor requested review of this revision.

REVISION SUMMARY
  Fix tons of warning such as:
  
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpack.c: In function ‘fp_get_param’:
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpack.c:39:21: warning: passing argument 1 of ‘fp_msg’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  
    fp_msg ("Error: internal initialization error\n"); exit (-1);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  In file included from /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpack.c:10:0:
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpack.h:188:5: note: expected ‘char *’ but argument is of type ‘const char *’
   int fp_msg (char *msg);
  
    ^~~~~~
  
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpack.c:59:12: warning: passing argument 1 of ‘fp_msg’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  
    fp_msg ("Error: multiple compression flags\n");
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  In file included from /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpack.c:10:0:
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpack.h:188:5: note: expected ‘char *’ but argument is of type ‘const char *’
   int fp_msg (char *msg);
  
    ^~~~~~
  
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpack.c:67:12: warning: passing argument 1 of ‘fp_msg’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  
    fp_msg ("Error: multiple compression flags\n");
  
  ...
  ....
  and
  
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpackutil.c:722:13: warning: passing argument 1 of ‘fp_tmpnam’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  
    fp_tmpnam("Tmp1", infits, outfits);
              ^~~~~~
  
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpackutil.c:123:5: note: expected ‘char *’ but argument is of type ‘const char *’
   int fp_tmpnam(char *suffix, char *rootname, char *tmpnam)
  
    ^~~~~~~~~
  
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpackutil.c:737:13: warning: passing argument 1 of ‘fp_tmpnam’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  
    fp_tmpnam("Tmpfile1", "", tempfilename);
  
  ...
  ...
  and
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpackutil.c: In function ‘fp_test_table’:
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpackutil.c:1913:67: warning: unused parameter ‘outfptr2’ [-Wunused-parameter]
   int fp_test_table (fitsfile *infptr, fitsfile *outfptr, fitsfile *outfptr2,
  
    ^~~~~~~~
  
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpackutil.c:1914:10: warning: unused parameter ‘fpvar’ [-Wunused-parameter]
  
    fpstate fpvar, int *status)
            ^~~~~
  
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpackutil.c: In function ‘abort_fpack’:
  /home/tstibor/dev/astronomy/kstars/kstars/fitsviewer/fpackutil.c:2367:22: warning: unused parameter ‘sig’ [-Wunused-parameter]
   void abort_fpack(int sig)

REPOSITORY
  R321 KStars

REVISION DETAIL
  https://phabricator.kde.org/D15314

AFFECTED FILES
  kstars/fitsviewer/fpack.c
  kstars/fitsviewer/fpack.h
  kstars/fitsviewer/fpackutil.c

To: tstibor, mutlaqja, lancaster
Cc: kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20180906/b134646c/attachment.html>


More information about the kde-edu mailing list