Use string objects instead of C strings

for name arguments to encoding methods.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@796 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1996-01-24 03:33:21 +00:00
parent a11f420b91
commit 07b43d0e5d
14 changed files with 41 additions and 41 deletions

View file

@ -99,7 +99,7 @@ static BOOL debug_binary_coder = NO;
{ {
int length = strlen(*(char**)d); int length = strlen(*(char**)d);
[self encodeValueOfCType:@encode(int) [self encodeValueOfCType:@encode(int)
at:&length withName:"BinaryCoder char* length"]; at:&length withName:@"BinaryCoder char* length"];
[stream writeBytes:*(char**)d length:length]; [stream writeBytes:*(char**)d length:length];
break; break;
} }
@ -173,7 +173,7 @@ static BOOL debug_binary_coder = NO;
char *s = buf; char *s = buf;
sprintf(buf, "%f", *(float*)d); sprintf(buf, "%f", *(float*)d);
[self encodeValueOfCType:@encode(char*) [self encodeValueOfCType:@encode(char*)
at:&s withName:"BinaryCoder float"]; at:&s withName:@"BinaryCoder float"];
break; break;
} }
case _C_DBL: case _C_DBL:
@ -182,7 +182,7 @@ static BOOL debug_binary_coder = NO;
char *s = buf; char *s = buf;
sprintf(buf, "%f", *(double*)d); sprintf(buf, "%f", *(double*)d);
[self encodeValueOfCType:@encode(char*) [self encodeValueOfCType:@encode(char*)
at:&s withName:"BinaryCoder double"]; at:&s withName:@"BinaryCoder double"];
break; break;
} }
default: default:
@ -317,7 +317,7 @@ static BOOL debug_binary_coder = NO;
[[BinaryCoder debugStderrCoder] [[BinaryCoder debugStderrCoder]
encodeValueOfCType:type encodeValueOfCType:type
at:d at:d
withName:"decoding unnamed"]; withName:@"decoding unnamed"];
} }
} }

View file

@ -41,9 +41,9 @@
- (void) encodeWithCoder: aCoder - (void) encodeWithCoder: aCoder
{ {
[super encodeWithCoder:(id)aCoder]; [super encodeWithCoder:(id)aCoder];
[aCoder encodeObjectReference:_right withName:"Right BinaryTree Node"]; [aCoder encodeObjectReference:_right withName:@"Right BinaryTree Node"];
[aCoder encodeObjectReference:_left withName:"Left BinaryTree Node"]; [aCoder encodeObjectReference:_left withName:@"Left BinaryTree Node"];
[aCoder encodeObjectReference:_parent withName:"Parent BinaryTree Node"]; [aCoder encodeObjectReference:_parent withName:@"Parent BinaryTree Node"];
} }
- initWithCoder: aCoder - initWithCoder: aCoder

View file

@ -1303,12 +1303,12 @@ for info about latest version.",
{ {
[aCoder encodeValueOfObjCType:encoding [aCoder encodeValueOfObjCType:encoding
at:elt_get_ptr_to_member(encoding, &e) at:elt_get_ptr_to_member(encoding, &e)
withName:"Collection element"]; withName:@"Collection element"];
} }
[aCoder encodeValueOfCType:@encode(unsigned) [aCoder encodeValueOfCType:@encode(unsigned)
at:&count at:&count
withName:"Collection element count"]; withName:@"Collection element count"];
[self withElementsCall:archiveElement]; [self withElementsCall:archiveElement];
} }

View file

