aboutsummaryrefslogtreecommitdiff
path: root/src/constraint_handler.c
diff options
context:
space:
mode:
authoraxtloss <axtlos@getcryst.al>2024-07-16 02:28:06 +0200
committeraxtloss <axtlos@getcryst.al>2024-07-16 02:28:06 +0200
commit8a1c3461bb820bf875a50be56c7652177cf50645 (patch)
treeb79b103693dc01f0f5b0b993e9f9fcf972d67977 /src/constraint_handler.c
parent0366952bae967a1b69c510f8e633c0567ccab4a9 (diff)
downloadextlib-8a1c3461bb820bf875a50be56c7652177cf50645.tar.gz
extlib-8a1c3461bb820bf875a50be56c7652177cf50645.tar.bz2
fix formatting
Diffstat (limited to 'src/constraint_handler.c')
-rw-r--r--src/constraint_handler.c55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/constraint_handler.c b/src/constraint_handler.c
index 450632e..5506ab0 100644
--- a/src/constraint_handler.c
+++ b/src/constraint_handler.c
@@ -11,41 +11,44 @@ static constraint_handler_t *_cnstrnt_handler = NULL;
constraint_handler_t
set_constraint_handler_s (constraint_handler_t handler)
{
- constraint_handler_t *new, *old, ret;
-
- new = malloc (sizeof (constraint_handler_t));
- if (!new) return NULL;
- *new = handler;
- old = _cnstrnt_handler;
- _cnstrnt_handler = new;
- if (!old)
- ret = NULL;
- else {
- ret = *old;
- free (old);
- }
- return ret;
+ constraint_handler_t *new, *old, ret;
+
+ new = malloc (sizeof (constraint_handler_t));
+ if (!new)
+ return NULL;
+ *new = handler;
+ old = _cnstrnt_handler;
+ _cnstrnt_handler = new;
+ if (!old)
+ ret = NULL;
+ else
+ {
+ ret = *old;
+ free (old);
+ }
+ return ret;
}
void
-throw_constraint_handler_s (const char * restrict msg, errno_t error)
+throw_constraint_handler_s (const char *restrict msg, errno_t error)
{
- constraint_handler_t ch;
- ch = _cnstrnt_handler != NULL ? *_cnstrnt_handler : NULL;
- if (ch != NULL)
- ch (msg, NULL, error);
+ constraint_handler_t ch;
+ ch = _cnstrnt_handler != NULL ? *_cnstrnt_handler : NULL;
+ if (ch != NULL)
+ ch (msg, NULL, error);
}
void
-abort_handler_s (const char *restrict msg, void * restrict ptr, errno_t error)
+abort_handler_s (const char *restrict msg, void *restrict ptr, errno_t error)
{
- static const char abrt_msg[] = "abort_handler: ";
+ static const char abrt_msg[] = "abort_handler: ";
- fprintf (stderr, "%s", abrt_msg);
- fprintf (stderr, "%s\n", msg);
- abort ();
+ fprintf (stderr, "%s", abrt_msg);
+ fprintf (stderr, "%s\n", msg);
+ abort ();
}
void
-ignore_handler_s (const char * restrict msg, void * restrict ptr, errno_t error)
-{}
+ignore_handler_s (const char *restrict msg, void *restrict ptr, errno_t error)
+{
+}