Sfoglia il codice sorgente

Be consistent about no space between function and ‘(’.

Paul Eggert 4 anni fa
parent
commit
6010bddd13
6 ha cambiato i file con 31 aggiunte e 31 eliminazioni
  1. 1 1
      date.c
  2. 2 2
      difftime.c
  3. 7 7
      localtime.c
  4. 6 6
      private.h
  5. 7 7
      zdump.c
  6. 8 8
      zic.c

+ 1 - 1
date.c

@@ -92,7 +92,7 @@ main(const int argc, char *argv[])
 			}
 			rflag = true;
 			errno = 0;
-			secs = strtoimax (optarg, &endarg, 0);
+			secs = strtoimax(optarg, &endarg, 0);
 			if (*endarg || optarg == endarg)
 				errno = EINVAL;
 			else if (! (TIME_T_MIN <= secs && secs <= TIME_T_MAX))

+ 2 - 2
difftime.c

@@ -23,7 +23,7 @@ difftime(time_t time1, time_t time0)
 	** If double is large enough, simply convert and subtract
 	** (assuming that the larger type has more precision).
 	*/
-	if (sizeof (time_t) < sizeof (double)) {
+	if (sizeof(time_t) < sizeof(double)) {
 	  double t1 = time1, t0 = time0;
 	  return t1 - t0;
 	}
@@ -36,7 +36,7 @@ difftime(time_t time1, time_t time0)
 	  return time0 <= time1 ? time1 - time0 : dminus(time0 - time1);
 
 	/* Use uintmax_t if wide enough.  */
-	if (sizeof (time_t) <= sizeof (uintmax_t)) {
+	if (sizeof(time_t) <= sizeof(uintmax_t)) {
 	  uintmax_t t1 = time1, t0 = time0;
 	  return time0 <= time1 ? t1 - t0 : dminus(t0 - t1);
 	}

+ 7 - 7
localtime.c

@@ -348,7 +348,7 @@ union input_buffer {
   struct tzhead tzhead;
 
   /* The entire buffer.  */
-  char buf[2 * sizeof(struct tzhead) + 2 * sizeof (struct state)
+  char buf[2 * sizeof(struct tzhead) + 2 * sizeof(struct state)
 	   + 4 * TZ_MAX_TIMES];
 };
 
@@ -367,7 +367,7 @@ union local_storage {
   } u;
 
   /* The file name to be opened.  */
-  char fullname[BIGGEST(sizeof (struct file_analysis),
+  char fullname[BIGGEST(sizeof(struct file_analysis),
 			sizeof tzdirslash + 1024)];
 };
 
@@ -384,7 +384,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
 	register ssize_t		nread;
 	register bool doaccess;
 	register union input_buffer *up = &lsp->u.u;
-	register int tzheadsize = sizeof (struct tzhead);
+	register int tzheadsize = sizeof(struct tzhead);
 
 	sp->goback = sp->goahead = false;
 
@@ -2025,10 +2025,10 @@ time2sub(struct tm *const tmp,
 		    && (yourtm.TM_GMTOFF < 0
 			? (-SECSPERDAY <= yourtm.TM_GMTOFF
 			   && (mytm.TM_GMTOFF <=
-			       (SMALLEST (INT_FAST32_MAX, LONG_MAX)
+			       (SMALLEST(INT_FAST32_MAX, LONG_MAX)
 				+ yourtm.TM_GMTOFF)))
 			: (yourtm.TM_GMTOFF <= SECSPERDAY
-			   && ((BIGGEST (INT_FAST32_MIN, LONG_MIN)
+			   && ((BIGGEST(INT_FAST32_MIN, LONG_MIN)
 				+ yourtm.TM_GMTOFF)
 			       <= mytm.TM_GMTOFF)))) {
 		  /* MYTM matches YOURTM except with the wrong UT offset.
@@ -2113,8 +2113,8 @@ time2(struct tm * const	tmp,
 
 static time_t
 time1(struct tm *const tmp,
-      struct tm *(*funcp) (struct state const *, time_t const *,
-			   int_fast32_t, struct tm *),
+      struct tm *(*funcp)(struct state const *, time_t const *,
+			  int_fast32_t, struct tm *),
       struct state const *sp,
       const int_fast32_t offset)
 {

+ 6 - 6
private.h

@@ -361,10 +361,10 @@ typedef unsigned long uintmax_t;
 #endif
 
 #if 3 <= __GNUC__
-# define ATTRIBUTE_CONST __attribute__ ((const))
-# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-# define ATTRIBUTE_PURE __attribute__ ((__pure__))
-# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+# define ATTRIBUTE_CONST __attribute__((const))
+# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
+# define ATTRIBUTE_PURE __attribute__((__pure__))
+# define ATTRIBUTE_FORMAT(spec) __attribute__((__format__ spec))
 #else
 # define ATTRIBUTE_CONST /* empty */
 # define ATTRIBUTE_MALLOC /* empty */
@@ -374,7 +374,7 @@ typedef unsigned long uintmax_t;
 
 #if !defined _Noreturn && __STDC_VERSION__ < 201112
 # if 2 < __GNUC__ + (8 <= __GNUC_MINOR__)
-#  define _Noreturn __attribute__ ((__noreturn__))
+#  define _Noreturn __attribute__((__noreturn__))
 # else
 #  define _Noreturn
 # endif
@@ -620,7 +620,7 @@ time_t time2posix_z(timezone_t, time_t) ATTRIBUTE_PURE;
 # define bool int
 #endif
 
-#define TYPE_BIT(type)	(sizeof (type) * CHAR_BIT)
+#define TYPE_BIT(type)	(sizeof(type) * CHAR_BIT)
 #define TYPE_SIGNED(type) (((type) -1) < 0)
 #define TWOS_COMPLEMENT(t) ((t) ~ (t) 0 < 0)
 

+ 7 - 7
zdump.c

@@ -519,7 +519,7 @@ main(int argc, char *argv[])
 		}
 	}
 	gmtzinit();
-	INITIALIZE (now);
+	INITIALIZE(now);
 	if (! (iflag | vflag | Vflag))
 	  now = time(NULL);
 	longest = 0;
@@ -1123,21 +1123,21 @@ static const char *
 tformat(void)
 {
 	if (0 > (time_t) -1) {		/* signed */
-		if (sizeof (time_t) == sizeof (intmax_t))
+		if (sizeof(time_t) == sizeof(intmax_t))
 			return "%"PRIdMAX;
-		if (sizeof (time_t) > sizeof (long))
+		if (sizeof(time_t) > sizeof(long))
 			return "%lld";
-		if (sizeof (time_t) > sizeof (int))
+		if (sizeof(time_t) > sizeof(int))
 			return "%ld";
 		return "%d";
 	}
 #ifdef PRIuMAX
-	if (sizeof (time_t) == sizeof (uintmax_t))
+	if (sizeof(time_t) == sizeof(uintmax_t))
 		return "%"PRIuMAX;
 #endif
-	if (sizeof (time_t) > sizeof (unsigned long))
+	if (sizeof(time_t) > sizeof(unsigned long))
 		return "%llu";
-	if (sizeof (time_t) > sizeof (unsigned int))
+	if (sizeof(time_t) > sizeof(unsigned int))
 		return "%lu";
 	return "%u";
 }

+ 8 - 8
zic.c

@@ -476,7 +476,7 @@ erealloc(void *ptr, size_t size)
 }
 
 static char * ATTRIBUTE_MALLOC
-ecpyalloc (char const *str)
+ecpyalloc(char const *str)
 {
   return memcheck(strdup(str));
 }
@@ -592,7 +592,7 @@ usage(FILE *stream, int status)
    ancestors.  After this is done, all files are accessed with names
    relative to DIR.  */
 static void
-change_directory (char const *dir)
+change_directory(char const *dir)
 {
   if (chdir(dir) != 0) {
     int chdir_errno = errno;
@@ -693,14 +693,14 @@ timerange_option(char *timerange)
   char *lo_end = timerange, *hi_end;
   if (*timerange == '@') {
     errno = 0;
-    lo = strtoimax (timerange + 1, &lo_end, 10);
+    lo = strtoimax(timerange + 1, &lo_end, 10);
     if (lo_end == timerange + 1 || (lo == INTMAX_MAX && errno == ERANGE))
       return false;
   }
   hi_end = lo_end;
   if (lo_end[0] == '/' && lo_end[1] == '@') {
     errno = 0;
-    hi = strtoimax (lo_end + 2, &hi_end, 10);
+    hi = strtoimax(lo_end + 2, &hi_end, 10);
     if (hi_end == lo_end + 2 || hi == INTMAX_MIN)
       return false;
     hi -= ! (hi == INTMAX_MAX && errno == ERANGE);
@@ -924,9 +924,9 @@ componentcheck(char const *name, char const *component,
 	ptrdiff_t component_len = component_end - component;
 	if (component_len == 0) {
 	  if (!*name)
-	    error (_("empty file name"));
+	    error(_("empty file name"));
 	  else
-	    error (_(component == name
+	    error(_(component == name
 		     ? "file name '%s' begins with '/'"
 		     : *component_end
 		     ? "file name '%s' contains '//'"
@@ -1019,10 +1019,10 @@ random_dirent(char const **name, char **namealloc)
   /* This randomization is not the best, but is portable to C89.  */
   if (!initialized++) {
     unsigned now = time(NULL);
-    srand(rand () ^ now);
+    srand(rand() ^ now);
   }
   for (i = 0; i < suffixlen; i++)
-    dst[dirlen + prefixlen + i] = alphabet[rand () % alphabetlen];
+    dst[dirlen + prefixlen + i] = alphabet[rand() % alphabetlen];
 }
 
 /* Prepare to write to the file *OUTNAME, using *TEMPNAME to store the