aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2015-07-03 20:49:16 +0200
committerRay <raysan5@gmail.com>2015-07-03 20:49:16 +0200
commita59433e7a3b22d5ded7505689fb44f1927194077 (patch)
tree4e75d2a6213b0b799b3ea12c677986158905bff4 /src/utils.c
parentcae6f3c613794e5e02233aa1590eb1ea9a8239cd (diff)
parentcd08ae7b858b62b341aebc86a7a4e915447c9423 (diff)
downloadraylib-a59433e7a3b22d5ded7505689fb44f1927194077.tar.gz
raylib-a59433e7a3b22d5ded7505689fb44f1927194077.zip
Merge pull request #23 from raysan5/develop
Integrate develop branch
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/utils.c b/src/utils.c
index c3c20b47..8e42e533 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -79,7 +79,7 @@ unsigned char *DecompressData(const unsigned char *data, unsigned long compSize,
pUncomp = (mz_uint8 *)malloc((size_t)uncompSize);
// Check correct memory allocation
- if (!pUncomp)
+ if (pUncomp == NULL)
{
TraceLog(WARNING, "Out of memory while decompressing data");
}
@@ -235,18 +235,18 @@ void TraceLog(int msgType, const char *text, ...)
}
// Initialize asset manager from android app
-void InitAssetManager(AAssetManager *manager)
+void InitAssetManager(AAssetManager *manager)
{
assetManager = manager;
}
// Replacement for fopen
-FILE *android_fopen(const char *fileName, const char *mode)
+FILE *android_fopen(const char *fileName, const char *mode)
{
if (mode[0] == 'w') return NULL;
AAsset *asset = AAssetManager_open(assetManager, fileName, 0);
-
+
if(!asset) return NULL;
return funopen(asset, android_read, android_write, android_seek, android_close);
@@ -292,24 +292,24 @@ int GetNextPOT(int num)
// Module specific Functions Definition
//----------------------------------------------------------------------------------
#if defined(PLATFORM_ANDROID)
-static int android_read(void *cookie, char *buf, int size)
+static int android_read(void *cookie, char *buf, int size)
{
return AAsset_read((AAsset *)cookie, buf, size);
}
-static int android_write(void *cookie, const char *buf, int size)
+static int android_write(void *cookie, const char *buf, int size)
{
TraceLog(ERROR, "Can't provide write access to the APK");
return EACCES;
}
-static fpos_t android_seek(void *cookie, fpos_t offset, int whence)
+static fpos_t android_seek(void *cookie, fpos_t offset, int whence)
{
return AAsset_seek((AAsset *)cookie, offset, whence);
}
-static int android_close(void *cookie)
+static int android_close(void *cookie)
{
AAsset_close((AAsset *)cookie);
return 0;