Various improvements

This commit is contained in:
Fabian Wolff
2016-03-06 19:43:57 +01:00
parent b115b84dd1
commit 2fb3522470
21 changed files with 155 additions and 136 deletions

View File

@@ -1,20 +1,15 @@
cmake_minimum_required(VERSION 2.8)
project(sqstd)
set(SQSTD_SRC sqstdblob.cpp
sqstdio.cpp
sqstdstream.cpp
sqstdmath.cpp
sqstdsystem.cpp
sqstdstring.cpp
sqstdaux.cpp
sqstdrex.cpp)
# sources
set(SQSTD_SRCS
sqstdblob.cpp
sqstdio.cpp
sqstdstream.cpp
sqstdmath.cpp
sqstdsystem.cpp
sqstdstring.cpp
sqstdaux.cpp
sqstdrex.cpp
)
add_library(sqstd SHARED ${SQSTD_SRC})
target_link_libraries(sqstd squirrel)
install(TARGETS sqstd LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
# shared lib
add_library(sqstd SHARED ${SQSTD_SRCS})
# static lib
add_library(sqstd_static STATIC ${SQSTD_SRCS})
add_library(sqstd_static STATIC ${SQSTD_SRC})
install(TARGETS sqstd_static ARCHIVE DESTINATION lib)

View File

@@ -114,7 +114,7 @@ static SQInteger _blob__typeof(HSQUIRRELVM v)
return 1;
}
static SQInteger _blob_releasehook(SQUserPointer p, SQInteger size)
static SQInteger _blob_releasehook(SQUserPointer p, SQInteger SQ_UNUSED_ARG(size))
{
SQBlob *self = (SQBlob*)p;
self->~SQBlob();
@@ -230,7 +230,7 @@ static const SQRegFunction bloblib_funcs[]={
_DECL_GLOBALBLOB_FUNC(swap2,2,_SC(".n")),
_DECL_GLOBALBLOB_FUNC(swap4,2,_SC(".n")),
_DECL_GLOBALBLOB_FUNC(swapfloat,2,_SC(".n")),
{0,0}
{0,0,0,0}
};
SQRESULT sqstd_getblob(HSQUIRRELVM v,SQInteger idx,SQUserPointer *ptr)

View File

@@ -115,7 +115,7 @@ static SQInteger _file__typeof(HSQUIRRELVM v)
return 1;
}
static SQInteger _file_releasehook(SQUserPointer p, SQInteger size)
static SQInteger _file_releasehook(SQUserPointer p, SQInteger SQ_UNUSED_ARG(size))
{
SQFile *self = (SQFile*)p;
self->~SQFile();
@@ -463,7 +463,7 @@ static const SQRegFunction iolib_funcs[]={
_DECL_GLOBALIO_FUNC(loadfile,-2,_SC(".sb")),
_DECL_GLOBALIO_FUNC(dofile,-2,_SC(".sb")),
_DECL_GLOBALIO_FUNC(writeclosuretofile,3,_SC(".sc")),
{0,0}
{0,0,0,0}
};
SQRESULT sqstd_register_iolib(HSQUIRRELVM v)

View File

@@ -78,7 +78,7 @@ static const SQRegFunction mathlib_funcs[] = {
_DECL_FUNC(rand,1,NULL),
_DECL_FUNC(fabs,2,_SC(".n")),
_DECL_FUNC(abs,2,_SC(".n")),
{0,0},
{0,0,0,0},
};
#undef _DECL_FUNC

View File

@@ -249,7 +249,7 @@ static const SQRegFunction _stream_methods[] = {
_DECL_STREAM_FUNC(eos,1,_SC("x")),
_DECL_STREAM_FUNC(flush,1,_SC("x")),
_DECL_STREAM_FUNC(_cloned,0,NULL),
{0,0}
{0,0,0,0}
};
void init_streamclass(HSQUIRRELVM v)

View File

@@ -350,7 +350,7 @@ static SQInteger _string_endswith(HSQUIRRELVM v)
SQRex *self = NULL; \
sq_getinstanceup(v,1,(SQUserPointer *)&self,0);
static SQInteger _rexobj_releasehook(SQUserPointer p, SQInteger size)
static SQInteger _rexobj_releasehook(SQUserPointer p, SQInteger SQ_UNUSED_ARG(size))
{
SQRex *self = ((SQRex *)p);
sqstd_rex_free(self);
@@ -452,7 +452,7 @@ static const SQRegFunction rexobj_funcs[]={
_DECL_REX_FUNC(capture,-2,_SC("xsn")),
_DECL_REX_FUNC(subexpcount,1,_SC("x")),
_DECL_REX_FUNC(_typeof,1,_SC("x")),
{0,0}
{0,0,0,0}
};
#undef _DECL_REX_FUNC
@@ -466,7 +466,7 @@ static const SQRegFunction stringlib_funcs[]={
_DECL_FUNC(escape,2,_SC(".s")),
_DECL_FUNC(startswith,3,_SC(".ss")),
_DECL_FUNC(endswith,3,_SC(".ss")),
{0,0}
{0,0,0,0}
};
#undef _DECL_FUNC

View File

@@ -126,7 +126,7 @@ static const SQRegFunction systemlib_funcs[]={
_DECL_FUNC(date,-1,_SC(".nn")),
_DECL_FUNC(remove,2,_SC(".s")),
_DECL_FUNC(rename,3,_SC(".ss")),
{0,0}
{0,0,0,0}
};
#undef _DECL_FUNC