memzero.[ch]: Define memzero() and strzero() as inline functions
There's no need to have these as macros, so use functions, which are a lot safer: there's no need to worry about multiple evaluation of args, and there's also more type safety. Compiler warnings are also simpler, as they don't dump all the nested macros. Cc: Christian Göttsche <cgzones@googlemail.com> Cc: Serge Hallyn <serge@hallyn.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Iker Pedrosa
parent
fca2fd65c0
commit
2daa6cc65d
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023, Alejandro Colomar <alx@kernel.org>
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "memzero.h"
|
||||
|
||||
|
||||
extern inline void memzero(void *ptr, size_t size);
|
||||
extern inline void strzero(char *s);
|
||||
Reference in New Issue
Block a user