diff options
Diffstat (limited to 'modules/mono/glue/collections_glue.cpp')
-rw-r--r-- | modules/mono/glue/collections_glue.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/mono/glue/collections_glue.cpp b/modules/mono/glue/collections_glue.cpp index b7fa7fcab2..4e3dc9c4ea 100644 --- a/modules/mono/glue/collections_glue.cpp +++ b/modules/mono/glue/collections_glue.cpp @@ -49,7 +49,7 @@ void godot_icall_Array_Dtor(Array *ptr) { MonoObject *godot_icall_Array_At(Array *ptr, int index) { if (index < 0 || index >= ptr->size()) { GDMonoUtils::set_pending_exception(mono_get_exception_index_out_of_range()); - return NULL; + return nullptr; } return GDMonoMarshal::variant_to_mono_object(ptr->operator[](index)); } @@ -57,7 +57,7 @@ MonoObject *godot_icall_Array_At(Array *ptr, int index) { MonoObject *godot_icall_Array_At_Generic(Array *ptr, int index, uint32_t type_encoding, GDMonoClass *type_class) { if (index < 0 || index >= ptr->size()) { GDMonoUtils::set_pending_exception(mono_get_exception_index_out_of_range()); - return NULL; + return nullptr; } return GDMonoMarshal::variant_to_mono_object(ptr->operator[](index), ManagedType(type_encoding, type_class)); } @@ -162,28 +162,28 @@ void godot_icall_Dictionary_Dtor(Dictionary *ptr) { MonoObject *godot_icall_Dictionary_GetValue(Dictionary *ptr, MonoObject *key) { Variant *ret = ptr->getptr(GDMonoMarshal::mono_object_to_variant(key)); - if (ret == NULL) { + if (ret == nullptr) { MonoObject *exc = mono_object_new(mono_domain_get(), CACHED_CLASS(KeyNotFoundException)->get_mono_ptr()); #ifdef DEBUG_ENABLED CRASH_COND(!exc); #endif GDMonoUtils::runtime_object_init(exc, CACHED_CLASS(KeyNotFoundException)); GDMonoUtils::set_pending_exception((MonoException *)exc); - return NULL; + return nullptr; } return GDMonoMarshal::variant_to_mono_object(ret); } MonoObject *godot_icall_Dictionary_GetValue_Generic(Dictionary *ptr, MonoObject *key, uint32_t type_encoding, GDMonoClass *type_class) { Variant *ret = ptr->getptr(GDMonoMarshal::mono_object_to_variant(key)); - if (ret == NULL) { + if (ret == nullptr) { MonoObject *exc = mono_object_new(mono_domain_get(), CACHED_CLASS(KeyNotFoundException)->get_mono_ptr()); #ifdef DEBUG_ENABLED CRASH_COND(!exc); #endif GDMonoUtils::runtime_object_init(exc, CACHED_CLASS(KeyNotFoundException)); GDMonoUtils::set_pending_exception((MonoException *)exc); - return NULL; + return nullptr; } return GDMonoMarshal::variant_to_mono_object(ret, ManagedType(type_encoding, type_class)); } @@ -207,7 +207,7 @@ int godot_icall_Dictionary_Count(Dictionary *ptr) { void godot_icall_Dictionary_Add(Dictionary *ptr, MonoObject *key, MonoObject *value) { Variant varKey = GDMonoMarshal::mono_object_to_variant(key); Variant *ret = ptr->getptr(varKey); - if (ret != NULL) { + if (ret != nullptr) { GDMonoUtils::set_pending_exception(mono_get_exception_argument("key", "An element with the same key already exists")); return; } @@ -221,7 +221,7 @@ void godot_icall_Dictionary_Clear(Dictionary *ptr) { MonoBoolean godot_icall_Dictionary_Contains(Dictionary *ptr, MonoObject *key, MonoObject *value) { // no dupes Variant *ret = ptr->getptr(GDMonoMarshal::mono_object_to_variant(key)); - return ret != NULL && *ret == GDMonoMarshal::mono_object_to_variant(value); + return ret != nullptr && *ret == GDMonoMarshal::mono_object_to_variant(value); } MonoBoolean godot_icall_Dictionary_ContainsKey(Dictionary *ptr, MonoObject *key) { @@ -241,7 +241,7 @@ MonoBoolean godot_icall_Dictionary_Remove(Dictionary *ptr, MonoObject *key, Mono // no dupes Variant *ret = ptr->getptr(varKey); - if (ret != NULL && *ret == GDMonoMarshal::mono_object_to_variant(value)) { + if (ret != nullptr && *ret == GDMonoMarshal::mono_object_to_variant(value)) { ptr->erase(varKey); return true; } @@ -251,8 +251,8 @@ MonoBoolean godot_icall_Dictionary_Remove(Dictionary *ptr, MonoObject *key, Mono MonoBoolean godot_icall_Dictionary_TryGetValue(Dictionary *ptr, MonoObject *key, MonoObject **value) { Variant *ret = ptr->getptr(GDMonoMarshal::mono_object_to_variant(key)); - if (ret == NULL) { - *value = NULL; + if (ret == nullptr) { + *value = nullptr; return false; } *value = GDMonoMarshal::variant_to_mono_object(ret); @@ -261,8 +261,8 @@ MonoBoolean godot_icall_Dictionary_TryGetValue(Dictionary *ptr, MonoObject *key, MonoBoolean godot_icall_Dictionary_TryGetValue_Generic(Dictionary *ptr, MonoObject *key, MonoObject **value, uint32_t type_encoding, GDMonoClass *type_class) { Variant *ret = ptr->getptr(GDMonoMarshal::mono_object_to_variant(key)); - if (ret == NULL) { - *value = NULL; + if (ret == nullptr) { + *value = nullptr; return false; } *value = GDMonoMarshal::variant_to_mono_object(ret, ManagedType(type_encoding, type_class)); |