mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-04-26 14:46:38 +00:00
2004-02-06 Mike Kestner <mkestner@ximian.com>
* glib/time_t_CustomMarshaler.cs : use TimeSpan.TotalSeconds, not TimeSpan.Seconds. svn path=/trunk/gtk-sharp/; revision=22842
This commit is contained in:
parent
0fb19cdc37
commit
cbd7afb761
|
@ -1,3 +1,8 @@
|
||||||
|
2004-02-06 Mike Kestner <mkestner@ximian.com>
|
||||||
|
|
||||||
|
* glib/time_t_CustomMarshaler.cs : use TimeSpan.TotalSeconds, not
|
||||||
|
TimeSpan.Seconds.
|
||||||
|
|
||||||
2004-02-06 John Luke <jluke@cfl.rr.com>
|
2004-02-06 John Luke <jluke@cfl.rr.com>
|
||||||
|
|
||||||
* gtk/Gtk.metadata: hide unneeded RadioMenuItem ctors
|
* gtk/Gtk.metadata: hide unneeded RadioMenuItem ctors
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace GLib {
|
||||||
|
|
||||||
private time_t_CustomMarshaler ()
|
private time_t_CustomMarshaler ()
|
||||||
{
|
{
|
||||||
utc_offset = DateTime.Now.Subtract (DateTime.UtcNow).Seconds;
|
utc_offset = (int) DateTime.Now.Subtract (DateTime.UtcNow).TotalSeconds;
|
||||||
local_epoch = new DateTime (1970, 1, 1, 0, 0, 0);
|
local_epoch = new DateTime (1970, 1, 1, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ namespace GLib {
|
||||||
int size = Marshal.SizeOf (typeof (int)) + GetNativeDataSize ();
|
int size = Marshal.SizeOf (typeof (int)) + GetNativeDataSize ();
|
||||||
IntPtr ptr = Marshal.AllocCoTaskMem (size);
|
IntPtr ptr = Marshal.AllocCoTaskMem (size);
|
||||||
IntPtr time_t_ptr = new IntPtr (ptr.ToInt32 () + Marshal.SizeOf (typeof(int)));
|
IntPtr time_t_ptr = new IntPtr (ptr.ToInt32 () + Marshal.SizeOf (typeof(int)));
|
||||||
int secs = dt.Subtract (local_epoch).Seconds + utc_offset;
|
int secs = ((int)dt.Subtract (local_epoch).TotalSeconds) + utc_offset;
|
||||||
if (GetNativeDataSize () == 4)
|
if (GetNativeDataSize () == 4)
|
||||||
Marshal.WriteInt32 (time_t_ptr, secs);
|
Marshal.WriteInt32 (time_t_ptr, secs);
|
||||||
else if (GetNativeDataSize () == 8)
|
else if (GetNativeDataSize () == 8)
|
||||||
|
|
Loading…
Reference in a new issue