mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Remove unused private method pointed out by David Chisnall
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28161 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
eba9ab6e75
commit
17e3bcd42e
3 changed files with 8 additions and 109 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2009-03-31 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Headers/Foundation/NSInvocation.h:
|
||||||
|
* Source/NSInvocation.m:
|
||||||
|
Remove unused private method pointed out by David Chisnall.
|
||||||
|
|
||||||
2009-03-31 Richard Frith-Macdonald <rfm@gnu.org>
|
2009-03-31 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Headers/Foundation/NSDebug.h:
|
* Headers/Foundation/NSDebug.h:
|
||||||
|
|
|
@ -120,7 +120,6 @@ extern "C" {
|
||||||
- (id) initWithArgframe: (arglist_t)frame selector: (SEL)aSelector;
|
- (id) initWithArgframe: (arglist_t)frame selector: (SEL)aSelector;
|
||||||
- (id) initWithMethodSignature: (NSMethodSignature*)aSignature;
|
- (id) initWithMethodSignature: (NSMethodSignature*)aSignature;
|
||||||
- (id) initWithSelector: (SEL)aSelector;
|
- (id) initWithSelector: (SEL)aSelector;
|
||||||
- (id) initWithTarget: (id)anObject selector: (SEL)aSelector, ...;
|
|
||||||
- (void*) returnFrame: (arglist_t)argFrame;
|
- (void*) returnFrame: (arglist_t)argFrame;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -923,7 +923,8 @@ _arg_addr(NSInvocation *inv, int index)
|
||||||
types = sel_get_type(aSelector);
|
types = sel_get_type(aSelector);
|
||||||
if (types == 0)
|
if (types == 0)
|
||||||
{
|
{
|
||||||
types = sel_get_type(sel_get_any_typed_uid(GSNameFromSelector(aSelector)));
|
types
|
||||||
|
= sel_get_type(sel_get_any_typed_uid(GSNameFromSelector(aSelector)));
|
||||||
}
|
}
|
||||||
if (types == 0)
|
if (types == 0)
|
||||||
{
|
{
|
||||||
|
@ -936,113 +937,6 @@ _arg_addr(NSInvocation *inv, int index)
|
||||||
return [self initWithMethodSignature: newSig];
|
return [self initWithMethodSignature: newSig];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialises the receiver with the specified target, selector, and
|
|
||||||
* a variable number of arguments.
|
|
||||||
*/
|
|
||||||
- (id) initWithTarget: anObject selector: (SEL)aSelector, ...
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
NSMethodSignature *newSig;
|
|
||||||
|
|
||||||
if (anObject)
|
|
||||||
{
|
|
||||||
newSig = [anObject methodSignatureForSelector: aSelector];
|
|
||||||
self = [self initWithMethodSignature: newSig];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
self = [self initWithSelector: aSelector];
|
|
||||||
}
|
|
||||||
if (self)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
[self setTarget: anObject];
|
|
||||||
[self setSelector: aSelector];
|
|
||||||
va_start (ap, aSelector);
|
|
||||||
for (i = 3; i <= _numArgs; i++)
|
|
||||||
{
|
|
||||||
const char *type = _info[i].type;
|
|
||||||
unsigned size = _info[i].size;
|
|
||||||
void *datum;
|
|
||||||
|
|
||||||
datum = _arg_addr(self, i-1);
|
|
||||||
|
|
||||||
#define CASE_TYPE(_C,_T) case _C: *(_T*)datum = va_arg (ap, _T); break
|
|
||||||
switch (*type)
|
|
||||||
{
|
|
||||||
case _C_ID:
|
|
||||||
*(id*)datum = va_arg (ap, id);
|
|
||||||
if (_argsRetained)
|
|
||||||
{
|
|
||||||
IF_NO_GC(RETAIN(*(id*)datum));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case _C_CHARPTR:
|
|
||||||
*(char**)datum = va_arg (ap, char*);
|
|
||||||
if (_argsRetained)
|
|
||||||
{
|
|
||||||
char *old = *(char**)datum;
|
|
||||||
|
|
||||||
if (old != 0)
|
|
||||||
{
|
|
||||||
char *tmp;
|
|
||||||
|
|
||||||
tmp = NSZoneMalloc(NSDefaultMallocZone(),strlen(old)+1);
|
|
||||||
strcpy(tmp, old);
|
|
||||||
*(char**)datum = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
CASE_TYPE(_C_CLASS, Class);
|
|
||||||
CASE_TYPE(_C_SEL, SEL);
|
|
||||||
CASE_TYPE(_C_LNG, long);
|
|
||||||
CASE_TYPE(_C_ULNG, unsigned long);
|
|
||||||
CASE_TYPE(_C_INT, NSInteger);
|
|
||||||
CASE_TYPE(_C_UINT, NSUInteger);
|
|
||||||
case _C_SHT:
|
|
||||||
*(short*)datum = (short)va_arg(ap, NSInteger);
|
|
||||||
break;
|
|
||||||
case _C_USHT:
|
|
||||||
*(unsigned short*)datum = (unsigned short)va_arg(ap, NSInteger);
|
|
||||||
break;
|
|
||||||
case _C_CHR:
|
|
||||||
*(char*)datum = (char)va_arg(ap, NSInteger);
|
|
||||||
break;
|
|
||||||
case _C_UCHR:
|
|
||||||
*(unsigned char*)datum = (unsigned char)va_arg(ap, NSInteger);
|
|
||||||
break;
|
|
||||||
case _C_FLT:
|
|
||||||
*(float*)datum = (float)va_arg(ap, double);
|
|
||||||
break;
|
|
||||||
CASE_TYPE(_C_DBL, double);
|
|
||||||
CASE_TYPE(_C_PTR, void*);
|
|
||||||
case _C_STRUCT_B:
|
|
||||||
default:
|
|
||||||
#if !defined(USE_LIBFFI) && !defined(USE_FFCALL)
|
|
||||||
#if defined(sparc) || defined(powerpc)
|
|
||||||
/* FIXME: This only appears on sparc and ppc machines so far.
|
|
||||||
structures appear to be aligned on word boundaries.
|
|
||||||
Hopefully there is a more general way to figure this out */
|
|
||||||
size = (size<sizeof(NSInteger))?4:size;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
NSLog(@"Unsafe handling of type of %d argument.", i-1);
|
|
||||||
{
|
|
||||||
struct {
|
|
||||||
char x[size];
|
|
||||||
} dummy;
|
|
||||||
dummy = va_arg(ap, typeof(dummy));
|
|
||||||
memcpy(datum, dummy.x, size);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal use.<br />
|
* Internal use.<br />
|
||||||
* Provides a return frame that the ObjectiveC runtime can use to
|
* Provides a return frame that the ObjectiveC runtime can use to
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue