From owner-freebsd-current Tue Oct 29 20: 2:27 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 77D3437B47E for ; Tue, 29 Oct 2002 20:02:22 -0800 (PST) Received: from newton.issci.ca (mail.acns.ab.ca [142.179.151.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id C25B843E42 for ; Tue, 29 Oct 2002 20:02:21 -0800 (PST) (envelope-from davidc@newton.issci.ca) Received: from newton.issci.ca (localhost [127.0.0.1]) by newton.issci.ca (8.12.6/8.12.5) with ESMTP id g9U42G6Y045730 for ; Tue, 29 Oct 2002 21:02:16 -0700 (MST) (envelope-from davidc@newton.issci.ca) Received: (from davidc@localhost) by newton.issci.ca (8.12.6/8.12.6/Submit) id g9U42GUU045729 for freebsd-current@freebsd.org; Tue, 29 Oct 2002 21:02:16 -0700 (MST) Date: Tue, 29 Oct 2002 21:02:16 -0700 From: Chad David To: freebsd-current@freebsd.org Subject: Re: Objective-C threads Message-ID: <20021029210216.A45337@newton.issci.ca> Mail-Followup-To: freebsd-current@freebsd.org References: <20021029190941.A43525@newton.issci.ca> <20021030031156.GA76120@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ZPt4rx8FFjLCG7dd" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20021030031156.GA76120@dragon.nuxi.com>; from obrien@freebsd.org on Tue, Oct 29, 2002 at 07:11:56PM -0800 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Oct 29, 2002 at 07:11:56PM -0800, David O'Brien wrote: > On Tue, Oct 29, 2002 at 07:09:41PM -0700, Chad David wrote: > > Does anybody know if there is a good reason why libobjc is built with > > thr-single.c? As well, who is the current maintainer of Objective-C? > > Few of us have ObjC clue. Do you have a patch that makes things better > that you can explain to us? To start with I have a few changes to hash.h, objc-list.h and thr.h that allow my code to even compile (without warnings) with I have attached. I believe they are all pretty obvious, except for the change to compare_ptrs(), which I'm not totally sure about... I have additional updates to the threading, but I'm not quite finished going through it all yet. -- Chad David davidc@issci.ca www.FreeBSD.org davidc@freebsd.org ISSci Inc. Calgary, Alberta Canada --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="objc.patch" diff -ud ./hash.h /usr/include/objc/hash.h --- ./hash.h Thu May 9 16:50:04 2002 +++ /usr/include/objc/hash.h Wed Oct 23 17:13:23 2002 @@ -174,8 +174,8 @@ unsigned int ctr = 0; - while (*(char*)key) { - ret ^= *(char*)key++ << ctr; + while (*(const char*)key) { + ret ^= *((const char*)key)++ << ctr; ctr = (ctr + 1) % sizeof (void *); } @@ -187,7 +187,7 @@ static inline int compare_ptrs (const void *k1, const void *k2) { - return !(k1 - k2); + return (k1 == k2); } diff -ud ./objc-list.h /usr/include/objc/objc-list.h --- ./objc-list.h Wed Mar 29 20:23:36 2000 +++ /usr/include/objc/objc-list.h Wed Oct 23 17:14:21 2002 @@ -64,9 +64,9 @@ larger than the list length, NULL is returned */ static inline void* -list_nth(int index, struct objc_list* list) +list_nth(int indx, struct objc_list* list) { - while(index-- != 0) + while(indx-- != 0) { if(list->tail) list = list->tail; diff -ud ./thr.h /usr/include/objc/thr.h --- ./thr.h Thu May 9 16:50:04 2002 +++ /usr/include/objc/thr.h Wed Oct 23 17:13:47 2002 @@ -111,7 +111,7 @@ it can be informed; for example, the GNUstep Base Library sets it so it can implement the NSBecomingMultiThreaded notification. */ -typedef void (*objc_thread_callback)(); +typedef void (*objc_thread_callback)(void); objc_thread_callback objc_set_thread_callback(objc_thread_callback func); /* Backend initialization functions */ --ZPt4rx8FFjLCG7dd-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message