From 956a7e53f0c50ce9a107a4a335d1431af45c0228 Mon Sep 17 00:00:00 2001 From: Bingxian Lu Date: Tue, 4 Apr 2017 20:16:41 +0800 Subject: [PATCH] fix bug on ARM char -> signed char ARM processor's "char" is unsigned by default, while here should be "signed char". --- matlab/read_bfee.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matlab/read_bfee.c b/matlab/read_bfee.c index c338ddf6..69fc048a 100644 --- a/matlab/read_bfee.c +++ b/matlab/read_bfee.c @@ -14,7 +14,7 @@ void read_bfee(unsigned char *inBytes, mxArray *outCell) unsigned int rssi_a = inBytes[10]; unsigned int rssi_b = inBytes[11]; unsigned int rssi_c = inBytes[12]; - char noise = inBytes[13]; + signed char noise = inBytes[13]; unsigned int agc = inBytes[14]; unsigned int antenna_sel = inBytes[15]; unsigned int len = inBytes[16] + (inBytes[17] << 8); @@ -23,7 +23,7 @@ void read_bfee(unsigned char *inBytes, mxArray *outCell) unsigned int i, j; unsigned int index = 0, remainder; unsigned char *payload = &inBytes[20]; - char tmp; + signed char tmp; mwSize size[] = {Ntx, Nrx, 30}; mxArray *csi = mxCreateNumericArray(3, size, mxDOUBLE_CLASS, mxCOMPLEX); mwSize perm_size[] = {1, 3};