changeset 492:cc1a5f764782

*** empty log message ***
author kono
date Wed, 21 Dec 2005 12:10:43 +0900
parents a379da780856
children c85540f30297
files mc-codegen.c test/putenemy.c test/simp.c
diffstat 3 files changed, 27 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mc-codegen.c	Wed Dec 21 11:33:53 2005 +0900
+++ b/mc-codegen.c	Wed Dec 21 12:10:43 2005 +0900
@@ -3862,7 +3862,7 @@
     } else {
 	switch(t) {
 	case DOTS: return e;
-        case UNSIGNED:  e = unsigned_value(e); break;
+        case UNSIGNED:  e = unsigned_value(e);  t = UNSIGNED; break;
         case CHAR:      e = char_value(e); t = INT; break;
         case UCHAR:     e = uchar_value(e); t = UNSIGNED; break;
         case SHORT:     e = short_value(e); t = INT; break;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/putenemy.c	Wed Dec 21 12:10:43 2005 +0900
@@ -0,0 +1,19 @@
+extern int printf(char *,...);
+void
+Putenemy(int charno,float x,float y,float sx,float sy,int move) {
+     if(x)
+          printf("%d %f %f %f %f %d\n",charno,x,y,sx,sy,move);
+     else
+          printf("check\n");
+}
+int
+main()
+{
+     int ix=32,iy=32; float fx=32,fy=32;
+     Putenemy(0,ix,iy,1,0,10);
+     Putenemy(1,(float)ix,(float)iy,1,0,10);
+     Putenemy(2,(float)ix,(float)iy,(float)ix,(float)iy,ix);
+     Putenemy(3,(float)ix,(float)iy,(float)ix,0,ix);
+     Putenemy(4,fx,fy,1,0,10);
+}
+
--- a/test/simp.c	Wed Dec 21 11:33:53 2005 +0900
+++ b/test/simp.c	Wed Dec 21 12:10:43 2005 +0900
@@ -1,5 +1,6 @@
 #include "stdio.h"
 
+int
 alpha(c)
 char c;
 {
@@ -7,6 +8,10 @@
 }
 char ch;
 
+void main1();
+int main0() ;
+
+int
 main(int ac,char *av[]) 
 {
     int i;
@@ -20,6 +25,7 @@
     return main0(ac,ch,av);
 }
 
+int
 main0(ac,ch,av) 
 int ac;
 char ch;
@@ -34,6 +40,7 @@
     return 0;
 }
 
+void
 main1(int l)
 {
    printf("#0038:%d\n", ((l+0)<-511||(l+0)>511));