[57755] users/toby/objcports

toby at macports.org toby at macports.org
Tue Sep 15 23:25:29 PDT 2009


Revision: 57755
          http://trac.macports.org/changeset/57755
Author:   toby at macports.org
Date:     2009-09-15 23:25:25 -0700 (Tue, 15 Sep 2009)
Log Message:
-----------
misc

Modified Paths:
--------------
    users/toby/objcports/MPIndex.c
    users/toby/objcports/MPPort.c
    users/toby/objcports/variables.plist

Property Changed:
----------------
    users/toby/objcports/variables.plist

Modified: users/toby/objcports/MPIndex.c
===================================================================
--- users/toby/objcports/MPIndex.c	2009-09-16 05:53:34 UTC (rev 57754)
+++ users/toby/objcports/MPIndex.c	2009-09-16 06:25:25 UTC (rev 57755)
@@ -22,10 +22,11 @@
 	free(fn);
 	Tcl_RegisterChannel(interp, chan);
 
-	while (1) {
+	for (;;) {
 		int objc;
 		Tcl_Obj **objv;
-		const void *key, *value;
+		CFStringRef key;
+		CFDictionaryRef value;
 		CFArrayRef info;
 		Tcl_Obj *line;
 		int len;

Modified: users/toby/objcports/MPPort.c
===================================================================
--- users/toby/objcports/MPPort.c	2009-09-16 05:53:34 UTC (rev 57754)
+++ users/toby/objcports/MPPort.c	2009-09-16 06:25:25 UTC (rev 57755)
@@ -79,13 +79,28 @@
 	CFRelease(arraydict);
 }
 
+static CFMutableDictionaryRef
+_copy_variable_info(void)
+{
+	char *sectdata;
+	unsigned long sectsize;
+	CFDataRef data;
+	CFMutableDictionaryRef result;
+
+	sectdata = getsectdata("MacPorts", "variables", &sectsize);
+	assert(sectdata);
+
+	data = CFDataCreateWithBytesNoCopy(NULL, (UInt8 *)sectdata, sectsize, kCFAllocatorNull);
+	result = (CFMutableDictionaryRef)CFPropertyListCreateWithData(NULL, data, kCFPropertyListMutableContainersAndLeaves, NULL, NULL);
+	CFRelease(data);
+
+	return result;
+}
+
 mp_port_t
 mp_port_create(CFURLRef url, CFDictionaryRef options)
 {
 	mp_port_t port;
-	char *sectdata;
-	unsigned long sectsize;
-	CFDataRef vdata;
 
 	port = calloc(1, sizeof(struct mp_port_s));
 
@@ -96,11 +111,7 @@
 
 	port->_variables = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
 
-	sectdata = getsectdata("MacPorts", "variables", &sectsize);
-	assert(sectdata);
-	vdata = CFDataCreateWithBytesNoCopy(NULL, (UInt8 *)sectdata, sectsize, kCFAllocatorNull);
-	port->_variableInfo = (CFMutableDictionaryRef)CFPropertyListCreateWithData(NULL, vdata, kCFPropertyListMutableContainersAndLeaves, NULL, NULL);
-	CFRelease(vdata);
+	port->_variableInfo = _copy_variable_info();
 
 	add_command_var(port->_variableInfo, CFSTR("cvs")); // portfetch.tcl
 	add_command_var(port->_variableInfo, CFSTR("svn")); // portfetch.tcl

Modified: users/toby/objcports/variables.plist
===================================================================
(Binary files differ)


Property changes on: users/toby/objcports/variables.plist
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090915/4c0c26ee/attachment.html>


More information about the macports-changes mailing list