@ -271,7 +271,7 @@ static int messagesReceivedCount;
work the way I wanted, we wouldn't need to do this. */ work the way I wanted, we wouldn't need to do this. */
[op encodeValueOfCType:@encode(char*) [op encodeValueOfCType:@encode(char*)
at:&type at:&type
withName:"selector type"]; withName:@"selector type"];
/* xxx This doesn't work with proxies and the NeXT runtime because /* xxx This doesn't work with proxies and the NeXT runtime because
type may be a method_type from a remote machine with a type may be a method_type from a remote machine with a
@ -713,7 +713,7 @@ static int messagesReceivedCount;
type = ""; type = "";
[op encodeValueOfCType:@encode(char*) [op encodeValueOfCType:@encode(char*)
at:&type at:&type
withName:"Requested Method Type for Target"]; withName:@"Requested Method Type for Target"];
[op dismiss]; [op dismiss];
return self; return self;
} }
@ -728,7 +728,7 @@ static int messagesReceivedCount;
assert(in_port); assert(in_port);
/* Perhaps we should turn this into a class method. */ /* Perhaps we should turn this into a class method. */
assert([rmc connection] == self); assert([rmc connection] == self);
[op encodeObject:rootObject withName:"root object"]; [op encodeObject:rootObject withName:@"root object"];
[op dismiss]; [op dismiss];
return self; return self;
} }

View file

@ -55,9 +55,9 @@
{ {
[anEncoder encodeValueOfCType:@encode(unsigned char) [anEncoder encodeValueOfCType:@encode(unsigned char)
at:&_send_behavior at:&_send_behavior
withName:"DelegatePool Send Behavior"]; withName:@"DelegatePool Send Behavior"];
[anEncoder encodeObject:_list [anEncoder encodeObject:_list
withName:"DelegatePool Collection of Delegates"]; withName:@"DelegatePool Collection of Delegates"];
} }
+ newWithCoder: aDecoder + newWithCoder: aDecoder

View file

@ -97,9 +97,9 @@
[super _encodeCollectionWithCoder:aCoder]; [super _encodeCollectionWithCoder:aCoder];
[aCoder encodeValueOfObjCType:@encode(char*) at:&encoding [aCoder encodeValueOfObjCType:@encode(char*) at:&encoding
withName:"EltNodeCollector Content Type Encoding"]; withName:@"EltNodeCollector Content Type Encoding"];
[aCoder encodeValueOfObjCType:"#" at:&_node_class [aCoder encodeValueOfObjCType:"#" at:&_node_class
withName:"EltNodeCollector Content Node Class"]; withName:@"EltNodeCollector Content Node Class"];
} }
- _initCollectionWithCoder: aCoder - _initCollectionWithCoder: aCoder
@ -117,7 +117,7 @@
- (void) _encodeContentsWithCoder: (Coder*)aCoder - (void) _encodeContentsWithCoder: (Coder*)aCoder
{ {
[aCoder encodeObject:_contents_collector [aCoder encodeObject:_contents_collector
withName:"EltNodeCollector Contents Collector"]; withName:@"EltNodeCollector Contents Collector"];
} }
- (void) _decodeContentsWithCoder: (Coder*)aCoder - (void) _decodeContentsWithCoder: (Coder*)aCoder

View file

@ -42,8 +42,8 @@
- (void) encodeWithCoder: aCoder - (void) encodeWithCoder: aCoder
{ {
[super encodeWithCoder:aCoder]; [super encodeWithCoder:aCoder];
[aCoder encodeObjectReference:_next withName:"Next LinkedList Node"]; [aCoder encodeObjectReference:_next withName:@"Next LinkedList Node"];
[aCoder encodeObjectReference:_prev withName:"Prev LinkedList Node"]; [aCoder encodeObjectReference:_prev withName:@"Prev LinkedList Node"];
} }
- initWithCoder: aCoder - initWithCoder: aCoder

View file

