1
0
Fork 0
forked from len0rd/rockbox

Buflib: Clarification about invalid handles

* Enhance allocation function comments to better state the return value and what an invalid value is
* Change clients to check for "< 0" instead of "<= 0" or "== 0"
* Return -1 or -2 depending on the exact failure in buflib_alloc_ex.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30469 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2011-09-07 23:16:29 +00:00
parent 6a989b8d4d
commit 5296af838c
5 changed files with 15 additions and 10 deletions

View file

@ -1520,9 +1520,11 @@ int read_pfraw(char* filename, int prio)
sizeof( pix_t ) * bmph.width * bmph.height;
int hid;
while (!(hid = rb->buflib_alloc(&buf_ctx, size)) && free_slide_prio(prio));
do {
hid = rb->buflib_alloc(&buf_ctx, size);
} while (hid < 0 && free_slide_prio(prio));
if (!hid) {
if (hid < 0) {
rb->close( fh );
return 0;
}