[commit] r2291 - iOS 5.8b10 fix cusormask (no mask) bug, fix creation/mod file time & timezone issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2291 - iOS 5.8b10 fix cusormask (no mask) bug, fix creation/mod file time & timezone issue

commits-3
 
Author: johnmci
Date: 2010-09-09 11:09:55 -0700 (Thu, 09 Sep 2010)
New Revision: 2291

Modified:
   trunk/platforms/iOS/vm/Common/Classes/sqSqueakMainApplication.m
   trunk/platforms/iOS/vm/OSX/sqSqueakOSXApplication+attributes.m
   trunk/platforms/iOS/vm/OSX/sqSqueakOSXApplication+cursor.m
   trunk/platforms/iOS/vm/SqueakPureObjc-InfoCOG.plist
Log:
iOS 5.8b10  fix cusormask (no mask) bug, fix creation/mod file time & timezone issue

Modified: trunk/platforms/iOS/vm/Common/Classes/sqSqueakMainApplication.m
===================================================================
--- trunk/platforms/iOS/vm/Common/Classes/sqSqueakMainApplication.m 2010-09-09 18:07:54 UTC (rev 2290)
+++ trunk/platforms/iOS/vm/Common/Classes/sqSqueakMainApplication.m 2010-09-09 18:09:55 UTC (rev 2291)
@@ -211,33 +211,19 @@
 
 sqInt convertToSqueakTime(NSDate *givenDate)
 {
- //IM
- NSTimeInterval dateDifference;
- static NSDate *squeakEpoch=NULL;
 
- if (!givenDate)
- return 0;
+ time_t unixTime = [givenDate timeIntervalSince1970];
 
- if (squeakEpoch == NULL) {
- NSDateComponents *comps = [NSDateComponents new];
- NSCalendar *calenderEnglishUSA = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar]; //Use USA english calender versus user choosen china calender
- //NSTimeZone* zone =[NSTimeZone timeZoneForSecondsFromGMT: 0];
- //[calenderEnglishUSA setTimeZone: zone];  THIS appears not to be needed?
- [comps setYear: 1901];
- [comps setMonth: 1];
- [comps setDay: 1];
- [comps setHour: 0];
- [comps setMinute: 0];
- [comps setSecond: 0];
-
- squeakEpoch = [calenderEnglishUSA  dateFromComponents: comps];
- [squeakEpoch retain];
- [comps release];
- [calenderEnglishUSA release];
- }
-
- /* Squeak epoch is Jan 1, 1901.  Unix epoch is Jan 1, 1970 */
- dateDifference = [givenDate timeIntervalSinceDate: squeakEpoch];
- return (sqInt) (usqInt) dateDifference;
-}
-
+#ifdef HAVE_TM_GMTOFF
+ unixTime+= localtime(&unixTime)->tm_gmtoff;
+#else
+# ifdef HAVE_TIMEZONE
+ unixTime+= ((daylight) * 60*60) - timezone;
+# else
+#  error: cannot determine timezone correction
+# endif
+#endif
+ /* Squeak epoch is Jan 1, 1901.  Unix epoch is Jan 1, 1970: 17 leap years
+     and 52 non-leap years later than Squeak. */
+ return unixTime + ((52*365UL + 17*366UL) * 24*60*60UL);
+}
\ No newline at end of file

Modified: trunk/platforms/iOS/vm/OSX/sqSqueakOSXApplication+attributes.m
===================================================================
--- trunk/platforms/iOS/vm/OSX/sqSqueakOSXApplication+attributes.m 2010-09-09 18:07:54 UTC (rev 2290)
+++ trunk/platforms/iOS/vm/OSX/sqSqueakOSXApplication+attributes.m 2010-09-09 18:09:55 UTC (rev 2291)
@@ -83,7 +83,8 @@
 
 #if STACKVM
 
- return "Mac Cocoa Cog 5.8b9 06-Sep-10 >01641B99-1842-4422-A99D-43153BEDEFFA<";
+ return "Mac Cocoa Cog 5.8b10 07-Sep-10 >8AD3A516-DBAC-4CD4-BC89-8F21317DF7E1<";
+// return "Mac Cocoa Cog 5.8b9 06-Sep-10 >01641B99-1842-4422-A99D-43153BEDEFFA<";
 // return "Mac Cocoa Cog 5.8b8 04-Sep-10 >8A66B7E0-B578-4E5F-97B4-6195547A35F5<";
 // return "Mac Cocoa Cog 5.8b7 02-Sep-10 >4EBF00E3-453E-4010-9AC8-6B64C292984B<";
 // return "Mac Cocoa Cog 5.8b6 31-Aug-10 >DFB49E57-40FB-44B9-97D3-B7CA51608429<";

Modified: trunk/platforms/iOS/vm/OSX/sqSqueakOSXApplication+cursor.m
===================================================================
--- trunk/platforms/iOS/vm/OSX/sqSqueakOSXApplication+cursor.m 2010-09-09 18:07:54 UTC (rev 2290)
+++ trunk/platforms/iOS/vm/OSX/sqSqueakOSXApplication+cursor.m 2010-09-09 18:09:55 UTC (rev 2291)
@@ -83,7 +83,12 @@
  unsigned int word= ((unsigned int *)pointerForOop(cursorBitsIndex))[i];
  data[i*2 + 0]= (word >> 24) & 0xFF;
  data[i*2 + 1]= (word >> 16) & 0xFF;
- word= ((unsigned int *)pointerForOop(cursorMaskIndex))[i];
+
+ if (cursorMaskIndex)
+ word= ((unsigned int *)pointerForOop(cursorMaskIndex))[i];
+ else
+ word = 0xFFFFFFFF;
+
  mask[i*2 + 0]= (word >> 24) & 0xFF;
  mask[i*2 + 1]= (word >> 16) & 0xFF;
  }

Modified: trunk/platforms/iOS/vm/SqueakPureObjc-InfoCOG.plist
===================================================================
--- trunk/platforms/iOS/vm/SqueakPureObjc-InfoCOG.plist 2010-09-09 18:07:54 UTC (rev 2290)
+++ trunk/platforms/iOS/vm/SqueakPureObjc-InfoCOG.plist 2010-09-09 18:09:55 UTC (rev 2291)
@@ -350,7 +350,7 @@
  <key>CFBundleExecutable</key>
  <string>${EXECUTABLE_NAME}</string>
  <key>CFBundleGetInfoString</key>
- <string>Squeak VM 5.8b9 http://www.squeak.org</string>
+ <string>Squeak VM 5.8b10 http://www.squeak.org</string>
  <key>CFBundleIconFile</key>
  <string>Squeak.icns</string>
  <key>CFBundleIdentifier</key>
@@ -362,11 +362,11 @@
  <key>CFBundlePackageType</key>
  <string>APPL</string>
  <key>CFBundleShortVersionString</key>
- <string>5.8b9</string>
+ <string>5.8b10</string>
  <key>CFBundleSignature</key>
  <string>FAST</string>
  <key>CFBundleVersion</key>
- <string>27.0</string>
+ <string>28.0</string>
  <key>LSBackgroundOnly</key>
  <false/>
  <key>LSMinimumSystemVersion</key>