Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!snorkelwacker!apple!springer!x From: x@springer.Apple.COM (X Windows) Newsgroups: comp.unix.aux Subject: Re: XmacII color name lookup problems Keywords: A/UX X11 dbm Message-ID: <1990Oct11.145627@springer.Apple.COM> Date: 11 Oct 90 21:56:27 GMT References: <2463@root44.co.uk> Sender: usenet@Apple.COM Reply-To: peters@apple.apple.com Organization: Apple Computer, Inc. Lines: 85 In article <2463@root44.co.uk>, kieron@root.co.uk (Kieron Drake) writes: |> |> DESCRIPTION: |> |> As above for symptoms. The problem was that under this version of A/UX |> the documentation, and implementation, of the dbm routines differ |> from almost everybody else's. The normal (non-NDBM) version has fetch |> defined as: |> datum fetch(datum key); |> but A/UX has it as: |> datum *fetch(datum key); |> |> Note that the man page and the implementation agree on the latter |> interpretation but the declaration of fetch() in /usr/include/dbm.h |> is in the former style! |> Actually the man page is wrong, /usr/include/dbm.h and the source for fetch in our dbm.c agree: datum fetch(key) datum key; { ... } As for your problem, I think the fault is in rgb.c where the compiler errs :-( . To wit -- springer.x 203% rlog rgb.c RCS file: RCS/rgb.c,v; Working file: rgb.c head: 1.2 locks: ; strict access list: x mgchow peters davep symbolic names: v2_1d3: 1.2; GoldenMaster: 1.2; R4UpdateAlpha1: 1.2; comment leader: " * " total revisions: 2; selected revisions: 2 description: Initial Apple Check In. ---------------------------- revision 1.2 date: 90/01/08 21:43:17; author: x; state: Exp; lines added/del: 3/3 pcc blows code generation for e.g. rgb.red = (red * 65535)/255, emitting a divs.w. Forced assignement to a long to fix it. SCP. ---------------------------- revision 1.1 date: 90/01/08 21:30:16; author: x; state: Exp; Initial revision ======================================================================== ====== springer.x 204% rcsdiff -c -r1.1 rgb.c RCS file: RCS/rgb.c,v retrieving revision 1.1 diff -c -r1.1 rgb.c *** /tmp/,RCSt1a03577 Thu Oct 11 15:09:46 1990 --- rgb.c Tue May 29 14:10:15 1990 *************** *** 118,126 **** name[i] = tolower (name[i]); } key.dsize = n; ! rgb.red = (red * 65535) / 255; ! rgb.green = (green * 65535) / 255; ! rgb.blue = (blue * 65535) / 255; if (dbm_store (rgb_dbm, key, content, DBM_REPLACE)) { fprintf (stderr, "%s: store of entry \"%s\" failed\n", ProgramName, name); --- 118,126 ---- name[i] = tolower (name[i]); } key.dsize = n; ! rgb.red = red = (red * 65535) / 255; ! rgb.green = green = (green * 65535) / 255; ! rgb.blue = blue = (blue * 65535) / 255; if (dbm_store (rgb_dbm, key, content, DBM_REPLACE)) { fprintf (stderr, "%s: store of entry \"%s\" failed\n", ProgramName, name); Steve Peters X Project Leader Apple Computer, Inc. peters@apple.apple.com