[Vm-dev] [commit] r2595 - compute gmt offset when tm_gmtoff is not
available
commits at squeakvm.org
commits at squeakvm.org
Thu Sep 13 11:23:04 UTC 2012
Author: piumarta
Date: 2012-09-13 04:23:03 -0700 (Thu, 13 Sep 2012)
New Revision: 2595
Modified:
trunk/platforms/unix/ChangeLog
trunk/platforms/unix/vm-sound-Sun/sqUnixSoundSun.c
trunk/platforms/unix/vm/sqUnixMain.c
Log:
compute gmt offset when tm_gmtoff is not available
Modified: trunk/platforms/unix/ChangeLog
===================================================================
--- trunk/platforms/unix/ChangeLog 2012-09-13 00:26:33 UTC (rev 2594)
+++ trunk/platforms/unix/ChangeLog 2012-09-13 11:23:03 UTC (rev 2595)
@@ -1,3 +1,11 @@
+2012-09-14 Ian Piumarta <com -dot- gmail -at- piumarta (backwards)>
+
+ * vm/sqUnixMain.c (sqUnixUtcWithOffset): Compute gmt offset from
+ gmtime - localtime when tm_gmtoff not available.
+
+ * vm-sound-Sun/sqUnixSoundSun.c (sound_InsertSamplesFromLeadTime):
+ Fix typo in prototype: sqint -> sqInt.
+
2012-09-12 Ian Piumarta <com -dot- gmail -at- piumarta (backwards)>
* cmake/configure: Check for platforms/.svn because
Modified: trunk/platforms/unix/vm/sqUnixMain.c
===================================================================
--- trunk/platforms/unix/vm/sqUnixMain.c 2012-09-13 00:26:33 UTC (rev 2594)
+++ trunk/platforms/unix/vm/sqUnixMain.c 2012-09-13 11:23:03 UTC (rev 2595)
@@ -27,7 +27,7 @@
/* Author: Ian Piumarta <ian.piumarta at squeakland.org>
*
- * Last edited: 2011-01-24 10:31:12 by piumarta on emilia.local
+ * Last edited: 2012-09-14 05:15:14 by piumarta on solaris11x86
*/
#include "sq.h"
@@ -218,7 +218,18 @@
time_t seconds= timeval.tv_sec;
suseconds_t usec= timeval.tv_usec;
*microSeconds= seconds * 1000000 + usec;
+#if defined(HAVE_TM_GMTOFF)
*offset= localtime(&seconds)->tm_gmtoff;
+#else
+ {
+ struct tm *local= localtime(&seconds);
+ struct tm *gmt= gmtime(&seconds);
+ int d= local->tm_yday - gmt->tm_yday;
+ int h= ((d < -1 ? 24 : 1 < d ? -24 : d * 24) + local->tm_hour - gmt->tm_hour);
+ int m= h * 60 + local->tm_min - gmt->tm_min;
+ *offset= m * 60;
+ }
+#endif
return 0;
}
Modified: trunk/platforms/unix/vm-sound-Sun/sqUnixSoundSun.c
===================================================================
--- trunk/platforms/unix/vm-sound-Sun/sqUnixSoundSun.c 2012-09-13 00:26:33 UTC (rev 2594)
+++ trunk/platforms/unix/vm-sound-Sun/sqUnixSoundSun.c 2012-09-13 11:23:03 UTC (rev 2595)
@@ -263,8 +263,7 @@
}
-static sqInt sound_InsertSamplesFromLeadTime(sqint frameCount, void *srcBufPtr,
- sqInt samplesOfLeadTime)
+static sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, void *srcBufPtr, sqInt samplesOfLeadTime)
{
PRINTF(("(frameCount=%d, srcBufPtr=%d, samplesOfLeadTime=%d)",
frameCount, srcBufPtr, samplesOfLeadTime));
More information about the Vm-dev
mailing list