00001 /* 00002 ** LCLint - annotation-assisted static program checker 00003 ** Copyright (C) 1994-2000 University of Virginia, 00004 ** Massachusetts Institute of Technology 00005 ** 00006 ** This program is free software; you can redistribute it and/or modify it 00007 ** under the terms of the GNU General Public License as published by the 00008 ** Free Software Foundation; either version 2 of the License, or (at your 00009 ** option) any later version. 00010 ** 00011 ** This program is distributed in the hope that it will be useful, but 00012 ** WITHOUT ANY WARRANTY; without even the implied warranty of 00013 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 ** General Public License for more details. 00015 ** 00016 ** The GNU General Public License is available from http://www.gnu.org/ or 00017 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00018 ** MA 02111-1307, USA. 00019 ** 00020 ** For information on lclint: lclint-request@cs.virginia.edu 00021 ** To report a bug: lclint-bug@cs.virginia.edu 00022 ** For more information: http://lclint.cs.virginia.edu 00023 */ 00024 /* 00025 ** ynm.c 00026 */ 00027 00028 # include "lclintMacros.nf" 00029 # include "basic.h" 00030 00031 ynm ynm_fromCodeChar (char c) 00032 { 00033 switch (c) 00034 { 00035 case '+': return YES; 00036 case '-': return NO; 00037 case '=': return MAYBE; 00038 BADDEFAULT; 00039 } 00040 } 00041 00042 int ynm_compare (ynm x, ynm y) 00043 { 00044 switch (x) 00045 { 00046 case YES: if (y == YES) return 0; else return 1; 00047 case NO: if (y == NO) return 0; else return -1; 00048 case MAYBE: if (y == MAYBE) return 0; else return 1; 00049 } 00050 00051 BADEXIT; 00052 } 00053 00054
1.2.3 written by Dimitri van Heesch,
© 1997-2000