@@ -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 @@ -35,11 +35,11 @@ # include # undef Class # undef __NOLIBBASE__ #endif -static objc_enumeration_mutation_handler_t enumerationMutationHandler = NULL; +static objc_enumeration_mutation_handler enumerationMutationHandler = NULL; void objc_enumerationMutation(id object) { if (enumerationMutationHandler != NULL) @@ -47,27 +47,27 @@ else OBJC_ERROR("Object was mutated during enumeration!"); } void -objc_setEnumerationMutationHandler(objc_enumeration_mutation_handler_t handler) +objc_setEnumerationMutationHandler(objc_enumeration_mutation_handler handler) { enumerationMutationHandler = handler; } void objc_error(const char *title, const char *format, ...) { #if defined(OF_WINDOWS) || defined(OF_AMIGAOS) -# define BUF_LEN 512 - char message[BUF_LEN]; +# define messageLen 512 + char message[messageLen]; int status; va_list args; va_start(args, format); - status = vsnprintf(message, BUF_LEN, format, args); - if (status <= 0 || status >= BUF_LEN) + status = vsnprintf(message, messageLen, format, args); + if (status <= 0 || status >= messageLen) message[0] = '\0'; va_end(args); # undef BUF_LEN #endif