Commit Graph

18 Commits

Author SHA1 Message Date
Daniel Hahler 3cd0bb5783 common/array.h: add macro `foreach_reverse`
Ref: https://github.com/awesomeWM/awesome/pull/340
2015-07-25 16:42:50 +02:00
Uli Schlachter 2b1febeabe Make objects properly inherit signals from classes
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-07 14:42:03 +01:00
Gregor Best c2ea920ca0 remove encoding=utf-8 from modelines
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:

    #!/bin/ksh

    git ls-tree -r HEAD | cut -f2 | while read f; do
        egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
        sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
        mv /tmp/foo $f
    done

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-11 17:34:09 +02:00
Uli Schlachter 0783ee8ffb barray: Work with more compare functions
Currently, this code requires a compare functions to return either -1, 0 or 1.
Values outside of this range will result in endless loops. Fix this by using if
instead of switch() for the result of the compare function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-01 15:37:21 +02:00
Julien Danjou f8d549139f array: add bisect-style insert and lookup
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-16 17:10:55 +02:00
Mariusz Ceier 7010ffd164 Fix foreach macro
Fixes support of break/continue statement

Signed-off-by: Mariusz Ceier <mceier@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-29 21:13:37 +02:00
Julien Danjou 505245a5ff array: fix foreach statement
We continously check for len, and build var upon each iteration so we
are sure we never go away in memory.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-29 19:54:07 +02:00
Julien Danjou 56225a39fe array: check that we are still in the tab
If the array is modified while we are running the foreach() loop, the
tab of the array may be reallocated, so var can be totally out of the
memory: check for that.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-28 08:34:13 +02:00
Julien Danjou 87c3c02b72 array: add a set of useful functions
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:32 +02:00
Julien Danjou e145afec53 array: add foreach() statement
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:32 +02:00
Julien Danjou 737a70f60c remove a bunch of useless #include-s
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-24 20:57:29 +02:00
Julien Danjou e3ed35e853 array: remove spurious semi colon
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-28 15:57:00 +02:00
Julien Danjou f5f0663bf1 fix ARRAY_TYPE decl
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-24 16:25:11 +02:00
Pierre Habouzit 4d7a7694ae Calling destructor on splice is wrong, take doesn't want it e.g.
Also fix one assert.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-25 11:04:56 +02:00
Pierre Habouzit 3513e43f0f fix stupid array bug: missing sizeof()
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-23 17:26:35 +02:00
Pierre Habouzit ef4eae17c4 Split DO_ARRAY in two parts. 2008-06-23 16:40:43 +02:00
Pierre Habouzit dc6373488f wipe elements overwritten by a splice
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 22:09:19 +02:00
Pierre Habouzit f2fd90655e Add a simple array generic type.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 13:52:26 +02:00