Commit 78d59afa authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk
Browse files

Dumper: Rename upcast -> downcast



Change-Id: I776373da348a961e3daf2c45bbbb84ca4736512a
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent a4ea3987
...@@ -117,7 +117,7 @@ def dynamicTypeName(value): ...@@ -117,7 +117,7 @@ def dynamicTypeName(value):
pass pass
return str(value.type) return str(value.type)
def upcast(value): def downcast(value):
try: try:
return value.cast(value.dynamic_type) return value.cast(value.dynamic_type)
except: except:
...@@ -128,7 +128,7 @@ def upcast(value): ...@@ -128,7 +128,7 @@ def upcast(value):
# pass # pass
return value return value
def expensiveUpcast(value): def expensiveDowncast(value):
try: try:
return value.cast(value.dynamic_type) return value.cast(value.dynamic_type)
except: except:
...@@ -1054,7 +1054,7 @@ class Dumper: ...@@ -1054,7 +1054,7 @@ class Dumper:
pass pass
for item in locals: for item in locals:
value = upcast(item.value) value = downcast(item.value)
with OutputSafer(self): with OutputSafer(self):
self.anonNumber = -1 self.anonNumber = -1
...@@ -1639,7 +1639,7 @@ class Dumper: ...@@ -1639,7 +1639,7 @@ class Dumper:
if self.useDynamicType and tryDynamic: if self.useDynamicType and tryDynamic:
self.putItem(expensiveUpcast(value), False) self.putItem(expensiveDowncast(value), False)
return return
format = self.formats.get(self.currentIName) format = self.formats.get(self.currentIName)
...@@ -1669,7 +1669,7 @@ class Dumper: ...@@ -1669,7 +1669,7 @@ class Dumper:
dumper = qqDumpers.get(nsStrippedType, None) dumper = qqDumpers.get(nsStrippedType, None)
if not dumper is None: if not dumper is None:
if tryDynamic: if tryDynamic:
dumper(self, expensiveUpcast(value)) dumper(self, expensiveDowncast(value))
else: else:
dumper(self, value) dumper(self, value)
return return
...@@ -1789,7 +1789,7 @@ class Dumper: ...@@ -1789,7 +1789,7 @@ class Dumper:
#if not bitsize is None: #if not bitsize is None:
# self.put("bitsize=\"%s\",bitpos=\"%s\"," # self.put("bitsize=\"%s\",bitpos=\"%s\","
# % (bitsize, bitpos)) # % (bitsize, bitpos))
self.putItem(upcast(value[field.name])) self.putItem(downcast(value[field.name]))
def listAnonymous(self, value, name, type): def listAnonymous(self, value, name, type):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment