فهرست منبع

Fix default makefiles (also normalize line ends \n only), fix some compile warnings.

mingodad 8 سال پیش
والد
کامیت
c91c7ccfb2
8فایلهای تغییر یافته به همراه146 افزوده شده و 133 حذف شده
  1. 21 18
      SquiLu/Makefile
  2. 21 21
      SquiLu/sq/Makefile
  3. 41 41
      SquiLu/sqstdlib/Makefile
  4. 52 52
      SquiLu/squirrel/Makefile
  5. 3 1
      SquiLu/squirrel/sqapi.cpp
  6. 4 0
      SquiLu/squirrel/sqbaselib.cpp
  7. 2 0
      SquiLu/squirrel/sqobject.cpp
  8. 2 0
      SquiLu/squirrel/sqvm.cpp

+ 21 - 18
SquiLu/Makefile

@@ -1,22 +1,25 @@
-
-SQUIRREL=.
-MAKE=make
-
-sq32:
-	cd squirrel; $(MAKE) 
-	cd sqstdlib; $(MAKE) 
-	cd sq; $(MAKE) 
-
-sqprof:
-	cd squirrel; $(MAKE) sqprof
-	cd sqstdlib; $(MAKE) sqprof
-	cd sq; $(MAKE) sqprof
-
-sq64:
-	cd squirrel; $(MAKE) sq64
-	cd sqstdlib; $(MAKE) sq64
+
+SQUIRREL=.
+MAKE=make
+
+DIRS=bin lib
+$(shell mkdir -p $(DIRS))
+
+sq32:
+	cd squirrel; $(MAKE) 
+	cd sqstdlib; $(MAKE) 
+	cd sq; $(MAKE) 
+
+sqprof:
+	cd squirrel; $(MAKE) sqprof
+	cd sqstdlib; $(MAKE) sqprof
+	cd sq; $(MAKE) sqprof
+
+sq64:
+	cd squirrel; $(MAKE) sq64
+	cd sqstdlib; $(MAKE) sq64
 	cd sq; $(MAKE) sq64
 	cd sq; $(MAKE) sq64
 	
 	
 clean:
 clean:
 	rm lib/*
 	rm lib/*
-	rm bin/*
+	rm bin/*

+ 21 - 21
SquiLu/sq/Makefile

@@ -1,21 +1,21 @@
-SQUIRREL= ..
-
-
-OUT= $(SQUIRREL)/bin/sq
-INCZ= -I$(SQUIRREL)/include -I. -I$(SQUIRREL)/sqlibs -DNO_EXCEPTION_KEY_NOT_FOUND22=1
-LIBZ= -L$(SQUIRREL)/lib 
-LIB= -lsquirrel -lsqstdlib
-
-OBJS= sq.o
-	
-SRCS= sq.c
-	
-	
-sq32:
-	g++ -O2 -s -fno-exceptions -fno-rtti -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
-
-sqprof:
-	g++ -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
-	
-sq64:
-	g++ -O2 -s -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
+SQUIRREL= ..
+
+
+OUT= $(SQUIRREL)/bin/sq
+INCZ= -I$(SQUIRREL)/include -I. -I$(SQUIRREL)/sqlibs -DNO_EXCEPTION_KEY_NOT_FOUND22=1
+LIBZ= -L$(SQUIRREL)/lib 
+LIB= -lsquirrel -lsqstdlib
+
+OBJS= sq.o
+	
+SRCS= sq.c
+	
+	
+sq32:
+	g++ -O2 -s -fno-exceptions -fno-rtti -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
+
+sqprof:
+	g++ -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
+	
+sq64:
+	g++ -O2 -s -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)

+ 41 - 41
SquiLu/sqstdlib/Makefile

@@ -1,41 +1,41 @@
-SQUIRREL= ..
-
-
-OUT= $(SQUIRREL)/lib/libsqstdlib.a
-INCZ= -I$(SQUIRREL)/include -I. -Iinclude
-
-OBJS= \
-	sqstdblob.o \
-	sqstdio.o \
-	sqstdstream.o \
-	sqstdmath.o \
-	sqstdsystem.o \
-	sqstdstring.o \
-	sqstdaux.o \
-	sqstdrex.o
-	
-SRCS= \
-	sqstdblob.cpp \
-	sqstdio.cpp \
-	sqstdstream.cpp \
-	sqstdmath.cpp \
-	sqstdsystem.cpp \
-	sqstdstring.cpp \
-	sqstdaux.cpp \
-	sqstdrex.cpp
-	
-	
-sq32:
-	$(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
-	ar rc $(OUT) *.o
-	rm *.o
-
-sqprof:
-	$(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
-	ar rc $(OUT) *.o
-	rm *.o
-	
-sq64:
-	$(CC) -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
-	ar rc $(OUT) *.o
-	rm *.o
+SQUIRREL= ..
+
+
+OUT= $(SQUIRREL)/lib/libsqstdlib.a
+INCZ= -I$(SQUIRREL)/include -I. -Iinclude
+
+OBJS= \
+	sqstdblob.o \
+	sqstdio.o \
+	sqstdstream.o \
+	sqstdmath.o \
+	sqstdsystem.o \
+	sqstdstring.o \
+	sqstdaux.o \
+	sqstdrex.o
+	
+SRCS= \
+	sqstdblob.cpp \
+	sqstdio.cpp \
+	sqstdstream.cpp \
+	sqstdmath.cpp \
+	sqstdsystem.cpp \
+	sqstdstring.cpp \
+	sqstdaux.cpp \
+	sqstdrex.cpp
+	
+	
+sq32:
+	$(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
+	ar rc $(OUT) *.o
+	rm *.o
+
+sqprof:
+	$(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
+	ar rc $(OUT) *.o
+	rm *.o
+	
+sq64:
+	$(CC) -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
+	ar rc $(OUT) *.o
+	rm *.o

+ 52 - 52
SquiLu/squirrel/Makefile

@@ -1,54 +1,54 @@
-SQUIRREL= ..
-
-
-OUT= $(SQUIRREL)/lib/libsquirrel.a
-INCZ= -I$(SQUIRREL)/include -I. -Iinclude -I$(SQUIRREL)/sqstdlib
-DEFS= 
-LIB=	
-
-OBJS= \
-	sqapi.o \
-	sqbaselib.o \
-	sqfuncstate.o \
-	sqdebug.o \
-	sqlexer.o \
-	sqobject.o \
-	sqcompiler.o \
-	sqstate.o \
-	sqtable.o \
-	sqmem.o \
-	sqvm.o \
+SQUIRREL= ..
+
+
+OUT= $(SQUIRREL)/lib/libsquirrel.a
+INCZ= -I$(SQUIRREL)/include -I. -Iinclude -I$(SQUIRREL)/sqstdlib
+DEFS= 
+LIB=	
+
+OBJS= \
+	sqapi.o \
+	sqbaselib.o \
+	sqfuncstate.o \
+	sqdebug.o \
+	sqlexer.o \
+	sqobject.o \
+	sqcompiler.o \
+	sqstate.o \
+	sqtable.o \
+	sqmem.o \
+	sqvm.o \
 	sqclass.o \
 	sqclass.o \
-	lua-regex.o
-	
-SRCS= \
-	sqapi.cpp \
-	sqbaselib.cpp \
-	sqfuncstate.cpp \
-	sqdebug.cpp \
-	sqlexer.cpp \
-	sqobject.cpp \
-	sqcompiler.cpp \
-	sqstate.cpp \
-	sqtable.cpp \
-	sqmem.cpp \
-	sqvm.cpp \
+	lua-regex.o
+	
+SRCS= \
+	sqapi.cpp \
+	sqbaselib.cpp \
+	sqfuncstate.cpp \
+	sqdebug.cpp \
+	sqlexer.cpp \
+	sqobject.cpp \
+	sqcompiler.cpp \
+	sqstate.cpp \
+	sqtable.cpp \
+	sqmem.cpp \
+	sqvm.cpp \
 	sqclass.cpp \
 	sqclass.cpp \
-	lua-regex.c
-
-	
-	
-sq32:
-	$(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
-	ar rc $(OUT) *.o
-	rm *.o
-
-sqprof:
-	$(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
-	ar rc $(OUT) *.o
-	rm *.o
-
-sq64:
-	$(CC) -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
-	ar rc $(OUT) *.o
-	rm *.o
+	lua-regex.c
+
+	
+	
+sq32:
+	$(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
+	ar rc $(OUT) *.o
+	rm *.o
+
+sqprof:
+	$(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
+	ar rc $(OUT) *.o
+	rm *.o
+
+sq64:
+	$(CC) -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
+	ar rc $(OUT) *.o
+	rm *.o

+ 3 - 1
SquiLu/squirrel/sqapi.cpp

@@ -1446,6 +1446,8 @@ SQBool sq_rawexists(HSQUIRRELVM v,SQInteger idx)
 			result = _array(self)->Exists(tointeger(obj));
 			result = _array(self)->Exists(tointeger(obj));
 		}
 		}
 		break;
 		break;
+	default:
+		break;
 	}
 	}
 	v->Pop();
 	v->Pop();
 	return result;
 	return result;
@@ -1699,7 +1701,7 @@ SQRESULT sq_writeclosure_as_source(HSQUIRRELVM v,SQWRITEFUNC w,SQUserPointer up)
 	if(_closure(o)->_function->_noutervalues)
 	if(_closure(o)->_function->_noutervalues)
 		return sq_throwerror(v,_SC("a closure with free valiables bound cannot be serialized"));
 		return sq_throwerror(v,_SC("a closure with free valiables bound cannot be serialized"));
     const SQChar decl[] = _SC("local bytecode = ");
     const SQChar decl[] = _SC("local bytecode = ");
-	if(w(up, (void*)decl, scstrlen(decl)) != scstrlen(decl))
+	if(w(up, (void*)decl, scstrlen(decl)) != (int)scstrlen(decl))
 		return sq_throwerror(v,_SC("io error"));
 		return sq_throwerror(v,_SC("io error"));
 	if(!_closure(o)->SaveAsSource(v,up,w))
 	if(!_closure(o)->SaveAsSource(v,up,w))
 		return SQ_ERROR;
 		return SQ_ERROR;

+ 4 - 0
SquiLu/squirrel/sqbaselib.cpp

@@ -1467,6 +1467,8 @@ static int process_string_gsub(LuaMatchState *ms, void *udata, lua_char_buffer_s
             }
             }
         }
         }
         break;
         break;
+	default:
+		return sq_throwerror(v, _SC("unexpected type"));
     }
     }
     sq_settop(v, top); //restore the stack to it's original state
     sq_settop(v, top); //restore the stack to it's original state
     return result; //returning non zero means continue
     return result; //returning non zero means continue
@@ -1508,6 +1510,8 @@ static SQRESULT string_gsub(HSQUIRRELVM v)
                 }
                 }
                 return sq_throwerror(v,error_ptr);
                 return sq_throwerror(v,error_ptr);
             }
             }
+   	   default:
+		return sq_throwerror(v, _SC("unexpected type"));
         }
         }
     }
     }
 	return sq_throwerror(v,_SC("invalid type for parameter 3 function/table/array/string expected"));
 	return sq_throwerror(v,_SC("invalid type for parameter 3 function/table/array/string expected"));

+ 2 - 0
SquiLu/squirrel/sqobject.cpp

@@ -59,6 +59,8 @@ SQObjectPtr SQObjectPtr::operator[](const SQChar *key) {
         case OT_TABLE: _table(*this)->Get(key, val); break;
         case OT_TABLE: _table(*this)->Get(key, val); break;
         case OT_CLASS: _class(*this)->Get(key, val); break;
         case OT_CLASS: _class(*this)->Get(key, val); break;
         case OT_INSTANCE: _instance(*this)->Get(key, val); break;
         case OT_INSTANCE: _instance(*this)->Get(key, val); break;
+	default:
+		break;
     }
     }
     return val;
     return val;
 }
 }

+ 2 - 0
SquiLu/squirrel/sqvm.cpp

@@ -644,6 +644,8 @@ bool SQVM::FOREACH_OP(SQObjectPtr &o1,SQObjectPtr &o2,SQObjectPtr
                 _FINISH(0);
                 _FINISH(0);
             }
             }
             break;
             break;
+	    default:
+		break;
         }
         }
 	default:
 	default:
 		Raise_Error(_SC("cannot iterate %s"), GetTypeName(o1));
 		Raise_Error(_SC("cannot iterate %s"), GetTypeName(o1));