reading format problem on Tru64unix platform.

From: Ch. Krishna Mohan <chennupati_k_at_hotmail.com>
Date: Tue, 08 Jan 2002 18:32:53 +0000

Hi ,
I am facing problem while using reading format long in tru64unix
operating system.my data is getting corrupted.
This is only with Compaq C compiler.C++ compiler did it well.

Here I am giving a piece of code which I have.I am using XGetWindowProperty
of xlibrary call to extract the colours from it eventually by sscanf
funtion.

char *data;
if (XGetWindowProperty(X_Dpy, xwin,
                    xevent.xselectionrequest.target, 0L, 1000, False,
                    (Atom)AnyPropertyType, &actualType, &actualFormat,
                    &numItems, &bytesAfter, &propData) == Success)
{
                        char* data = (char*)propData;
                        ColorPixelVal fg, bg, ts, bs, sc;
                        int i, w;
sscanf(data, "_%lx_%lx_%lx_%lx_%lx%n",
                                &bg, &fg, &ts, &bs, &sc, &w))
}

after that if I print data value of string it look like as follows.

data=_d_11_f_10_e_12_16_14_15_13_17_1b_19_1a_18_d_11_f_10_e_d_11_f_10_e_12_16_14_15_13_d_11_f_10_e_
I will be reading this above string in a loop for extracting colours.
But background colour which "bg" in my code is corrupting and coming to
zero..

I could not analyse the proper reason behind this.Why is comapq C compiler
is not able to handle this? I came to know from Tru64unix porting guides
that this could happen because of lower order bit like 2 bit or 3 bit data
is set to zero if we read in long format.
Please give me suggestions whether this is the right reason or not.

regards
Krishna


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
Received on Tue Jan 08 2002 - 18:33:43 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:43 NZDT