diff --git a/Makefile.am b/Makefile.am index cf4c82d..0079e48 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ libautoptr_la_SOURCES = # # version-info current:revision:age # -libautoptr_la_LDFLAGS=-rpath '$(libdir)' -version-info 1:1:1 +libautoptr_la_LDFLAGS=-rpath '$(libdir)' -version-info 2:2:2 libautoptr_la_LIBADD = $(SUBLIBS) pkgincludedir = ${includedir} diff --git a/README.md b/README.md index 2757c71..c23d597 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ data structure. An example usage is struct my_struct { struct autoptr __autoptr; // Treating as a "private" member + int data; ... }; diff --git a/configure.ac b/configure.ac index f046dca..b328daf 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. dnl AC_PREREQ([2.59]) -AC_INIT([libautoptr], [0.1.0], [jgraham@compukix.net]) +AC_INIT([libautoptr], [0.2.0], [jgraham@compukix.net]) AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_HEADERS([config.h]) @@ -36,7 +36,7 @@ dnl Check if Libtool is present dnl Libtool is used for building share libraries AC_PROG_LIBTOOL -# Checks for header files. +# Checks for header files.i AC_CHECK_HEADERS([ \ assert.h \ pthread.h \ diff --git a/doc/doxygen/doxygen.cfg b/doc/doxygen/doxygen.cfg index 709ea71..b9276a1 100644 --- a/doc/doxygen/doxygen.cfg +++ b/doc/doxygen/doxygen.cfg @@ -38,7 +38,7 @@ PROJECT_NAME = "libautoptr" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.0 +PROJECT_NUMBER = 0.2.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tests/test_autoptr1.c b/tests/test_autoptr1.c index dbc5867..a74c32f 100644 --- a/tests/test_autoptr1.c +++ b/tests/test_autoptr1.c @@ -1,30 +1,30 @@ #include #include -#include #include "test_common.h" +#include int main(int argc, char **argv) { - struct test t; - struct test *p = NULL; - - test_ctor(&t); - p = autoptr_bind(&t); + struct test t; + struct test *p = NULL; + + test_ctor(&t); + p = autoptr_bind(&t); - assert( ! autoptr_destroy_ok(&t) ); + assert(!autoptr_destroy_ok(&t)); - // Release ownership of primary test object - autoptr_release(&t); + // Release ownership of primary test object + autoptr_release(&t); - // The test object should be destroyable (i.e., single owner) - assert( autoptr_destroy_ok(&t) ); + // The test object should be destroyable (i.e., single owner) + assert(autoptr_destroy_ok(&t)); - autoptr_unbind((void **)&p); - assert( p == NULL ); + autoptr_unbind((void **)&p); + assert(p == NULL); - // Ensure that destructor callback was called - assert(!test_initd); + // Ensure that destructor callback was called + assert(!test_initd); - return 0; + return 0; } diff --git a/tests/test_autoptr2.c b/tests/test_autoptr2.c index db902c2..862a41e 100644 --- a/tests/test_autoptr2.c +++ b/tests/test_autoptr2.c @@ -1,34 +1,34 @@ #include #include -#include #include "test_common.h" +#include int main(int argc, char **argv) { - struct test *t = test_valloc(3); - struct test *p0 = autoptr_bind(&t[0]); - struct test *p1 = autoptr_bind(&t[1]); - struct test *p2 = autoptr_bind(&t[2]); - - assert( ! autoptr_destroy_ok(t) ); - - // Release ownership of primary test object - autoptr_release(t); - - autoptr_unbind((void **)&p0); - assert( p0 == NULL ); - assert(test_initd); - - autoptr_unbind((void **)&p1); - assert( p1 == NULL ); - assert(test_initd); - - autoptr_unbind((void **)&p2); - assert( p2 == NULL ); - - // Ensure that destructor callback was called - assert(!test_initd); - - return 0; + struct test *t = test_valloc(3); + struct test *p0 = autoptr_bind(&t[0]); + struct test *p1 = autoptr_bind(&t[1]); + struct test *p2 = autoptr_bind(&t[2]); + + assert(!autoptr_destroy_ok(t)); + + // Release ownership of primary test object + autoptr_release(t); + + autoptr_unbind((void **)&p0); + assert(p0 == NULL); + assert(test_initd); + + autoptr_unbind((void **)&p1); + assert(p1 == NULL); + assert(test_initd); + + autoptr_unbind((void **)&p2); + assert(p2 == NULL); + + // Ensure that destructor callback was called + assert(!test_initd); + + return 0; } diff --git a/tests/test_common.h b/tests/test_common.h index 13464ec..23fadb9 100644 --- a/tests/test_common.h +++ b/tests/test_common.h @@ -9,7 +9,7 @@ static int test_initd = 0; struct test { struct autoptr __autoptr; - int data; + int data; }; static void test_dtor(struct test *t); @@ -18,7 +18,7 @@ static void test_ctor(struct test *t) autoptr_ctor(t, sizeof(*t), (void (*)(void *))test_dtor); ++test_initd; - t->data = 42; + t->data = 42; } static void test_dtor(struct test *t)