Pxgraph
Xgraph is a 2-D plotting package for the X Window System that is written in C. Pxgraph is an extension to xgraph.pxgraph binaries
Below are links to prebuilt GNU zipped pxgraph binaries.Note that in Ptolemy 0.7.1, the
$PTOLEMY/bin/pxgraph
script reads the PT_USE_X11_PXGRAPH environment variable.
If that PT_USE_X11_PXGRAPH is set to anything, then
$PTOLEMY/bin.$PTARCH/pxgraph.x11 is run.
Thus, the
pxgraph.exe or pxgraph binaries
below should be copied to $PTOLEMY/bin.$PTARCH/pxgraph.x11
See $PTOLEMY/src/pxgraph/README.txt
Bug in st.c
(12/03) The following problem was reported by Shachindra Sharma inst.c where a particular
string results in a negative hash code because of overflow.
Pxgraph does not call this function, but st.c appears in other locations, such as
http://embedded.eecs.berkeley.edu/pubs/downloads/octtools/index.htm
and
http://www.mit.edu/afs/sipb/project/ruby-lang/src/ruby-1.6.4/st.c.
The fix is below:
int st_strhash(string, modulus)
register char *string;
int modulus;
{
register long val = 0;
register int c;
while ((c = *string++) != '\0') {
val = val*997 + c;
}
/* Shachindra Sharma writes:
".. will have a problem when the value variable "val" is equal
to the maximum negative integer value (for the particular OS its being
run on say if its 32 bit OS the value would be -2^31 = -2147483648)
val < 0 ? -val : val will still be -val for such a case due to the
property of maximum negative integer that -val == val.
As an example if we have a input string to this function like
the one given below:
"TRDTOP_HIP_UHIF1_HPDMA_UHPDREG1_HPDRCH3E1MCUADDR[20]"
the value of the variable "val" would be -2147483648 resulting
in a negative value being returned by the function which could result
in problems for the user is OS was 32 bit. The hash function otherwise
for any values of "val" larger or smaller than this value would work
fine so the probabilty of such a situation is rather low.
*/
if (val == -val) {
unsigned int newhash = -val;
return (newhash%modulus);
} else {
return ((val < 0) ? -val : val)%modulus;
}
}
Last Updated: $Date$
