]> git.notmuchmail.org Git - notmuch/commitdiff
compat: run uncrustify
authoruncrustify <david@tethera.net>
Thu, 13 Jun 2019 10:34:25 +0000 (07:34 -0300)
committerDavid Bremner <david@tethera.net>
Fri, 14 Jun 2019 10:41:27 +0000 (07:41 -0300)
This is the result of running

     $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h

in the compat directory

17 files changed:
compat/canonicalize_file_name.c
compat/check_asctime.c
compat/check_getpwuid.c
compat/compat.h
compat/function-attributes.h
compat/gen_zlib_pc.c
compat/getdelim.c
compat/getline.c
compat/have_canonicalize_file_name.c
compat/have_d_type.c
compat/have_getline.c
compat/have_strcasestr.c
compat/have_strsep.c
compat/have_timegm.c
compat/strcasestr.c
compat/strsep.c
compat/timegm.c

index e92c0f6253636b435087680a562092feb352ed5e..000f9e781573e92b50bef8708962bffa0e08f2d6 100644 (file)
@@ -4,10 +4,10 @@
 #include <stdlib.h>
 
 char *
 #include <stdlib.h>
 
 char *
-canonicalize_file_name (const char * path)
+canonicalize_file_name (const char *path)
 {
 #ifdef PATH_MAX
 {
 #ifdef PATH_MAX
-    char *resolved_path =  malloc (PATH_MAX+1);
+    char *resolved_path =  malloc (PATH_MAX + 1);
     if (resolved_path == NULL)
        return NULL;
 
     if (resolved_path == NULL)
        return NULL;
 
index b0e56f0c1a2b10e1bb46564d91967cb829101bc8..62ad69d66dc9665ba8b59e1646ad30458a8ac107 100644 (file)
@@ -1,7 +1,8 @@
 #include <time.h>
 #include <stdio.h>
 
 #include <time.h>
 #include <stdio.h>
 
-int main()
+int
+main ()
 {
     struct tm tm;
 
 {
     struct tm tm;
 
index c435eb89df035c48c6b33474fe1180d87d2b1710..babeb742cabc6baa5d6367de48ef372da1fcc9bd 100644 (file)
@@ -1,7 +1,8 @@
 #include <stdio.h>
 #include <pwd.h>
 
 #include <stdio.h>
 #include <pwd.h>
 
-int main()
+int
+main ()
 {
     struct passwd passwd, *ignored;
 
 {
     struct passwd passwd, *ignored;
 
index 88bc4df40cf1b40c37fa81b73e9e62dd4f09c2fb..8f15e585fda82221eaeed22bfc0834b4ccd9fa67 100644 (file)
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
-#if !STD_GETPWUID
+#if ! STD_GETPWUID
 #define _POSIX_PTHREAD_SEMANTICS 1
 #endif
 #define _POSIX_PTHREAD_SEMANTICS 1
 #endif
-#if !STD_ASCTIME
+#if ! STD_ASCTIME
 #define _POSIX_PTHREAD_SEMANTICS 1
 #endif
 
 #define _POSIX_PTHREAD_SEMANTICS 1
 #endif
 
-#if !HAVE_CANONICALIZE_FILE_NAME
+#if ! HAVE_CANONICALIZE_FILE_NAME
 /* we only call this function from C, and this makes testing easier */
 #ifndef __cplusplus
 char *
 /* we only call this function from C, and this makes testing easier */
 #ifndef __cplusplus
 char *
@@ -45,7 +45,7 @@ canonicalize_file_name (const char *path);
 #endif
 #endif
 
 #endif
 #endif
 
-#if !HAVE_GETLINE
+#if ! HAVE_GETLINE
 #include <stdio.h>
 #include <unistd.h>
 
 #include <stdio.h>
 #include <unistd.h>
 
@@ -55,31 +55,31 @@ getline (char **lineptr, size_t *n, FILE *stream);
 ssize_t
 getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp);
 
 ssize_t
 getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp);
 
-#endif /* !HAVE_GETLINE */
+#endif  /* !HAVE_GETLINE */
 
 
-#if !HAVE_STRCASESTR
-char* strcasestr(const char *haystack, const char *needle);
-#endif /* !HAVE_STRCASESTR */
+#if ! HAVE_STRCASESTR
+char *strcasestr (const char *haystack, const char *needle);
+#endif  /* !HAVE_STRCASESTR */
 
 
-#if !HAVE_STRSEP
-char *strsep(char **stringp, const char *delim);
-#endif /* !HAVE_STRSEP */
+#if ! HAVE_STRSEP
+char *strsep (char **stringp, const char *delim);
+#endif  /* !HAVE_STRSEP */
 
 
-#if !HAVE_TIMEGM
+#if ! HAVE_TIMEGM
 #include <time.h>
 time_t timegm (struct tm *tm);
 #include <time.h>
 time_t timegm (struct tm *tm);
-#endif /* !HAVE_TIMEGM */
+#endif  /* !HAVE_TIMEGM */
 
 /* Silence gcc warnings about unused results.  These warnings exist
  * for a reason; any use of this needs to be justified. */
 #ifdef __GNUC__
 
 /* Silence gcc warnings about unused results.  These warnings exist
  * for a reason; any use of this needs to be justified. */
 #ifdef __GNUC__
-#define IGNORE_RESULT(x) ({ __typeof__(x) __z = (x); (void)(__z = __z); })
+#define IGNORE_RESULT(x) ({ __typeof__(x) __z = (x); (void) (__z = __z); })
 #else /* !__GNUC__ */
 #define IGNORE_RESULT(x) x
 #else /* !__GNUC__ */
 #define IGNORE_RESULT(x) x
-#endif /* __GNUC__ */
+#endif  /* __GNUC__ */
 
 #ifdef __cplusplus
 }
 #endif
 
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* NOTMUCH_COMPAT_H */
+#endif  /* NOTMUCH_COMPAT_H */
index 1945b5bf1bed7ea6f20c12398a7c82948b68fbdd..8f08bec45f20ff6ab3a6bfaaebfa5b5870ce1772 100644 (file)
@@ -35,9 +35,9 @@
  * provides support for testing for function attributes.
  */
 #ifndef NORETURN_ATTRIBUTE
  * provides support for testing for function attributes.
  */
 #ifndef NORETURN_ATTRIBUTE
-#if (__GNUC__ >= 3 ||                          \
-     (__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || \
-     __has_attribute (noreturn))
+#if (__GNUC__ >= 3 ||                           \
+     (__GNUC__ == 2 && __GNUC_MINOR__ >= 5) ||  \
+    __has_attribute (noreturn))
 #define NORETURN_ATTRIBUTE __attribute__ ((noreturn))
 #else
 #define NORETURN_ATTRIBUTE
 #define NORETURN_ATTRIBUTE __attribute__ ((noreturn))
 #else
 #define NORETURN_ATTRIBUTE
index 198a727c647ad4ea984ee8abeeefce27e2591d13..7c0ee727589f93dccce99c384513b69a23c83b43 100644 (file)
@@ -2,17 +2,18 @@
 #include <zlib.h>
 
 static const char *template =
 #include <zlib.h>
 
 static const char *template =
-       "prefix=/usr\n"
-       "exec_prefix=${prefix}\n"
-       "libdir=${exec_prefix}/lib\n"
-       "\n"
-       "Name: zlib\n"
-       "Description: zlib compression library\n"
-       "Version: %s\n"
-       "Libs: -lz\n";
+    "prefix=/usr\n"
+    "exec_prefix=${prefix}\n"
+    "libdir=${exec_prefix}/lib\n"
+    "\n"
+    "Name: zlib\n"
+    "Description: zlib compression library\n"
+    "Version: %s\n"
+    "Libs: -lz\n";
 
 
-int main(void)
+int
+main (void)
 {
 {
-       printf(template, ZLIB_VERSION);
-       return 0;
+    printf (template, ZLIB_VERSION);
+    return 0;
 }
 }
index 407f3d07c7443836a11b5dbc9236337e7e6294e7..e5c1f07c200078fc68c9a86e530ad00c540069b7 100644 (file)
@@ -1,21 +1,21 @@
 /* getdelim.c --- Implementation of replacement getdelim function.
 /* getdelim.c --- Implementation of replacement getdelim function.
  Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007,
  2008, 2009 Free Software Foundation, Inc.
-
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License as
  published by the Free Software Foundation; either version 3, or (at
  your option) any later version.
-
  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.
-
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  02110-1301, USA.  */
* Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007,
* 2008, 2009 Free Software Foundation, Inc.
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3, or (at
* your option) any later version.
+ *
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.  */
 
 /* Ported from glibc by Simon Josefsson. */
 
 
 /* Ported from glibc by Simon Josefsson. */
 
 
 #if USE_UNLOCKED_IO
 # include "unlocked-io.h"
 
 #if USE_UNLOCKED_IO
 # include "unlocked-io.h"
-# define getc_maybe_unlocked(fp)       getc(fp)
-#elif !HAVE_FLOCKFILE || !HAVE_FUNLOCKFILE || !HAVE_DECL_GETC_UNLOCKED
+# define getc_maybe_unlocked(fp)        getc (fp)
+#elif ! HAVE_FLOCKFILE || ! HAVE_FUNLOCKFILE || ! HAVE_DECL_GETC_UNLOCKED
 # undef flockfile
 # undef funlockfile
 # define flockfile(x) ((void) 0)
 # define funlockfile(x) ((void) 0)
 # undef flockfile
 # undef funlockfile
 # define flockfile(x) ((void) 0)
 # define funlockfile(x) ((void) 0)
-# define getc_maybe_unlocked(fp)       getc(fp)
+# define getc_maybe_unlocked(fp)        getc (fp)
 #else
 #else
-# define getc_maybe_unlocked(fp)       getc_unlocked(fp)
+# define getc_maybe_unlocked(fp)        getc_unlocked (fp)
 #endif
 
 /* Read up to (and including) a DELIMITER from FP into *LINEPTR (and
 #endif
 
 /* Read up to (and including) a DELIMITER from FP into *LINEPTR (and
  NUL-terminate it).  *LINEPTR is a pointer returned from malloc (or
  NULL), pointing to *N characters of space.  It is realloc'ed as
  necessary.  Returns the number of characters read (not including
  the null terminator), or -1 on error or EOF.  */
* NUL-terminate it).  *LINEPTR is a pointer returned from malloc (or
* NULL), pointing to *N characters of space.  It is realloc'ed as
* necessary.  Returns the number of characters read (not including
* the null terminator), or -1 on error or EOF.  */
 
 ssize_t
 getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
 {
 
 ssize_t
 getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
 {
-  ssize_t result = -1;
-  size_t cur_len = 0;
+    ssize_t result = -1;
+    size_t cur_len = 0;
 
 
-  if (lineptr == NULL || n == NULL || fp == NULL)
-    {
-      errno = EINVAL;
-      return -1;
+    if (lineptr == NULL || n == NULL || fp == NULL) {
+       errno = EINVAL;
+       return -1;
     }
 
     }
 
-  flockfile (fp);
-
-  if (*lineptr == NULL || *n == 0)
-    {
-      char *new_lineptr;
-      *n = 120;
-      new_lineptr = (char *) realloc (*lineptr, *n);
-      if (new_lineptr == NULL)
-       {
-         result = -1;
-         goto unlock_return;
+    flockfile (fp);
+
+    if (*lineptr == NULL || *n == 0) {
+       char *new_lineptr;
+       *n = 120;
+       new_lineptr = (char *) realloc (*lineptr, *n);
+       if (new_lineptr == NULL) {
+           result = -1;
+           goto unlock_return;
        }
        }
-      *lineptr = new_lineptr;
+       *lineptr = new_lineptr;
     }
 
     }
 
-  for (;;)
-    {
-      int i;
+    for (;;) {
+       int i;
 
 
-      i = getc_maybe_unlocked (fp);
-      if (i == EOF)
-       {
-         result = -1;
-         break;
+       i = getc_maybe_unlocked (fp);
+       if (i == EOF) {
+           result = -1;
+           break;
        }
 
        }
 
-      /* Make enough space for len+1 (for final NUL) bytes.  */
-      if (cur_len + 1 >= *n)
-       {
-         size_t needed_max =
-           SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX;
-         size_t needed = 2 * *n + 1;   /* Be generous. */
-         char *new_lineptr;
-
-         if (needed_max < needed)
-           needed = needed_max;
-         if (cur_len + 1 >= needed)
-           {
-             result = -1;
-             errno = EOVERFLOW;
-             goto unlock_return;
+       /* Make enough space for len+1 (for final NUL) bytes.  */
+       if (cur_len + 1 >= *n) {
+           size_t needed_max =
+               SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX;
+           size_t needed = 2 * *n + 1; /* Be generous. */
+           char *new_lineptr;
+
+           if (needed_max < needed)
+               needed = needed_max;
+           if (cur_len + 1 >= needed) {
+               result = -1;
+               errno = EOVERFLOW;
+               goto unlock_return;
            }
 
            }
 
-         new_lineptr = (char *) realloc (*lineptr, needed);
-         if (new_lineptr == NULL)
-           {
-             result = -1;
-             goto unlock_return;
+           new_lineptr = (char *) realloc (*lineptr, needed);
+           if (new_lineptr == NULL) {
+               result = -1;
+               goto unlock_return;
            }
 
            }
 
-         *lineptr = new_lineptr;
-         *n = needed;
+           *lineptr = new_lineptr;
+           *n = needed;
        }
 
        }
 
-      (*lineptr)[cur_len] = i;
-      cur_len++;
+       (*lineptr)[cur_len] = i;
+       cur_len++;
 
 
-      if (i == delimiter)
-       break;
+       if (i == delimiter)
+           break;
     }
     }
-  (*lineptr)[cur_len] = '\0';
-  result = cur_len ? (ssize_t) cur_len : result;
+    (*lineptr)[cur_len] = '\0';
+    result = cur_len ? (ssize_t) cur_len : result;
 
 
- unlock_return:
-  funlockfile (fp); /* doesn't set errno */
 unlock_return:
+    funlockfile (fp); /* doesn't set errno */
 
 
-  return result;
+    return result;
 }
 }
index 222e0f6cd70be54b52a12f3644872c62c5be52ab..2fcaba1439b7d20714dbc83beceef37f08fc8d56 100644 (file)
@@ -1,20 +1,20 @@
 /* getline.c --- Implementation of replacement getline function.
 /* getline.c --- Implementation of replacement getline function.
  Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
-
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License as
  published by the Free Software Foundation; either version 3, or (at
  your option) any later version.
-
  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.
-
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  02110-1301, USA.  */
* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3, or (at
* your option) any later version.
+ *
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.  */
 
 /* Written by Simon Josefsson. */
 
 
 /* Written by Simon Josefsson. */
 
@@ -25,5 +25,5 @@
 ssize_t
 getline (char **lineptr, size_t *n, FILE *stream)
 {
 ssize_t
 getline (char **lineptr, size_t *n, FILE *stream)
 {
-  return getdelim (lineptr, n, '\n', stream);
+    return getdelim (lineptr, n, '\n', stream);
 }
 }
index 24c848ec3bf5d8e21b8d8ddd1dbf908779782d44..e56097930fc85cde5c9fce535c1f14df3a64dfa5 100644 (file)
@@ -1,7 +1,8 @@
 #define _GNU_SOURCE
 #include <stdlib.h>
 
 #define _GNU_SOURCE
 #include <stdlib.h>
 
-int main()
+int
+main ()
 {
     char *found;
     char *string;
 {
     char *found;
     char *string;
index 9ca6c6e08ed6cad81e84bf012e224c3225fecce7..5338ee4dadac620abe51b21d69580c02ceb39fac 100644 (file)
@@ -1,6 +1,7 @@
 #include <dirent.h>
 
 #include <dirent.h>
 
-int main()
+int
+main ()
 {
     struct dirent ent;
 
 {
     struct dirent ent;
 
index a8bcd17e8dcc15f5f3d32f3c23b86ac0bb5c4305..6952a3b36724bfd771920677740d4c82a76b8efb 100644 (file)
@@ -2,12 +2,13 @@
 #include <stdio.h>
 #include <sys/types.h>
 
 #include <stdio.h>
 #include <sys/types.h>
 
-int main()
+int
+main ()
 {
     ssize_t count = 0;
     size_t n = 0;
     char **lineptr = NULL;
     FILE *stream = NULL;
 
 {
     ssize_t count = 0;
     size_t n = 0;
     char **lineptr = NULL;
     FILE *stream = NULL;
 
-    count = getline(lineptr, &n, stream);
+    count = getline (lineptr, &n, stream);
 }
 }
index c0fb7629d8e410f3a372c5c365c722e2a17a4ee1..3cd1838d950bd30c6239053a09d2a8f401f8b537 100644 (file)
@@ -1,10 +1,11 @@
 #define _GNU_SOURCE
 #include <strings.h>
 
 #define _GNU_SOURCE
 #include <strings.h>
 
-int main()
+int
+main ()
 {
     char *found;
     const char *haystack, *needle;
 
 {
     char *found;
     const char *haystack, *needle;
 
-    found = strcasestr(haystack, needle);
+    found = strcasestr (haystack, needle);
 }
 }
index 2abab819b01a483e8f1738995b5aa163f3eca7fb..dd4aae753447cee641bfd9d26a45d7b8cb73f2af 100644 (file)
@@ -1,11 +1,12 @@
 #define _GNU_SOURCE
 #include <string.h>
 
 #define _GNU_SOURCE
 #include <string.h>
 
-int main()
+int
+main ()
 {
     char *found;
     char **stringp;
     const char *delim;
 
 {
     char *found;
     char **stringp;
     const char *delim;
 
-    found = strsep(stringp, delim);
+    found = strsep (stringp, delim);
 }
 }
index 483fc3b6685dd3df772382a888edfd7dde3401d5..8f7b380e767b6caf97d64963aa48f5be66d82a1b 100644 (file)
@@ -1,6 +1,7 @@
 #include <time.h>
 
 #include <time.h>
 
-int main()
+int
+main ()
 {
 {
-    return (int) timegm((struct tm *)0);
+    return (int) timegm ((struct tm *) 0);
 }
 }
index 62a3a5450170be12a0f9e7eef61a2e97dc1e9ea9..d4480bf3ce073b1c5aa63211199ba0231aac8d7d 100644 (file)
@@ -3,20 +3,20 @@
  * don't include it in their library
  *
  * based on a GPL implementation in OpenTTD found under GPL v2
  * don't include it in their library
  *
  * based on a GPL implementation in OpenTTD found under GPL v2
-
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License as
  published by the Free Software Foundation, version 2.
-
  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.
-
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  02110-1301, USA.  */
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2.
+ *
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.  */
 
 /* Imported into notmuch by Dirk Hohndel - original author unknown. */
 
 
 /* Imported into notmuch by Dirk Hohndel - original author unknown. */
 
 
 #include "compat.h"
 
 
 #include "compat.h"
 
-char *strcasestr(const char *haystack, const char *needle)
+char *
+strcasestr (const char *haystack, const char *needle)
 {
 {
-       size_t hay_len = strlen(haystack);
-       size_t needle_len = strlen(needle);
-       while (hay_len >= needle_len) {
-               if (strncasecmp(haystack, needle, needle_len) == 0)
-                   return (char *) haystack;
+    size_t hay_len = strlen (haystack);
+    size_t needle_len = strlen (needle);
+
+    while (hay_len >= needle_len) {
+       if (strncasecmp (haystack, needle, needle_len) == 0)
+           return (char *) haystack;
 
 
-               haystack++;
-               hay_len--;
-       }
+       haystack++;
+       hay_len--;
+    }
 
 
-       return NULL;
+    return NULL;
 }
 }
index 78ab9e714a0f8325de0c22123b2875001aae18c7..4b6926d9fdb491711ce9597b3db9fd02a96346f9 100644 (file)
@@ -1,65 +1,61 @@
 /* Copyright (C) 1992, 93, 96, 97, 98, 99, 2004 Free Software Foundation, Inc.
 /* Copyright (C) 1992, 93, 96, 97, 98, 99, 2004 Free Software Foundation, Inc.
  This file is part of the GNU C Library.
-
  The GNU C Library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
-
  The GNU C Library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
-
  You should have received a copy of the GNU Lesser General Public
  License along with the GNU C Library; if not, write to the Free
  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  02111-1307 USA.  */
* This file is part of the GNU C Library.
+ *
* The GNU C Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
+ *
* The GNU C Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with the GNU C Library; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.  */
 
 #include <string.h>
 
 /* Taken from glibc 2.6.1 */
 
 
 #include <string.h>
 
 /* Taken from glibc 2.6.1 */
 
-char *strsep (char **stringp, const char *delim)
+char *
+strsep (char **stringp, const char *delim)
 {
 {
-  char *begin, *end;
+    char *begin, *end;
 
 
-  begin = *stringp;
-  if (begin == NULL)
-    return NULL;
+    begin = *stringp;
+    if (begin == NULL)
+       return NULL;
 
 
-  /* A frequent case is when the delimiter string contains only one
-     character.  Here we don't need to call the expensive `strpbrk'
-     function and instead work using `strchr'.  */
-  if (delim[0] == '\0' || delim[1] == '\0')
-    {
-      char ch = delim[0];
+    /* A frequent case is when the delimiter string contains only one
+     * character.  Here we don't need to call the expensive `strpbrk'
+     * function and instead work using `strchr'.  */
+    if (delim[0] == '\0' || delim[1] == '\0') {
+       char ch = delim[0];
 
 
-      if (ch == '\0')
-       end = NULL;
-      else
-       {
-         if (*begin == ch)
-           end = begin;
-         else if (*begin == '\0')
+       if (ch == '\0')
            end = NULL;
            end = NULL;
-         else
-           end = strchr (begin + 1, ch);
+       else {
+           if (*begin == ch)
+               end = begin;
+           else if (*begin == '\0')
+               end = NULL;
+           else
+               end = strchr (begin + 1, ch);
        }
        }
-    }
-  else
-    /* Find the end of the token.  */
-    end = strpbrk (begin, delim);
-
-  if (end)
-    {
-      /* Terminate the token and set *STRINGP past NUL character.  */
-      *end++ = '\0';
-      *stringp = end;
-    }
-  else
-    /* No more delimiters; this is the last token.  */
-    *stringp = NULL;
-
-  return begin;
+    } else
+       /* Find the end of the token.  */
+       end = strpbrk (begin, delim);
+
+    if (end) {
+       /* Terminate the token and set *STRINGP past NUL character.  */
+       *end++ = '\0';
+       *stringp = end;
+    } else
+       /* No more delimiters; this is the last token.  */
+       *stringp = NULL;
+
+    return begin;
 }
 }
index 3560c370f40c425ecf379fc3b9a9850355a515dc..005a42399d8e8b9afa63e33ef4278778709943d7 100644 (file)
@@ -1,19 +1,19 @@
 /* timegm.c --- Implementation of replacement timegm function.
 /* timegm.c --- Implementation of replacement timegm function.
-
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License as
  published by the Free Software Foundation; either version 3, or (at
  your option) any later version.
-
  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.
-
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  02110-1301, USA.  */
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3, or (at
* your option) any later version.
+ *
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.  */
 
 /* Copyright 2013 Blake Jones. */
 
 
 /* Copyright 2013 Blake Jones. */
 
@@ -35,20 +35,20 @@ leapyear (int year)
 time_t
 timegm (struct tm *tm)
 {
 time_t
 timegm (struct tm *tm)
 {
-    int        monthlen[2][12] = {
+    int monthlen[2][12] = {
        { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
        { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
     };
        { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
        { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
     };
-    int        year, month, days;
+    int year, month, days;
 
     days = 365 * (tm->tm_year - 70);
     for (year = 70; year < tm->tm_year; year++) {
 
     days = 365 * (tm->tm_year - 70);
     for (year = 70; year < tm->tm_year; year++) {
-       if (leapyear(1900 + year)) {
+       if (leapyear (1900 + year)) {
            days++;
        }
     }
     for (month = 0; month < tm->tm_mon; month++) {
            days++;
        }
     }
     for (month = 0; month < tm->tm_mon; month++) {
-       days += monthlen[leapyear(1900 + year)][month];
+       days += monthlen[leapyear (1900 + year)][month];
     }
     days += tm->tm_mday - 1;
 
     }
     days += tm->tm_mday - 1;