You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2022/04/23 02:31:24 UTC

[arrow] branch master updated: ARROW-16296: [GLib] Add missing casts for GArrowRoundMode

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

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


The following commit(s) were added to refs/heads/master by this push:
     new dc2e02a4a2 ARROW-16296: [GLib] Add missing casts for GArrowRoundMode
dc2e02a4a2 is described below

commit dc2e02a4a29d9a5c667ce8c307bdf42504f2e486
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Sat Apr 23 11:31:08 2022 +0900

    ARROW-16296: [GLib] Add missing casts for GArrowRoundMode
    
    This fixes the following warning:
    
        GLib-GObject-WARNING **: value "((GArrowRoundMode) -765521144)"
        of type 'GArrowRoundMode' is invalid or out of range for property
        'mode' of type 'GArrowRoundMode'
    
    Closes #12971 from kou/glib-compute-round-options-missing-cast
    
    Authored-by: Sutou Kouhei <ko...@clear-code.com>
    Signed-off-by: Sutou Kouhei <ko...@clear-code.com>
---
 c_glib/arrow-glib/compute.cpp | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/c_glib/arrow-glib/compute.cpp b/c_glib/arrow-glib/compute.cpp
index b607b04b91..0080688b13 100644
--- a/c_glib/arrow-glib/compute.cpp
+++ b/c_glib/arrow-glib/compute.cpp
@@ -5269,10 +5269,11 @@ GArrowRoundOptions *
 garrow_round_options_new_raw(
   const arrow::compute::RoundOptions *arrow_options)
 {
-  auto options = g_object_new(GARROW_TYPE_ROUND_OPTIONS,
-                              "n-digits", arrow_options->ndigits,
-                              "mode", arrow_options->round_mode,
-                              NULL);
+  auto options = g_object_new(
+    GARROW_TYPE_ROUND_OPTIONS,
+    "n-digits", arrow_options->ndigits,
+    "mode", static_cast<GArrowRoundMode>(arrow_options->round_mode),
+    NULL);
   return GARROW_ROUND_OPTIONS(options);
 }
 
@@ -5294,10 +5295,11 @@ garrow_round_to_multiple_options_new_raw(
       arrow_copied_options.get());
   auto multiple =
     garrow_scalar_new_raw(&(arrow_copied_round_to_multiple_options->multiple));
-  auto options = g_object_new(GARROW_TYPE_ROUND_TO_MULTIPLE_OPTIONS,
-                              "multiple", multiple,
-                              "mode", arrow_options->round_mode,
-                              NULL);
+  auto options =
+    g_object_new(GARROW_TYPE_ROUND_TO_MULTIPLE_OPTIONS,
+                 "multiple", multiple,
+                 "mode", static_cast<GArrowRoundMode>(arrow_options->round_mode),
+                 NULL);
   g_object_unref(multiple);
   return GARROW_ROUND_TO_MULTIPLE_OPTIONS(options);
 }