[PATCH v2 02/27] monitor: Remove target_long use in get_monitor_def()

Philippe Mathieu-Daudé posted 27 patches 21 hours ago
[PATCH v2 02/27] monitor: Remove target_long use in get_monitor_def()
Posted by Philippe Mathieu-Daudé 21 hours ago
Truncate manually, removing the need of target-specific
code in get_monitor_def().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 monitor/hmp-target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c
index 812714ada01..b9b79e8e927 100644
--- a/monitor/hmp-target.c
+++ b/monitor/hmp-target.c
@@ -93,7 +93,7 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
 
     ret = target_get_monitor_def(cs, name, &tmp);
     if (!ret) {
-        *pval = (target_long) tmp;
+        *pval = target_long_bits() == 32 ? (int32_t)tmp : tmp;
     }
 
     return ret;
-- 
2.53.0