annotate lib/imaxabs.c @ 12559:c2cbabec01dd

update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
author Jim Meyering <meyering@redhat.com>
date Fri, 01 Jan 2010 10:31:12 +0100
parents b5e42ef33b49
children 97fc9a21a8fb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7205
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* imaxabs() function: absolute value of 'intmax_t'.
12559
c2cbabec01dd update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents: 12518
diff changeset
2 Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
7205
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
4 This program is free software: you can redistribute it and/or modify
7205
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
7 (at your option) any later version.
7205
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
7205
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
7304
1c4ed7637c24 Include <config.h> unconditionally.
Bruno Haible <bruno@clisp.org>
parents: 7205
diff changeset
17 #include <config.h>
7205
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 /* Specification. */
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 #include <inttypes.h>
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 intmax_t
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 imaxabs (intmax_t x)
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 {
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 return (x >= 0 ? x : - x);
47e98e70a47d New module 'imaxabs'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 }