Re-ran indent on all .c & .h source code files
Like so --
find . -name "*.c" -or -name "*.h" -exec indent -nbfda -npcs -npsl -bli0 --no-tabs {} \;
The `indent` invocation differs from the last one noted in
CHANGES.txt (from 2006!?), in that I've added "--no-tabs",
to ensure indents are all space-based.
This commit is contained in:
parent
09f332367f
commit
cc05925d9e
99 changed files with 31659 additions and 27102 deletions
|
|
@ -54,10 +54,10 @@ DIR *opendir(const char *pSpec)
|
|||
strcat(pathname, "/*");
|
||||
pDir->hFind = FindFirstFile(pathname, &pDir->wfd);
|
||||
if (pDir->hFind == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
free(pDir);
|
||||
pDir = NULL;
|
||||
}
|
||||
{
|
||||
free(pDir);
|
||||
pDir = NULL;
|
||||
}
|
||||
return pDir;
|
||||
}
|
||||
|
||||
|
|
@ -83,16 +83,16 @@ struct dirent *readdir(struct DIR *pDir)
|
|||
assert(pDir != NULL);
|
||||
if (pDir->hFind)
|
||||
|
||||
{
|
||||
strcpy(pDir->de.d_name, (const char *)pDir->wfd.cFileName);
|
||||
if (!FindNextFile(pDir->hFind, &pDir->wfd))
|
||||
{
|
||||
strcpy(pDir->de.d_name, (const char *) pDir->wfd.cFileName);
|
||||
if (!FindNextFile(pDir->hFind, &pDir->wfd))
|
||||
|
||||
{
|
||||
FindClose(pDir->hFind);
|
||||
pDir->hFind = NULL;
|
||||
}
|
||||
return &pDir->de;
|
||||
{
|
||||
FindClose(pDir->hFind);
|
||||
pDir->hFind = NULL;
|
||||
}
|
||||
return &pDir->de;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +107,9 @@ struct dirent *readdir(struct DIR *pDir)
|
|||
*/
|
||||
int alphasort(const void *a, const void *b)
|
||||
{
|
||||
return (strcmp((*(const struct dirent **)a)->d_name, (*(const struct dirent **)b)->d_name));
|
||||
return (strcmp
|
||||
((*(const struct dirent **) a)->d_name,
|
||||
(*(const struct dirent **) b)->d_name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -124,11 +126,15 @@ static int addToList(int i, struct dirent ***namelist, struct dirent *entry)
|
|||
int size;
|
||||
struct dirent *block;
|
||||
|
||||
*namelist = (struct dirent **)realloc((void *)(*namelist), (size_t) ((i + 1) * sizeof(struct dirent *)));
|
||||
*namelist =
|
||||
(struct dirent **) realloc((void *) (*namelist),
|
||||
(size_t) ((i + 1) * sizeof(struct dirent *)));
|
||||
if (*namelist == NULL)
|
||||
return -1;
|
||||
size = (((char *)&entry->d_name) - ((char *)entry)) + strlen(entry->d_name) + 1;
|
||||
block = (struct dirent *)malloc(size);
|
||||
size =
|
||||
(((char *) &entry->d_name) - ((char *) entry)) + strlen(entry->d_name) +
|
||||
1;
|
||||
block = (struct dirent *) malloc(size);
|
||||
if (block == NULL)
|
||||
return -1;
|
||||
(*namelist)[i] = block;
|
||||
|
|
@ -145,7 +151,8 @@ static int addToList(int i, struct dirent ***namelist, struct dirent *entry)
|
|||
* @param compar Callback for sorting items in the list (via qsort()).
|
||||
* @return Count of items, or -1 on error.
|
||||
*/
|
||||
int scandir(const char *dir, struct dirent ***namelist, selectCB select, comparCB compar)
|
||||
int scandir(const char *dir, struct dirent ***namelist, selectCB select,
|
||||
comparCB compar)
|
||||
{
|
||||
DIR *pDir;
|
||||
int count;
|
||||
|
|
@ -157,15 +164,16 @@ int scandir(const char *dir, struct dirent ***namelist, selectCB select, comparC
|
|||
return -1;
|
||||
count = 0;
|
||||
while ((entry = readdir(pDir)) != NULL)
|
||||
{
|
||||
if (select == NULL || (select != NULL && select(entry)))
|
||||
if ((count = addToList(count, namelist, entry)) < 0)
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (select == NULL || (select != NULL && select(entry)))
|
||||
if ((count = addToList(count, namelist, entry)) < 0)
|
||||
break;
|
||||
}
|
||||
closedir(pDir);
|
||||
if (count <= 0)
|
||||
return -1;
|
||||
if (compar != NULL)
|
||||
qsort((void *)(*namelist), (size_t) count, sizeof(struct dirent *), compar);
|
||||
qsort((void *) (*namelist), (size_t) count, sizeof(struct dirent *),
|
||||
compar);
|
||||
return count;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue