Changeset 92:e3a0abb22ef4 in xplra for src/client/c/hu
- Timestamp:
- 09/21/17 17:00:26 (7 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/client/c/hu/varadiistvan/xplra
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/client/c/hu/varadiistvan/xplra/XPlane.cc
r87 r92 57 57 using xplra::Protocol; 58 58 59 using std:: auto_ptr;59 using std::unique_ptr; 60 60 using std::string; 61 61 using std::min; … … 149 149 if (socket!=0) return; 150 150 151 auto_ptr<LocalClientSocket> clientSocket(new LocalClientSocket("xplra",152 &waiter));151 unique_ptr<LocalClientSocket> clientSocket(new LocalClientSocket("xplra", 152 &waiter)); 153 153 LocalConnector& connector = clientSocket->getConnector(); 154 154 … … 342 342 length = getArray(name, Protocol::TYPE_FLOAT_ARRAY, -1, offset); 343 343 344 auto_ptr<float> data(new float[length]);344 unique_ptr<float[]> data(new float[length]); 345 345 if (!stream->read(data.get(), length*sizeof(float))) checkStream(); 346 346 return data.release(); … … 366 366 length = getArray(name, Protocol::TYPE_INT_ARRAY, -1, offset); 367 367 368 auto_ptr<int32_t> data(new int32_t[length]);368 unique_ptr<int32_t[]> data(new int32_t[length]); 369 369 if (!stream->read(data.get(), length*sizeof(int32_t))) checkStream(); 370 370 return data.release(); … … 390 390 length = getArray(name, Protocol::TYPE_BYTE_ARRAY, -1, offset); 391 391 392 auto_ptr<uint8_t> data(new uint8_t[length]);392 unique_ptr<uint8_t[]> data(new uint8_t[length]); 393 393 if (!stream->read(data.get(), length*sizeof(uint8_t))) checkStream(); 394 394 return data.release(); … … 400 400 { 401 401 size_t length = 0; 402 auto_ptr<uint8_t> data(getByteArray(name, length, offset));402 unique_ptr<uint8_t[]> data(getByteArray(name, length, offset)); 403 403 return string(reinterpret_cast<char*>(data.get())); 404 404 } … … 498 498 length, offset); 499 499 } else { 500 auto_ptr<uint8_t> buffer(new uint8_t[length]);500 unique_ptr<uint8_t[]> buffer(new uint8_t[length]); 501 501 memcpy(buffer.get(), value, valueLength); 502 502 memset(buffer.get() + valueLength, 0, length - valueLength); -
src/client/c/hu/varadiistvan/xplra/xplra.cc
r87 r92 59 59 using std::vector; 60 60 using std::set; 61 using std:: auto_ptr;61 using std::unique_ptr; 62 62 63 63 //------------------------------------------------------------------------------ … … 488 488 { 489 489 try { 490 auto_ptr<Connection> connection(new Connection());490 unique_ptr<Connection> connection(new Connection()); 491 491 connection->connect(); 492 492 return ConnectionSlot::addValue(connection.release()); … … 498 498 //------------------------------------------------------------------------------ 499 499 500 extern "C" int xplra_get_versions(int connectionID,501 int* xplaneVersion, int* xplmVersion,502 int* xplraVersion)500 extern "C" int xplra_get_versions(int connectionID, 501 int* xplaneVersion, int* xplmVersion, 502 int* xplraVersion) 503 503 { 504 504 Connection* connection = ConnectionSlot::getValue(connectionID);
Note:
See TracChangeset
for help on using the changeset viewer.