summaryrefslogtreecommitdiffstats
path: root/apps/plugins/sdl
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2019-07-29 21:05:00 -0400
committerFranklin Wei <franklin@rockbox.org>2019-07-30 03:44:43 +0200
commit94109a95062cb9830dc4452142dc65e905b7433f (patch)
treeec69b66b789be94412a3c618ca79da56a192f5e2 /apps/plugins/sdl
parent5e0bd5bfc093ceca8fd7313ab6410e2a43fdb1c9 (diff)
downloadrockbox-94109a95062cb9830dc4452142dc65e905b7433f.tar.gz
rockbox-94109a95062cb9830dc4452142dc65e905b7433f.tar.bz2
rockbox-94109a95062cb9830dc4452142dc65e905b7433f.zip
quake: fix file loading errors
Forgot a return statement in Sys_FileRead (which slipped by since I've made the questionable decision to disable all warnings...) Change-Id: Ia0f3da52b43765b8e0e9953893ac7957ec2f6c2e
Diffstat (limited to 'apps/plugins/sdl')
-rw-r--r--apps/plugins/sdl/progs/quake/sys_sdl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/plugins/sdl/progs/quake/sys_sdl.c b/apps/plugins/sdl/progs/quake/sys_sdl.c
index 44411bd153..efc285915b 100644
--- a/apps/plugins/sdl/progs/quake/sys_sdl.c
+++ b/apps/plugins/sdl/progs/quake/sys_sdl.c
@@ -168,13 +168,19 @@ static int Qfilelength (FILE *f)
}
#define CACHE_THRESHOLD (1024*1024)
+#define CACHE_ENABLE
/* really rough guesses */
+
+#ifdef CACHE_ENABLE
#if MEMORYSIZE >= 64
#define MAX_CACHE (32*1024*1024)
#elif MEMORYSIZE >= 32
#define MAX_CACHE (20*1024*1024)
-#else
+#endif
+#endif
+
+#ifndef MAX_CACHE
#define MAX_CACHE 0
#endif
@@ -221,6 +227,8 @@ int Sys_FileOpenRead (char *path, int *hndl)
}
}
}
+
+ return len;
}
int Sys_FileOpenWrite (char *path)