From 4e96391a72914a8dabce99713eaff0e1fae586ee Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Fri, 19 Oct 2012 10:32:39 +0200 Subject: [PATCH 01/10] New function getKeyValue to have a unified way of formatting variable output --- neo/SConstruct | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neo/SConstruct b/neo/SConstruct index c7000241..531a88ad 100644 --- a/neo/SConstruct +++ b/neo/SConstruct @@ -180,6 +180,9 @@ SILENT = '0' # site settings ---------------------------------- +def getKeyValue(k, v): + return k + '=\'' + v + '\'' + if ( not ARGUMENTS.has_key( 'NOCONF' ) or ARGUMENTS['NOCONF'] != '1' ): site_dict = {} if (os.path.exists(conf_filename)): From 3fe98a93160f5036e26e23817546562056cdc068 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Fri, 19 Oct 2012 10:35:32 +0200 Subject: [PATCH 02/10] Replace exec with faster and more clean globals environment dictionary --- neo/SConstruct | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neo/SConstruct b/neo/SConstruct index 531a88ad..81eae673 100644 --- a/neo/SConstruct +++ b/neo/SConstruct @@ -193,7 +193,7 @@ if ( not ARGUMENTS.has_key( 'NOCONF' ) or ARGUMENTS['NOCONF'] != '1' ): for k, v in site_dict.items(): exec_cmd = k + '=\'' + v + '\'' print ' ' + exec_cmd - exec(exec_cmd) + globals()[k] = v else: print 'Site settings ignored' @@ -202,9 +202,10 @@ else: # command line settings -------------------------- for k in ARGUMENTS.keys(): + value = ARGUMENTS[k] exec_cmd = k + '=\'' + ARGUMENTS[k] + '\'' print 'Command line: ' + exec_cmd - exec( exec_cmd ) + globals()[k] = value # end command line settings ---------------------- @@ -212,8 +213,7 @@ for k in ARGUMENTS.keys(): if ( not ARGUMENTS.has_key( 'NOCONF' ) or ARGUMENTS['NOCONF'] != '1' ): for k in serialized: - exec_cmd = 'site_dict[\'' + k + '\'] = ' + k - exec(exec_cmd) + site_dict[k] = globals()[k] site_file = open(conf_filename, 'w') p = pickle.Pickler(site_file) From 1e3770d205193b45f2370702a3a0843a7a158e82 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Fri, 19 Oct 2012 10:36:24 +0200 Subject: [PATCH 03/10] Use getKeyValue to format variable output --- neo/SConstruct | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/neo/SConstruct b/neo/SConstruct index 81eae673..8cf2bd7d 100644 --- a/neo/SConstruct +++ b/neo/SConstruct @@ -191,8 +191,7 @@ if ( not ARGUMENTS.has_key( 'NOCONF' ) or ARGUMENTS['NOCONF'] != '1' ): site_dict = p.load() print 'Loading build configuration from ' + conf_filename + ':' for k, v in site_dict.items(): - exec_cmd = k + '=\'' + v + '\'' - print ' ' + exec_cmd + print ' ' + getKeyValue(k, v) globals()[k] = v else: print 'Site settings ignored' @@ -203,8 +202,7 @@ else: for k in ARGUMENTS.keys(): value = ARGUMENTS[k] - exec_cmd = k + '=\'' + ARGUMENTS[k] + '\'' - print 'Command line: ' + exec_cmd + print 'Command line: ' + getKeyValue(k, value); globals()[k] = value # end command line settings ---------------------- From 352db04172a40bc5bf5040f8f8c17b833d110942 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Fri, 19 Oct 2012 10:37:42 +0200 Subject: [PATCH 04/10] Make sure compile options are printed in any case --- neo/SConstruct | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neo/SConstruct b/neo/SConstruct index 8cf2bd7d..aa5ced1c 100644 --- a/neo/SConstruct +++ b/neo/SConstruct @@ -180,6 +180,8 @@ SILENT = '0' # site settings ---------------------------------- +printed_config = False + def getKeyValue(k, v): return k + '=\'' + v + '\'' @@ -190,11 +192,12 @@ if ( not ARGUMENTS.has_key( 'NOCONF' ) or ARGUMENTS['NOCONF'] != '1' ): p = pickle.Unpickler(site_file) site_dict = p.load() print 'Loading build configuration from ' + conf_filename + ':' + printed_config = True for k, v in site_dict.items(): print ' ' + getKeyValue(k, v) globals()[k] = v else: - print 'Site settings ignored' + print 'Site settings ignored - using default' # end site settings ------------------------------ From fe150f53f833f023a91a14ff61994f3634af9f98 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Fri, 19 Oct 2012 14:34:01 +0200 Subject: [PATCH 05/10] Fix code for process exit --- neo/sys/scons/scons_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neo/sys/scons/scons_utils.py b/neo/sys/scons/scons_utils.py index 270c36be..6be1e4c0 100644 --- a/neo/sys/scons/scons_utils.py +++ b/neo/sys/scons/scons_utils.py @@ -116,7 +116,7 @@ def checkLDD( target, source, env ): file = target[0] if (not os.path.isfile(file.abspath)): print('ERROR: CheckLDD: target %s not found\n' % target[0]) - Exit(1) + sys.exit(1) ( status, output ) = commands.getstatusoutput( 'ldd -r %s' % file ) # if ( status != 0 ): # print 'ERROR: ldd command returned with exit code %d' % status From e6ffce864b3392e08403344fd4755e53c85679e1 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Sun, 28 Oct 2012 11:03:26 +0100 Subject: [PATCH 06/10] Undef stricmp and strnicmp before redefining to avoid warning messages. --- neo/idlib/Str.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neo/idlib/Str.h b/neo/idlib/Str.h index 393b3665..c82134a2 100644 --- a/neo/idlib/Str.h +++ b/neo/idlib/Str.h @@ -61,9 +61,15 @@ If you have questions concerning this license or the applicable additional terms #endif #define StrCmpNI use_idStr_Icmpn +#ifdef stricmp +#undef stricmp +#endif #define stricmp idStr::Icmp // use_idStr_Icmp #define _stricmp use_idStr_Icmp #define strcasecmp use_idStr_Icmp +#ifdef strnicmp +#undef strnicmp +#endif #define strnicmp use_idStr_Icmpn #define _strnicmp use_idStr_Icmpn #define _memicmp use_idStr_Icmpn From 6d96705874032bda9f38b29d0a43685d0a0db236 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Sun, 28 Oct 2012 11:35:22 +0100 Subject: [PATCH 07/10] Remove unused variables to prevent annoying warnings. --- neo/idlib/math/Curve.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neo/idlib/math/Curve.h b/neo/idlib/math/Curve.h index c8c454fe..29c13b88 100644 --- a/neo/idlib/math/Curve.h +++ b/neo/idlib/math/Curve.h @@ -386,7 +386,7 @@ idCurve::SetConstantSpeed template< class type > ID_INLINE void idCurve::SetConstantSpeed(const float totalTime) { - int i, j; + int i; float *length, totalLength, scale, t; length = (float *) _alloca16(values.Num() * sizeof(float)); @@ -876,7 +876,9 @@ idCurve_QuadraticBezier::BasisSecondDerivative template< class type > ID_INLINE void idCurve_QuadraticBezier::BasisSecondDerivative(const float t, float *bvals) const { +#if 0 float s1 = (float)(t - this->times[0]) / (this->times[2] - this->times[0]); +#endif bvals[0] = 2.0f; bvals[1] = -4.0f; bvals[2] = 2.0f; From 1269483f35a7ee80f97c56674fa638e356ad3316 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Sun, 28 Oct 2012 18:03:46 +0100 Subject: [PATCH 08/10] For LLVM we need to set the base function explicitly. --- neo/idlib/containers/VectorSet.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neo/idlib/containers/VectorSet.h b/neo/idlib/containers/VectorSet.h index 5205a3e5..5f9daccf 100644 --- a/neo/idlib/containers/VectorSet.h +++ b/neo/idlib/containers/VectorSet.h @@ -163,7 +163,11 @@ ID_INLINE int idVectorSet::FindVector(const type &v, const float } hash.Add(hashKey, idList::Num()); +#ifdef __llvm__ + idList:: +#endif Append(v); + return idList::Num()-1; } From 2c9d6b5bb7740dd27aad326015c49400e54518b9 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Sun, 28 Oct 2012 18:05:31 +0100 Subject: [PATCH 09/10] Define HUGE when missing (e.g. for LLVM) --- neo/tools/compilers/roqvq/codec.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neo/tools/compilers/roqvq/codec.cpp b/neo/tools/compilers/roqvq/codec.cpp index a59538f0..dcac0b9b 100644 --- a/neo/tools/compilers/roqvq/codec.cpp +++ b/neo/tools/compilers/roqvq/codec.cpp @@ -30,6 +30,10 @@ If you have questions concerning this license or the applicable additional terms #include "codec.h" +#ifndef HUGE +#define HUGE HUGE_VAL +#endif //!HUGE + float glimit(const float val) { if (val<0) return 0; From bfe6a33f6c1cf266c79f464cba7bda4182748a0b Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Sun, 28 Oct 2012 18:09:01 +0100 Subject: [PATCH 10/10] Enable BuildList for lists (and strings) --- neo/sys/scons/scons_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neo/sys/scons/scons_utils.py b/neo/sys/scons/scons_utils.py index 6be1e4c0..e557cca9 100644 --- a/neo/sys/scons/scons_utils.py +++ b/neo/sys/scons/scons_utils.py @@ -178,7 +178,12 @@ def SetupUtils( env ): env.SharedLibrarySafe = SharedLibrarySafe def BuildList( s_prefix, s_string ): - s_list = string.split( s_string ) + try: + s_list = string.split( s_string ) + except: + # Assume already list + s_list = s_string + for i in range( len( s_list ) ): s_list[ i ] = s_prefix + '/' + s_list[ i ] return s_list