mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
minor coding style changes
This commit is contained in:
@ -406,16 +406,15 @@ UTIL_STATIC const char** UTIL_createFileList(const char **inputNames, unsigned i
|
|||||||
{
|
{
|
||||||
size_t pos;
|
size_t pos;
|
||||||
unsigned i, nbFiles;
|
unsigned i, nbFiles;
|
||||||
char *bufend, *buf;
|
char* buf = (char*)malloc(LIST_SIZE_INCREASE);
|
||||||
|
char* bufend = buf + LIST_SIZE_INCREASE;
|
||||||
const char** fileTable;
|
const char** fileTable;
|
||||||
|
|
||||||
buf = (char*)malloc(LIST_SIZE_INCREASE);
|
|
||||||
if (!buf) return NULL;
|
if (!buf) return NULL;
|
||||||
bufend = buf + LIST_SIZE_INCREASE;
|
|
||||||
|
|
||||||
for (i=0, pos=0, nbFiles=0; i<inputNamesNb; i++) {
|
for (i=0, pos=0, nbFiles=0; i<inputNamesNb; i++) {
|
||||||
if (!UTIL_isDirectory(inputNames[i])) {
|
if (!UTIL_isDirectory(inputNames[i])) {
|
||||||
size_t len = strlen(inputNames[i]);
|
size_t const len = strlen(inputNames[i]);
|
||||||
if (buf + pos + len >= bufend) {
|
if (buf + pos + len >= bufend) {
|
||||||
ptrdiff_t newListSize = (bufend - buf) + LIST_SIZE_INCREASE;
|
ptrdiff_t newListSize = (bufend - buf) + LIST_SIZE_INCREASE;
|
||||||
buf = (char*)UTIL_realloc(buf, newListSize);
|
buf = (char*)UTIL_realloc(buf, newListSize);
|
||||||
@ -437,8 +436,7 @@ UTIL_STATIC const char** UTIL_createFileList(const char **inputNames, unsigned i
|
|||||||
fileTable = (const char**)malloc((nbFiles+1) * sizeof(const char*));
|
fileTable = (const char**)malloc((nbFiles+1) * sizeof(const char*));
|
||||||
if (!fileTable) { free(buf); return NULL; }
|
if (!fileTable) { free(buf); return NULL; }
|
||||||
|
|
||||||
for (i=0, pos=0; i<nbFiles; i++)
|
for (i=0, pos=0; i<nbFiles; i++) {
|
||||||
{
|
|
||||||
fileTable[i] = buf + pos;
|
fileTable[i] = buf + pos;
|
||||||
pos += strlen(fileTable[i]) + 1;
|
pos += strlen(fileTable[i]) + 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user