Changeset 92:e3a0abb22ef4 in xplra for src
- Timestamp:
- 09/21/17 17:00:26 (7 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src
- Files:
-
- 5 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); -
src/plugin/src/xplra/MessageWindow.h
r51 r92 98 98 * started to be scrolled, if it should be scrolled. 99 99 */ 100 static const float scrollTimeout = 1.0;100 static constexpr float scrollTimeout = 1.0; 101 101 102 102 /** 103 103 * The amount of time in seconds between each character step. 104 104 */ 105 static const float scrollInterval = 0.1;105 static constexpr float scrollInterval = 0.1; 106 106 107 107 private: -
src/plugin/src/xplra/Protocol.h
r81 r92 259 259 * The maximal message duration 260 260 */ 261 static const float MAX_MESSAGE_DURATION = 5*60;261 static constexpr float MAX_MESSAGE_DURATION = 5*60; 262 262 263 263 /** -
src/plugin/src/xplra/RequestQueue.h
r13 r92 76 76 * The interval of the flight loop. 77 77 */ 78 static const float flightLoopInterval = 0.1;78 static constexpr float flightLoopInterval = 0.1; 79 79 #endif 80 80
Note:
See TracChangeset
for help on using the changeset viewer.