[libbluray-devel] Move print_hex to strutl.c

hpi1 git at videolan.org
Tue Jan 6 15:39:30 CET 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat Jan  3 01:41:02 2015 +0200| [518283250f4bc7a6083e9632e8d58b38ba585e2d] | committer: hpi1

Move print_hex to strutl.c

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=518283250f4bc7a6083e9632e8d58b38ba585e2d
---

 src/libbluray/bdnav/bdid_parse.c |    4 ++--
 src/util/logging.c               |   10 ----------
 src/util/logging.h               |    1 -
 src/util/strutl.c                |   10 ++++++++++
 src/util/strutl.h                |    2 ++
 5 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/libbluray/bdnav/bdid_parse.c b/src/libbluray/bdnav/bdid_parse.c
index 743b30c..549ee94 100644
--- a/src/libbluray/bdnav/bdid_parse.c
+++ b/src/libbluray/bdnav/bdid_parse.c
@@ -80,10 +80,10 @@ static BDID_DATA *_bdid_parse(const char *file_name)
     bs_seek_byte(&bs, 40);
 
     bs_read_bytes(&bs, tmp, 4);
-    print_hex(bdid->org_id, tmp, 4);
+    str_print_hex(bdid->org_id, tmp, 4);
 
     bs_read_bytes(&bs, tmp, 16);
-    print_hex(bdid->disc_id, tmp, 16);
+    str_print_hex(bdid->disc_id, tmp, 16);
 
     file_close(fp);
     return bdid;
diff --git a/src/util/logging.c b/src/util/logging.c
index 2738720..36f781e 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -45,16 +45,6 @@ uint32_t bd_get_debug_mask(void)
     return debug_mask;
 }
 
-char *print_hex(char *out, const uint8_t *buf, int count)
-{
-    int zz;
-    for(zz = 0; zz < count; zz++) {
-        sprintf(out + (zz * 2), "%02x", buf[zz]);
-    }
-
-    return out;
-}
-
 void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...)
 {
     static int   debug_init = 0;
diff --git a/src/util/logging.h b/src/util/logging.h
index 6c68eff..a3590a1 100644
--- a/src/util/logging.h
+++ b/src/util/logging.h
@@ -36,7 +36,6 @@ BD_PRIVATE extern uint32_t debug_mask;
     }                                                   \
   } while (0)
 
-BD_PRIVATE char *print_hex(char *out, const uint8_t *str, int count);
 BD_PRIVATE void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...) BD_ATTR_FORMAT_PRINTF(4,5);
 
 
diff --git a/src/util/strutl.c b/src/util/strutl.c
index ea29067..4e9dc4f 100644
--- a/src/util/strutl.c
+++ b/src/util/strutl.c
@@ -95,3 +95,13 @@ void str_tolower(char *s)
         s++;
     }
 }
+
+char *str_print_hex(char *out, const uint8_t *buf, int count)
+{
+    int zz;
+    for (zz = 0; zz < count; zz++) {
+        sprintf(out + (zz * 2), "%02x", buf[zz]);
+    }
+
+    return out;
+}
diff --git a/src/util/strutl.h b/src/util/strutl.h
index 1e59cd6..b512655 100644
--- a/src/util/strutl.h
+++ b/src/util/strutl.h
@@ -30,4 +30,6 @@ BD_PRIVATE char * str_printf(const char *fmt, ...) BD_ATTR_FORMAT_PRINTF(1,2) BD
 BD_PRIVATE uint32_t str_to_uint32(const char *s, int n);
 BD_PRIVATE void     str_tolower(char *s);
 
+BD_PRIVATE char * str_print_hex(char *out, const uint8_t *str, int count);
+
 #endif // STRUTL_H_



More information about the libbluray-devel mailing list