summaryrefslogtreecommitdiff
path: root/src/tc-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tc-list.c')
-rw-r--r--src/tc-list.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/tc-list.c b/src/tc-list.c
index c30f5aa..e0087e3 100644
--- a/src/tc-list.c
+++ b/src/tc-list.c
@@ -1,10 +1,4 @@
-/*
- * Copyright Jan Engelhardt
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the WTF Public License version 2 or
- * (at your option) any later version.
- */
+// SPDX-License-Identifier: MIT
#ifdef __cplusplus
# include <cstdio>
# include <cstdlib>
@@ -39,6 +33,8 @@ static void l_init(unsigned int max, bool unshift)
obj = new struct text_object;
#else
obj = malloc(sizeof(*obj));
+ if (obj == NULL)
+ abort();
#endif
HXlist_init(&obj->list);
obj->id[0] = HX_irand('a', 'z'+1);
@@ -111,6 +107,8 @@ static void l_empty(void)
static void l_shift(void)
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
/* Check for -Wshadow warnings */
struct object {
int value;
@@ -130,6 +128,7 @@ static void l_shift(void)
HXclist_push(&clh, &q.anchor);
x = p = HXclist_pop(&clh, struct object, anchor);
printf("%d\n", p->value);
+#pragma GCC diagnostic pop
}
int main(int argc, const char **argv)