Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/time remove "register" in new code
details: https://anonhg.NetBSD.org/src/rev/3e89943e8ae4
branches: trunk
changeset: 788669:3e89943e8ae4
user: christos <christos%NetBSD.org@localhost>
date: Wed Jul 17 23:09:26 2013 +0000
description:
remove "register" in new code
fix backwards check for overflow
diffstat:
lib/libc/time/localtime.c | 10 +++++-----
lib/libc/time/scheck.c | 16 ++++++++--------
lib/libc/time/strftime.c | 8 ++++----
lib/libc/time/zdump.c | 8 ++++----
4 files changed, 21 insertions(+), 21 deletions(-)
diffs (140 lines):
diff -r a0df5fbaf31f -r 3e89943e8ae4 lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Wed Jul 17 22:36:26 2013 +0000
+++ b/lib/libc/time/localtime.c Wed Jul 17 23:09:26 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: localtime.c,v 1.74 2013/07/17 20:13:04 christos Exp $ */
+/* $NetBSD: localtime.c,v 1.75 2013/07/17 23:09:26 christos Exp $ */
/*
** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
#if 0
static char elsieid[] = "@(#)localtime.c 8.17";
#else
-__RCSID("$NetBSD: localtime.c,v 1.74 2013/07/17 20:13:04 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.75 2013/07/17 23:09:26 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -1538,7 +1538,7 @@
struct tm *tmp;
if ((offset > 0 && offset > INT_FAST32_MAX) ||
- (offset < 0 && offset > INT_FAST32_MIN)) {
+ (offset < 0 && offset < INT_FAST32_MIN)) {
errno = EOVERFLOW;
return NULL;
}
@@ -1554,7 +1554,7 @@
offtime_r(const time_t *timep, long offset, struct tm *tmp)
{
if ((offset > 0 && offset > INT_FAST32_MAX) ||
- (offset < 0 && offset > INT_FAST32_MIN)) {
+ (offset < 0 && offset < INT_FAST32_MIN)) {
errno = EOVERFLOW;
return NULL;
}
@@ -2189,7 +2189,7 @@
time_t t;
if ((offset > 0 && offset > INT_FAST32_MAX) ||
- (offset < 0 && offset > INT_FAST32_MIN)) {
+ (offset < 0 && offset < INT_FAST32_MIN)) {
errno = EOVERFLOW;
return -1;
}
diff -r a0df5fbaf31f -r 3e89943e8ae4 lib/libc/time/scheck.c
--- a/lib/libc/time/scheck.c Wed Jul 17 22:36:26 2013 +0000
+++ b/lib/libc/time/scheck.c Wed Jul 17 23:09:26 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scheck.c,v 1.10 2013/07/17 20:13:04 christos Exp $ */
+/* $NetBSD: scheck.c,v 1.11 2013/07/17 23:09:26 christos Exp $ */
/*
** This file is in the public domain, so clarified as of
@@ -15,7 +15,7 @@
#if 0
static char elsieid[] = "@(#)scheck.c 8.19";
#else
-__RCSID("$NetBSD: scheck.c,v 1.10 2013/07/17 20:13:04 christos Exp $");
+__RCSID("$NetBSD: scheck.c,v 1.11 2013/07/17 23:09:26 christos Exp $");
#endif
#endif /* !defined lint */
@@ -26,12 +26,12 @@
const char *
scheck(const char *const string, const char *const format)
{
- register char * fbuf;
- register const char * fp;
- register char * tp;
- register int c;
- register const char * result;
- char dummy;
+ char * fbuf;
+ const char * fp;
+ char * tp;
+ int c;
+ const char * result;
+ char dummy;
result = "";
if (string == NULL || format == NULL)
diff -r a0df5fbaf31f -r 3e89943e8ae4 lib/libc/time/strftime.c
--- a/lib/libc/time/strftime.c Wed Jul 17 22:36:26 2013 +0000
+++ b/lib/libc/time/strftime.c Wed Jul 17 23:09:26 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: strftime.c,v 1.27 2013/07/17 20:13:04 christos Exp $ */
+/* $NetBSD: strftime.c,v 1.28 2013/07/17 23:09:26 christos Exp $ */
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
@@ -6,7 +6,7 @@
static char elsieid[] = "@(#)strftime.c 7.64";
static char elsieid[] = "@(#)strftime.c 8.3";
#else
-__RCSID("$NetBSD: strftime.c,v 1.27 2013/07/17 20:13:04 christos Exp $");
+__RCSID("$NetBSD: strftime.c,v 1.28 2013/07/17 23:09:26 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -645,8 +645,8 @@
_yconv(const int a, const int b, const int convert_top, const int convert_yy,
char *pt, const char *const ptlim)
{
- register int lead;
- register int trail;
+ int lead;
+ int trail;
#define DIVISOR 100
trail = a % DIVISOR + b % DIVISOR;
diff -r a0df5fbaf31f -r 3e89943e8ae4 lib/libc/time/zdump.c
--- a/lib/libc/time/zdump.c Wed Jul 17 22:36:26 2013 +0000
+++ b/lib/libc/time/zdump.c Wed Jul 17 23:09:26 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zdump.c,v 1.29 2013/07/17 20:13:04 christos Exp $ */
+/* $NetBSD: zdump.c,v 1.30 2013/07/17 23:09:26 christos Exp $ */
/*
** This file is in the public domain, so clarified as of
** 2009-05-17 by Arthur David Olson.
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: zdump.c,v 1.29 2013/07/17 20:13:04 christos Exp $");
+__RCSID("$NetBSD: zdump.c,v 1.30 2013/07/17 23:09:26 christos Exp $");
#endif /* !defined lint */
#include "version.h"
@@ -380,8 +380,8 @@
intmax_t lo;
intmax_t hi;
char dummy;
- register intmax_t cutloyear = ZDUMP_LO_YEAR;
- register intmax_t cuthiyear = ZDUMP_HI_YEAR;
+ intmax_t cutloyear = ZDUMP_LO_YEAR;
+ intmax_t cuthiyear = ZDUMP_HI_YEAR;
if (cutarg != NULL) {
if (sscanf(cutarg, "%"SCNdMAX"%c", &hi, &dummy) == 1) {
cuthiyear = hi;
Home |
Main Index |
Thread Index |
Old Index