397 Commits

Author SHA1 Message Date
Heng Li
7b166e5296 pass item index to function calls
kt_for() to be replaced by more complex but more versatile APIs
2013-10-09 23:52:13 -04:00
Heng Li
eff7d1ee9d don't need this now, but maybe in future 2013-10-09 14:26:17 -04:00
Heng Li
326cf675b2 fixed a dead loop when n_threads==1 2013-10-09 12:51:34 -04:00
Heng Li
82fd9293bb bugfix: wrong integer type
but it does not really matter
2013-10-09 11:55:39 -04:00
Heng Li
3d95aad202 no effective changes 2013-10-09 11:50:27 -04:00
Heng Li
0978a8b055 documentation; better var names 2013-10-09 11:47:29 -04:00
Heng Li
6e214f00ea let the main thread help the unfinished workers 2013-10-09 11:26:20 -04:00
Heng Li
28e53a3848 more comments 2013-10-09 11:01:28 -04:00
Heng Li
1954f3fca1 forgot to remove debugging code
which causes bugs
2013-10-08 23:08:18 -04:00
Heng Li
98b1434a72 fixed a typo 2013-10-08 23:01:44 -04:00
Heng Li
f8e0c2f23e Merge branch 'master' of github.com:attractivechaos/klib 2013-10-08 22:52:48 -04:00
Heng Li
cb9c88c84e for C++ compatibility 2013-10-08 22:45:29 -04:00
Heng Li
1b4415cd9c use test-and-set for spin lock 2013-10-08 20:54:22 -04:00
Heng Li
2dd629bbce working, but locking is slow 2013-10-08 20:45:40 -04:00
Heng Li
b8c7056ac9 remove 2013-10-08 16:55:28 -04:00
Heng Li
0a83546ec1 parallelize simple "for" loops 2013-10-08 16:55:04 -04:00
Heng Li
b5d9c93aad parallelize simple "for" loops 2013-10-08 16:50:21 -04:00
Heng Li
57dc7b07c9 removed incorrect comments 2013-07-24 11:19:38 -04:00
Heng Li
386c57514d revert a change to ks_resize()
due to a mistaken merge
2013-07-24 11:12:19 -04:00
Heng Li
bbf1648ac6 Merge pull request #21 from jmarshall/kstring
Make ks_resize(&kstr,kstr.l+1) useful for ensuring the string is allocated and NUL-terminated
2013-07-24 07:42:23 -07:00
John Marshall
7e277d8a8b Add kstring_t init/destroy documentation
Ideally these could be provided as ks_init()/ks_destroy(),
but those names are already in use with kstream_t.
2013-07-24 14:30:57 +01:00
John Marshall
99ca35977c Only canonicalise if there is room, and add docs
We could increment SIZE to ensure there would be room, but that would
disadvantage people using kstrings for binary data in power-of-2-sized
blocks.  Instead document that SIZE=KS.l+1 will ensure NUL-termination.

This fixes a bug in the previous version when the l<m invariant does not
hold (kputc_()/etc and manual manipulation only maintain the weaker l<=m);
hattip Rob Davies.
2013-07-24 14:08:25 +01:00
John Marshall
e1c0050667 ks_resize() canonicalises the stored string
It ensures the string is NUL-terminated, especially in the case that
ks_resize(&kstr,1) has been used on a newly-created kstring_t to ensure
that kstr.s is not NULL.
2013-07-23 16:16:19 +01:00
Heng Li
41bff76244 Merge pull request #20 from jmarshall/kputl
Bug fix for kputl(), and kputw()/kputl() tests
2013-07-23 04:50:21 -07:00
John Marshall
d47fc9def4 Fix kputl(LONG_MIN) bug
Use an explicitly unsigned long, and do any negation as that type.

Make similar changes to kputw(), as the code is clearer.
2013-07-23 11:56:15 +01:00
John Marshall
c95f147e67 Add kputw() and kputl() tests 2013-07-22 16:07:45 +01:00
Heng Li
cad4c57d97 Merge pull request #19 from jkbonfield/master
Error checking + updates from htslib
2013-07-19 10:58:43 -07:00
James Bonfield
133bb25dfe Merged with attractivechaos/klib:
- add upstream kvsprintf and rework ksprintf
- add upstream printf attribute checks
- use our kputw (has MIN_INT bug fix)
- keep our extra functions (kputc_, kputsn_, kputl)

Added ks_str and ks_len functions for tidier manipulation of
internals.

Added error checking to all functions that allocate memory and could
potentially fail; ie return EOF or negative values as per stdio
equivalents.
2013-07-17 17:51:13 +01:00
Attractive Chaos
af0848b627 Merge pull request #18 from sciascid/master
Document -1 extra return code in kh_put().
2013-07-15 07:36:39 -07:00
Daniele Sciascia
70c0e39705 Document -1 extra return code in kh_put(). 2013-07-13 21:22:53 +02:00
Attractive Chaos
fff70758ed Merge pull request #15 from yorhel/master
kstring printf improvements
2013-05-08 08:27:26 -07:00
Yorhel
9f49ae119c kstring: Add printf format attribute to kvsprintf() and ksprintf()
This allows compile-time detection of format-string related bugs.
Although the macros only check for the GCC version, clang (and perhaps
other compilers too) have these macros defined and can recognize
the formatting attributes as well.
2013-05-07 12:05:25 +02:00
Yorhel
e44075f866 kstring: Add kvsprintf() 2013-05-07 11:56:49 +02:00
Heng Li
0afbad198c khash-0.2.8: use quadratic probing 2013-05-02 17:34:11 -04:00
Heng Li
c944fdf868 change hash set to hash map 2013-05-02 16:25:50 -04:00
Heng Li
605507576b Merge branch 'master' of github.com:attractivechaos/klib 2013-05-02 15:51:45 -04:00
Heng Li
7452f78d6a test performance given packed struct 2013-05-02 15:51:14 -04:00
Attractive Chaos
343ef09d44 Merge pull request #14 from zjf/patch-1
typo correction
2013-04-01 07:44:14 -07:00
Jianfeng Zhu
e88599d5ca typo correction 2013-04-01 22:41:48 +08:00
Heng Li
e2080f6cce Merge branch 'master' of github.com:attractivechaos/klib 2013-02-20 20:14:35 -05:00
Heng Li
2763fa6d4c bugfix: point address changes 2013-02-20 20:14:04 -05:00
Attractive Chaos
8213e5bbba Merge pull request #12 from leecbaker/master
Minor spelling fixes
2013-02-16 05:30:16 -08:00
Lee Baker
1875d95379 Spelling corrections 2013-02-13 15:07:00 -06:00
Heng Li
0636685258 bugfix: 2nd best score not set
because I was comparing (uint32_t)-1 with a positive integer...
2013-02-12 17:37:14 -05:00
Heng Li
fd9cee5312 Merge branch 'master' of github.com:attractivechaos/klib 2013-02-12 16:21:12 -05:00
Heng Li
d4c28fd9c6 added NW and SW-extension; backported from bwa 2013-02-12 16:20:36 -05:00
Attractive Chaos
8ad7eab205 Merge pull request #11 from leecbaker/master
Minor spelling and grammar corrections in the readme
2013-02-01 13:11:55 -08:00
Lee Baker
97f9ce5ad2 Spelling / grammar corrections in the README. 2013-02-01 15:08:49 -06:00
Heng Li
04fc53768f minor gramartical improvement 2013-01-27 21:20:19 -05:00
Heng Li
6e848532ec fixed typo 2013-01-27 21:17:37 -05:00