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 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{ |
248 int vl, vr, eqrelval; |
249 250 vl = shift(); |
251 while ((eqrelval = geteqrel()) != -1) { |
252 vr = shift(); 253 |
254 switch (eqrelval) { |
255 case EQL: 256 vl = (vl == vr); 257 break; 258 case NEQ: 259 vl = (vl != vr); 260 break; |
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 } |
447 for (i = 0; i < (int)sizeof(int); i++) { |
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 --- |