@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2021 Jonathan Schleifer + * Copyright (c) 2008-2022 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -20,11 +20,11 @@ #ifdef OF_HAVE_THREADS # import "OFPlainMutex.h" #endif -struct weakref { +struct WeakRef { id **locations; size_t count; }; static struct objc_hashtable *hashtable; @@ -115,11 +115,11 @@ } id objc_storeWeak(id *object, id value) { - struct weakref *old; + struct WeakRef *old; #ifdef OF_HAVE_THREADS if (OFSpinlockLock(&spinlock) != 0) OBJC_ERROR("Failed to lock spinlock!"); #endif @@ -153,11 +153,11 @@ } } if (value != nil && class_respondsToSelector(object_getClass(value), @selector(allowsWeakReference)) && [value allowsWeakReference]) { - struct weakref *ref = objc_hashtable_get(hashtable, value); + struct WeakRef *ref = objc_hashtable_get(hashtable, value); if (ref == NULL) { if ((ref = calloc(1, sizeof(*ref))) == NULL) OBJC_ERROR("Not enough memory to allocate weak " "reference!"); @@ -186,11 +186,11 @@ id objc_loadWeakRetained(id *object) { id value = nil; - struct weakref *ref; + struct WeakRef *ref; #ifdef OF_HAVE_THREADS if (OFSpinlockLock(&spinlock) != 0) OBJC_ERROR("Failed to lock spinlock!"); #endif @@ -237,11 +237,11 @@ } void objc_moveWeak(id *dest, id *src) { - struct weakref *ref; + struct WeakRef *ref; #ifdef OF_HAVE_THREADS if (OFSpinlockLock(&spinlock) != 0) OBJC_ERROR("Failed to lock spinlock!"); #endif @@ -264,13 +264,13 @@ OBJC_ERROR("Failed to unlock spinlock!"); #endif } void -objc_zero_weak_references(id value) +objc_zeroWeakReferences(id value) { - struct weakref *ref; + struct WeakRef *ref; #ifdef OF_HAVE_THREADS if (OFSpinlockLock(&spinlock) != 0) OBJC_ERROR("Failed to lock spinlock!"); #endif