[PATCH 4/8] Support for flt and dbl in mcast_endian_convert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/cmap.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/exec/cmap.c b/exec/cmap.c
index 4b6efb4..5e61b03 100644
--- a/exec/cmap.c
+++ b/exec/cmap.c
@@ -811,6 +811,8 @@ static void exec_cmap_mcast_endian_convert(void *message)
 	uint16_t u16;
 	uint32_t u32;
 	uint64_t u64;
+	float flt;
+	double dbl;
 
 	swab_coroipc_request_header_t(&req_exec_cmap_mcast->header);
 
@@ -841,9 +843,16 @@ static void exec_cmap_mcast_endian_convert(void *message)
 			u64 = swab64(u64);
 			memcpy(item->value, &u64, sizeof(u64));
 			break;
-		/*
-		 * TODO: Need to convert also float and double
-		 */
+		case ICMAP_VALUETYPE_FLOAT:
+			memcpy(&flt, item->value, sizeof(flt));
+			swabflt(&flt);
+			memcpy(item->value, &flt, sizeof(flt));
+			break;
+		case ICMAP_VALUETYPE_DOUBLE:
+			memcpy(&dbl, item->value, sizeof(dbl));
+			swabdbl(&dbl);
+			memcpy(item->value, &dbl, sizeof(dbl));
+			break;
 		}
 
 		p += sizeof(*item) + item->value_len;
-- 
1.7.1

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux