Int16List* MtpDataPacket::getAInt16() { Int16List* result = new Int16List; int count = getUInt32(); for (int i = 0; i < count; i++) result->push_back(getInt16()); return result; }
Int16List* MtpDataPacket::getAInt16() { uint32_t count; if (!getUInt32(count)) return NULL; Int16List* result = new Int16List; for (uint32_t i = 0; i < count; i++) { int16_t value; if (!getInt16(value)) { delete result; return NULL; } result->push(value); } return result; }