Deleted Added
full compact
expr.c (95060) expr.c (95095)
1/* $OpenBSD: expr.c,v 1.12 2002/02/16 21:27:48 millert Exp $ */
2/* $NetBSD: expr.c,v 1.7 1995/09/28 05:37:31 tls Exp $ */
3
4/*
5 * Copyright (c) 1989, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 26 unchanged lines hidden (view full) ---

35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 */
39
40#include <sys/cdefs.h>
41__SCCSID("@(#)expr.c 8.2 (Berkeley) 4/29/95");
42__RCSID_SOURCE("$OpenBSD: expr.c,v 1.12 2002/02/16 21:27:48 millert Exp $");
1/* $OpenBSD: expr.c,v 1.12 2002/02/16 21:27:48 millert Exp $ */
2/* $NetBSD: expr.c,v 1.7 1995/09/28 05:37:31 tls Exp $ */
3
4/*
5 * Copyright (c) 1989, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 26 unchanged lines hidden (view full) ---

35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 */
39
40#include <sys/cdefs.h>
41__SCCSID("@(#)expr.c 8.2 (Berkeley) 4/29/95");
42__RCSID_SOURCE("$OpenBSD: expr.c,v 1.12 2002/02/16 21:27:48 millert Exp $");
43__FBSDID("$FreeBSD: head/usr.bin/m4/expr.c 95060 2002-04-19 17:26:21Z jmallett $");
43__FBSDID("$FreeBSD: head/usr.bin/m4/expr.c 95095 2002-04-20 01:49:10Z jmallett $");
44
45#include <sys/types.h>
46#include <ctype.h>
47#include <err.h>
48#include <stddef.h>
49#include <stdio.h>
50#include "mdef.h"
51#include "extern.h"

--- 188 unchanged lines hidden (view full) ---

240}
241
242/*
243 * eqrel : shift { eqrelop shift }
244 */
245static int
246eqrel()
247{
44
45#include <sys/types.h>
46#include <ctype.h>
47#include <err.h>
48#include <stddef.h>
49#include <stdio.h>
50#include "mdef.h"
51#include "extern.h"

--- 188 unchanged lines hidden (view full) ---

240}
241
242/*
243 * eqrel : shift { eqrelop shift }
244 */
245static int
246eqrel()
247{
248 int vl, vr, eqrel;
248 int vl, vr, eqrelval;
249
250 vl = shift();
249
250 vl = shift();
251 while ((eqrel = geteqrel()) != -1) {
251 while ((eqrelval = geteqrel()) != -1) {
252 vr = shift();
253
252 vr = shift();
253
254 switch (eqrel) {
255
254 switch (eqrelval) {
256 case EQL:
257 vl = (vl == vr);
258 break;
259 case NEQ:
260 vl = (vl != vr);
261 break;
255 case EQL:
256 vl = (vl == vr);
257 break;
258 case NEQ:
259 vl = (vl != vr);
260 break;
262
263 case LEQ:
264 vl = (vl <= vr);
265 break;
266 case LSS:
267 vl = (vl < vr);
268 break;
269 case GTR:
270 vl = (vl > vr);

--- 170 unchanged lines hidden (view full) ---

441 int value;
442 int c;
443 int v[sizeof(int)];
444
445 if (skipws() != '\'') {
446 ungetch();
447 return num();
448 }
261 case LEQ:
262 vl = (vl <= vr);
263 break;
264 case LSS:
265 vl = (vl < vr);
266 break;
267 case GTR:
268 vl = (vl > vr);

--- 170 unchanged lines hidden (view full) ---

439 int value;
440 int c;
441 int v[sizeof(int)];
442
443 if (skipws() != '\'') {
444 ungetch();
445 return num();
446 }
449 for (i = 0; i < sizeof(int); i++) {
447 for (i = 0; i < (int)sizeof(int); i++) {
450 if ((c = getch()) == '\'') {
451 ungetch();
452 break;
453 }
454 if (c == '\\') {
455 switch (c = getch()) {
456 case '0':
457 case '1':

--- 163 unchanged lines hidden ---
448 if ((c = getch()) == '\'') {
449 ungetch();
450 break;
451 }
452 if (c == '\\') {
453 switch (c = getch()) {
454 case '0':
455 case '1':

--- 163 unchanged lines hidden ---