Commits

Amaury Forgeot d'Arc committed e26eb44

Fix translation

Comments (0)

Files changed (1)

pypy/module/_decimal/interp_decimal.py

         w_result = W_Decimal.allocate(space, w_subtype)
         with lltype.scoped_alloc(rffi.CArrayPtr(rffi.UINT).TO, 1) as status_ptr:
             rmpdec.mpd_qcopy(w_result.mpd, self.mpd, status_ptr)
-            context.addstatus(space, status_ptr[0])
+            context.addstatus(space, rffi.cast(lltype.Signed, status_ptr[0]))
             rmpdec.mpd_qfinalize(w_result.mpd, context.ctx, status_ptr)
-            context.addstatus(space, status_ptr[0])
+            context.addstatus(space, rffi.cast(lltype.Signed, status_ptr[0]))
         return w_result
 
     def descr_str(self, space):
         return w_result
     else:
         if (rmpdec.mpd_isnan(w_value.mpd) and
-            w_value.mpd.c_digits > (context.ctx.c_prec - context.ctx.c_clamp)):
+            w_value.mpd.c_digits > (
+                context.ctx.c_prec - rffi.cast(lltype.Signed,
+                                               context.ctx.c_clamp))):
             # Special case: too many NaN payload digits
             context.addstatus(space, rmpdec.MPD_Conversion_syntax)
             w_result = W_Decimal.allocate(space, w_subtype)
     if not exact:
         with lltype.scoped_alloc(rffi.CArrayPtr(rffi.UINT).TO, 1) as status_ptr:
             rmpdec.mpd_qfinalize(w_result.mpd, context.ctx, status_ptr)
-            context.addstatus(space, status_ptr[0])
+            context.addstatus(space, rffi.cast(lltype.Signed, status_ptr[0]))
     return w_result
 
 def decimal_from_object(space, w_subtype, w_value, context, exact=True):