From c752987457f50c1adf5051e1fd8167a5637f1e34 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 26 Oct 2004 20:03:50 +0000 Subject: "" svn path=/trunk/; revision=2169 --- externals/grill/flext/.cvsignore | 9 -- externals/grill/flext/Makefile.am | 10 ++ externals/grill/flext/bootstrap.sh | 5 + externals/grill/flext/changes.txt | 4 + externals/grill/flext/config-pd-darwin.txt | 7 +- externals/grill/flext/configure.ac | 136 +++++++++++++++++++++ externals/grill/flext/flext.pbproj/project.pbxproj | 37 ++---- externals/grill/flext/flext.vcproj | 8 +- externals/grill/flext/flext.vcproj.vspscc | 10 -- externals/grill/flext/makefile.pd-darwin | 11 +- externals/grill/flext/makefile.pd-linux | 6 +- externals/grill/flext/source/Makefile.am | 116 ++++++++++++++++++ externals/grill/flext/source/flatom_pr.cpp | 8 +- externals/grill/flext/source/flext.h | 4 +- externals/grill/flext/source/flmap.h | 19 +-- externals/grill/flext/source/flsimd.cpp | 57 +++++---- externals/grill/flext/source/flsupport.cpp | 10 +- externals/grill/flext/source/flsupport.h | 8 +- externals/grill/flext/source/flxlet.cpp | 4 +- 19 files changed, 358 insertions(+), 111 deletions(-) delete mode 100755 externals/grill/flext/.cvsignore create mode 100755 externals/grill/flext/Makefile.am create mode 100755 externals/grill/flext/bootstrap.sh create mode 100755 externals/grill/flext/configure.ac delete mode 100644 externals/grill/flext/flext.vcproj.vspscc create mode 100755 externals/grill/flext/source/Makefile.am (limited to 'externals/grill') diff --git a/externals/grill/flext/.cvsignore b/externals/grill/flext/.cvsignore deleted file mode 100755 index 51cbd3a7..00000000 --- a/externals/grill/flext/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -max-os9 -max-osx -pd-darwin -pd-msvc -doc -build -flext Data -.DS_Store - diff --git a/externals/grill/flext/Makefile.am b/externals/grill/flext/Makefile.am new file mode 100755 index 00000000..9bcf5bb0 --- /dev/null +++ b/externals/grill/flext/Makefile.am @@ -0,0 +1,10 @@ +# +# automake template +# added by tim blechmann +# + +SUBDIRS = source + +EXTRA_DIST = flext.doxy # examples tutorial + +AUTOMAKE_OPTIONS = foreign \ No newline at end of file diff --git a/externals/grill/flext/bootstrap.sh b/externals/grill/flext/bootstrap.sh new file mode 100755 index 00000000..52a86eda --- /dev/null +++ b/externals/grill/flext/bootstrap.sh @@ -0,0 +1,5 @@ +#! /bin/sh + +aclocal \ +&& automake --add-missing \ +&& autoconf diff --git a/externals/grill/flext/changes.txt b/externals/grill/flext/changes.txt index cdabf647..d9b96343 100644 --- a/externals/grill/flext/changes.txt +++ b/externals/grill/flext/changes.txt @@ -13,6 +13,10 @@ Donations for further development of the package are highly appreciated. Version history: +0.4.8: +- fixes for 64 bit builds (size_t is integer type of pointer size) +- finally added a autoconf system (many many thanks to Tim Blechmann) + 0.4.7: - added flext::GetBool (just because flext::GetInt has been there for a while) - added bool to usable types for creation arguments diff --git a/externals/grill/flext/config-pd-darwin.txt b/externals/grill/flext/config-pd-darwin.txt index 0420315e..5f60ce4a 100644 --- a/externals/grill/flext/config-pd-darwin.txt +++ b/externals/grill/flext/config-pd-darwin.txt @@ -25,4 +25,9 @@ INSTDIR=/usr/local/lib/pd/flext # additional compiler flags # (check if they fit for your system!) -UFLAGS=-DFLEXT_USE_SIMD -malign-power -maltivec -faltivec +UFLAGS=-DFLEXT_USE_SIMD -maltivec -faltivec + + + + + diff --git a/externals/grill/flext/configure.ac b/externals/grill/flext/configure.ac new file mode 100755 index 00000000..4c0a0057 --- /dev/null +++ b/externals/grill/flext/configure.ac @@ -0,0 +1,136 @@ +dnl +dnl autoconf template +dnl added by tim blechmann +dnl + +dnl flext API version (current:release:age) +API_VERSION=0:0:0 + +AC_INIT([flext],[0.4.7],[gr@grrrr.org],[flext]) +AM_INIT_AUTOMAKE(1.6) + + +dnl configure options +AC_ARG_ENABLE(system, [ --enable-system flext system (default: pd)], + [ + case $enableval in + max) AC_DEFINE(FLEXT_SYS,1);; + *) AC_DEFINE(FLEXT_SYS,2);; + esac + system = $enableval + ], + AC_DEFINE(FLEXT_SYS,2)) + +AC_ARG_WITH(sysdir, + [ --with-sysdir path to pd or max headers], + [ + sysdir=$withval + INCLUDEDIR="-I$withval $INCLUDEDIR" + ], + [echo "path to system headers required "$enableval && exit 1]) + +dnl check for g_canvas.h in pd folder +AC_CHECK_FILE("$sysdir/g_canvas.h",,[echo "$sysdir/g_canvas.h not found" && exit 1]) + +AC_ARG_WITH(stkdir, + [ --with-stkdir path to stk headers], + [ + AC_CHECK_FILE("$withval/Stk.h",,[echo "$withval/Stk.h not found" && exit 1]) + stkdir=$withval + INCLUDEDIR="-I$withval $INCLUDEDIR" + ]) + +AM_CONDITIONAL([STK],[test "$stkdir"]) + +AC_ARG_WITH(sndobjdir, + [ --with-sndobjdir path to SndObj headers], + [ + AC_CHECK_FILE("$withval/SndObj.h",,[echo "$withval/SndObj.h not found" && exit 1]) + sndobjdir=$withval + INCLUDEDIR="-I$withval $INCLUDEDIR" + ]) + +AM_CONDITIONAL([SNDOBJ],[test "$sndobjdir"]) + +AC_ARG_ENABLE(optimize, [ --enable-optimize enables optimized builds for: pentium4, pentium3, G4, G5], + [ + case $enableval in + pentium3 | pentium3m) + OPT_FLAGS = "-mtune=$enableval -march=$enableval -mmmx -msse -mfpmath=sse"; + AC_DEFINE(FLEXT_USE_SIMD);; + pentium2 | athlon | pentium-mmx) + OPT_FLAGS="-mtune=$enableval -march=$enableval -mmmx";; + pentium) + OPT_FLAGS="-mtune=$enableval -march=$enableval";; + pentium4 | pentium4m | pentium-m | prescott | nocona | athlon-xp | athlon-mp | athlon64 | opteron) + OPT_FLAGS="-mtune=$enableval -march=$enableval -mmmx -msse -msse2 -mfpmath=sse"; + AC_DEFINE(FLEXT_USE_SIMD);; + G5 | G4) + OPT_FLAGS="-mtune=$enableval -march=$enableval -maltivec -faltivec -malign-natural"; + AC_DEFINE(FLEXT_USE_SIMD);; + G3) + OPT_FLAGS="-mtune=$enableval -march=$enableval -malign-natural";; + *) + ;; + esac + ]) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_MAKE_SET +AC_PROG_RANLIB + +dnl Checks for libraries. + +dnl Checks for header files. + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T +AC_STRUCT_TM + +dnl Checks for library functions. + +dnl system specific + +if test $(uname -s) == Linux ; then + DYNAMIC_LDFLAGS="-Wl,-Bdynamic" + PDEXT=pd_linux + SOEXT=so +fi +if test $(uname -s) == Darwin ; then + DYNAMIC_LDFLAGS="-version-info $API_VERSION -release $AC_PACKAGE_VERSION -dylib -dynamic -flat_namespace -undefined suppress" + + if test $system == max ; then + PDEXT=mxo + SOEXT=dylib + FRAMEWORKS=vecLib maxlib maxaudio + else + PDEXT=pd_darwin + SOEXT=dylib + FRAMEWORKS=vecLib + fi +fi + +dnl else +dnl echo "Platform NOT supported" +dnl exit 1 +dnl fi + +dnl todo: mingw / cygwin + +AC_SUBST(INCLUDEDIR) +AC_SUBST(OPT_FLAGS) +AC_SUBST(DYNAMIC_LDFLAGS) +AC_SUBST(stkdir) +AC_SUBST(sndobjdir) +AC_SUBST(PDEXT) +AC_SUBST(SOEXT) +AC_SUBST(FRAMEWORKS) dnl for osx +AC_OUTPUT([ + Makefile + tutorial/Makefile + source/Makefile]) diff --git a/externals/grill/flext/flext.pbproj/project.pbxproj b/externals/grill/flext/flext.pbproj/project.pbxproj index 3cf5e9b6..7164a900 100755 --- a/externals/grill/flext/flext.pbproj/project.pbxproj +++ b/externals/grill/flext/flext.pbproj/project.pbxproj @@ -109,8 +109,7 @@ sourceTree = ""; }; 08FB77AAFE841565C02AAC07 = { - fallbackIsa = PBXFileReference; - isa = PBXFrameworkReference; + isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; @@ -648,8 +647,6 @@ }; }; F5128F2503864E5501A80AC9 = { - buildRules = ( - ); buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -662,8 +659,6 @@ name = Development; }; F5128F2603864E5501A80AC9 = { - buildRules = ( - ); buildSettings = { COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; @@ -1025,8 +1020,7 @@ }; F55CEDC20383E6E401A80AC9 = { explicitFileType = "compiled.mach-o.dylib"; - fallbackIsa = PBXFileReference; - isa = PBXLibraryReference; + isa = PBXFileReference; path = flext.a; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; @@ -1415,8 +1409,7 @@ }; F55CEE120383F55201A80AC9 = { explicitFileType = "compiled.mach-o.dylib"; - fallbackIsa = PBXFileReference; - isa = PBXLibraryReference; + isa = PBXFileReference; path = flext_t.a; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; @@ -1666,8 +1659,7 @@ }; F55CEE2F0383F57A01A80AC9 = { explicitFileType = "compiled.mach-o.dylib"; - fallbackIsa = PBXFileReference; - isa = PBXLibraryReference; + isa = PBXFileReference; path = flext_d.a; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; @@ -1917,8 +1909,7 @@ }; F55CEE4C0383F59B01A80AC9 = { explicitFileType = "compiled.mach-o.dylib"; - fallbackIsa = PBXFileReference; - isa = PBXLibraryReference; + isa = PBXFileReference; path = flext_td.a; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; @@ -2235,8 +2226,7 @@ }; F59A5FAD0386DF3201A80AC9 = { explicitFileType = "compiled.mach-o.dylib"; - fallbackIsa = PBXFileReference; - isa = PBXLibraryReference; + isa = PBXFileReference; path = flext_t.max.a; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; @@ -2482,8 +2472,7 @@ }; F5AAF632038683E801A80AC9 = { explicitFileType = "compiled.mach-o.dylib"; - fallbackIsa = PBXFileReference; - isa = PBXLibraryReference; + isa = PBXFileReference; path = flext.max.a; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; @@ -2810,8 +2799,7 @@ }; F5C2051103D403B401A80AC9 = { explicitFileType = "compiled.mach-o.dylib"; - fallbackIsa = PBXFileReference; - isa = PBXLibraryReference; + isa = PBXFileReference; path = flext.a; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; @@ -3105,8 +3093,7 @@ }; F5C2062403D470B401A80AC9 = { explicitFileType = "compiled.mach-o.dylib"; - fallbackIsa = PBXFileReference; - isa = PBXLibraryReference; + isa = PBXFileReference; path = flext_t.a; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; @@ -3415,8 +3402,7 @@ }; F5CBC5B704757A5901A0C81C = { explicitFileType = "compiled.mach-o.dylib"; - fallbackIsa = PBXFileReference; - isa = PBXLibraryReference; + isa = PBXFileReference; path = libflext.dylib; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; @@ -4502,8 +4488,7 @@ }; F5CBC69B047584CD01A0C81C = { explicitFileType = "compiled.mach-o.dylib"; - fallbackIsa = PBXFileReference; - isa = PBXLibraryReference; + isa = PBXFileReference; path = libflext_d.dylib; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; diff --git a/externals/grill/flext/flext.vcproj b/externals/grill/flext/flext.vcproj index 6dba0f79..6061ce62 100644 --- a/externals/grill/flext/flext.vcproj +++ b/externals/grill/flext/flext.vcproj @@ -3,11 +3,8 @@ ProjectType="Visual C++" Version="7.10" Name="flext" - ProjectGUID="{817F8B42-38B6-401B-9D36-E3C77429A9F2}" - SccProjectName="max/flext" - SccAuxPath="" - SccLocalPath="." - SccProvider="MSSCCI:Jalindi Igloo"> + ProjectGUID="{B94DB81C-B5FB-4984-99DC-5063C3793BFE}" + Keyword="Win32Proj"> @@ -336,6 +333,7 @@ BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="TRUE" + Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3" CompileAs="0"/> 0; ++i) { if(i) { *(buf++) = ' '; --bufsz; } // prepend space if(PrintAtom(argv[i],buf,bufsz)) { - int len = strlen(buf); + size_t len = strlen(buf); buf += len,bufsz -= len; } else diff --git a/externals/grill/flext/source/flext.h b/externals/grill/flext/source/flext.h index 8d8f6e74..4dc3f421 100644 --- a/externals/grill/flext/source/flext.h +++ b/externals/grill/flext/source/flext.h @@ -23,10 +23,10 @@ WARRANTIES, see the file, "license.txt," in this distribution. */ //! \brief flext version number -#define FLEXT_VERSION 407 +#define FLEXT_VERSION 408 //! \brief flext version string -#define FLEXT_VERSTR "0.4.7" +#define FLEXT_VERSTR "0.4.8pre" //! @} diff --git a/externals/grill/flext/source/flmap.h b/externals/grill/flext/source/flmap.h index c20b5ade..64d4f565 100644 --- a/externals/grill/flext/source/flmap.h +++ b/externals/grill/flext/source/flmap.h @@ -21,18 +21,21 @@ WARRANTIES, see the file, "license.txt," in this distribution. @{ */ +//! Key/Value type for AnyMap... must have size of pointer! +typedef size_t AnyMapType; + //! Base class for maps class AnyMap: - public std::map + public std::map { - typedef std::map Parent; + typedef std::map Parent; public: AnyMap(); ~AnyMap(); - iterator find(unsigned int k); - unsigned int &operator [](unsigned int k); + iterator find(AnyMapType k); + AnyMapType &operator [](AnyMapType k); - typedef std::pair pair; + typedef std::pair pair; }; //! Specialized map class for any 32-bit key/value types @@ -66,9 +69,9 @@ public: inline T &data() const { return *(T *)&second; } }; - inline iterator find(K k) { return AnyMap::find(*(unsigned int *)&k); } - inline T &operator [](K k) { return *(T *)&(AnyMap::operator [](*(unsigned int *)&k)); } - inline void erase(K k) { AnyMap::erase(*(unsigned int *)&k); } + inline iterator find(K k) { return AnyMap::find(*(AnyMapType *)&k); } + inline T &operator [](K k) { return *(T *)&(AnyMap::operator [](*(AnyMapType *)&k)); } + inline void erase(K k) { AnyMap::erase(*(AnyMapType *)&k); } }; //! @} // FLEXT_SUPPORT diff --git a/externals/grill/flext/source/flsimd.cpp b/externals/grill/flext/source/flsimd.cpp index d3487790..12cdba7c 100755 --- a/externals/grill/flext/source/flsimd.cpp +++ b/externals/grill/flext/source/flsimd.cpp @@ -35,7 +35,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include // SSE #include // SSE2 #include // 3DNow! - #elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__MWERKS__) && defined(__ALTIVEC__) + #elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__MWERKS__) && defined(__VEC__) #if FLEXT_OSAPI == FLEXT_OSAPI_MAC_MACH #include #include @@ -47,7 +47,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include #include - #elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__GNUG__) && defined(__ALTIVEC__) + #elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__GNUG__) && defined(__VEC__) #include #include #endif @@ -272,7 +272,6 @@ static unsigned long setsimdcaps() if(cpuinfo.os_support&_CPU_FEATURE_SSE) simdflags += flext::simd_sse; if(cpuinfo.os_support&_CPU_FEATURE_SSE2) simdflags += flext::simd_sse2; #elif FLEXT_CPU == FLEXT_CPU_PPC - #if FLEXT_OSAPI == FLEXT_OSAPI_MAC_MACH int selectors[2] = { CTL_HW, HW_VECTORUNIT }; @@ -297,7 +296,7 @@ static unsigned long setsimdcaps() } -#if FLEXT_CPU == FLEXT_CPU_PPC && defined(__ALTIVEC__) +#if FLEXT_CPU == FLEXT_CPU_PPC && defined(__VEC__) /* functions for misaligned vector data - taken from the Altivec tutorial of Ian Ollmann, Ph.D. */ @@ -386,8 +385,8 @@ void flext::CopySamples(t_sample *dst,const t_sample *src,int cnt) prefetcht0 [eax+32] } - if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0) { - if((reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0) { + if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0) { + if((reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0) { // aligned src, aligned dst __asm { mov eax,dword ptr [src] @@ -435,7 +434,7 @@ loopau: } } else { - if((reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0) { + if((reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0) { // unaligned src, aligned dst __asm { mov eax,dword ptr [src] @@ -509,7 +508,7 @@ zero: #endif } -#if defined(FLEXT_USE_SIMD) && FLEXT_CPU == FLEXT_CPU_PPC && defined(__ALTIVEC__) +#if defined(FLEXT_USE_SIMD) && FLEXT_CPU == FLEXT_CPU_PPC && defined(__VEC__) // because of some frame code Altivec stuff should be in seperate functions.... static const vector float zero = (vector float)(0); @@ -683,7 +682,7 @@ void flext::SetSamples(t_sample *dst,int cnt,t_sample s) shufps xmm0,xmm0,0 } - if((reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0) { + if((reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0) { // aligned version __asm { mov ecx,[n] @@ -717,7 +716,7 @@ zero: while(cnt--) *(dst++) = s; } else -#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__ALTIVEC__) +#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__VEC__) if(GetSIMDCapabilities()&simd_altivec && IsVectorAligned(dst)) SetAltivec(dst,cnt,s); else @@ -769,8 +768,8 @@ void flext::MulSamples(t_sample *dst,const t_sample *src,t_sample op,int cnt) shufps xmm0,xmm0,0 } - if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0 - && (reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0 + if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0 + && (reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0 ) { // aligned version __asm { @@ -842,7 +841,7 @@ zero: vsmul(src,1,&op,dst,1,cnt); } else -#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__ALTIVEC__) +#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__VEC__) if(GetSIMDCapabilities()&simd_altivec && IsVectorAligned(src) && IsVectorAligned(dst)) MulAltivec(dst,src,op,cnt); else @@ -905,10 +904,10 @@ void flext::MulSamples(t_sample *dst,const t_sample *src,const t_sample *op,int prefetcht0 [ebx+32] } - if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0 - && (reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0 + if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0 + && (reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0 ) { - if((reinterpret_cast(op)&(__alignof(__m128)-1)) == 0) { + if((reinterpret_cast(op)&(__alignof(__m128)-1)) == 0) { __asm { mov ecx,[n] mov eax,dword ptr [src] @@ -986,7 +985,7 @@ void flext::MulSamples(t_sample *dst,const t_sample *src,const t_sample *op,int } } else { - if((reinterpret_cast(op)&(__alignof(__m128)-1)) == 0) { + if((reinterpret_cast(op)&(__alignof(__m128)-1)) == 0) { __asm { mov ecx,[n] mov eax,dword ptr [src] @@ -1072,7 +1071,7 @@ zero: vmul(src,1,op,1,dst,1,cnt); } else -#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__ALTIVEC__) +#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__VEC__) if(GetSIMDCapabilities()&simd_altivec && IsVectorAligned(src) && IsVectorAligned(op) && IsVectorAligned(dst)) MulAltivec(dst,src,op,cnt); else @@ -1135,8 +1134,8 @@ void flext::AddSamples(t_sample *dst,const t_sample *src,t_sample op,int cnt) shufps xmm0,xmm0,0 } - if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0 - && (reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0 + if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0 + && (reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0 ) { // aligned version __asm { @@ -1202,7 +1201,7 @@ loopu: while(cnt--) *(dst++) = *(src++)+op; } else -#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__ALTIVEC__) +#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__VEC__) if(GetSIMDCapabilities()&simd_altivec && IsVectorAligned(src) && IsVectorAligned(dst)) AddAltivec(dst,src,op,cnt); else @@ -1264,10 +1263,10 @@ void flext::AddSamples(t_sample *dst,const t_sample *src,const t_sample *op,int int n = cnt>>4; cnt -= n<<4; - if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0 - && (reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0 + if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0 + && (reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0 ) { - if((reinterpret_cast(op)&(__alignof(__m128)-1)) == 0) { + if((reinterpret_cast(op)&(__alignof(__m128)-1)) == 0) { __asm { mov ecx,dword ptr [n] mov eax,dword ptr [src] @@ -1345,7 +1344,7 @@ void flext::AddSamples(t_sample *dst,const t_sample *src,const t_sample *op,int } } else { - if((reinterpret_cast(op)&(__alignof(__m128)-1)) == 0) { + if((reinterpret_cast(op)&(__alignof(__m128)-1)) == 0) { __asm { mov ecx,dword ptr [n] mov eax,dword ptr [src] @@ -1430,7 +1429,7 @@ void flext::AddSamples(t_sample *dst,const t_sample *src,const t_sample *op,int vadd(src,1,op,1,dst,1,cnt); } else -#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__ALTIVEC__) +#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__VEC__) if(GetSIMDCapabilities()&simd_altivec && IsVectorAligned(src) && IsVectorAligned(op) && IsVectorAligned(dst)) AddAltivec(dst,src,op,cnt); else @@ -1497,8 +1496,8 @@ void flext::ScaleSamples(t_sample *dst,const t_sample *src,t_sample opmul,t_samp shufps xmm1,xmm1,0 } - if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0 - && (reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0 + if((reinterpret_cast(src)&(__alignof(__m128)-1)) == 0 + && (reinterpret_cast(dst)&(__alignof(__m128)-1)) == 0 ) { // aligned version __asm { @@ -1572,7 +1571,7 @@ loopu: while(cnt--) *(dst++) = *(src++)*opmul+opadd; } else -#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__ALTIVEC__) +#elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__VEC__) if(GetSIMDCapabilities()&simd_altivec && IsVectorAligned(src) && IsVectorAligned(dst)) ScaleAltivec(dst,src,opmul,opadd,cnt); else diff --git a/externals/grill/flext/source/flsupport.cpp b/externals/grill/flext/source/flsupport.cpp index 85d9720d..b4c3d09f 100644 --- a/externals/grill/flext/source/flsupport.cpp +++ b/externals/grill/flext/source/flsupport.cpp @@ -168,7 +168,7 @@ void flext_root::operator delete(void *blk) void *flext_root::NewAligned(size_t bytes,int bitalign) { const size_t ovh = sizeof(size_t)+sizeof(char *); - const unsigned long alignovh = bitalign/8-1; + const size_t alignovh = bitalign/8-1; bytes += ovh+alignovh; char *blk; @@ -195,7 +195,7 @@ void *flext_root::NewAligned(size_t bytes,int bitalign) } FLEXT_ASSERT(blk); - char *ablk = reinterpret_cast((reinterpret_cast(blk)+ovh+alignovh) & ~alignovh); + char *ablk = reinterpret_cast((reinterpret_cast(blk)+ovh+alignovh) & ~alignovh); *(char **)(ablk-sizeof(size_t)-sizeof(char *)) = blk; *(size_t *)(ablk-sizeof(size_t)) = bytes; return ablk; @@ -236,7 +236,7 @@ void flext_root::FreeAligned(void *blk) /*! \todo there is probably also a shortcut for Max and jMax \todo size checking */ -void flext::GetAString(const t_atom &a,char *buf,int szbuf) +void flext::GetAString(const t_atom &a,char *buf,size_t szbuf) { #if FLEXT_SYS == FLEXT_SYS_PD atom_string(const_cast(&a),buf,szbuf); @@ -287,5 +287,5 @@ void flext_root::error(const char *fmt,...) AnyMap::AnyMap() {} AnyMap::~AnyMap() {} -AnyMap::iterator AnyMap::find(unsigned int k) { return Parent::find(k); } -unsigned int &AnyMap::operator [](unsigned int k) { return Parent::operator [](k); } +AnyMap::iterator AnyMap::find(AnyMapType k) { return Parent::find(k); } +AnyMapType &AnyMap::operator [](AnyMapType k) { return Parent::operator [](k); } diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index d9f5b540..69848762 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -64,7 +64,7 @@ public: static void FreeAligned(void *blk); //! Test for alignment static bool IsAligned(void *ptr,int bitalign = 128) { - return (reinterpret_cast(ptr)&(bitalign-1)) == 0; + return (reinterpret_cast(ptr)&(bitalign-1)) == 0; } //! @} FLEXT_S_MEMORY }; @@ -256,14 +256,14 @@ public: static void CopyAtom(t_atom *dst,const t_atom *src) { *dst = *src; } //! Print an atom - static bool PrintAtom(const t_atom &a,char *buf,int bufsz); + static bool PrintAtom(const t_atom &a,char *buf,size_t bufsz); //! Scan an atom static bool ScanAtom(t_atom &a,const char *buf); //! Copy a list of atoms static t_atom *CopyList(int argc,const t_atom *argv); //! Print an atom list - static bool PrintList(int argc,const t_atom *argv,char *buf,int bufsz); + static bool PrintList(int argc,const t_atom *argv,char *buf,size_t bufsz); //! Copy a memory region static void CopyMem(void *dst,const void *src,int bytes); @@ -412,7 +412,7 @@ public: //! Access the string value (without type check) static const char *GetString(const t_atom &a) { t_symbol *s = GetSymbol(a); return s?GetString(s):NULL; } //! Check for a string and get its value - static void GetAString(const t_atom &a,char *buf,int szbuf); + static void GetAString(const t_atom &a,char *buf,size_t szbuf); //! Set the atom to represent a string static void SetString(t_atom &a,const char *c) { SetSymbol(a,MakeSymbol(c)); } diff --git a/externals/grill/flext/source/flxlet.cpp b/externals/grill/flext/source/flxlet.cpp index 1d57177c..f3afb207 100755 --- a/externals/grill/flext/source/flxlet.cpp +++ b/externals/grill/flext/source/flxlet.cpp @@ -22,7 +22,7 @@ flext_base::xlet::xlet(type t,const char *d): tp(t),nxt(NULL) { if(d) { - int ln = strlen(d); + size_t ln = strlen(d); desc = new char[ln+1]; memcpy(desc,d,ln); desc[ln] = 0; @@ -53,7 +53,7 @@ void flext_base::DescXlet(int ix,const char *d,xlet *&root) if(xi) { if(xi->desc) delete[] xi->desc; - int ln = strlen(d); + size_t ln = strlen(d); xi->desc = new char[ln+1]; memcpy(xi->desc,d,ln); xi->desc[ln] = 0; -- cgit v1.2.1