Follow-up Comment #23, sr #111312 (group freeipmi):

here's another debug patch to go on top of the others, just to really make
sure the casting bug exists on the line i think it is happening.

diff --git a/libfreeipmi/util/ipmi-sensor-util.c
b/libfreeipmi/util/ipmi-sensor-util.c
index 205c416fc..c4975c07d 100644
--- a/libfreeipmi/util/ipmi-sensor-util.c
+++ b/libfreeipmi/util/ipmi-sensor-util.c
@@ -291,12 +291,17 @@ ipmi_sensor_decode_value (int8_t r_exponent,
     dval = (double) raw_data;
   else if (analog_data_format == IPMI_SDR_ANALOG_DATA_FORMAT_1S_COMPLEMENT)
     {
+      fprintf (stderr, "ipmi-sensor-decode: 1s complement before : %X\n",
raw_data);
       if (raw_data & 0x80)
         raw_data++;
       dval = (double)((char) raw_data);
+      fprintf (stderr, "ipmi-sensor-decode: 1s complement after : %f\n",
dval);
     }
-  else /* analog_data_format == IPMI_SDR_ANALOG_DATA_FORMAT_2S_COMPLEMENT */
+  else { /* analog_data_format == IPMI_SDR_ANALOG_DATA_FORMAT_2S_COMPLEMENT
*/
+    fprintf (stderr, "ipmi-sensor-decode: 2s complement before : %X\n",
raw_data);
     dval = (double)((char) raw_data);
+    fprintf (stderr, "ipmi-sensor-decode: 2s complement after : %f\n",
dval);
+  }
 
   fprintf (stderr, "ipmi-sensor-decode: dval initial = %f\n", dval);
   dval *= (double) m;



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?111312>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to