Module Name: src Committed By: martin Date: Tue Apr 16 18:33:47 UTC 2024
Modified Files: src/lib/libc/time [netbsd-10]: strptime.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #648): lib/libc/time/strptime.c: revision 1.66 strptime(3): Declare digit d as time_t. This doesn't make a semantic difference -- d can only take on the ten values {0,1,2,3,4,5,6,7,8,9}, and the arithmetic with it later all comes out the same whether the type is unsigned or time_t, even if time_t were int32_t instead of int64_t. But it pacifies overzealous compilers used by downstream users of this code. And while it's silly to use a much wider type (64-bit signed) than is needed here to store a single digit, it doesn't really hurt either (32-bit unsigned is much larger than needed too). PR lib/58041 To generate a diff of this commit: cvs rdiff -u -r1.63.6.1 -r1.63.6.2 src/lib/libc/time/strptime.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/time/strptime.c diff -u src/lib/libc/time/strptime.c:1.63.6.1 src/lib/libc/time/strptime.c:1.63.6.2 --- src/lib/libc/time/strptime.c:1.63.6.1 Mon Mar 25 14:43:30 2024 +++ src/lib/libc/time/strptime.c Tue Apr 16 18:33:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: strptime.c,v 1.63.6.1 2024/03/25 14:43:30 martin Exp $ */ +/* $NetBSD: strptime.c,v 1.63.6.2 2024/04/16 18:33:47 martin Exp $ */ /*- * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: strptime.c,v 1.63.6.1 2024/03/25 14:43:30 martin Exp $"); +__RCSID("$NetBSD: strptime.c,v 1.63.6.2 2024/04/16 18:33:47 martin Exp $"); #endif #include "namespace.h" @@ -348,8 +348,7 @@ literal: case 's': { /* seconds since the epoch */ const time_t TIME_MAX = __type_max(time_t); - time_t sse; - unsigned d; + time_t sse, d; if (*bp < '0' || *bp > '9') { bp = NULL;