URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do assemble }
|
// { dg-do assemble }
|
template inline STRUCT *
|
template inline STRUCT *
|
setback(MEMBER *bp, MEMBER STRUCT::*offset)
|
setback(MEMBER *bp, MEMBER STRUCT::*offset)
|
{
|
{
|
// The implementation of this function may be platform dependend
|
// The implementation of this function may be platform dependend
|
if(!bp) return 0; // NULL pointers remain NULL
|
if(!bp) return 0; // NULL pointers remain NULL
|
union { int i; MEMBER STRUCT::*of; } u; // Switch types. Casting won't work.
|
union { int i; MEMBER STRUCT::*of; } u; // Switch types. Casting won't work.
|
u.of = offset;
|
u.of = offset;
|
return (STRUCT *) ((int) bp - u.i);
|
return (STRUCT *) ((int) bp - u.i);
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.