[Groonga-mysql-commit] mroonga/mroonga [master] Work on Ubuntu Hardy amd64 with gcc-4.2.3

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 28日 (水) 00:36:04 JST


Kouhei Sutou	2012-03-28 00:36:04 +0900 (Wed, 28 Mar 2012)

  New Revision: 26bd17691b195282564afc9329e0fb9dfc89378e

  Log:
    Work on Ubuntu Hardy amd64 with gcc-4.2.3
    
    Reported by Kazuhiko Shiozaki. Thanks!!!

  Modified files:
    ha_mroonga.cc

  Modified: ha_mroonga.cc (+5 -3)
===================================================================
--- ha_mroonga.cc    2012-03-27 17:06:49 +0900 (2ea6ef9)
+++ ha_mroonga.cc    2012-03-28 00:36:04 +0900 (181a6cc)
@@ -8921,14 +8921,15 @@ int ha_mroonga::storage_encode_key(Field *field, const uchar *key,
   DBUG_RETURN(error);
 }
 
-void ha_mroonga::storage_encode_multiple_column_key_float(float value,
+void ha_mroonga::storage_encode_multiple_column_key_float(volatile float value,
                                                           uint data_size,
                                                           uchar *buffer,
                                                           bool decode)
 {
   MRN_DBUG_ENTER_METHOD();
   int n_bits = (data_size * 8 - 1);
-  int int_value = *((int *)(&value));
+  volatile int *int_value_pointer = (int *)(&value);
+  int int_value = *int_value_pointer;
   if (!decode)
     int_value ^= ((int_value >> n_bits) | (1 << n_bits));
   mrn_byte_order_host_to_network(buffer, &int_value, data_size);
@@ -8940,13 +8941,14 @@ void ha_mroonga::storage_encode_multiple_column_key_float(float value,
   DBUG_VOID_RETURN;
 }
 
-void ha_mroonga::storage_encode_multiple_column_key_double(double value,
+void ha_mroonga::storage_encode_multiple_column_key_double(volatile double value,
                                                            uint data_size,
                                                            uchar *buffer,
                                                            bool decode)
 {
   MRN_DBUG_ENTER_METHOD();
   int n_bits = (data_size * 8 - 1);
+  volatile double double_value = value;
   volatile long long int *long_long_value_pointer = (long long int *)(&value);
   volatile long long int long_long_value = *long_long_value_pointer;
   if (!decode)




Groonga-mysql-commit メーリングリストの案内
Back to archive index