Skip to content

Commit 3a1ce27

Browse files
Merge branch 'release-1.1'
2 parents 78e0362 + 33d993c commit 3a1ce27

33 files changed

Lines changed: 844 additions & 180 deletions

CHANGES

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,13 @@ Version 1.0
44
Released 2017-01-03
55

66
* Initial release
7+
8+
Version 1.1
9+
===========
10+
11+
Released 2017-12-17
12+
13+
* New features:
14+
15+
- List type
16+
- More uniform interfaces

Makefile.am

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
22
AM_CFLAGS = -std=gnu11 -g -O3 -flto -fuse-linker-plugin
33
AM_LDFLAGS = -static
44

5-
DIST_SUBDIRS = docs benchmark
5+
DIST_SUBDIRS = docs benchmark examples
66

77
EXTRA_DIST = \
88
CHANGES \
99
LICENSE \
1010
README.rst
1111

1212
SOURCE_FILES = \
13+
src/dynamic/hash.c \
14+
src/dynamic/buffer.c \
15+
src/dynamic/list.c \
1316
src/dynamic/vector.c \
1417
src/dynamic/string.c \
15-
src/dynamic/buffer.c \
16-
src/dynamic/map.c \
17-
src/dynamic/hash.c
18+
src/dynamic/map.c
1819

1920
HEADER_FILES = \
21+
src/dynamic/hash.h \
22+
src/dynamic/buffer.h \
23+
src/dynamic/list.h \
2024
src/dynamic/vector.h \
2125
src/dynamic/string.h \
22-
src/dynamic/buffer.h \
23-
src/dynamic/map.h \
24-
src/dynamic/hash.h
26+
src/dynamic/map.h
2527

2628
AUTOMAKE_OPTIONS = subdir-objects
2729
lib_LTLIBRARIES= libdynamic.la
@@ -36,7 +38,7 @@ mainheader_HEADERS = src/dynamic.h
3638
pkgconfigdir = $(libdir)/pkgconfig
3739
pkgconfig_DATA = libdynamic.pc
3840

39-
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in docs/Makefile.in benchmark/Makefile.in libdynamic-?.?.?.tar.gz
41+
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in docs/Makefile.in benchmark/Makefile.in examples/Makefile.in libdynamic-?.?.?.tar.gz
4042
maintainer-clean-local:; rm -rf autotools m4 libdynamic-?.?.?
4143

4244
### unit tests ###
@@ -49,12 +51,25 @@ check_LIBRARIES = libdynamic_test.a
4951
libdynamic_test_a_CFLAGS = $(CHECK_CFLAGS)
5052
libdynamic_test_a_SOURCES = $(SOURCE_FILES) $(HEADER_FILES)
5153

52-
check_PROGRAMS = test/buffer
54+
55+
check_PROGRAMS = test/hash
56+
test_hash_CFLAGS = $(CHECK_CFLAGS)
57+
test_hash_LDADD = $(CHECK_LDADD)
58+
test_hash_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
59+
test_hash_SOURCES = test/hash.c test/mock.c
60+
61+
check_PROGRAMS += test/buffer
5362
test_buffer_CFLAGS = $(CHECK_CFLAGS)
5463
test_buffer_LDADD = $(CHECK_LDADD)
5564
test_buffer_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
5665
test_buffer_SOURCES = test/buffer.c test/mock.c
5766

67+
check_PROGRAMS += test/list
68+
test_list_CFLAGS = $(CHECK_CFLAGS)
69+
test_list_LDADD = $(CHECK_LDADD)
70+
test_list_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
71+
test_list_SOURCES = test/list.c test/mock.c
72+
5873
check_PROGRAMS += test/vector
5974
test_vector_CFLAGS = $(CHECK_CFLAGS)
6075
test_vector_LDADD = $(CHECK_LDADD)
@@ -67,12 +82,6 @@ test_string_LDADD = $(CHECK_LDADD)
6782
test_string_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
6883
test_string_SOURCES = test/string.c test/mock.c
6984

