diff options
| author | Richard M. Stallman | 1997-06-08 21:45:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-06-08 21:45:16 +0000 |
| commit | fdac7fbaa2c0559b37c6f18ecabf50e8f3334e2a (patch) | |
| tree | b59b3a8b66e07f6afe6407372c159e75da968a9b | |
| parent | fd72ddf609b417abf526ccc8865631f813e066e1 (diff) | |
| download | emacs-fdac7fbaa2c0559b37c6f18ecabf50e8f3334e2a.tar.gz emacs-fdac7fbaa2c0559b37c6f18ecabf50e8f3334e2a.zip | |
(time-stamp-string-preprocess, time-stamp-do-number):
Avoid compiler warnings: pass all arguments to time-stamp-do-number
explicitly, not dynamically.
| -rw-r--r-- | lisp/time-stamp.el | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index f357ddc7068..d4f1e1f3d12 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | ;; Copyright 1989, 1993, 1994, 1995, 1997 Free Software Foundation, Inc. | 3 | ;; Copyright 1989, 1993, 1994, 1995, 1997 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Maintainer's Time-stamp: <1997-06-01 17:02:45 gildea> | 5 | ;; Maintainer's Time-stamp: <1997-06-08 16:45:41 gildea> |
| 6 | ;; Maintainer: Stephen Gildea <gildea@alum.mit.edu> | 6 | ;; Maintainer: Stephen Gildea <gildea@alum.mit.edu> |
| 7 | ;; Keywords: tools | 7 | ;; Keywords: tools |
| 8 | 8 | ||
| @@ -348,15 +348,15 @@ With arg, turn time stamping on if and only if arg is positive." | |||
| 348 | (time-stamp-conv-warn "%B" "%#B")) | 348 | (time-stamp-conv-warn "%B" "%#B")) |
| 349 | (format-time-string "%#B" time))) | 349 | (format-time-string "%#B" time))) |
| 350 | ((eq cur-char ?d) ;day of month, 1-31 | 350 | ((eq cur-char ?d) ;day of month, 1-31 |
| 351 | (time-stamp-do-number cur-char)) | 351 | (time-stamp-do-number cur-char alt-form field-width time)) |
| 352 | ((eq cur-char ?H) ;hour, 0-23 | 352 | ((eq cur-char ?H) ;hour, 0-23 |
| 353 | (time-stamp-do-number cur-char)) | 353 | (time-stamp-do-number cur-char alt-form field-width time)) |
| 354 | ((eq cur-char ?I) ;hour, 1-12 | 354 | ((eq cur-char ?I) ;hour, 1-12 |
| 355 | (time-stamp-do-number cur-char)) | 355 | (time-stamp-do-number cur-char alt-form field-width time)) |
| 356 | ((eq cur-char ?m) ;month number, 1-12 | 356 | ((eq cur-char ?m) ;month number, 1-12 |
| 357 | (time-stamp-do-number cur-char)) | 357 | (time-stamp-do-number cur-char alt-form field-width time)) |
| 358 | ((eq cur-char ?M) ;minute, 0-59 | 358 | ((eq cur-char ?M) ;minute, 0-59 |
| 359 | (time-stamp-do-number cur-char)) | 359 | (time-stamp-do-number cur-char alt-form field-width time)) |
| 360 | ((eq cur-char ?p) ;am or pm | 360 | ((eq cur-char ?p) ;am or pm |
| 361 | (or change-case | 361 | (or change-case |
| 362 | (time-stamp-conv-warn "%p" "%#p")) | 362 | (time-stamp-conv-warn "%p" "%#p")) |
| @@ -364,7 +364,7 @@ With arg, turn time stamping on if and only if arg is positive." | |||
| 364 | ((eq cur-char ?P) ;AM or PM | 364 | ((eq cur-char ?P) ;AM or PM |
| 365 | (format-time-string "%p" time)) | 365 | (format-time-string "%p" time)) |
| 366 | ((eq cur-char ?S) ;seconds, 00-60 | 366 | ((eq cur-char ?S) ;seconds, 00-60 |
| 367 | (time-stamp-do-number cur-char)) | 367 | (time-stamp-do-number cur-char alt-form field-width time)) |
| 368 | ((eq cur-char ?w) ;weekday number, Sunday is 0 | 368 | ((eq cur-char ?w) ;weekday number, Sunday is 0 |
| 369 | (format-time-string "%w" time)) | 369 | (format-time-string "%w" time)) |
| 370 | ((eq cur-char ?y) ;year | 370 | ((eq cur-char ?y) ;year |
| @@ -417,10 +417,11 @@ With arg, turn time stamping on if and only if arg is positive." | |||
| 417 | (setq ind (1+ ind))) | 417 | (setq ind (1+ ind))) |
| 418 | result)) | 418 | result)) |
| 419 | 419 | ||
| 420 | (defun time-stamp-do-number (format-char) | 420 | (defun time-stamp-do-number (format-char alt-form field-width time) |
| 421 | ;; Handle compatible cases where only | 421 | ;; Handle a compatible FORMAT-CHAR where only |
| 422 | ;; the default width/padding will change. | 422 | ;; the default width/padding will change. |
| 423 | ;; Uses dynamic vars field-width, time. | 423 | ;; ALT-FORM is whether `#' specified. FIELD-WIDTH is the string |
| 424 | ;; width specification or "". TIME is the time to convert. | ||
| 424 | (let ((format-string (concat "%" (char-to-string format-char)))) | 425 | (let ((format-string (concat "%" (char-to-string format-char)))) |
| 425 | (and (not alt-form) (string-equal field-width "") | 426 | (and (not alt-form) (string-equal field-width "") |
| 426 | (time-stamp-conv-warn format-string | 427 | (time-stamp-conv-warn format-string |