summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Johnson <peter@tortall.net>2010-01-01 20:54:15 +0000
committerPeter Johnson <peter@tortall.net>2010-01-01 20:54:15 +0000
commitf608f67ad258a7802a674809f2e5472c7651aef9 (patch)
treea80aa71a2eea8e6479597fd03b5b194044bcedd5 /tools
parent4df9f87323a12af47df42c6847ceaa1b9689eea0 (diff)
downloadyasm-f608f67ad258a7802a674809f2e5472c7651aef9.tar.gz
Some minor Pyrex fixes:
- Don't return self in IntNum.__abs__ (return a copy instead). - yasm_sym_status enum values have YASM_ prefixes. svn path=/trunk/yasm/; revision=2255
Diffstat (limited to 'tools')
-rw-r--r--tools/python-yasm/intnum.pxi2
-rw-r--r--tools/python-yasm/symrec.pxi8
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/python-yasm/intnum.pxi b/tools/python-yasm/intnum.pxi
index 0b469b89..320ca1b0 100644
--- a/tools/python-yasm/intnum.pxi
+++ b/tools/python-yasm/intnum.pxi
@@ -115,7 +115,7 @@ cdef class IntNum:
def __neg__(self): return __intnum_op(self, YASM_EXPR_NEG, None)
def __pos__(self): return self
def __abs__(self):
- if yasm_intnum_sign(self.intn) >= 0: return self
+ if yasm_intnum_sign(self.intn) >= 0: return IntNum(self)
else: return __intnum_op(self, YASM_EXPR_NEG, None)
def __nonzero__(self): return not yasm_intnum_is_zero(self.intn)
def __invert__(self): return __intnum_op(self, YASM_EXPR_NOT, None)
diff --git a/tools/python-yasm/symrec.pxi b/tools/python-yasm/symrec.pxi
index 404ffe97..eb56ccf0 100644
--- a/tools/python-yasm/symrec.pxi
+++ b/tools/python-yasm/symrec.pxi
@@ -43,15 +43,15 @@ cdef class Symbol:
cdef yasm_sym_status status
s = set()
status = yasm_symrec_get_status(self.sym)
- if <int>status & <int>SYM_USED: s.add('used')
- if <int>status & <int>SYM_DEFINED: s.add('defined')
- if <int>status & <int>SYM_VALUED: s.add('valued')
+ if <int>status & <int>YASM_SYM_USED: s.add('used')
+ if <int>status & <int>YASM_SYM_DEFINED: s.add('defined')
+ if <int>status & <int>YASM_SYM_VALUED: s.add('valued')
return s
property in_table:
def __get__(self):
return bool(<int>yasm_symrec_get_status(self.sym) &
- <int>SYM_NOTINTABLE)
+ <int>YASM_SYM_NOTINTABLE)
property visibility:
def __get__(self):