summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortholo <>1996-03-25 21:17:36 +0000
committertholo <>1996-03-25 21:17:36 +0000
commitc25c16795b2748b87f78736ade4213077a6cd03a (patch)
tree055b6e8b95807ab3d5da1b34d34e4914f28d7708
parent441786effc7c61a4d82feb9cd84a20b1dfd27ecd (diff)
downloadopenbsd-c25c16795b2748b87f78736ade4213077a6cd03a.tar.gz
openbsd-c25c16795b2748b87f78736ade4213077a6cd03a.tar.bz2
openbsd-c25c16795b2748b87f78736ade4213077a6cd03a.zip
Add prototypes for local functions, add const qualifiers where needed
-rw-r--r--src/lib/libc/string/strftime.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/lib/libc/string/strftime.c b/src/lib/libc/string/strftime.c
index 0b69e10ac0..b6326f274e 100644
--- a/src/lib/libc/string/strftime.c
+++ b/src/lib/libc/string/strftime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: strftime.c,v 1.3 1996/03/09 02:42:58 niklas Exp $ */ 1/* $OpenBSD: strftime.c,v 1.4 1996/03/25 21:17:36 tholo Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1989 The Regents of the University of California. 4 * Copyright (c) 1989 The Regents of the University of California.
@@ -35,7 +35,7 @@
35 35
36#if defined(LIBC_SCCS) && !defined(lint) 36#if defined(LIBC_SCCS) && !defined(lint)
37/*static char *sccsid = "from: @(#)strftime.c 5.11 (Berkeley) 2/24/91";*/ 37/*static char *sccsid = "from: @(#)strftime.c 5.11 (Berkeley) 2/24/91";*/
38static char *rcsid = "$Id: strftime.c,v 1.3 1996/03/09 02:42:58 niklas Exp $"; 38static char *rcsid = "$Id: strftime.c,v 1.4 1996/03/25 21:17:36 tholo Exp $";
39#endif /* LIBC_SCCS and not lint */ 39#endif /* LIBC_SCCS and not lint */
40 40
41#include <sys/localedef.h> 41#include <sys/localedef.h>
@@ -46,8 +46,10 @@ static char *rcsid = "$Id: strftime.c,v 1.3 1996/03/09 02:42:58 niklas Exp $";
46 46
47static size_t gsize; 47static size_t gsize;
48static char *pt; 48static char *pt;
49static int _add(), _conv(), _secs(); 49static int _add __P((const char *));
50static size_t _fmt(); 50static int _secs __P((const struct tm *));
51static int _conv __P((int, int, char));
52static size_t _fmt __P((const char *, const struct tm *));
51 53
52size_t 54size_t
53strftime(s, maxsize, format, t) 55strftime(s, maxsize, format, t)
@@ -74,8 +76,8 @@ strftime(s, maxsize, format, t)
74 ((t)->tm_wday ? (t)->tm_wday - 1 : 6)) / 7) 76 ((t)->tm_wday ? (t)->tm_wday - 1 : 6)) / 7)
75static size_t 77static size_t
76_fmt(format, t) 78_fmt(format, t)
77 register char *format; 79 register const char *format;
78 struct tm *t; 80 const struct tm *t;
79{ 81{
80 for (; *format; ++format) { 82 for (; *format; ++format) {
81 if (*format == '%') { 83 if (*format == '%') {
@@ -276,7 +278,7 @@ _fmt(format, t)
276 278
277static int 279static int
278_secs(t) 280_secs(t)
279 struct tm *t; 281 const struct tm *t;
280{ 282{
281 static char buf[15]; 283 static char buf[15];
282 register time_t s; 284 register time_t s;
@@ -292,9 +294,13 @@ _secs(t)
292} 294}
293 295
294static int 296static int
297#if __STDC__
298_conv(int n, int digits, char pad)
299#else
295_conv(n, digits, pad) 300_conv(n, digits, pad)
296 int n, digits; 301 int n, digits;
297 char pad; 302 char pad;
303#endif
298{ 304{
299 static char buf[10]; 305 static char buf[10];
300 register char *p; 306 register char *p;
@@ -308,7 +314,7 @@ _conv(n, digits, pad)
308 314
309static int 315static int
310_add(str) 316_add(str)
311 register char *str; 317 register const char *str;
312{ 318{
313 for (;; ++pt, --gsize) { 319 for (;; ++pt, --gsize) {
314 if (!gsize) 320 if (!gsize)