Unit tests for formatting code, fix %%.

Also fix <signal.h> and <stdio.h> so they don't cause compiler warnings.

Change-Id: Ib1a746bf01de22d47dbd964de0e6af80a7c96303
This commit is contained in:
Elliott Hughes
2013-01-28 10:36:31 -08:00
parent 0a91b11d28
commit 41b3179c9e
5 changed files with 183 additions and 156 deletions

View File

@@ -59,7 +59,7 @@ extern const char* const sys_signame[];
static __inline__ int sigismember(const sigset_t* set, int signum) {
int bit = signum - 1; // Signal numbers start at 1, but bit positions start at 0.
if (set == NULL || bit < 0 || bit >= 8*sizeof(sigset_t)) {
if (set == NULL || bit < 0 || bit >= (int) (8*sizeof(sigset_t))) {
errno = EINVAL;
return -1;
}
@@ -69,7 +69,7 @@ static __inline__ int sigismember(const sigset_t* set, int signum) {
static __inline__ int sigaddset(sigset_t* set, int signum) {
int bit = signum - 1; // Signal numbers start at 1, but bit positions start at 0.
if (set == NULL || bit < 0 || bit >= 8*sizeof(sigset_t)) {
if (set == NULL || bit < 0 || bit >= (int) (8*sizeof(sigset_t))) {
errno = EINVAL;
return -1;
}
@@ -80,7 +80,7 @@ static __inline__ int sigaddset(sigset_t* set, int signum) {
static __inline__ int sigdelset(sigset_t* set, int signum) {
int bit = signum - 1; // Signal numbers start at 1, but bit positions start at 0.
if (set == NULL || bit < 0 || bit >= 8*sizeof(sigset_t)) {
if (set == NULL || bit < 0 || bit >= (int) (8*sizeof(sigset_t))) {
errno = EINVAL;
return -1;
}