summaryrefslogtreecommitdiff
path: root/src/gib_list.c
AgeCommit message (Collapse)AuthorLines
2018-10-17Use random() instead of rand() to increase portabilityDaniel Friesel-1/+1
Quoting glibc rand(3): The versions of rand() and srand() in the Linux C Library use the same random number generator as random(3) and srandom(3), so the lower-order bits should be as random as the higher-order bits. However, on older rand() implementations, and on current implementations on different systems, the lower-order bits are much less random than the higher-order bits. Do not use this function in applications intended to be portable when good randomness is needed. (Use random(3) instead.)
2018-03-10Only set random seed onceDaniel Friesel-1/+0
Fixes non-random behaviour when randomizing file lists several times per second. Closes #349
2014-05-06remove gib_utils, the same functionality is provided by utils alreadyDaniel Friesel-55/+5
2014-05-05gib_list_randomize: use code better suited for short lists (closes #151)Daniel Friesel-6/+4
Note that the i == r check was never reached in the original code but may be in the new variant. Since a shuffled list may well have one or two elements retain their absolute position once in a while, this should not be a problem. tests with 2- and 3-element lists show an even distribution amongst all elements.
2014-05-04strip unneded parts from giblib, part 1Daniel Friesel-2/+10
Not all functions were examined yet. Also TODO: * check strdup / malloc calls (some are apparently unchecked in giblib), maybe use estrdup / emalloc for those * Check includes and update dependency list if needed
2014-05-04import partial giblib source into feh, do not link with giblibDaniel Friesel-0/+624