# HG changeset patch # User Matti Hamalainen # Date 1425177923 -7200 # Node ID 501ee5f0c043fcc9a5f279a6ff967901011dd7af # Parent 1684bf6aa1f8da5c1f3c42f9f4e1324acdf85bb8 Rename variables for consistency. diff -r 1684bf6aa1f8 -r 501ee5f0c043 src/dmres.c --- a/src/dmres.c Sun Mar 01 04:43:10 2015 +0200 +++ b/src/dmres.c Sun Mar 01 04:45:23 2015 +0200 @@ -456,7 +456,7 @@ static int dm_pack_preload(DMResource *handle) { DMPackEntry *node; - int res = DMERR_OK; + int ret = DMERR_OK; if (handle->lib == NULL || handle->lib->packFile == NULL) return DMERR_NULLPTR; @@ -464,7 +464,7 @@ // Search PACK nodelist for file if ((node = dmPackFind(handle->lib->packFile->entries, handle->filename)) == NULL) { - res = dmError(DMERR_NOT_FOUND, + ret = dmError(DMERR_NOT_FOUND, "Entry '%s' not found in PACK file.\n", handle->filename); goto out; @@ -473,7 +473,7 @@ // Seek to entry if (fseek(handle->lib->packFile->file, node->offset, SEEK_SET) == -1) { - res = dmError(DMERR_FSEEK, + ret = dmError(DMERR_FSEEK, "Could not seek node position in PACK file.\n"); goto out; } @@ -481,7 +481,7 @@ res = dm_pack_decompress(handle, node); out: - return res; + return ret; } @@ -489,11 +489,11 @@ { if ((f->flags & DMF_LOADED_RAW) == 0) { - int res = dm_pack_preload(f); - if (res == DMERR_OK) + int ret = dm_pack_preload(f); + if (ret == DMERR_OK) f->flags |= DMF_LOADED_RAW; - return res; + return ret; } else return DMERR_OK; @@ -736,7 +736,7 @@ int dmf_open(DMResourceLib *lib, const char *filename, DMResource **phandle) { DMResource *handle; - int res; + int ret; // Check master directory for resource if ((*phandle = handle = dmResourceFind(lib, filename)) == NULL) @@ -760,7 +760,7 @@ } // Check if the data is preloaded - if ((res = handle->fops->fopen(handle)) == DMERR_OK) + if ((ret = handle->fops->fopen(handle)) == DMERR_OK) { dmResourceRef(handle); if (handle->flags & DMF_TEMPORARY) @@ -777,7 +777,7 @@ } dmfreset(handle); - return res; + return ret; } @@ -962,7 +962,7 @@ #ifdef DM_USE_STDIO static int dmResourcesLoadDirectory(DMResourceLib *lib, const char *path) { - int res = DMERR_OK; + int ret = DMERR_OK; struct dirent *dh; DIR *hdir = opendir(path); if (hdir == NULL) @@ -980,9 +980,9 @@ char *fname = dm_strdup_printf("%s/%s", path, dh->d_name); if (stat(fname, &sbuf) == -1) { - res = dmError(dmGetErrno(), + ret = dmError(dmGetErrno(), "Could not stat() %s, #%d: %s\n", - fname, res, dmErrorStr(res)); + fname, ret, dmErrorStr(ret)); dmFree(fname); goto out; } @@ -1006,7 +1006,7 @@ closedir(hdir); #endif - return res; + return ret; } #endif @@ -1120,11 +1120,11 @@ #ifdef DM_USE_PACKFS if (lib->flags & DRF_USE_PACK) { - int res = dmPackClose(lib->packFile); - if (res != DMERR_OK) + int ret = dmPackClose(lib->packFile); + if (ret != DMERR_OK) { - dmError(res, "Error closing PACK, #%i: %s\n", - res, dmErrorStr(res)); + dmError(ret, "Error closing PACK, #%i: %s\n", + ret, dmErrorStr(ret)); } dmFree(lib->packFilename);