Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / bc / dc / dc-regdef.h
blob540268c196b5e3e1c07503b491114dc49418f7e3
1 /*
2 * definitions for dc's "register" declarations
4 * Copyright (C) 1994 Free Software Foundation, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you can either send email to this
18 * program's author (see below) or write to:
20 * The Free Software Foundation, Inc.
21 * 59 Temple Place, Suite 330
22 * Boston, MA 02111 USA
25 #ifdef HAVE_LIMITS_H
26 # include <limits.h> /* UCHAR_MAX */
27 #endif
29 /* determine how many register stacks there are */
30 #ifndef DC_REGCOUNT
31 # ifndef UCHAR_MAX
32 # define DC_REGCOUNT 256
33 # else
34 # define DC_REGCOUNT (UCHAR_MAX+1)
35 # endif
36 #endif /* not DC_REGCOUNT */
38 /* efficiency hack for masking arbritrary integers to 0..(DC_REGCOUNT-1) */
39 #if (DC_REGCOUNT & (DC_REGCOUNT-1)) == 0 /* DC_REGCOUNT is power of 2 */
40 # define regmap(r) ((r) & (DC_REGCOUNT-1))
41 #else
42 # define regmap(r) ((r) % DC_REGCOUNT)
43 #endif