Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Side by Side Diff: third_party/yasm/patched-yasm/tools/python-yasm/expr.pxi

Issue 6170009: Update our yasm copy to yasm 1.1.0 (Part 1: yasm side)... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Python bindings for Yasm: Pyrex input file for expr.h 1 # Python bindings for Yasm: Pyrex input file for expr.h
2 # 2 #
3 # Copyright (C) 2006 Michael Urman, Peter Johnson 3 # Copyright (C) 2006 Michael Urman, Peter Johnson
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions 6 # modification, are permitted provided that the following conditions
7 # are met: 7 # are met:
8 # 1. Redistributions of source code must retain the above copyright 8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright 10 # 2. Redistributions in binary form must reproduce the above copyright
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 __op[op] = operation 52 __op[op] = operation
53 53
54 del operator, op, ops, operation 54 del operator, op, ops, operation
55 55
56 cdef object __make_expression(yasm_expr *expr): 56 cdef object __make_expression(yasm_expr *expr):
57 return Expression(__pass_voidp(expr, Expression)) 57 return Expression(__pass_voidp(expr, Expression))
58 58
59 cdef class Expression: 59 cdef class Expression:
60 cdef yasm_expr *expr 60 cdef yasm_expr *expr
61 61
62 def __new__(self, op, *args, **kwargs): 62 def __cinit__(self, op, *args, **kwargs):
63 self.expr = NULL 63 self.expr = NULL
64 64
65 if isinstance(op, Expression): 65 if isinstance(op, Expression):
66 self.expr = yasm_expr_copy((<Expression>op).expr) 66 self.expr = yasm_expr_copy((<Expression>op).expr)
67 return 67 return
68 if PyCObject_Check(op): 68 if PyCObject_Check(op):
69 self.expr = <yasm_expr *>__get_voidp(op, Expression) 69 self.expr = <yasm_expr *>__get_voidp(op, Expression)
70 return 70 return
71 71
72 cdef size_t numargs 72 cdef size_t numargs
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 raise ValueError("not a WRT expression") 127 raise ValueError("not a WRT expression")
128 return __make_expression(retval) 128 return __make_expression(retval)
129 129
130 def get_intnum(self, calc_bc_dist=False): 130 def get_intnum(self, calc_bc_dist=False):
131 cdef yasm_intnum *retval 131 cdef yasm_intnum *retval
132 retval = yasm_expr_get_intnum(&self.expr, calc_bc_dist) 132 retval = yasm_expr_get_intnum(&self.expr, calc_bc_dist)
133 if retval == NULL: 133 if retval == NULL:
134 raise ValueError("not an intnum expression") 134 raise ValueError("not an intnum expression")
135 return __make_intnum(yasm_intnum_copy(retval)) 135 return __make_intnum(yasm_intnum_copy(retval))
136 136
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698