clang-format the files

This commit is contained in:
dota17
2020-03-28 10:25:00 +08:00
parent c117d8a8a8
commit 8b162c4b89
54 changed files with 2860 additions and 2713 deletions

View File

@@ -18,25 +18,36 @@ static int vasprintf(char **buf, const char *fmt, va_list ap)
int chars;
char *b;
if(!buf) { return -1; }
if (!buf)
{
return -1;
}
#ifdef WIN32
chars = _vscprintf(fmt, ap)+1;
#else /* !defined(WIN32) */
chars = _vscprintf(fmt, ap) + 1;
#else /* !defined(WIN32) */
/* CAW: RAWR! We have to hope to god here that vsnprintf doesn't overwrite
* our buffer like on some 64bit sun systems.... but hey, its time to move on
*/
chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap)+1;
if(chars < 0) { chars *= -1; } /* CAW: old glibc versions have this problem */
chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap) + 1;
if (chars < 0)
{
chars *= -1;
} /* CAW: old glibc versions have this problem */
#endif /* defined(WIN32) */
b = (char*)malloc(sizeof(char)*chars);
if(!b) { return -1; }
b = (char *)malloc(sizeof(char) * chars);
if (!b)
{
return -1;
}
if((chars = vsprintf(b, fmt, ap)) < 0)
if ((chars = vsprintf(b, fmt, ap)) < 0)
{
free(b);
} else {
}
else
{
*buf = b;
}