RE: [info-performer] User Data problem/Question

Date view Thread view Subject view Author view

From: Gordon Tomlinson (Gordon.Tomlinson++at++warhammeronline.com)
Date: 02/18/2004 05:52:28


Did you create the Int with pf Shared memory ?

-----Original Message-----
From: Gary Quinn [mailto:G.Quinn++at++tees.ac.uk]
Sent: 18 February 2004 12:31
To: info-performer++at++performer.engr.sgi.com
Subject: [info-performer] User Data problem/Question

  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");
}

-----------------------------------------------------------------------
   List Archives, Info, FAQ: http://www.sgi.com/software/performer/
   Open Development Project: http://oss.sgi.com/projects/performer/
                Submissions: info-performer++at++sgi.com
            Admin. requests: info-performer-request++at++sgi.com
-----------------------------------------------------------------------


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Feb 18 2004 - 05:55:15 PST