[vlc-commits] cdrom.h: use static inline instead of macros

Jean-Baptiste Kempf git at videolan.org
Fri Jan 2 14:51:48 CET 2015


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jan  2 14:51:01 2015 +0100| [6b5ea5623160161695580c0b38b408753dbc809c] | committer: Jean-Baptiste Kempf

cdrom.h: use static inline instead of macros

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6b5ea5623160161695580c0b38b408753dbc809c
---

 modules/access/vcd/cdrom.h |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/access/vcd/cdrom.h b/modules/access/vcd/cdrom.h
index 0e9e342..4278e24 100644
--- a/modules/access/vcd/cdrom.h
+++ b/modules/access/vcd/cdrom.h
@@ -60,10 +60,15 @@ enum {
 /*****************************************************************************
  * Misc. Macros
  *****************************************************************************/
-/* LBA = msf.frame + 75 * ( msf.second + 60 * msf.minute ) */
-#define MSF_TO_LBA(min, sec, frame) ((int)frame + 75 * (sec + 60 * min))
-/* LBA = msf.frame + 75 * ( msf.second - 2 + 60 * msf.minute ) */
-#define MSF_TO_LBA2(min, sec, frame) ((int)frame + 75 * (sec -2 + 60 * min))
+static inline int MSF_TO_LBA(uint8_t min, uint8_t sec, uint8_t frame)
+{
+    return (int)(frame + 75 * (sec + 60 * min));
+}
+static inline int MSF_TO_LBA2(uint8_t min, uint8_t sec, uint8_t frame)
+{
+    return (int)(frame + 75 * (sec -2 + 60 * min));
+}
+
 /* Converts BCD to Binary data */
 #define BCD_TO_BIN(i) \
     (uint8_t)((uint8_t)(0xf & (uint8_t)i)+((uint8_t)10*((uint8_t)i >> 4)))



More information about the vlc-commits mailing list