diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/code_generators/generate_umath.py | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py index 40bc1560f..ec62df590 100644 --- a/numpy/core/code_generators/generate_umath.py +++ b/numpy/core/code_generators/generate_umath.py @@ -949,30 +949,7 @@ def make_arrays(funcdict): thedict = chartotype1 # one input and one output for t in uf.type_descriptions: - if (t.func_data not in (None, FullTypeDescr) and - not isinstance(t.func_data, FuncNameSuffix)): - funclist.append('NULL') - astype = '' - if not t.astype is None: - astype = '_As_%s' % thedict[t.astype] - astr = ('%s_functions[%d] = PyUFunc_%s%s;' % - (name, k, thedict[t.type], astype)) - code2list.append(astr) - if t.type == 'O': - astr = ('%s_data[%d] = (void *) %s;' % - (name, k, t.func_data)) - code2list.append(astr) - datalist.append('(void *)NULL') - elif t.type == 'P': - datalist.append('(void *)"%s"' % t.func_data) - else: - astr = ('%s_data[%d] = (void *) %s;' % - (name, k, t.func_data)) - code2list.append(astr) - datalist.append('(void *)NULL') - #datalist.append('(void *)%s' % t.func_data) - sub += 1 - elif t.func_data is FullTypeDescr: + if t.func_data is FullTypeDescr: tname = english_upper(chartoname[t.type]) datalist.append('(void *)NULL') funclist.append( @@ -982,7 +959,7 @@ def make_arrays(funcdict): tname = english_upper(chartoname[t.type]) funclist.append( '%s_%s_%s' % (tname, name, t.func_data.suffix)) - else: + elif t.func_data is None: datalist.append('(void *)NULL') tname = english_upper(chartoname[t.type]) funclist.append('%s_%s' % (tname, name)) @@ -998,6 +975,28 @@ def make_arrays(funcdict): ISA=vt.upper(), isa=vt, fname=name, type=tname, idx=k )) + else: + funclist.append('NULL') + astype = '' + if not t.astype is None: + astype = '_As_%s' % thedict[t.astype] + astr = ('%s_functions[%d] = PyUFunc_%s%s;' % + (name, k, thedict[t.type], astype)) + code2list.append(astr) + if t.type == 'O': + astr = ('%s_data[%d] = (void *) %s;' % + (name, k, t.func_data)) + code2list.append(astr) + datalist.append('(void *)NULL') + elif t.type == 'P': + datalist.append('(void *)"%s"' % t.func_data) + else: + astr = ('%s_data[%d] = (void *) %s;' % + (name, k, t.func_data)) + code2list.append(astr) + datalist.append('(void *)NULL') + #datalist.append('(void *)%s' % t.func_data) + sub += 1 for x in t.in_ + t.out: siglist.append('NPY_%s' % (english_upper(chartoname[x]),)) |