summaryrefslogtreecommitdiffstats
path: root/apps/plugins/pictureflow
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-09-07 23:16:29 +0000
committerThomas Martitz <kugel@rockbox.org>2011-09-07 23:16:29 +0000
commit5296af838c39b8b7c4b00a3c896345f9e0719dcf (patch)
treee3e31a974f23bd4cd810c00b892c1eabaec4c676 /apps/plugins/pictureflow
parent6a989b8d4dec4750ad474598bd52897381d2f3cb (diff)
downloadrockbox-5296af838c39b8b7c4b00a3c896345f9e0719dcf.tar.gz
rockbox-5296af838c39b8b7c4b00a3c896345f9e0719dcf.tar.bz2
rockbox-5296af838c39b8b7c4b00a3c896345f9e0719dcf.zip
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
Diffstat (limited to 'apps/plugins/pictureflow')
-rw-r--r--apps/plugins/pictureflow/pictureflow.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index c13aca1a95..a572586886 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -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;
}