[Numpy-svn] r6384 - branches/coremath/numpy/core

numpy-svn@scip... numpy-svn@scip...
Wed Feb 18 11:24:51 CST 2009


Author: cdavid
Date: 2009-02-18 11:24:44 -0600 (Wed, 18 Feb 2009)
New Revision: 6384

Modified:
   branches/coremath/numpy/core/setup.py
Log:
Remove unused code.

Modified: branches/coremath/numpy/core/setup.py
===================================================================
--- branches/coremath/numpy/core/setup.py	2009-02-18 17:24:24 UTC (rev 6383)
+++ branches/coremath/numpy/core/setup.py	2009-02-18 17:24:44 UTC (rev 6384)
@@ -472,70 +472,6 @@
 """
 
 import sys
-def generate_testcode(target):
-    if sys.platform == 'win32':
-        target = target.replace('\\','\\\\')
-    testcode = [r'''
-#include <Python.h>
-#include <limits.h>
-#include <stdio.h>
-
-int main(int argc, char **argv)
-{
-
-        FILE *fp;
-
-        fp = fopen("'''+target+'''","w");
-        ''']
-
-    c_size_test = r'''
-#ifndef %(sz)s
-          fprintf(fp,"#define %(sz)s %%d\n", sizeof(%(type)s));
-#else
-          fprintf(fp,"/* #define %(sz)s %%d */\n", %(sz)s);
-#endif
-'''
-    for sz, t in [('SIZEOF_SHORT', 'short'),
-                  ('SIZEOF_INT', 'int'),
-                  ('SIZEOF_LONG', 'long'),
-                  ('SIZEOF_FLOAT', 'float'),
-                  ('SIZEOF_DOUBLE', 'double'),
-                  ('SIZEOF_LONG_DOUBLE', 'long double'),
-                  ('SIZEOF_PY_INTPTR_T', 'Py_intptr_t'),
-                  ]:
-        testcode.append(c_size_test % {'sz' : sz, 'type' : t})
-
-    testcode.append('#ifdef PY_LONG_LONG')
-    testcode.append(c_size_test % {'sz' : 'SIZEOF_LONG_LONG',
-                                   'type' : 'PY_LONG_LONG'})
-    testcode.append(c_size_test % {'sz' : 'SIZEOF_PY_LONG_LONG',
-                                   'type' : 'PY_LONG_LONG'})
-
-
-    testcode.append(r'''
-#else
-        fprintf(fp, "/* PY_LONG_LONG not defined */\n");
-#endif
-#ifndef CHAR_BIT
-          {
-             unsigned char var = 2;
-             int i=0;
-             while (var >= 2) {
-                     var = var << 1;
-                     i++;
-             }
-             fprintf(fp,"#define CHAR_BIT %d\n", i+1);
-          }
-#else
-          fprintf(fp, "/* #define CHAR_BIT %d */\n", CHAR_BIT);
-#endif
-          fclose(fp);
-          return 0;
-}
-''')
-    testcode = '\n'.join(testcode)
-    return testcode
-
 def generate_numpyconfig_code(target):
     """Return the source code as a string of the code to generate the
     numpyconfig header file."""



More information about the Numpy-svn mailing list