70-
check_PROGRAMS += test/hash
71-
test_hash_CFLAGS = $(CHECK_CFLAGS)
72-
test_hash_LDADD = $(CHECK_LDADD)
73-
test_hash_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
74-
test_hash_SOURCES = test/hash.c test/mock.c
75-
7685
check_PROGRAMS += test/map
7786
test_map_CFLAGS = $(CHECK_CFLAGS)
7887
test_map_LDADD = $(CHECK_LDADD)

benchmark/map.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,18 @@ static void shuffle(int *array, size_t n)
7373

7474
static int set_int_empty = -1;
7575

76-
static size_t set_int_hash(map *m, void *e)
76+
static size_t set_int_hash(void *e)
7777
{
78-
(void) m;
7978
return *(int *) e;
8079
}
8180

82-
static int set_int_equal(map *m, void *e1, void *e2)
81+
static int set_int_equal(void *e1, void *e2)
8382
{
84-
(void) m;
8583
return *(int *) e1 == *(int *) e2;
8684
}
8785

88-
static void set_int_set(map *m, void *e1, void *e2)
86+
static void set_int_set(void *e1, void *e2)
8987
{
90-
(void) m;
9188
*(int *) e1 = *(int *) e2;
9289
}
9390

@@ -182,5 +179,5 @@ int main()
182179
(void) fprintf(stdout, "%s,%lu,%f,%f,%f,%lu\n", mp->name, mp->size, mp->insert, mp->lookup, mp->delete, mp->sum);
183180
}
184181

185-
vector_destruct(&metrics);
182+
vector_destruct(&metrics, NULL);
186183
}

benchmark/map_libdynamic.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,18 @@ struct map_element
1515
uint32_t value;
1616
};
1717

18-
static size_t hash(map *m, void *e)
18+
static size_t hash(void *e)
1919
{
20-
(void) m;
2120
return *(uint32_t *) e;
2221
}
2322

24-
static int equal(map *m, void *e1, void *e2)
23+
static int equal(void *e1, void *e2)
2524
{
26-
(void) m;
2725
return *(uint32_t *) e1 == *(uint32_t *) e2;
2826
}
2927

30-
static void set(map *m, void *e1, void *e2)
28+
static void set(void *e1, void *e2)
3129
{
32-
(void) m;
3330
*(uint64_t *) e1 = *(uint64_t *) e2;
3431
}
3532

benchmark/map_libdynamic_subclass.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,18 @@ struct map_int_pair_element
1919

2020
static map_int_pair_element empty = {.key = -1};
2121

22-
static size_t hash(map *m, void *e)
22+
static size_t hash(void *e)
2323
{
24-
(void) m;
2524
return *(uint32_t *) e;
2625
}
2726

28-
static void set(map *m, void *dst, void *src)
27+
static void set(void *dst, void *src)
2928
{
30-
(void) m;
3129
*(uint64_t *) dst = *(uint64_t *) src;
3230
}
3331

34-
static int equal(map *m, void *e1, void *e2)
32+
static int equal(void *e1, void *e2)
3533
{
36-
(void) m;
3734
return *(uint32_t *) e1 == *(uint32_t *) e2;
3835
}
3936

benchmark/vector_dynamic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ void vector_dynamic(vector_metric *metric, size_t n)
2121
t2 = ntime();
2222
metric->insert = (double) (t2 - t1) / n;
2323

24-
vector_destruct(&v);
24+
vector_destruct(&v, NULL);
2525
}

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([libdynamic], [1.0.0], [fredrik.widlund@gmail.com])
1+
AC_INIT([libdynamic], [1.1.0], [fredrik.widlund@gmail.com])
22
AC_CONFIG_AUX_DIR(autotools)
33
AC_CONFIG_MACRO_DIR([m4])
44
AM_INIT_AUTOMAKE([-Wall -Werror foreign no-define])
@@ -11,5 +11,5 @@ AC_PROG_LIBTOOL
1111
AM_PROG_CC_C_O
1212
AC_PROG_CXX
1313

14-
AC_CONFIG_FILES([Makefile docs/Makefile benchmark/Makefile libdynamic.pc])
14+
AC_CONFIG_FILES([Makefile docs/Makefile benchmark/Makefile examples/Makefile libdynamic.pc])
1515
AC_OUTPUT

0 commit comments

Comments
 (0)