fix: correct clang-format and other files

This commit is contained in:
2025-10-28 21:31:26 -04:00
parent 6af34bfd0d
commit c5881e15bf
17 changed files with 795 additions and 651 deletions

View File

@@ -40,20 +40,26 @@
#include "xmem.h"
void *ensure_nonnull(void *ptr) {
if (ptr == NULL)
fatalf("memory exhausted");
return ptr;
void *ensure_nonnull(void *ptr)
{
if (ptr == NULL)
fatalf("memory exhausted");
return ptr;
}
void *xmalloc(size_t size) { return ensure_nonnull(malloc(size)); }
void *xrealloc(void *ptr, size_t size) {
return ensure_nonnull(realloc(ptr, size));
void *xmalloc(size_t size)
{
return ensure_nonnull(malloc(size));
}
void *xcalloc(size_t nmemb, size_t size) {
return ensure_nonnull(calloc(nmemb, size));
void *xrealloc(void *ptr, size_t size)
{
return ensure_nonnull(realloc(ptr, size));
}
void *xcalloc(size_t nmemb, size_t size)
{
return ensure_nonnull(calloc(nmemb, size));
}
/* end of file xmem.c */