make sccs.include replace the entire line
[unix-history] / usr / src / usr.bin / pascal / libpc / SUCC.c
CommitLineData
4c77a6d3
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
a745d566 3static char sccsid[] = "@(#)SUCC.c 1.5 %G%";
4c77a6d3 4
4c77a6d3 5
492cc5d3 6long
4c77a6d3
KM
7SUCC(value, lower, upper)
8
492cc5d3
KM
9 long value;
10 long lower;
11 long upper;
4c77a6d3 12{
d3fdcc0c
KM
13 if (value == upper) {
14 ERROR("Cannot take succ of last element of a range\n");
d3fdcc0c 15 }
4c77a6d3
KM
16 value++;
17 if (value < lower || value > upper) {
d3fdcc0c 18 ERROR("Value of %D is out of range\n", value);
4c77a6d3
KM
19 }
20 return value;
21}