[overture] Re: getTagData casting conundrum

  • From: "Kyle K. Chand" <chand1@xxxxxxxx>
  • To: overture@xxxxxxxxxxxxx
  • Date: Thu, 31 Jan 2008 09:33:11 -0800

Hi Erik,

This is what we are using... I thought it should would be in the latest release 
but maybe not (?).

  /// getBC returns the boundary condition number associated with {type,entity} 
or returns -1 if no bc is specified
  inline long getBC(EntityTypeEnum type, int entity)
  { return hasBC(type,entity) ? 
long(getTagData(type,entity,tagPrefix(type,BCEntity))) : -1; }

The void pointer is used to store a number of things, from a pointer to user 
defined data to integer values for
boundary conditions.  

Kyle

PS I am the original author :-)

On Thursday 31 January 2008 09:08, Erik Wilson wrote:
> 
> Hello,
> 
> I am receiving the following error on an AIX 64-bit build:
> 
> "/ptmp/wilsone/overture-64/include/UnstructuredMapping.h", line 428.47: 
> 1540-0216 (S) An expression of type "void *" cannot be converted to type 
> "int".
> 
> Which is the following code:
> 
> inline int getBC(EntityTypeEnum type, int entity)
> { return hasBC(type,entity) ? 
> int(getTagData(type,entity,tagPrefix(type,BCEntity))) : -1; }
> 
> My immediate reaction is to obtain the value returned by getTagData 
> rather than casting the address to an Int, ie:
> 
> { return hasBC(type,entity) ? 
> *(int*)(getTagData(type,entity,tagPrefix(type,BCEntity))) : -1; }
> 
> However, I am not sure if this what the original author intended.
> 
> Any ideas what should really be happening here?
> 
> Thanks,
>   -Erik
> 
> 

-- 
Kyle K. Chand
mailto:chand1@xxxxxxxx
phoneto:  (925)  422 7740

Other related posts: