diff mc-parse.c @ 660:3e1dba5758d8

*** empty log message ***
author kono
date Wed, 31 Jan 2007 16:06:04 +0900
parents 8320ae3ac186
children dbfbeb05210c
line wrap: on
line diff
--- a/mc-parse.c	Wed Jan 24 14:31:50 2007 +0900
+++ b/mc-parse.c	Wed Jan 31 16:06:04 2007 +0900
@@ -773,10 +773,12 @@
 set_converter(char *s)
 {
     chptr = s;
-    if (macroeq("c2cbc")) conv=&c2cbc_converter;
+    if (0) ;
+#if !UDPCL
+    else if (macroeq("c2cbc")) conv=&c2cbc_converter;
     else if (macroeq("cbc2c")) conv=&cbc2c_converter;
     else if (macroeq("c")) conv=&c_converter;
-#if UDPCL
+#else
     else if (macroeq("udpcl")) conv=&udpcl_converter;
 #endif
     else conv=&null_converter;
@@ -2009,7 +2011,7 @@
     } else {
 	if (parse && (car(parse)!=ST_DECL&&car(parse)!=ST_COMMENT))
 	    error(-1);  // What kind of error?
-	if (car(parse)==ST_COMMENT)
+	if (parse && car(parse)==ST_COMMENT)
 	    cadr(parse)=0;
 	else
 	    parse = 0;
@@ -2698,7 +2700,7 @@
 docase(void)
 {
 #if CASE_CODE
-    int l=0,clist=0,c,cst = (car(csvalue1)==CONST);
+    int l=0,clist=0,c,cst = (csvalue1 && car(csvalue1)==CONST);
     if (!inmode && !cst)
 	l = fwdlabel();
     while(sym==CASE) {
@@ -2762,7 +2764,7 @@
 #else
     /* casading branch implementation */
     int c,clist,l,slfree;
-    int cst = (car(csvalue1)==CONST);
+    int cst = (csvalue1 && car(csvalue1)==CONST);
     if (!inmode && !cst) {
 	if (retpending) { 
 	    ret(); retpending=0;
@@ -4105,6 +4107,10 @@
 
     function_type(ftype,&dots);
 
+    if (type0<=0) {
+	getsym(0);
+	return INT;
+    }
     argtypes = caddr(type0);
     if (!argtypes) dots=1;
     if ((t=type_value(cadr(type0)))>=0 && (car(t)==STRUCT||car(t)==UNION)) {