Mercurial > hg > dmlib
diff src/dmres.c @ 1102:e06abfde6c39
Cosmetics pass: Remove excess whitespace.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 03 Mar 2015 23:22:36 +0200 |
parents | 9f06f6661cdf |
children | fd1ccfc62ceb |
line wrap: on
line diff
--- a/src/dmres.c Tue Mar 03 22:32:34 2015 +0200 +++ b/src/dmres.c Tue Mar 03 23:22:36 2015 +0200 @@ -28,7 +28,7 @@ DMResource *node = dmMalloc0(sizeof(DMResource)); if (node == NULL) return NULL; - + node->lib = lib; node->filename = dm_strdup(filename); node->rawSize = size; @@ -80,7 +80,7 @@ { if (lib == NULL || node == NULL) return; - + node->lib = lib; if (lib->resources != NULL) @@ -93,7 +93,7 @@ { lib->resources = node->prev = node; } - + node->next = NULL; } @@ -260,16 +260,16 @@ int ret = dm_stdio_fopen(handle); if (ret != DMERR_OK) return ret; - + dm_stdio_fsize(handle); - + handle->rawData = dmMalloc(handle->rawSize); if (handle->rawData == NULL) return DMERR_MALLOC; - + if (dm_stdio_fread(handle->rawData, sizeof(Uint8), handle->rawSize, handle) != handle->rawSize) return DMERR_FREAD; - + return DMERR_OK; } @@ -668,7 +668,7 @@ NULL, dm_mem_fread, NULL, - + dm_pack_fopen, dm_pack_fclose, dm_pack_preload, @@ -690,7 +690,7 @@ dm_mem_fputc, dm_mem_fread, dm_mem_fwrite, - + NULL, dmResourceFree, NULL @@ -737,7 +737,7 @@ ret = handle->rops->load(handle); handle->fops->fclose(handle); } - + if (ret == DMERR_OK) handle->flags |= DMF_LOADED_RES; } @@ -831,7 +831,7 @@ handle->fops = &dfStdioFileOps; handle->fh = fopen(filename, mode); handle->error = dmGetErrno(); - + if (handle->fh == NULL) { dmResourceFree(handle); @@ -873,10 +873,10 @@ { if (f == NULL) return DMERR_NULLPTR; - + if (f->fops == NULL || f->fops->freset == NULL) return DMERR_OK; - + return f->fops->freset(f); } @@ -949,7 +949,7 @@ *p++ = c; } *p = 0; - + return (n > 0) ? s : NULL; } @@ -1040,7 +1040,7 @@ // Basic data lib->mutex = dmCreateMutex(); - lib->flags = flags; + lib->flags = flags; lib->resPath = dm_strdup((path != NULL) ? path : DMRES_DATA_PATH); @@ -1086,7 +1086,7 @@ res->fops = &dfPackFileOps; dmResourceInsert(lib, res); } - + initialized = TRUE; } } @@ -1126,10 +1126,10 @@ int dmResourcesClose(DMResourceLib *lib) { DMResource *node; - + if (lib == NULL) return DMERR_NULLPTR; - + dmMutexLock(lib->mutex); // Shutdown possible subsystems @@ -1170,12 +1170,12 @@ int ret = DMERR_OK; dmMutexLock(lib->mutex); - - // Initialize preloading + + // Initialize preloading if (lib->preload == NULL || start) { DMResource *node; - + lib->preload = lib->resources; *loaded = 0; *total = 0;