Path: utzoo!censor!geac!jtsv16!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU (der Mouse) Newsgroups: comp.windows.x Subject: (none) Message-ID: <8908021309.AA10810@Larry.McRCIM.McGill.EDU> Date: 2 Aug 89 13:09:24 GMT Organization: The Internet Lines: 38 >> 1. You have some image data statically defined, say in an array. By >> static I mean it wasn't allocated using malloc. > I question whether this is the best thing to do. #include "picture.xbm" You were saying...? > I can't say for sure, but it sounds like you're making assumptions on > the bit/byte ordering of your image and when you eventually try to > XPutImage this thing to a drawable, you might not get what you want > if you are talking to an X server on a different architecture. From the Xlib documentation, the section which talks about XImages... Other members (for example, byte_order, bitmap_unit, and so forth) are characteristics of both the image and the server. If these members differ between the image and the server, XPutImage makes the appropriate conversions. So I wouldn't worry. >> Is there a "best" way to do this? Should you set the data pointer >> in the image structure to NULL before calling XDestroyImage? > Just as a thought -- you could set the data pointer to malloc(1) :-} Unless there's a defined way to do this, you've probably got the most portable solution. (The current MIT version may check for a null pointer, but if this isn't part of the "contract" of XDestroyImage, you will eventually get bitten by an Xlib which doesn't check. For what it's worth, a quick check of the Xlib doc doesn't turn up any mention of what happens if the data pointer is null.) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu