Commit 9bc7c737 authored by Samuel Holland's avatar Samuel Holland
Browse files

libgcompat: Fix formatting inconsistencies (clang-format)


Signed-off-by: Samuel Holland's avatarSamuel Holland <samuel@sholland.org>
parent d8e667a6
#include <sys/select.h>
#include "internal.h"
#define REASON_FD_SET_OVERFLOW \
"Fault: Overflow in fd_set detected.\n" \
"Description: This is caused by a programmer naively attempting to redefine FD_SETSIZE,\n" \
" which is not allowed on POSIX platforms. The program must be either rebuilt\n" \
" with the correct FD_SETSIZE definition, or preferably rewritten to avoid use\n" \
" of select(2) in general. See also: poll(2).\n" \
#define REASON_FD_SET_OVERFLOW \
"Fault: Overflow in fd_set detected.\n" \
"Description: This is caused by a programmer naively attempting to\n" \
" redefine FD_SETSIZE, which is not allowed on POSIX platforms.\n" \
" The program must either be rebuilt with the correct FD_SETSIZE\n" \
" definition, or else be rewritten to avoid use of select(2) in \n" \
" general. See also: poll(2).\n" \
" libgcompat believes FD_SETSIZE to be %zu.\n"
unsigned long __fdelt_chk(unsigned long size)
{
GCOMPAT__assert_with_reason(size < FD_SETSIZE, REASON_FD_SET_OVERFLOW, FD_SETSIZE);
GCOMPAT__assert_with_reason(size < FD_SETSIZE, REASON_FD_SET_OVERFLOW,
FD_SETSIZE);
return size / (sizeof(unsigned long) << 3);
}
#include <stdio.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
void GCOMPAT__panic(const char *fmt, ...)
{
va_list va;
......
#define _GNU_SOURCE /* Extra maths functions */
#include <math.h> /* Literally everything */
#define _GNU_SOURCE /* Extra maths functions */
#include <math.h> /* Literally everything */
#include "alias.h" /* weak_alias */
#include "internal.h" /* GCOMPAT__assert_with_reason */
#include "alias.h" /* weak_alias */
#include "internal.h" /* GCOMPAT__assert_with_reason */
/**
* Multiplies the first argument x by FLT_RADIX (probably 2) to the power of y.
......@@ -14,7 +14,7 @@ long double scalbl(long double x, long double y)
* 1) Good Enough(TM)
* 2) scalbl is deprecated anyway
* */
return scalblnl(x, (long int)y);
return scalblnl(x, (long int) y);
}
/*
......@@ -144,7 +144,6 @@ int __isnan(double arg)
}
weak_alias(__isnan, isnan);
/**
* Test for a NaN.
*
......@@ -290,7 +289,6 @@ long double __asinl_finite(long double x)
return res;
}
/**
* Returns the principal value of the arc tangent of x/y, expressed in radians.
*/
......@@ -363,7 +361,6 @@ long double __atanhl_finite(long double x)
return res;
}
/**
* Returns the hyperbolic cosine of x.
*/
......
......@@ -42,7 +42,7 @@ int __res_nclose(res_state statp)
weak_alias(__res_nclose, res_nclose);
int __res_search(const char *dname, int class, int type, unsigned char *answer,
int anslen)
int anslen)
{
return res_search(dname, class, type, answer, anslen);
}
#include <assert.h> /* assert */
#include <poll.h> /* poll, pollfd, nfds_t */
#include <stddef.h> /* NULL */
#include <poll.h> /* poll, pollfd, nfds_t */
#include <sys/socket.h> /* recv, recvfrom */
/**
......
......@@ -2,10 +2,10 @@
#include <assert.h> /* assert */
#include <stddef.h> /* NULL, size_t */
#include <stdint.h> /* SIZE_MAX */
#include <string.h> /* memcpy, strcpy, strncat, strndup */
#include <stdlib.h> /* rand_r */
#include <unistd.h> /* getpid */
#include <string.h> /* memcpy, strcpy, strncat, strndup */
#include <time.h> /* time */
#include <unistd.h> /* getpid */
#include "alias.h" /* weak_alias */
......@@ -189,8 +189,7 @@ size_t __strcspn_c2(const char *str, int bad, int bad2)
{
size_t length = 0;
const char *s = str;
while(*s != bad && *s != bad2 && *s != '\0')
{
while (*s != bad && *s != bad2 && *s != '\0') {
length++;
s++;
}
......@@ -285,7 +284,7 @@ char *strfry(char *s)
if (!len)
return s;
seed += time(NULL) ^ getpid() ^ (uintptr_t)s;
seed += time(NULL) ^ getpid() ^ (uintptr_t) s;
for (i = 0; i < len - 1; ++i) {
j = rand_r(&seed) % (len - i) + i;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment