summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-01-06 08:35:21 +0000
committerJim Meyering <jim@meyering.net>2000-01-06 08:35:21 +0000
commit2315cbdeaa313420942c5dc7730e46d737ed5be0 (patch)
tree08143e008d7ed4b1e696b43ffed2589de61a9adf /src
parenteee26242bbd206084431e4642bc400cfffa5ceae (diff)
downloadcoreutils-2315cbdeaa313420942c5dc7730e46d737ed5be0.tar.xz
(apply_suffix): Comment.
Diffstat (limited to 'src')
-rw-r--r--src/sleep.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sleep.c b/src/sleep.c
index 5d4596414..27385aea7 100644
--- a/src/sleep.c
+++ b/src/sleep.c
@@ -83,11 +83,14 @@ point number.\n\
}
exit (status);
}
-
-/* FIXME: describe */
+/* Given a floating point value *X, and a suffix character, SUFFIX_CHAR,
+ scale *X by the multiplier implied by SUFFIX_CHAR. SUFFIX_CHAR may
+ be the NUL byte or `s' to denote seconds, `m' for minutes, `h' for
+ hours, or `d' for days. If SUFFIX_CHAR is invalid, don't modify *X
+ and return nonzero. Otherwise return zero. */
static int
-apply_suffix (double *s, char suffix_char)
+apply_suffix (double *x, char suffix_char)
{
unsigned int multiplier;
@@ -113,7 +116,7 @@ apply_suffix (double *s, char suffix_char)
if (multiplier == 0)
return 1;
- *s *= multiplier;
+ *x *= multiplier;
return 0;
}