Code cleanups

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28770 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-10-04 09:53:19 +00:00
parent 2f0e07d89a
commit 3f7f5e5410
8 changed files with 312 additions and 1897 deletions

View file

@ -93,6 +93,7 @@ int con_data (id prx)
id obj;
small_struct small = {12};
foo ffoo = {'Z', 1234.5678, 99, "cow", 9876543};
foo bck;
printf("Testing data sending\n");
@ -214,11 +215,13 @@ int con_data (id prx)
#if 1 || !defined(__MINGW32__)
pool = [NSAutoreleasePool new];
printf("Struct:\n");
memcpy(&bck, &ffoo, sizeof(bck));
printf(" sending c='%c',d=%g,i=%d,s=%s,l=%ld",
ffoo.c, ffoo.d, ffoo.i, ffoo.s, ffoo.l);
ffoo = [prx sendStruct: ffoo];
printf(" got c='%c',d=%g,i=%d,s=%s,l=%ld\n",
ffoo.c, ffoo.d, ffoo.i, ffoo.s, ffoo.l);
memcpy(&ffoo, &bck, sizeof(bck));
printf(" sending ptr to c='%c',d=%g,i=%d,s=%s,l=%ld",
ffoo.c, ffoo.d, ffoo.i, ffoo.s, ffoo.l);
[prx getStruct: &ffoo];

View file

@ -291,8 +291,11 @@
- (void) getObject: (id *)str
{
static NSString *ret = @"hello";
printf ("(%s) got object (%s)\n", GSNameFromSelector(_cmd),
GSClassNameFromObject(*str));
*str = ret;
printf(" returning (%s)\n", [*str cString]);
fflush(stdout);
}
@ -307,8 +310,9 @@
- (void) getString: (char **)str
{
static char *ret = "hello";
printf ("(%s) got string (%s)", GSNameFromSelector(_cmd), *str);
(*str)[0] = 'N';
*str = ret;
printf(" returning (%s)\n", *str);
fflush(stdout);
}