[libav-commits] avformat: const correctness for av_hex_dump / av_hex_dump_log

Diego Biurrun git at libav.org
Mon Oct 1 13:31:13 CEST 2012


Module: libav
Branch: master
Commit: d3c40a7d1d9e4a90edec540a6acfe060dc829273

Author:    Diego Biurrun <diego at biurrun.de>
Committer: Diego Biurrun <diego at biurrun.de>
Date:      Mon Oct  1 12:48:23 2012 +0200

avformat: const correctness for av_hex_dump / av_hex_dump_log

---

 libavformat/avformat.h |    4 ++--
 libavformat/utils.c    |    7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 134a38b..f9f39a6 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1539,7 +1539,7 @@ enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
  *
  * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
  */
-void av_hex_dump(FILE *f, uint8_t *buf, int size);
+void av_hex_dump(FILE *f, const uint8_t *buf, int size);
 
 /**
  * Send a nice hexadecimal dump of a buffer to the log.
@@ -1553,7 +1553,7 @@ void av_hex_dump(FILE *f, uint8_t *buf, int size);
  *
  * @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2
  */
-void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size);
+void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size);
 
 /**
  * Send a nice dump of a packet to the specified file stream.
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 2682e97..32cf580 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3566,7 +3566,8 @@ int av_get_frame_filename(char *buf, int buf_size,
     return -1;
 }
 
-static void hex_dump_internal(void *avcl, FILE *f, int level, uint8_t *buf, int size)
+static void hex_dump_internal(void *avcl, FILE *f, int level,
+                              const uint8_t *buf, int size)
 {
     int len, i, j, c;
 #undef fprintf
@@ -3595,12 +3596,12 @@ static void hex_dump_internal(void *avcl, FILE *f, int level, uint8_t *buf, int
 #undef PRINT
 }
 
-void av_hex_dump(FILE *f, uint8_t *buf, int size)
+void av_hex_dump(FILE *f, const uint8_t *buf, int size)
 {
     hex_dump_internal(NULL, f, 0, buf, size);
 }
 
-void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size)
+void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
 {
     hex_dump_internal(avcl, NULL, level, buf, size);
 }



More information about the libav-commits mailing list