[info-performer] User Data problem/Question

Date view Thread view Subject view Author view

From: Gary Quinn (G.Quinn++at++tees.ac.uk)
Date: 02/18/2004 04:31:23


  Hi Performers.

  I've hit on a problem relating to UserDataSlots,
  and I'm not sure if I'm abusing them or if there's
  a problem with specific values similar to the
  pfMemory thing.

  I've simplified the problem down to something that
  can be added into simple.c

  Storing a value of 8 causes a segmentation fault
  under both Windoze 2000 pf 3.0.2
  and IRIX with performer 3.0.1

  Values 0 to 7, and 9 don't cause a problem.

  I'm trying to associate an integer with a pfNode
  by abusing/casting a pointer value.

  Am I doing something stupid or is this a pfBug ?

  Cheers,
  Gary.

/*
cc simple.c -o simple -n32 -lm -lpfdu_ogl -lpfutil_ogl -lpf_ogl
*/
void setUserData( pfNode *root )
{
  int dataSlot = pfGetNamedUserDataSlot("TSCurrentTex");
  char *data;
  
  data=(char *)7;
  pfNotify(PFNFY_ALWAYS, PFNFY_USAGE, "data =%8x\n", (long)data);
  pfUserDataSlot( (pfObject *)root, dataSlot, data);
  
  data=(char *)8;
  pfNotify(PFNFY_ALWAYS, PFNFY_USAGE, "data =%8x\n", (long)data);

  /* segmentation fault when data=8 */
  pfUserDataSlot( (pfObject *)root, dataSlot, data);

  pfNotify(PFNFY_ALWAYS, PFNFY_USAGE, "end of setUserData\n");
}


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Feb 18 2004 - 04:32:46 PST