@ -120,9 +120,9 @@ stringDecrementCountAndFillHoleAt(MutableCStringStruct *self,
- (void) encodeWithCoder: aCoder - (void) encodeWithCoder: aCoder
{ {
[aCoder encodeValueOfObjCType:@encode(unsigned) at:&_capacity [aCoder encodeValueOfObjCType:@encode(unsigned) at:&_capacity
withName:"String capacity"]; withName:@"String capacity"];
[aCoder encodeValueOfObjCType:@encode(char*) at:&_contents_chars [aCoder encodeValueOfObjCType:@encode(char*) at:&_contents_chars
withName:"String content_chars"]; withName:@"String content_chars"];
} }
- initWithCoder: aCoder - initWithCoder: aCoder

View file

@ -60,7 +60,7 @@
- (void) encodeWithCoder: aCoder - (void) encodeWithCoder: aCoder
{ {
[aCoder encodeValueOfObjCType:@encode(char*) at:&_contents_chars [aCoder encodeValueOfObjCType:@encode(char*) at:&_contents_chars
withName:"Concrete String content_chars"]; withName:@"Concrete String content_chars"];
} }
- initWithCoder: aCoder - initWithCoder: aCoder
@ -256,9 +256,9 @@ stringDecrementCountAndFillHoleAt(NSGMutableCStringStruct *self,
- (void) encodeWithCoder: aCoder - (void) encodeWithCoder: aCoder
{ {
[aCoder encodeValueOfObjCType:@encode(unsigned) at:&_capacity [aCoder encodeValueOfObjCType:@encode(unsigned) at:&_capacity
withName:"String capacity"]; withName:@"String capacity"];
[aCoder encodeValueOfObjCType:@encode(char*) at:&_contents_chars [aCoder encodeValueOfObjCType:@encode(char*) at:&_contents_chars
withName:"String content_chars"]; withName:@"String content_chars"];
} }
- initWithCoder: aCoder - initWithCoder: aCoder

View file

@ -149,13 +149,13 @@ static inline BOOL class_is_kind_of(Class self, Class aClassObject)
/* This proxy is local on the other side */ /* This proxy is local on the other side */
willBeLocal = YES; willBeLocal = YES;
[aRmc encodeObjectBycopy:nil [aRmc encodeObjectBycopy:nil
withName:"Proxy is local on other side"]; withName:@"Proxy is local on other side"];
[aRmc encodeValueOfObjCType:@encode(unsigned) [aRmc encodeValueOfObjCType:@encode(unsigned)
at:&aTarget at:&aTarget
withName:"Object Proxy target"]; withName:@"Object Proxy target"];
[aRmc encodeValueOfObjCType:@encode(BOOL) [aRmc encodeValueOfObjCType:@encode(BOOL)
at:&willBeLocal at:&willBeLocal
withName:"Proxy willBeLocal"]; withName:@"Proxy willBeLocal"];
} }
else else
{ {
@ -167,13 +167,13 @@ static inline BOOL class_is_kind_of(Class self, Class aClassObject)
/* It's remote here, so we need to tell other side where to form /* It's remote here, so we need to tell other side where to form
triangle connection to */ triangle connection to */
[aRmc encodeObjectBycopy:op [aRmc encodeObjectBycopy:op
withName:"Proxy outPort"]; withName:@"Proxy outPort"];
[aRmc encodeValueOfObjCType:@encode(unsigned) [aRmc encodeValueOfObjCType:@encode(unsigned)
at:&aTarget at:&aTarget
withName:"Object Proxy target"]; withName:@"Object Proxy target"];
[aRmc encodeValueOfObjCType:@encode(BOOL) [aRmc encodeValueOfObjCType:@encode(BOOL)
at:&willBeLocal at:&willBeLocal
withName:"Proxy willBeLocal"]; withName:@"Proxy willBeLocal"];
} }
} }
else else
@ -185,13 +185,13 @@ static inline BOOL class_is_kind_of(Class self, Class aClassObject)
[[aRmc connection] addLocalObject:anObject]; [[aRmc connection] addLocalObject:anObject];
/* if nil port, other connection will use ConnectedCoder remotePort */ /* if nil port, other connection will use ConnectedCoder remotePort */
[aRmc encodeObjectBycopy:nil [aRmc encodeObjectBycopy:nil
withName:"Proxy outPort == remotePort"]; withName:@"Proxy outPort == remotePort"];
[aRmc encodeValueOfObjCType:@encode(unsigned) [aRmc encodeValueOfObjCType:@encode(unsigned)
at:&aTarget at:&aTarget
withName:"Object Proxy target"]; withName:@"Object Proxy target"];
[aRmc encodeValueOfObjCType:@encode(BOOL) [aRmc encodeValueOfObjCType:@encode(BOOL)
at:&willBeLocal at:&willBeLocal
withName:"Proxy willBeLocal"]; withName:@"Proxy willBeLocal"];
} }
} }

