소스 검색

Pacify Visual Studio 2013 'const' yet again

Problem reported by Kees Dekker in:
http://mm.icann.org/pipermail/tz/2015-July/022527.html
* date.c (wildinput, oops, display, timeout, iffy):
* zdump.c (yeartot):
* zic.c (dolink, itsdir, inrule, inzone, inzcont):
Change arg attributes to match the corresponding declaration.
Paul Eggert 10 년 전
부모
커밋
98311971ef
3개의 변경된 파일11개의 추가작업 그리고 13개의 파일을 삭제
  1. 5 7
      date.c
  2. 1 1
      zdump.c
  3. 5 5
      zic.c

+ 5 - 7
date.c

@@ -287,8 +287,7 @@ reset(time_t newt)
 }
 
 static void
-wildinput(const char *const item, const char *const value,
-	  const char *const reason)
+wildinput(char const *item, char const *value, char const *reason)
 {
 	fprintf(stderr,
 		_("date: error: bad command line %s \"%s\", %s\n"),
@@ -314,7 +313,7 @@ usage(void)
 }
 
 static void
-oops(const char *const string)
+oops(char const *string)
 {
 	int		e = errno;
 
@@ -327,7 +326,7 @@ oops(const char *const string)
 }
 
 static void
-display(const char *const format, time_t const now)
+display(char const *format, time_t now)
 {
 	struct tm *tmp;
 
@@ -352,7 +351,7 @@ display(const char *const format, time_t const now)
 #define INCR	1024
 
 static void
-timeout(FILE *const fp, const char *const format, const struct tm *tmp)
+timeout(FILE *fp, char const *format, struct tm const *tmp)
 {
 	char *	cp;
 	size_t	result;
@@ -579,8 +578,7 @@ checkfinal(char const *value, bool didusg, time_t t, time_t oldnow)
 }
 
 static void
-iffy(const time_t thist, const time_t thatt,
-	const char * const value, const char * const reason)
+iffy(time_t thist, time_t thatt, char const *value, char const *reason)
 {
 	struct tm *tmp;
 	bool dst;

+ 1 - 1
zdump.c

@@ -740,7 +740,7 @@ main(int argc, char *argv[])
 }
 
 static time_t
-yeartot(const intmax_t y)
+yeartot(intmax_t y)
 {
 	register intmax_t	myy, seconds, years;
 	register time_t		t;

+ 5 - 5
zic.c

@@ -739,7 +739,7 @@ relname(char const *dir, char const *base)
 }
 
 static void
-dolink(const char *const fromfield, const char *const tofield)
+dolink(char const *fromfield, char const *tofield)
 {
 	register char *	fromname;
 	register char *	toname;
@@ -859,7 +859,7 @@ static const zic_t big_bang_time = BIG_BANG;
 
 /* Return 1 if NAME is a directory, 0 if it's something else, -1 if trouble.  */
 static int
-itsdir(const char *const name)
+itsdir(char const *name)
 {
 	struct stat st;
 	int res = stat(name, &st);
@@ -1101,7 +1101,7 @@ warning(_("values over 24 hours not handled by pre-2007 versions of zic"));
 }
 
 static void
-inrule(register char **const fields, const int nfields)
+inrule(char **fields, int nfields)
 {
 	static struct rule	r;
 
@@ -1127,7 +1127,7 @@ inrule(register char **const fields, const int nfields)
 }
 
 static bool
-inzone(register char **const fields, const int nfields)
+inzone(char **fields, int nfields)
 {
 	register int	i;
 
@@ -1161,7 +1161,7 @@ _("duplicate zone name %s (file \"%s\", line %d)"),
 }
 
 static bool
-inzcont(register char **const fields, const int nfields)
+inzcont(char **fields, int nfields)
 {
 	if (nfields < ZONEC_MINFIELDS || nfields > ZONEC_MAXFIELDS) {
 		error(_("wrong number of fields on Zone continuation line"));