Changeset 382d653 in rtems for testsuites


Ignore:
Timestamp:
Aug 10, 2018, 1:23:01 PM (16 months ago)
Author:
Joel Sherrill <joel@…>
Branches:
master
Children:
ab971bf5
Parents:
b3693f5
git-author:
Joel Sherrill <joel@…> (08/10/18 13:23:01)
git-committer:
Joel Sherrill <joel@…> (08/10/18 13:24:29)
Message:

libtests/POSIX: Fix warnings and style.

Location:
testsuites/libtests/POSIX
Files:
46 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/POSIX/close.c

    rb3693f5 r382d653  
    1616main (void)
    1717{
    18   close (42);
    19 
    20   return 0;
     18  return close(42);
    2119}
  • testsuites/libtests/POSIX/dup2.c

    rb3693f5 r382d653  
    1919  int newfd = 43;
    2020
    21   dup2 (oldfd, newfd);
    22 
    23   return 0;
     21  return dup2 (oldfd, newfd);
    2422}
  • testsuites/libtests/POSIX/fcntl.c

    rb3693f5 r382d653  
    1414#include <fcntl.h>
    1515
    16 int
    17 main (void)
     16int main (void)
    1817{
    19   fcntl (42, 43);
    20   fcntl (42, 43, 44);
     18  int rc;
    2119
    22   return 0;
     20  rc = fcntl (42, 43);
     21  (void) rc;
     22 
     23  rc = fcntl (42, 43, 44);
     24
     25  return rc;
    2326}
  • testsuites/libtests/POSIX/flockfile.c

    rb3693f5 r382d653  
    1616{
    1717  FILE *file = NULL;
     18
    1819  flockfile(file);
    1920  return 0;
  • testsuites/libtests/POSIX/fork.c

    rb3693f5 r382d653  
    1616main (void)
    1717{
    18   fork ();
     18  int rc;
    1919
    20   return 0;
     20  rc = fork();
     21
     22  return rc;
    2123}
  • testsuites/libtests/POSIX/free.c

    rb3693f5 r382d653  
    1313#include <stdlib.h>
    1414
    15 int
    16 main (void)
     15int main (void)
    1716{
    18   free ((void *) 42);
     17  free((void *) 42);
    1918
    2019  return 0;
  • testsuites/libtests/POSIX/fstat.c

    rb3693f5 r382d653  
    1515#include <unistd.h>
    1616
    17 int
    18 main (void)
     17int main (void)
    1918{
    2019  struct stat buf;
    2120  int fd = 42;
    22   fstat (fd, &buf);
     21  int rc;
    2322
    24   return 0;
     23  rc = fstat(fd, &buf);
     24
     25  return rc;
    2526}
  • testsuites/libtests/POSIX/ftrylockfile.c

    rb3693f5 r382d653  
    1616{
    1717  FILE *file = NULL;
    18   int ret = ftrylockfile(file);
     18  int ret;
     19
     20  ret = ftrylockfile(file);
    1921  return ret;
    2022}
  • testsuites/libtests/POSIX/funlockfile.c

    rb3693f5 r382d653  
    1616{
    1717  FILE *file = NULL;
     18
    1819  funlockfile(file);
    1920  return 0;
  • testsuites/libtests/POSIX/getdents.c

    rb3693f5 r382d653  
    1313#include <dirent.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  int status;
    1918  int fd = 42;
    2019
    21   status = getdents (fd, "/tmp/foo", 0);
     20  status = getdents(fd, "/tmp/foo", 0);
     21  return status;
    2222}
  • testsuites/libtests/POSIX/getlogin.c

    rb3693f5 r382d653  
    1313#include <unistd.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  char *login;
     18
    1919  login = getlogin ();
     20  (void) login;
    2021
    2122  return 0;
  • testsuites/libtests/POSIX/getpwnam.c

    rb3693f5 r382d653  
    1414#include <pwd.h>
    1515
    16 int
    17 main (void)
     16int main(void)
    1817{
    1918  struct passwd *pass;
    20   pass = getpwnam ("root");
    2119
    22   return 0;
     20  pass = getpwnam("root");
     21
     22  return (pass != NULL);
    2323}
  • testsuites/libtests/POSIX/getpwuid.c

    rb3693f5 r382d653  
    1414#include <pwd.h>
    1515
    16 int
    17 main (void)
     16int main(void)
    1817{
    1918  struct passwd *pass;
  • testsuites/libtests/POSIX/gettimeofday.c

    rb3693f5 r382d653  
    1313#include <sys/time.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  struct timeval tv;
  • testsuites/libtests/POSIX/getuid.c

    rb3693f5 r382d653  
    1414#include <sys/types.h>
    1515
    16 int
    17 main (void)
     16int main(void)
    1817{
    1918  uid_t uid;
    20   uid = getuid ();
     19  uid = getuid();
    2120
    22   return 0;
     21  return (uid != 0);
    2322}
  • testsuites/libtests/POSIX/htonl.c

    rb3693f5 r382d653  
    1313#include <arpa/inet.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  uint32_t u32;
     
    2019
    2120  u32 = htonl(0x12345678);
     21  (void) u32;
    2222  u16 = htons(0x1234);
     23  (void) u16;
    2324
    2425  u32 = ntohl(0x12345678);
     26  (void) u32;
    2527  u16 = ntohs(0x1234);
     28  (void) u16;
    2629 
    2730  return 0;
  • testsuites/libtests/POSIX/iconv.c

    rb3693f5 r382d653  
    1313#include <iconv.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  iconv_t cd = NULL;
     
    2726  ret = iconv(cd, &i, &isize, &o, &osize);
    2827
    29   return 0;
     28  return ret;
    3029}
  • testsuites/libtests/POSIX/iconv_close.c

    rb3693f5 r382d653  
    1313#include <iconv.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  iconv_t cd = NULL;
     
    2120  ret = iconv_close(cd);
    2221
    23   return 0;
     22  return ret;
    2423}
  • testsuites/libtests/POSIX/iconv_open.c

    rb3693f5 r382d653  
    1313#include <iconv.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  iconv_t ret;
     
    2019  ret = iconv_open("utf8", "ascii" );
    2120
    22   return 0;
     21  return (ret == 0);
    2322}
  • testsuites/libtests/POSIX/issetugid.c

    rb3693f5 r382d653  
    1313#include <unistd.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  int status;
    19   status = issetugid ();
     18  status = issetugid();
    2019
    21   return 0;
     20  return status;
    2221}
  • testsuites/libtests/POSIX/kill.c

    rb3693f5 r382d653  
    1313#include <signal.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  pid_t pid = 0;
     18  int rc;
    1919
    20   kill (pid, SIGHUP);
    21   kill (pid, SIGKILL);
    22   kill (pid, SIGTERM);
     20  rc = kill(pid, SIGHUP);
     21  (void) rc;
    2322
    24   return 0;
     23  rc = kill(pid, SIGKILL);
     24  (void) rc;
     25
     26  rc = kill(pid, SIGTERM);
     27
     28  return rc;
    2529}
  • testsuites/libtests/POSIX/longjmp.c

    rb3693f5 r382d653  
    1313#include <setjmp.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  jmp_buf buf;
    19   longjmp (buf, 0);
     18  longjmp(buf, 0);
    2019  return 0;
    2120}
  • testsuites/libtests/POSIX/lseek.c

    rb3693f5 r382d653  
    1414#include <unistd.h>
    1515
    16 int
    17 main (void)
     16int main(void)
    1817{
    1918  off_t res;
    2019  int fd = 42;
    2120
    22   res = lseek (fd, 0, SEEK_SET);
    23   res = lseek (fd, 1, SEEK_CUR);
    24   res = lseek (fd, 2, SEEK_END);
     21  res = lseek(fd, 0, SEEK_SET);
     22  (void) res;
     23
     24  res = lseek(fd, 1, SEEK_CUR);
     25  (void) res;
     26
     27  res = lseek(fd, 2, SEEK_END);
     28  (void) res;
    2529
    2630  return 0;
  • testsuites/libtests/POSIX/lstat.c

    rb3693f5 r382d653  
    1515#include <unistd.h>
    1616
    17 int
    18 main (void)
     17int main(void)
    1918{
    2019  struct stat buf;
    2120  int status;
    2221
    23   status = lstat ("/tmp/foo", &buf);
     22  status = lstat("/tmp/foo", &buf);
    2423
    25   return 0;
     24  return status;
    2625}
  • testsuites/libtests/POSIX/malloc.c

    rb3693f5 r382d653  
    1313#include <stdlib.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    18   void *ptr = malloc (42);
     17  void *ptr = malloc(42);
    1918
    2019  return (ptr != NULL);
  • testsuites/libtests/POSIX/nanosleep.c

    rb3693f5 r382d653  
    1313#include <time.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  struct timespec req = { 0, 42 };
     
    2019  int status;
    2120
    22   status = nanosleep (&req, &rem);
     21  status = nanosleep(&req, &rem);
    2322
    24   return 0;
     23  return status;
    2524}
  • testsuites/libtests/POSIX/open.c

    rb3693f5 r382d653  
    1515#include <fcntl.h>
    1616
    17 int
    18 main (void)
     17int main(void)
    1918{
    2019  int fd1;
    2120  int fd2;
    2221
    23   fd1 = open ("/tmp/foo1", O_RDWR | O_APPEND);
    24   fd2 = open ("/tmp/foo2", O_CREAT, S_IWUSR);
     22  fd1 = open("/tmp/foo1", O_RDWR | O_APPEND);
     23  fd2 = open("/tmp/foo2", O_CREAT, S_IWUSR);
    2524
    26   return 0;
     25  return (fd1 != fd2);
    2726}
  • testsuites/libtests/POSIX/pipe.c

    rb3693f5 r382d653  
    1313#include <unistd.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  int filedes[2];
    1918  int status;
    2019
    21   status = pipe (filedes);
     20  status = pipe(filedes);
    2221
    23   return 0;
     22  return status;
    2423}
  • testsuites/libtests/POSIX/posix_memalign.c

    rb3693f5 r382d653  
    1313#include <stdlib.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  void *a;
    19   int ret = posix_memalign (&a, sizeof (void *) * 2, 42);
     18  int ret = posix_memalign(&a, sizeof (void *) * 2, 42);
    2019
    2120  return ret;
  • testsuites/libtests/POSIX/read.c

    rb3693f5 r382d653  
    1313#include <unistd.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  int fd = 42;
     
    2019  ssize_t len;
    2120
    22   len = read (fd, &buf, 4);
     21  len = read(fd, &buf, 4);
    2322
    24   return 0;
     23  return (len != 0);
    2524}
  • testsuites/libtests/POSIX/readv.c

    rb3693f5 r382d653  
    1313#include <sys/uio.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  struct iovec iov;
     
    2019  ssize_t ret;
    2120
    22   ret = readv (0, &iov, count);
     21  ret = readv(0, &iov, count);
    2322
    2423  return ret;
  • testsuites/libtests/POSIX/realloc.c

    rb3693f5 r382d653  
    1313#include <stdlib.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    18   realloc (NULL, 42);
     17  void *p = realloc(NULL, 42);
    1918
    20   return 0;
     19  return (p == NULL);
    2120}
  • testsuites/libtests/POSIX/setjmp.c

    rb3693f5 r382d653  
    1313#include <setjmp.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  jmp_buf buf;
    19   setjmp (buf);
     18  setjmp(buf);
    2019  return 0;
    2120}
  • testsuites/libtests/POSIX/sigaddset.c

    rb3693f5 r382d653  
    1313#include <signal.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  sigset_t set;
    1918  int status;
    20   status = sigaddset (&set, 21);
     19  status = sigaddset(&set, 21);
    2120
    2221  return status;
  • testsuites/libtests/POSIX/sigdelset.c

    rb3693f5 r382d653  
    1313#include <signal.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  sigset_t set;
    1918  int status;
    20   status = sigdelset (&set, 21);
     19  status = sigdelset(&set, 21);
    2120
    2221  return status;
  • testsuites/libtests/POSIX/sigemptyset.c

    rb3693f5 r382d653  
    1313#include <signal.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  sigset_t set;
    19   int status = sigemptyset (&set);
     18  int status = sigemptyset(&set);
    2019
    2120  return status;
  • testsuites/libtests/POSIX/sigfillset.c

    rb3693f5 r382d653  
    1313#include <signal.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  sigset_t set;
    1918  int status;
    20   status = sigfillset (&set);
     19  status = sigfillset(&set);
    2120
    2221  return status;
  • testsuites/libtests/POSIX/sigismember.c

    rb3693f5 r382d653  
    1313#include <signal.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  sigset_t set;
  • testsuites/libtests/POSIX/sigprocmask.c

    rb3693f5 r382d653  
    1313#include <signal.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    18   int status;
     17  int rc;
    1918  sigset_t set1, set2;
    2019
    21   status = sigprocmask (SIG_BLOCK, &set1, &set2);
    22   status = sigprocmask (SIG_UNBLOCK, &set1, &set2);
    23   status = sigprocmask (SIG_SETMASK, &set1, &set2);
     20  rc = sigprocmask(SIG_BLOCK, &set1, &set2);
     21  (void) rc;
    2422
    25   return 0;
     23  rc = sigprocmask(SIG_UNBLOCK, &set1, &set2);
     24  (void) rc;
     25
     26  rc = sigprocmask(SIG_SETMASK, &set1, &set2);
     27
     28  return rc;
    2629}
  • testsuites/libtests/POSIX/stat.c

    rb3693f5 r382d653  
    1515#include <unistd.h>
    1616
    17 int
    18 main (void)
     17int main(void)
    1918{
    2019  struct stat buf;
    2120  int status;
    2221
    23   status = stat ("/tmp/foo", &buf);
     22  status = stat("/tmp/foo", &buf);
    2423
    25   return 0;
     24  return status;
    2625}
  • testsuites/libtests/POSIX/unlink.c

    rb3693f5 r382d653  
    1717{
    1818  int status;
    19   status = unlink ("/tmp/foo");
     19  status = unlink("/tmp/foo");
    2020
    21   return 0;
     21  return status;
    2222}
  • testsuites/libtests/POSIX/vfork.c

    rb3693f5 r382d653  
    1414#include <unistd.h>
    1515
    16 int
    17 main (void)
     16int main(void)
    1817{
    1918  pid_t pid;
    20   pid = vfork ();
     19  pid = vfork();
    2120
    22   return 0;
     21  return (pid != 0);
    2322}
  • testsuites/libtests/POSIX/wait.c

    rb3693f5 r382d653  
    1414#include <sys/wait.h>
    1515
    16 int
    17 main (void)
     16int main(void)
    1817{
    1918  int status;
     
    2120  pid = wait(&status);
    2221
    23   return 0;
     22  return (pid != 0);
    2423}
  • testsuites/libtests/POSIX/waitpid.c

    rb3693f5 r382d653  
    1515
    1616int
    17 main (void)
     17main(void)
    1818{
    1919  int status;
    2020  pid_t pid;
    21   pid = waitpid (-1, &status, WNOHANG);
     21  pid = waitpid(-1, &status, WNOHANG);
    2222
    23   return 0;
     23  return (pid != 0);
    2424}
  • testsuites/libtests/POSIX/write.c

    rb3693f5 r382d653  
    1313#include <unistd.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  char string[] = "1234";
     
    2019  ssize_t ret;
    2120
    22   ret = write (0, &string, count);
     21  ret = write(0, &string, count);
    2322
    24   return 0;
     23  return ret;
    2524}
  • testsuites/libtests/POSIX/writev.c

    rb3693f5 r382d653  
    1313#include <sys/uio.h>
    1414
    15 int
    16 main (void)
     15int main(void)
    1716{
    1817  struct iovec iov;
     
    2019  ssize_t ret;
    2120
    22   ret = writev (0, &iov, count);
     21  ret = writev(0, &iov, count);
    2322
    2423  return ret;
Note: See TracChangeset for help on using the changeset viewer.