Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package tllist for openSUSE:Factory checked in at 2022-12-05 18:00:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/tllist (Old) and /work/SRC/openSUSE:Factory/.tllist.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "tllist" Mon Dec 5 18:00:57 2022 rev:2 rq:1040037 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/tllist/tllist.changes 2021-06-13 23:06:25.439699045 +0200 +++ /work/SRC/openSUSE:Factory/.tllist.new.1835/tllist.changes 2022-12-05 18:01:01.144522090 +0100 @@ -1,0 +2,6 @@ +Sun Dec 4 13:49:56 UTC 2022 - Dirk Müller <dmuel...@suse.com> + +- update to 1.1.0: + * tll_sort() - sorts the list in O(n log(n)) time + +------------------------------------------------------------------- Old: ---- tllist-1.0.5.tar.gz New: ---- tllist-1.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ tllist.spec ++++++ --- /var/tmp/diff_new_pack.D5hQjq/_old 2022-12-05 18:01:01.788525597 +0100 +++ /var/tmp/diff_new_pack.D5hQjq/_new 2022-12-05 18:01:01.792525618 +0100 @@ -1,7 +1,7 @@ # # spec file for package tllist # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: tllist -Version: 1.0.5 +Version: 1.1.0 Release: 0 Summary: A C header file only implementation of a typed linked list License: MIT ++++++ tllist-1.0.5.tar.gz -> tllist-1.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tllist/.gitlab-ci.yml new/tllist/.gitlab-ci.yml --- old/tllist/.gitlab-ci.yml 2021-02-07 16:00:03.000000000 +0100 +++ new/tllist/.gitlab-ci.yml 2022-08-07 09:21:53.000000000 +0200 @@ -1,4 +1,4 @@ -image: alpine:edge +image: alpine:latest stages: - build @@ -7,7 +7,6 @@ # GIT_SUBMODULE_STRATEGY: normal before_script: - - echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories - apk update - apk add musl-dev meson ninja gcc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tllist/.woodpecker.yml new/tllist/.woodpecker.yml --- old/tllist/.woodpecker.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/tllist/.woodpecker.yml 2022-08-07 09:21:53.000000000 +0200 @@ -0,0 +1,21 @@ +pipeline: + build: + image: alpine:latest + when: { branch: master } + commands: + - apk update + - apk add musl-dev meson ninja gcc + + - mkdir -p bld/debug + - cd bld/debug + - meson --buildtype=debug ../.. + - ninja -v -k0 + - ninja -v test + - cd ../.. + + - mkdir -p bld/release + - cd bld/release + - meson --buildtype=release ../.. + - ninja -v -k0 + - ninja -v test + - cd ../.. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tllist/PKGBUILD new/tllist/PKGBUILD --- old/tllist/PKGBUILD 2021-02-07 16:00:03.000000000 +0100 +++ new/tllist/PKGBUILD 2022-08-07 09:21:53.000000000 +0200 @@ -1,5 +1,5 @@ pkgname=tllist -pkgver=1.0.4 +pkgver=1.1.0 pkgrel=1 pkgdesc="A C header file only implementation of a typed linked list" arch=('x86_64' 'aarch64') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tllist/README.md new/tllist/README.md --- old/tllist/README.md 2021-02-07 16:00:03.000000000 +0100 +++ new/tllist/README.md 2022-08-07 09:21:53.000000000 +0200 @@ -1,3 +1,5 @@ +[](https://ci.codeberg.org/dnkl/tllist) + # tllist **tllist** is a **T**yped **L**inked **L**ist C header file only @@ -313,3 +315,4 @@ | `tll_remove_and_free(list, it, cb)` | removes _it_ from the list, and calls `cb(it->item)`. | `tll_(r)foreach()` | O(1) | | `tll_free(list)` | removes **all** items from the list | | O(n) | | `tll_free_and_free(list, cb)` | removes **all** items from the list, and calls `cb(it->item)` for each item. | | O(n) | +| `tll_sort(list, cmp)` | sort the list according to the result of `cmp(item1, item2)` | | O(n log(n)) | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tllist/meson.build new/tllist/meson.build --- old/tllist/meson.build 2021-02-07 16:00:03.000000000 +0100 +++ new/tllist/meson.build 2022-08-07 09:21:53.000000000 +0200 @@ -1,4 +1,8 @@ -project('tllist', 'c', version: '1.0.4', license: 'MIT', meson_version: '>=0.54.0') +project('tllist', + 'c', + version: '1.1.0', + license: 'MIT', + meson_version: '>=0.54.0') tllist = declare_dependency(include_directories: '.') meson.override_dependency('tllist', tllist) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tllist/test.c new/tllist/test.c --- old/tllist/test.c 2021-02-07 16:00:03.000000000 +0100 +++ new/tllist/test.c 2022-08-07 09:21:53.000000000 +0200 @@ -6,6 +6,18 @@ #include <tllist.h> +static int +order12(int a, int b) +{ + return (b < a); +} + +static int +order21(int a, int b) +{ + return (a < b); +} + int main(int argc, const char *const *argv) { @@ -20,6 +32,14 @@ assert(tll_front(l) == 123); assert(tll_back(l) == 789); + tll_sort(l, order21); + assert(tll_front(l) == 789); + assert(tll_back(l) == 123); + + tll_sort(l, order12); + assert(tll_front(l) == 123); + assert(tll_back(l) == 789); + /* push front */ tll_push_front(l, 0xabc); assert(tll_length(l) == 4); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tllist/tllist.h new/tllist/tllist.h --- old/tllist/tllist.h 2021-02-07 16:00:03.000000000 +0100 +++ new/tllist/tllist.h 2022-08-07 09:21:53.000000000 +0200 @@ -190,3 +190,65 @@ (list).length = 0; \ (list).head = (list).tail = NULL; \ } while (0) + +#define tll_sort(list, cmp) \ + do { \ + __typeof((list).head) __p; \ + __typeof((list).head) __q; \ + __typeof((list).head) __e; \ + __typeof((list).head) __t; \ + int __insize, __nmerges, __p_size, __q_size; \ + if ((list).head == NULL) \ + break; \ + __insize = 1; \ + while (1) { \ + __p = (list).head; \ + (list).head = NULL; \ + __t = NULL; \ + __nmerges = 0; \ + while (__p != NULL) { \ + __nmerges++; \ + __q = __p; \ + __p_size = 0; \ + for (int _i = 0; _i < __insize; _i++) { \ + __p_size++; \ + __q = __q->next; \ + if (__q == NULL) \ + break; \ + } \ + __q_size = __insize; \ + while (__p_size > 0 || (__q_size > 0 && __q != NULL)) { \ + if (__p_size == 0) { \ + __e = __q; \ + __q = __q->next; \ + __q_size--; \ + } else if (__q_size == 0 || __q == NULL) { \ + __e = __p; \ + __p = __p->next; \ + __p_size--; \ + } else if (cmp(__p->item, __q->item) <= 0) { \ + __e = __p; \ + __p = __p->next; \ + __p_size--; \ + } else { \ + __e = __q; \ + __q = __q->next; \ + __q_size--; \ + } \ + if (__t != NULL) { \ + __t->next = __e; \ + } else { \ + (list).head = __e; \ + } \ + __e->prev = __t; \ + __t = __e; \ + } \ + __p = __q; \ + } \ + (list).tail = __t; \ + __t->next = NULL; \ + __insize *= 2; \ + if (__nmerges <= 1) \ + break; \ + } \ + } while (0)