View file

@ -41,7 +41,7 @@
- (void) encodeWithCoder: aCoder - (void) encodeWithCoder: aCoder
{ {
[super encodeWithCoder:aCoder]; [super encodeWithCoder:aCoder];
[aCoder encodeValueOfObjCType:@encode(BOOL) at:&_red withName:"RBTreeNode isRed"]; [aCoder encodeValueOfObjCType:@encode(BOOL) at:&_red withName:@"RBTreeNode isRed"];
} }
- initWithCoder: aCoder - initWithCoder: aCoder

View file

@ -68,10 +68,10 @@
[super _encodeCollectionWithCoder:aCoder]; [super _encodeCollectionWithCoder:aCoder];
[aCoder encodeValueOfCType:@encode(char*) [aCoder encodeValueOfCType:@encode(char*)
at:&enc at:&enc
withName:"Set contents encoding"]; withName:@"Set contents encoding"];
[aCoder encodeValueOfCType:@encode(unsigned) [aCoder encodeValueOfCType:@encode(unsigned)
at:&(_contents_hash->size) at:&(_contents_hash->size)
withName:"Set contents capacity"]; withName:@"Set contents capacity"];
return; return;
} }

View file

@ -387,7 +387,7 @@ or
{ {
[aCoder encodeValueOfObjCType:@encode(typeof(sockPort.sin_port)) [aCoder encodeValueOfObjCType:@encode(typeof(sockPort.sin_port))
at:&sockPort.sin_port at:&sockPort.sin_port
withName:"socket number"]; withName:@"socket number"];
if (![self isSoft]) if (![self isSoft])
{ {
struct hostent *hp; struct hostent *hp;
@ -400,13 +400,13 @@ or
bcopy(hp->h_addr, &sp.sin_addr, hp->h_length); bcopy(hp->h_addr, &sp.sin_addr, hp->h_length);
[aCoder encodeValueOfObjCType:@encode(typeof(sp.sin_addr.s_addr)) [aCoder encodeValueOfObjCType:@encode(typeof(sp.sin_addr.s_addr))
at:&sp.sin_addr.s_addr at:&sp.sin_addr.s_addr
withName:"inet address"]; withName:@"inet address"];
} }
else else
{ {
[aCoder encodeValueOfObjCType:@encode(typeof(sockPort.sin_addr.s_addr)) [aCoder encodeValueOfObjCType:@encode(typeof(sockPort.sin_addr.s_addr))
at:&sockPort.sin_addr.s_addr at:&sockPort.sin_addr.s_addr
withName:"inet address"]; withName:@"inet address"];
} }
} }

View file

@ -55,8 +55,8 @@
- (void) encodeWithCoder: aCoder - (void) encodeWithCoder: aCoder
{ {
[super encodeWithCoder:aCoder]; [super encodeWithCoder:aCoder];
[aCoder encodeObjectReference:_parent withName:"Parent Tree Node"]; [aCoder encodeObjectReference:_parent withName:@"Parent Tree Node"];
[aCoder encodeObject:_children withName:"Children of Tree Node"]; [aCoder encodeObject:_children withName:@"Children of Tree Node"];
} }
- initWithCoder: aCoder - initWithCoder: aCoder