summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2024-05-14 21:29:40 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2024-05-14 21:29:40 (GMT)
commit7358dc2001d27d3c5a0c0fe39288b1a310a6d89e (patch)
treec83f3d52b11c72336dbabc4c1448c2ca4a375a36 /src/common
parented57185faa4d7a53d953cf74a6f8626f44ce9b75 (diff)
Restore a minimal support for plugins.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/Makefile.am6
-rw-r--r--src/common/bits.c2
-rw-r--r--src/common/xdg.c5
3 files changed, 8 insertions, 5 deletions
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 53d3627..9d0885e 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -53,7 +53,11 @@ endif
libcommon4_la_SOURCES = \
- extstr.h extstr.c
+ asm.h asm.c \
+ bits.h bits.c \
+ extstr.h extstr.c \
+ pathname.h pathname.c \
+ xdg.h xdg.c
libcommon4_la_CFLAGS = $(TOOLKIT_CFLAGS) $(LIBXML_CFLAGS)
diff --git a/src/common/bits.c b/src/common/bits.c
index 3d0004c..37e3141 100644
--- a/src/common/bits.c
+++ b/src/common/bits.c
@@ -87,7 +87,7 @@ static bitfield_t *_create_bit_field(size_t length)
base = sizeof(bitfield_t) + needed * sizeof(unsigned long);
- result = (bitfield_t *)malloc(base);
+ result = malloc(base);
result->length = length;
diff --git a/src/common/xdg.c b/src/common/xdg.c
index 23feeb9..cabff75 100644
--- a/src/common/xdg.c
+++ b/src/common/xdg.c
@@ -79,7 +79,7 @@ char *get_xdg_config_dir(const char *suffix)
if (strcmp(entry->d_name, ".") == 0) continue;
if (strcmp(entry->d_name, "..") == 0) continue;
- result = (char *)calloc(strlen(env) + 2 + strlen(suffix) + 1, sizeof(char));
+ result = calloc(strlen(env) + 2 + strlen(suffix) + 1, sizeof(char));
strcpy(result, env);
if (env[strlen(env) - 1] != G_DIR_SEPARATOR)
@@ -101,8 +101,7 @@ char *get_xdg_config_dir(const char *suffix)
env = getenv("HOME");
if (env == NULL || env[0] == '\0') return NULL;
- result = (char *)calloc(strlen(env) + 1 + strlen(".config" G_DIR_SEPARATOR_S)
- + strlen(suffix) + 1, sizeof(char));
+ result = calloc(strlen(env) + 1 + strlen(".config" G_DIR_SEPARATOR_S) + strlen(suffix) + 1, sizeof(char));
strcpy(result, env);