diff --git a/.cirrus.yml b/.cirrus.yml index 0234f062..7a289e53 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -14,4 +14,4 @@ cirrus-ci_task: - mv c-toxcore cirrus-ci-build - cd - test_all_script: - - bazel test --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST --copt=-DUSE_IPV6=0 -c opt -k //c-toxcore/... + - bazel test --copt=-DUSE_IPV6=0 -c opt -k //c-toxcore/... diff --git a/toxav/BUILD.bazel b/toxav/BUILD.bazel index a2b57ee9..865c0545 100644 --- a/toxav/BUILD.bazel +++ b/toxav/BUILD.bazel @@ -122,3 +122,23 @@ cc_library( ":video", ], ) + +CIMPLE_SRCS = glob( + [ + "*.c", + "*.h", + ], + exclude = [ + "*.api.h", + "toxav.h", + ], +) + +sh_test( + name = "cimple_test", + size = "small", + srcs = ["//hs-tokstyle/tools:check-cimple"], + args = ["$(location %s)" % f for f in CIMPLE_SRCS], + data = CIMPLE_SRCS, + tags = ["manual"], +) diff --git a/toxav/ring_buffer.c b/toxav/ring_buffer.c index 2b76f2ba..7cb8996d 100644 --- a/toxav/ring_buffer.c +++ b/toxav/ring_buffer.c @@ -85,8 +85,9 @@ RingBuffer *rb_new(int size) } buf->size = size + 1; /* include empty elem */ + buf->data = (void **)calloc(buf->size, sizeof(void *)); - if (!(buf->data = (void **)calloc(buf->size, sizeof(void *)))) { + if (!buf->data) { free(buf); return nullptr; } @@ -118,7 +119,7 @@ uint16_t rb_data(const RingBuffer *b, void **dest) { uint16_t i = 0; - for (; i < rb_size(b); i++) { + for (; i < rb_size(b); ++i) { dest[i] = b->data[(b->start + i) % b->size]; } diff --git a/toxcore/BUILD.bazel b/toxcore/BUILD.bazel index fc28a333..2fe951ac 100644 --- a/toxcore/BUILD.bazel +++ b/toxcore/BUILD.bazel @@ -279,3 +279,27 @@ cc_library( "//c-toxcore/toxencryptsave:defines", ], ) + +CIMPLE_SRCS = glob( + [ + "*.c", + "*.h", + ], + exclude = [ + "*.api.h", + "ccompat.h", + "crypto_core_mem.c", + "ping_array.h", + "tox.h", + "tox_api.c", + ], +) + +sh_test( + name = "cimple_test", + size = "small", + srcs = ["//hs-tokstyle/tools:check-cimple"], + args = ["$(location %s)" % f for f in CIMPLE_SRCS], + data = CIMPLE_SRCS, + tags = ["manual"], +)