Barry Schwartz  committed 0673b2e

Add default-int constructor of ot_longdatetime; add that module to those included in opentype_data_types.

  • Participants
  • Parent commits 216b5ae

Comments (0)

Files changed (2)

File fortran/font/opentype_data_types.F90

   use opentype_bytes
   use opentype_shorts
   use opentype_uint24
+  use opentype_longdatetime
   use opentype_longs
   use opentype_fixed
 end module opentype_data_types
   print *, int(ot_byte(123))
   print *, int(ot_ushort(12345))
   print *, int(ot_uint24(12345678))
+  print *, int(ot_longdatetime(0))
   print *, int(ot_ulong(1234567890))
   print *, real(ot_fixed(12345))
   print *, real(ot_f2dot14(-2))

File fortran/font/opentype_longdatetime.F90

   interface ot_longdatetime
      module procedure ot_longdatetime_of_int
+     module procedure ot_longdatetime_of_default_int
   end interface ot_longdatetime
   interface int
          int(iand(i,255_int64), kind=int8)]
   end function ot_longdatetime_of_int
+  elemental function ot_longdatetime_of_default_int(i_time) result(b)
+    integer, intent(in) :: i_time
+    type(ot_longdatetime) :: b
+    b = ot_longdatetime_of_int(int(i_time, kind=int64))
+  end function ot_longdatetime_of_default_int
   elemental function int_of_ot_longdatetime(b) result(i_time)
     integer(int64) :: i_time
     type(ot_longdatetime), intent(in) :: b