/* Add a protocol to the hashtable. */
void
-__objc_protocols_add_protocol (const char *name, Protocol *object)
+__objc_protocols_add_protocol (const char *name, struct objc_protocol *object)
{
objc_mutex_lock (__protocols_hashtable_lock);
Objective-C programs while trying to catch a problem that has
never been seen in practice, so we don't do it. */
if (! objc_hash_is_key_in_hash (__protocols_hashtable, name))
- {
- objc_hash_add (&__protocols_hashtable, name, object);
- }
+ objc_hash_add (&__protocols_hashtable, name, object);
objc_mutex_unlock (__protocols_hashtable_lock);
}
/* Check that it is a Protocol object before casting it to (struct
objc_protocol *). */
- if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+ if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
return NO;
objc_mutex_lock (__objc_runtime_mutex);
/* Create the objc_protocol_list. */
protocols = malloc (sizeof (struct objc_protocol_list));
protocols->count = 1;
- protocols->list[0] = protocol;
+ protocols->list[0] = (struct objc_protocol *)protocol;
/* Attach it to the list of class protocols. */
protocols->next = class_->protocols;
/* Check that it is a Protocol object before casting it to (struct
objc_protocol *). */
- if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+ if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
return NO;
/* Acquire the runtime lock because the list of protocols for a
size_t i;
for (i = 0; i < proto_list->count; i++)
{
- if (proto_list->list[i] == protocol
- || protocol_conformsToProtocol (proto_list->list[i],
+ if (proto_list->list[i] == (struct objc_protocol *)protocol
+ || protocol_conformsToProtocol ((Protocol *)proto_list->list[i],
protocol))
{
objc_mutex_unlock (__objc_runtime_mutex);
size_t j;
for (j = 0; j < proto_list->count; j++)
{
- returnValue[i] = proto_list->list[j];
+ returnValue[i] = (Protocol *)proto_list->list[j];
i++;
}
proto_list = proto_list->next;
if (protocol->class_pointer != anotherProtocol->class_pointer)
return NO;
- if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+ if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
return NO;
if (strcmp (((struct objc_protocol *)protocol)->protocol_name,
for (i = 0; i < proto_list->count; i++)
{
- if (protocol_conformsToProtocol (proto_list->list[i], anotherProtocol))
+ if (protocol_conformsToProtocol ((Protocol *)proto_list->list[i], anotherProtocol))
return YES;
}
proto_list = proto_list->next;
if (protocol->class_pointer != anotherProtocol->class_pointer)
return NO;
- if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+ if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
return NO;
/* Equality between formal protocols is only formal (nothing to do
{
/* Check that it is a Protocol object before casting it to (struct
objc_protocol *). */
- if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+ if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
return NULL;
return ((struct objc_protocol *)protocol)->protocol_name;
/* Check that it is a Protocol object before casting it to (struct
objc_protocol *). */
- if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+ if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
return no_result;
if (instanceMethod)
/* Check that it is a Protocol object before casting it to (struct
objc_protocol *). */
- if (protocol == NULL || protocol->class_pointer != objc_lookupClass ("Protocol"))
+ if (protocol == NULL || protocol->class_pointer != objc_lookUpClass ("Protocol"))
{
if (numberOfReturnedMethods)
*numberOfReturnedMethods = 0;
/* Check that it is a Protocol object before casting it to (struct
objc_protocol *). */
- if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+ if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
return NULL;
/* TODO: New ABI. */
/* Check that it is a Protocol object before casting it to (struct
objc_protocol *). */
- if (protocol == NULL || protocol->class_pointer != objc_lookupClass ("Protocol"))
+ if (protocol == NULL || protocol->class_pointer != objc_lookUpClass ("Protocol"))
{
if (numberOfReturnedProperties)
*numberOfReturnedProperties = 0;
/* Check that it is a Protocol object before casting it to (struct
objc_protocol *). */
- if (protocol == NULL || protocol->class_pointer != objc_lookupClass ("Protocol"))
+ if (protocol == NULL || protocol->class_pointer != objc_lookUpClass ("Protocol"))
{
if (numberOfReturnedProtocols)
*numberOfReturnedProtocols = 0;
size_t j;
for (j = 0; j < proto_list->count; j++)
{
- returnValue[i] = proto_list->list[j];
+ returnValue[i] = (Protocol *)proto_list->list[j];
i++;
}
proto_list = proto_list->next;