]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
const-correctify output and where formatting functions
authorPetr Machata <pmachata@redhat.com>
Mon, 2 Feb 2009 16:33:21 +0000 (17:33 +0100)
committerPetr Machata <pmachata@redhat.com>
Mon, 2 Feb 2009 17:02:44 +0000 (18:02 +0100)
src/dwarflint.c
src/dwarflint.h

index 7c3f83e4d30d789e1bce2921ec49cb06453402df..f576fc3a5290fa651ec5a5b718c9768bd64f0bd4 100644 (file)
@@ -125,7 +125,7 @@ check_category (enum message_category cat)
 }
 
 static void
-wr_verror (struct where *wh, const char *format, va_list ap)
+wr_verror (const struct where *wh, const char *format, va_list ap)
 {
   printf ("error: %s", where_fmt (wh, NULL));
   vprintf (format, ap);
@@ -134,7 +134,7 @@ wr_verror (struct where *wh, const char *format, va_list ap)
 }
 
 static void
-wr_vwarning (struct where *wh, const char *format, va_list ap)
+wr_vwarning (const struct where *wh, const char *format, va_list ap)
 {
   printf ("warning: %s", where_fmt (wh, NULL));
   vprintf (format, ap);
@@ -143,7 +143,7 @@ wr_vwarning (struct where *wh, const char *format, va_list ap)
 }
 
 void
-wr_error (struct where *wh, const char *format, ...)
+wr_error (const struct where *wh, const char *format, ...)
 {
   va_list ap;
   va_start (ap, format);
@@ -152,7 +152,7 @@ wr_error (struct where *wh, const char *format, ...)
 }
 
 void
-wr_warning (struct where *wh, const char *format, ...)
+wr_warning (const struct where *wh, const char *format, ...)
 {
   va_list ap;
   va_start (ap, format);
@@ -161,8 +161,8 @@ wr_warning (struct where *wh, const char *format, ...)
 }
 
 void
-wr_message (enum message_category category, struct where *wh,
-            const char *format, ...)
+wr_message (enum message_category category, const struct where *wh,
+           const char *format, ...)
 {
   va_list ap;
   va_start (ap, format);
@@ -540,7 +540,7 @@ static bool check_pub_structural (struct read_ctx *ctx,
 
 
 const char *
-where_fmt (struct where *wh, char *ptr)
+where_fmt (const struct where *wh, char *ptr)
 {
   if (wh == NULL)
     return "";
@@ -647,7 +647,7 @@ where_fmt (struct where *wh, char *ptr)
 }
 
 void
-where_fmt_chain (struct where *wh, const char *severity)
+where_fmt_chain (const struct where *wh, const char *severity)
 {
   if (wh != NULL)
     for (struct where *it = wh->next; it != NULL; it = it->next)
index ee1ced918a465575e7372818fbc2bac6ed66e819..4e2a7ea93cdf4409ef2899c9bda54b464fbc0626 100644 (file)
@@ -45,8 +45,8 @@ extern "C"
   ((struct where)                                                      \
     {(SECTION), (uint64_t)-1, (uint64_t)-1, (uint64_t)-1, NULL, NEXT})
 
-  extern const char *where_fmt (struct where *wh, char *ptr);
-  extern void where_fmt_chain (struct where *wh, const char *severity);
+  extern const char *where_fmt (const struct where *wh, char *ptr);
+  extern void where_fmt_chain (const struct where *wh, const char *severity);
   extern void where_reset_1 (struct where *wh, uint64_t addr);
   extern void where_reset_2 (struct where *wh, uint64_t addr);
   extern void where_reset_3 (struct where *wh, uint64_t addr);
@@ -93,13 +93,13 @@ extern "C"
     mc_all       = 0xffffff00, // all areas
   };
 
-  extern void wr_error (struct where *wh, const char *format, ...)
+  extern void wr_error (const struct where *wh, const char *format, ...)
     __attribute__ ((format (printf, 2, 3)));
 
-  extern void wr_warning (struct where *wh, const char *format, ...)
+  extern void wr_warning (const struct where *wh, const char *format, ...)
     __attribute__ ((format (printf, 2, 3)));
 
-  extern void wr_message (enum message_category category, struct where *wh,
+  extern void wr_message (enum message_category category, const struct where *wh,
                          const char *format, ...)
     __attribute__ ((format (printf, 3, 4)));