From a1f4c99e94d64aed70995c2cbe0b0ef5a5cc3313 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 21 Jan 2007 22:01:34 +0000 Subject: Remove yasm_immval, moving remaining unique information (sign flag) into yasm_value. svn path=/trunk/yasm/; revision=1740 --- tools/python-yasm/bytecode.pxi | 28 ---------------------------- tools/python-yasm/tests/test_bytecode.py | 9 +-------- 2 files changed, 1 insertion(+), 36 deletions(-) (limited to 'tools') diff --git a/tools/python-yasm/bytecode.pxi b/tools/python-yasm/bytecode.pxi index 50c72ae7..86f38d8f 100644 --- a/tools/python-yasm/bytecode.pxi +++ b/tools/python-yasm/bytecode.pxi @@ -39,15 +39,9 @@ cdef extern from "libyasm/bytecode.h": unsigned int nosplit unsigned int strong - cdef struct yasm_immval: - yasm_value val - unsigned int len - unsigned int sign - cdef struct yasm_dataval cdef struct yasm_datavalhead - cdef yasm_immval* yasm_imm_create_expr(yasm_expr *e, yasm_bytecode *precbc) cdef yasm_expr* yasm_ea_get_disp(yasm_effaddr *ea) cdef void yasm_ea_set_len(yasm_effaddr *ea, unsigned int len) cdef void yasm_ea_set_nosplit(yasm_effaddr *ea, unsigned int nosplit) @@ -153,28 +147,6 @@ cdef extern from "libyasm/bc-int.h": cdef yasm_bytecode *yasm_bc__next(yasm_bytecode *bc) -cdef object __make_immval(yasm_immval *imm): - return ImmVal(__pass_voidp(imm, ImmVal)) - -cdef class ImmVal: - cdef yasm_immval *imm - - def __new__(self, value, precbc=None): - if isinstance(value, Expression): - if precbc is None: - self.imm = yasm_imm_create_expr( - yasm_expr_copy((value).expr), NULL) - elif isinstance(precbc, Bytecode): - self.imm = yasm_imm_create_expr( - yasm_expr_copy((value).expr), - (precbc).bc) - else: - raise TypeError("Invalid precbc type '%s'" % type(precbc)) - elif PyCObject_Check(value): - self.imm = __get_voidp(value, ImmVal) - else: - raise TypeError("Invalid value type '%s'" % type(value)) - cdef class Bytecode: cdef yasm_bytecode *bc diff --git a/tools/python-yasm/tests/test_bytecode.py b/tools/python-yasm/tests/test_bytecode.py index ff7d7061..fb6c2a2b 100644 --- a/tools/python-yasm/tests/test_bytecode.py +++ b/tools/python-yasm/tests/test_bytecode.py @@ -1,11 +1,4 @@ # $Id$ from tests import TestCase, add -from yasm import Bytecode, ImmVal, Expression +from yasm import Bytecode, Expression -class TImmVal(TestCase): - def test_create(self): - self.assertRaises(TypeError, ImmVal, "notimmval") - - imm = ImmVal(Expression('+', 2, 3)) - -add(TImmVal) -- cgit v1.2.3