[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[swarm-cvs] [7947] objc runtime abstraction fixes for GNU/Linux
From: |
Scott Christley |
Subject: |
[swarm-cvs] [7947] objc runtime abstraction fixes for GNU/Linux |
Date: |
Tue, 15 Jan 2013 18:33:00 +0000 |
Revision: 7947
http://svn.sv.gnu.org/viewvc/?view=rev&root=swarm&revision=7947
Author: schristley
Date: 2013-01-15 18:33:00 +0000 (Tue, 15 Jan 2013)
Log Message:
-----------
objc runtime abstraction fixes for GNU/Linux
Modified Paths:
--------------
trunk/swarm/src/activity/ActionGroup.m
trunk/swarm/src/activity/ChangeLog
trunk/swarm/src/activity/activity.m
trunk/swarm/src/defobj/ChangeLog
trunk/swarm/src/defobj/Program.m
trunk/swarm/src/defobj/swarm-objc-api.h
trunk/swarm/src/defobj/swarm-objc-gnu.h
trunk/swarm/src/defobj/swarm-objc-gnu.m
Modified: trunk/swarm/src/activity/ActionGroup.m
===================================================================
--- trunk/swarm/src/activity/ActionGroup.m 2013-01-15 18:31:29 UTC (rev
7946)
+++ trunk/swarm/src/activity/ActionGroup.m 2013-01-15 18:33:00 UTC (rev
7947)
@@ -49,7 +49,7 @@
#if SWARM_OBJC_DONE
[(id) self setIndexFromMemberLoc: offsetof (CAction, ownerActions)];
#else
- [(id) self setIndexFromMemberLoc:
ivar_getOffset(class_getInstanceVariable([CAction class], "ownerActions"))];
+ [(id) self setIndexFromMemberLoc:
swarm_ivar_getOffset(swarm_class_getInstanceVariable([CAction class],
"ownerActions"))];
#endif
setNextPhase (self);
setMappedAlloc (self);
@@ -371,7 +371,7 @@
#if SWARM_OBJC_DONE
[(id) self setIndexFromMemberLoc: offsetof (CAction, ownerActions)];
#else
- [(id) self setIndexFromMemberLoc:
ivar_getOffset(class_getInstanceVariable([CAction class], "ownerActions"))];
+ [(id) self setIndexFromMemberLoc:
swarm_ivar_getOffset(swarm_class_getInstanceVariable([CAction class],
"ownerActions"))];
#endif
setMappedAlloc (self);
setNextPhase (self);
Modified: trunk/swarm/src/activity/ChangeLog
===================================================================
--- trunk/swarm/src/activity/ChangeLog 2013-01-15 18:31:29 UTC (rev 7946)
+++ trunk/swarm/src/activity/ChangeLog 2013-01-15 18:33:00 UTC (rev 7947)
@@ -1,9 +1,13 @@
+2013-01-15 Scott Christley <address@hidden>
+
+ * ActionGroup.m, activity.m: Use swarm objc runtime abstraction
functions.
+
2012-3-14 Scott Christley <address@hidden>
- * ActionGroup.m, activity.m: Get correct ivar offset.
-
- * Action.[hm]: Use NSInvocation for OpenStep.
-
+ * ActionGroup.m, activity.m: Get correct ivar offset.
+
+ * Action.[hm]: Use NSInvocation for OpenStep.
+
2009-11-24 Scott Christley <address@hidden>
* activity.h: Use activity directory to include generated file on
Modified: trunk/swarm/src/activity/activity.m
===================================================================
--- trunk/swarm/src/activity/activity.m 2013-01-15 18:31:29 UTC (rev 7946)
+++ trunk/swarm/src/activity/activity.m 2013-01-15 18:33:00 UTC (rev 7947)
@@ -70,7 +70,7 @@
setIndexFromMemberLoc: offsetof (Activity_c, activityRefs)];
#else
[_activity_activityRefsType
- setIndexFromMemberLoc:
ivar_getOffset(class_getInstanceVariable([Activity_c class], "activityRefs"))];
+ setIndexFromMemberLoc:
swarm_ivar_getOffset(swarm_class_getInstanceVariable([Activity_c class],
"activityRefs"))];
#endif
_activity_activityRefsType = [_activity_activityRefsType customizeEnd];
@@ -80,7 +80,7 @@
setIndexFromMemberLoc: offsetof (Activity_c, activitySetRefs)];
#else
[_activity_activitySetRefsType
- setIndexFromMemberLoc:
ivar_getOffset(class_getInstanceVariable([Activity_c class],
"activitySetRefs"))];
+ setIndexFromMemberLoc:
swarm_ivar_getOffset(swarm_class_getInstanceVariable([Activity_c class],
"activitySetRefs"))];
#endif
_activity_activitySetRefsType = [_activity_activitySetRefsType customizeEnd];
Modified: trunk/swarm/src/defobj/ChangeLog
===================================================================
--- trunk/swarm/src/defobj/ChangeLog 2013-01-15 18:31:29 UTC (rev 7946)
+++ trunk/swarm/src/defobj/ChangeLog 2013-01-15 18:33:00 UTC (rev 7947)
@@ -1,23 +1,29 @@
+2013-01-15 Scott Christley <address@hidden>
+
+ * swarm-objc-api.h: Use ObjCBOOL.
+ * swarm-objc-gnu.h: Add swarm_protocol_getName.
+ * swarm-objc-gnu.m: New function swarm_procotocl_copyProtocolList.
+
2012-3-14 Scott Christley <address@hidden>
- * Arguments.m: Use NSInvocation on OpenStep, which requires an
- autorelease pool so memory is leaked during argument parsing.
-
- * swarm-objc-api.h: Add protocol functions.
- * swarm-objc-apple2.h: Likewise.
-
- * swarm-objc-apple.m: Get proper alignment when copying ivar info.
-
- * Program.h: Need to inherit from NSObject for OpenStep.
- * DefClass.h: Likewise.
-
- * Program.m: Copy protocols.
-
- * _fcall.m: Do not use avcall on OpenStep.
-
- * make-h2x: Protocols not constant on 64-bit Mac OSX, so assign
- values at runtime.
+ * Arguments.m: Use NSInvocation on OpenStep, which requires an
+ autorelease pool so memory is leaked during argument parsing.
+ * swarm-objc-api.h: Add protocol functions.
+ * swarm-objc-apple2.h: Likewise.
+
+ * swarm-objc-apple.m: Get proper alignment when copying ivar info.
+
+ * Program.h: Need to inherit from NSObject for OpenStep.
+ * DefClass.h: Likewise.
+
+ * Program.m: Copy protocols.
+
+ * _fcall.m: Do not use avcall on OpenStep.
+
+ * make-h2x: Protocols not constant on 64-bit Mac OSX, so assign
+ values at runtime.
+
2010-04-11 Marcus G. Daniels <address@hidden>
* Arguments.m: Look for signature (swarmconfig.h) in Swarm/.
Modified: trunk/swarm/src/defobj/Program.m
===================================================================
--- trunk/swarm/src/defobj/Program.m 2013-01-15 18:31:29 UTC (rev 7946)
+++ trunk/swarm/src/defobj/Program.m 2013-01-15 18:33:00 UTC (rev 7947)
@@ -326,7 +326,7 @@
type->name = (*(proto_t *) protocol)->name;
#else
type->name = swarm_protocol_getName(*protocol);
- if (type->name) printf("Protocol: %s\n", type->name);
+ //if (type->name) printf("Protocol: %s\n", type->name);
#endif
type->typeID = *typeID;
type->supertypes = *protocol;
@@ -351,7 +351,7 @@
ObjcProtocol **pList = swarm_protocol_copyProtocolList(*protocol,
&outCount);
int i = 0;
for (i = 0; i < outCount; ++i) {
- printf("Protocol list: %s\n", swarm_protocol_getName(pList[i]));
+ //printf("Protocol list: %s\n", swarm_protocol_getName(pList[i]));
if ((strcmp (swarm_protocol_getName(pList[i]), "CREATABLE") == 0)
|| strcmp (swarm_protocol_getName(pList[i]), "RETURNABLE") == 0)
type->implementation = Creating;
Modified: trunk/swarm/src/defobj/swarm-objc-api.h
===================================================================
--- trunk/swarm/src/defobj/swarm-objc-api.h 2013-01-15 18:31:29 UTC (rev
7946)
+++ trunk/swarm/src/defobj/swarm-objc-api.h 2013-01-15 18:33:00 UTC (rev
7947)
@@ -259,7 +259,7 @@
const char *
swarm_protocol_getName (ObjcProtocol *);
-BOOL
+ObjcBOOL
swarm_protocol_isEqual(ObjcProtocol *proto, ObjcProtocol *other);
ObjcProtocol **
Modified: trunk/swarm/src/defobj/swarm-objc-gnu.h
===================================================================
--- trunk/swarm/src/defobj/swarm-objc-gnu.h 2013-01-15 18:31:29 UTC (rev
7946)
+++ trunk/swarm/src/defobj/swarm-objc-gnu.h 2013-01-15 18:33:00 UTC (rev
7947)
@@ -62,3 +62,5 @@
#define swarm_ivar_getName(ivar) (((Ivar_t)ivar)->ivar_name)
#define swarm_ivar_getOffset(ivar) (((Ivar_t)ivar)->ivar_offset)
#define swarm_ivar_getTypeEncoding(ivar) (((Ivar_t)ivar)->ivar_type)
+
+#define swarm_protocol_getName(p) (((Protocol *)p)->protocol_name)
Modified: trunk/swarm/src/defobj/swarm-objc-gnu.m
===================================================================
--- trunk/swarm/src/defobj/swarm-objc-gnu.m 2013-01-15 18:31:29 UTC (rev
7946)
+++ trunk/swarm/src/defobj/swarm-objc-gnu.m 2013-01-15 18:33:00 UTC (rev
7947)
@@ -427,3 +427,35 @@
//
// Working with protocols
//
+Protocol **
+swarm_protocol_copyProtocolList (Protocol *proto, unsigned int *outCount)
+{
+ struct objc_protocol_list *protocols;
+ Protocol **protocolList;
+ int i, j;
+
+ // Get count of all protocols
+ *outCount = 0;
+ protocols = proto->protocol_list;
+ while (protocols != NULL) {
+ *outCount += protocols->count;
+ protocols = protocols->next;
+ }
+
+ // no protocols?
+ if (*outCount == 0) return NULL;
+
+ // Allocate protocol array
+ protocolList = (Protocol **)malloc(*outCount * sizeof(Protocol *));
+ i = 0;
+ protocols = proto->protocol_list;
+ while (protocols != NULL) {
+ for (j = 0; j < protocols->count; ++j) {
+ protocolList[i] = protocols->list[j];
+ ++i;
+ }
+ protocols = protocols->next;
+ }
+
+ return protocolList;
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [swarm-cvs] [7947] objc runtime abstraction fixes for GNU/Linux,
Scott Christley <=