gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master d5e397cc: Library (jpeg.h and tiff.h): address


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master d5e397cc: Library (jpeg.h and tiff.h): addressed compiler warning for const
Date: Sun, 22 May 2022 08:43:45 -0400 (EDT)

branch: master
commit d5e397cc8a13901210174730f6738c43d4ae3fd4
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Library (jpeg.h and tiff.h): addressed compiler warning for const
    
    Until now, when the host operating system didn't have the JPEG or TIFF
    libraries, during the 'make' phase, we would see compiler warnings saying
    that a 'const' is missing in the 'jpeg_error_no_libjpeg' and
    'tiff_error_no_litiff' functions. This happened because we were passing the
    caller function's name to them (through '__func__'). However, '__func__' is
    a constant string defined at compile time, so to be clean (and avoid
    warnings), its better to put a 'const' before its definition.
    
    With this commit, a 'const' qualifier has been placed before the argument
    definition in these two functions and this removed the compiler warning.
    
    This issue was found with the help of Jeremy Lim.
---
 THANKS                       | 1 +
 doc/announce-acknowledge.txt | 1 +
 lib/jpeg.c                   | 2 +-
 lib/tiff.c                   | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/THANKS b/THANKS
index 42d4fc0e..899501f7 100644
--- a/THANKS
+++ b/THANKS
@@ -76,6 +76,7 @@ support in Gnuastro. The list is ordered alphabetically (by 
family name).
     Floriane Leclercq                    floriane.leclercq@univ-lyon1.fr
     Alan Lefor                           alefor@astr.tohoku.ac.jp
     Javier Licandro                      jlicandr@iac.es
+    Jeremy Lim                           jjlim@hku.hk
     Alejandro Lumbreras Calle            alumbreras@cefca.es
     Sebastián Luna Valero                sluna@iaa.es
     Alberto Madrigal                     brt.madrigal@gmail.com
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index befb0246..c07f0795 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -5,6 +5,7 @@ Faezeh Bijarchian
 Sepideh Eskandarlou
 Sílvia Farras
 Teet Kuutma
+Jeremy Lim
 Juan Miro
 Irene Pintos Castro
 Ignacio Ruiz Cejudo
diff --git a/lib/jpeg.c b/lib/jpeg.c
index 9dc9a2e5..4d7d91f3 100644
--- a/lib/jpeg.c
+++ b/lib/jpeg.c
@@ -74,7 +74,7 @@ jpeg_error_exit(j_common_ptr cinfo)
 #else
 
 static void
-jpeg_error_no_libjpeg(char *func)
+jpeg_error_no_libjpeg(const char *func)
 {
   error(EXIT_FAILURE, 0, "%s: libjpeg was not found during the "
         "configuration of %s on this system. To read from JPEG files, "
diff --git a/lib/tiff.c b/lib/tiff.c
index 3fb55994..44f4d3a9 100644
--- a/lib/tiff.c
+++ b/lib/tiff.c
@@ -50,7 +50,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
  *************************************************************/
 #ifndef HAVE_LIBTIFF
 static void
-tiff_error_no_litiff(char *func)
+tiff_error_no_litiff(const char *func)
 {
   error(EXIT_FAILURE, 0, "%s: libtiff was not found during the "
         "configuration of %s on this system. To read from TIFF files, "



reply via email to

[Prev in Thread] Current Thread [Next in Thread]