Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
oc-payload.cc: fix signed/unsigned char issues
When char == signed char, conversion to and from uint_8 fails in some places. Started to happen recently in Ostro OS, perhaps because of a compiler update. The conversion of sid is straightforward. OCSecurityPayload->securityData is less obvious: it is an uint_8 pointer, which seems to end up getting converted to a boolean instead of a character string. The typecast unfortunately has to be done inside the macro, reducing its type safety. ../src/structures/oc-payload.cc: In function 'v8::Local<v8::Object> js_OCDiscoveryPayload(OCDiscoveryPayload*)': ../src/structures/oc-payload.cc:240:30: error: invalid conversion from 'char*' to 'uint8_t* {aka unsigned char*}' [-fpermissive] js_SID(payload->sid)); In file included from ../src/structures/oc-payload.cc:18:0: ../src/structures/oc-payload.cc: In function 'v8::Local<v8::Object> js_OCSecurityPayload(OCSecurityPayload*)': ../src/structures/../common.h:63:45: error: 'Nan::imp::FactoryBase<v8::Boolean>::return_t {aka class v8::Local<v8::Boolean>}' has no member named 'ToLocalChecked' Nan::New((source)->memberName).ToLocalChecked()); \ ^ ../src/structures/oc-payload.cc:312:3: note: in expansion of macro 'SET_STRING_IF_NOT_NULL' SET_STRING_IF_NOT_NULL(returnValue, payload, securityData); Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
- Loading branch information