URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* Contributed by Nicola Pero - Wed Dec 5 17:12:40 GMT 2001 */
|
/* Contributed by Nicola Pero - Wed Dec 5 17:12:40 GMT 2001 */
|
#include <objc/objc.h>
|
#include <objc/objc.h>
|
#include <objc/Object.h>
|
#include <objc/Object.h>
|
|
|
typedef enum { black, white } color;
|
typedef enum { black, white } color;
|
|
|
typedef struct
|
typedef struct
|
{
|
{
|
color a:2;
|
color a:2;
|
color b:2;
|
color b:2;
|
} color_couple;
|
} color_couple;
|
|
|
@interface TestClass: Object
|
@interface TestClass: Object
|
{
|
{
|
color_couple *c;
|
color_couple *c;
|
}
|
}
|
- (color_couple *)colorCouple;
|
- (color_couple *)colorCouple;
|
- (void)setColorCouple: (color_couple *)a;
|
- (void)setColorCouple: (color_couple *)a;
|
@end
|
@end
|
|
|
@implementation TestClass
|
@implementation TestClass
|
- (color_couple *)colorCouple
|
- (color_couple *)colorCouple
|
{
|
{
|
return c;
|
return c;
|
}
|
}
|
- (void)setColorCouple: (color_couple *)a
|
- (void)setColorCouple: (color_couple *)a
|
{
|
{
|
c = a;
|
c = a;
|
}
|
}
|
@end
|
@end
|
|
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
color_couple cc;
|
color_couple cc;
|
TestClass *c;
|
TestClass *c;
|
|
|
c = [TestClass new];
|
c = [TestClass new];
|
|
|
cc.a = black;
|
cc.a = black;
|
cc.b = white;
|
cc.b = white;
|
|
|
[c setColorCouple: &cc];
|
[c setColorCouple: &cc];
|
if ([c colorCouple] != &cc)
|
if ([c colorCouple] != &cc)
|
{
|
{
|
abort ();
|
abort ();
|
}
|
}
|
|
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.