You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2022/03/16 23:05:15 UTC

[thrift] branch master updated: FIX: error C4244: conversion from "int64_t" to "int", possible data loss Client: py Patch: Jens Geyer

This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new 37f26bb  FIX: error C4244: conversion from "int64_t" to "int", possible data loss Client: py Patch: Jens Geyer
37f26bb is described below

commit 37f26bbd1143a586134acfbaab6d2b816143a966
Author: Jens Geyer <je...@apache.org>
AuthorDate: Wed Mar 16 23:57:26 2022 +0100

    FIX: error C4244: conversion from "int64_t" to "int", possible data loss
    Client: py
    Patch: Jens Geyer
---
 compiler/cpp/src/thrift/generate/t_py_generator.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/cpp/src/thrift/generate/t_py_generator.cc b/compiler/cpp/src/thrift/generate/t_py_generator.cc
index 4457871..7f3cae5 100644
--- a/compiler/cpp/src/thrift/generate/t_py_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_py_generator.cc
@@ -603,7 +603,7 @@ string t_py_generator::render_const_value(t_type* type, t_const_value* value) {
     }
   } else if (type->is_enum()) {
     out << indent();
-    int int_val = value->get_integer();
+    int64_t int_val = value->get_integer();
     if (gen_enum_) {
       t_enum_value* enum_val = ((t_enum*)type)->get_constant_by_value(int_val);
       out << type->get_name() << "." << enum_val->get_name();