Browse code

corex: rpc shm stats values printed as unsigned long

- GH #2824

Daniel-Constantin Mierla authored on 12/01/2022 16:03:58
Showing 1 changed files
... ...
@@ -46,9 +46,9 @@ static void corex_rpc_shm_info(rpc_t* rpc, void* ctx)
46 46
 		rpc->fault(ctx, 500, "Internal error creating rpc");
47 47
 		return;
48 48
 	}
49
-	if(rpc->struct_add(th, "su",
49
+	if(rpc->struct_add(th, "sj",
50 50
 			"name", (_shm_root.mname)?_shm_root.mname:"unknown",
51
-			"size", (unsigned int)shm_mem_size) <0) {
51
+			"size", shm_mem_size) <0) {
52 52
 		rpc->fault(ctx, 500, "Internal error adding fields");
53 53
 		return;
54 54
 	}
... ...
@@ -69,13 +69,13 @@ static void corex_rpc_shm_stats(rpc_t* rpc, void* c)
69 69
 
70 70
 	shm_info(&mi);
71 71
 	rpc->add(c, "{", &th);
72
-	rpc->struct_add(th, "uuuuuu",
73
-			"total", (unsigned int)(mi.total_size),
74
-			"free", (unsigned int)(mi.free),
75
-			"used", (unsigned int)(mi.used),
76
-			"real_used",(unsigned int)(mi.real_used),
77
-			"max_used", (unsigned int)(mi.max_used),
78
-			"fragments", (unsigned int)mi.total_frags
72
+	rpc->struct_add(th, "jjjjjj",
73
+			"total", mi.total_size,
74
+			"free", mi.free,
75
+			"used", mi.used,
76
+			"real_used", mi.real_used,
77
+			"max_used", mi.max_used,
78
+			"fragments", mi.total_frags
79 79
 		);
80 80
 }
81 81