fix warnings, add toBCD function
[enigma2.git] / lib / dvb / dvbtime.h
index ec47de4611d2bd6ffe0bcf7627cdf62aa3a6c291..c441965279ef577ac3cd32f823bfd272d04d1a61 100644 (file)
@@ -18,6 +18,13 @@ inline int fromBCD(int bcd)
        return ((bcd&0xF0)>>4)*10+(bcd&0xF);
 }
 
+inline int toBCD(int dec)
+{
+       if (dec >= 100)
+               return -1;
+       return int(dec/10)*0x10 + dec%10;
+}
+
 time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5);
 
 class TDT: public eGTable