Use C++ language supported 'nullptr' (#13944)
This commit is contained in:
@@ -81,7 +81,7 @@ bool SdBaseFile::addDirCluster() {
|
||||
// cache a file's directory entry
|
||||
// return pointer to cached entry or null for failure
|
||||
dir_t* SdBaseFile::cacheDirEntry(uint8_t action) {
|
||||
if (!vol_->cacheRawBlock(dirBlock_, action)) return NULL;
|
||||
if (!vol_->cacheRawBlock(dirBlock_, action)) return nullptr;
|
||||
return vol_->cache()->dir + dirIndex_;
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ bool SdBaseFile::openParent(SdBaseFile* dir) {
|
||||
|
||||
// search for parent in '../..'
|
||||
do {
|
||||
if (file.readDir(&entry, NULL) != 32) return false;
|
||||
if (file.readDir(&entry, nullptr) != 32) return false;
|
||||
c = entry.firstClusterLow;
|
||||
c |= (uint32_t)entry.firstClusterHigh << 16;
|
||||
} while (c != cluster);
|
||||
|
@@ -158,7 +158,7 @@ char *createFilename(char *buffer, const dir_t &p) {
|
||||
|
||||
uint16_t nrFile_index;
|
||||
|
||||
void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) {
|
||||
void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=nullptr*/) {
|
||||
dir_t p;
|
||||
uint8_t cnt = 0;
|
||||
|
||||
@@ -226,7 +226,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
||||
|
||||
case LS_GetFilename:
|
||||
createFilename(filename, p);
|
||||
if (match != NULL) {
|
||||
if (match != nullptr) {
|
||||
if (strcasecmp(match, filename) == 0) return;
|
||||
}
|
||||
else if (cnt == nrFile_index) return; // 0 based index
|
||||
@@ -241,7 +241,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
||||
void CardReader::ls() {
|
||||
lsAction = LS_SerialPrint;
|
||||
root.rewind();
|
||||
lsDive(NULL, root);
|
||||
lsDive(nullptr, root);
|
||||
}
|
||||
|
||||
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
|
||||
@@ -276,7 +276,7 @@ void CardReader::ls() {
|
||||
|
||||
// Find the item, setting the long filename
|
||||
diveDir.rewind();
|
||||
lsDive(NULL, diveDir, segment);
|
||||
lsDive(nullptr, diveDir, segment);
|
||||
|
||||
// Print /LongNamePart to serial output
|
||||
SERIAL_CHAR('/');
|
||||
@@ -528,11 +528,11 @@ void CardReader::report_status() {
|
||||
|
||||
void CardReader::write_command(char *buf) {
|
||||
char* begin = buf;
|
||||
char* npos = NULL;
|
||||
char* npos = nullptr;
|
||||
char* end = buf + strlen(buf) - 1;
|
||||
|
||||
file.writeError = false;
|
||||
if ((npos = strchr(buf, 'N')) != NULL) {
|
||||
if ((npos = strchr(buf, 'N')) != nullptr) {
|
||||
begin = strchr(npos, ' ') + 1;
|
||||
end = strchr(npos, '*') - 1;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ void CardReader::checkautostart() {
|
||||
sprintf_P(autoname, PSTR("auto%c.g"), autostart_index + '0');
|
||||
dir_t p;
|
||||
root.rewind();
|
||||
while (root.readDir(&p, NULL) > 0) {
|
||||
while (root.readDir(&p, nullptr) > 0) {
|
||||
for (int8_t i = (int8_t)strlen((char*)p.name); i--;) p.name[i] = tolower(p.name[i]);
|
||||
if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) {
|
||||
openAndPrintFile(autoname);
|
||||
@@ -602,9 +602,9 @@ void CardReader::closefile(const bool store_location) {
|
||||
* Get the name of a file in the current directory by index
|
||||
* with optional name to match.
|
||||
*/
|
||||
void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) {
|
||||
void CardReader::getfilename(uint16_t nr, const char * const match/*=nullptr*/) {
|
||||
#if ENABLED(SDSORT_CACHE_NAMES)
|
||||
if (match != NULL) {
|
||||
if (match != nullptr) {
|
||||
while (nr < sort_count) {
|
||||
if (strcasecmp(match, sortshort[nr]) == 0) break;
|
||||
nr++;
|
||||
@@ -620,14 +620,14 @@ void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) {
|
||||
lsAction = LS_GetFilename;
|
||||
nrFile_index = nr;
|
||||
workDir.rewind();
|
||||
lsDive(NULL, workDir, match);
|
||||
lsDive(nullptr, workDir, match);
|
||||
}
|
||||
|
||||
uint16_t CardReader::getnrfilenames() {
|
||||
lsAction = LS_Count;
|
||||
nrFiles = 0;
|
||||
workDir.rewind();
|
||||
lsDive(NULL, workDir);
|
||||
lsDive(nullptr, workDir);
|
||||
//SERIAL_ECHOLN(nrFiles);
|
||||
return nrFiles;
|
||||
}
|
||||
@@ -639,7 +639,7 @@ uint16_t CardReader::getnrfilenames() {
|
||||
*
|
||||
* Returns a pointer to the last segment (filename) of the given DOS 8.3 path.
|
||||
*
|
||||
* A NULL result indicates an unrecoverable error.
|
||||
* A nullptr result indicates an unrecoverable error.
|
||||
*/
|
||||
const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, const bool echo/*=false*/) {
|
||||
// Track both parent and subfolder
|
||||
@@ -647,13 +647,13 @@ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, con
|
||||
SdFile *sub = &newDir1, *startDir;
|
||||
|
||||
const char *dirname_start = path;
|
||||
if (path[0] == '/') {
|
||||
if (path[0] == '/') {
|
||||
curDir = &root;
|
||||
workDirDepth = 0;
|
||||
dirname_start++;
|
||||
}
|
||||
else
|
||||
curDir = &workDir;
|
||||
curDir = &workDir;
|
||||
|
||||
startDir = curDir;
|
||||
|
||||
@@ -674,7 +674,7 @@ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, con
|
||||
// Open curDir
|
||||
if (!sub->open(curDir, dosSubdirname, O_READ)) {
|
||||
SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname, ".");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Close curDir if not at starting-point
|
||||
|
@@ -78,7 +78,7 @@ public:
|
||||
static void printLongPath(char *path);
|
||||
#endif
|
||||
|
||||
static void getfilename(uint16_t nr, const char* const match=NULL);
|
||||
static void getfilename(uint16_t nr, const char* const match=nullptr);
|
||||
static uint16_t getnrfilenames();
|
||||
|
||||
static void getAbsFilename(char *t);
|
||||
@@ -224,7 +224,7 @@ private:
|
||||
static LsAction lsAction; //stored for recursion.
|
||||
static uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
|
||||
static char *diveDirName;
|
||||
static void lsDive(const char *prepend, SdFile parent, const char * const match=NULL);
|
||||
static void lsDive(const char *prepend, SdFile parent, const char * const match=nullptr);
|
||||
|
||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||
static void flush_presort();
|
||||
|
@@ -57,7 +57,7 @@ EpInfo* USB::getEpInfoEntry(uint8_t addr, uint8_t ep) {
|
||||
UsbDevice *p = addrPool.GetUsbDevicePtr(addr);
|
||||
|
||||
if (!p || !p->epinfo)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
EpInfo *pep = p->epinfo;
|
||||
|
||||
@@ -67,7 +67,7 @@ EpInfo* USB::getEpInfoEntry(uint8_t addr, uint8_t ep) {
|
||||
|
||||
pep++;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* set device table entry */
|
||||
@@ -141,7 +141,7 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque
|
||||
uint8_t rcode;
|
||||
SETUP_PKT setup_pkt;
|
||||
|
||||
EpInfo *pep = NULL;
|
||||
EpInfo *pep = nullptr;
|
||||
uint16_t nak_limit = 0;
|
||||
|
||||
rcode = SetAddress(addr, ep, &pep, &nak_limit);
|
||||
@@ -162,7 +162,7 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque
|
||||
rcode = dispatchPkt(tokSETUP, ep, nak_limit); //dispatch packet
|
||||
if (rcode) return rcode; // Return HRSLT if not zero
|
||||
|
||||
if (dataptr != NULL) { //data stage, if present
|
||||
if (dataptr != nullptr) { //data stage, if present
|
||||
if (direction) { //IN transfer
|
||||
uint16_t left = total;
|
||||
pep->bmRcvToggle = 1; //bmRCVTOG1;
|
||||
@@ -205,7 +205,7 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque
|
||||
/* rcode 0 if no errors. rcode 01-0f is relayed from dispatchPkt(). Rcode f0 means RCVDAVIRQ error,
|
||||
fe USB xfer timeout */
|
||||
uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data, uint8_t bInterval /*= 0*/) {
|
||||
EpInfo *pep = NULL;
|
||||
EpInfo *pep = nullptr;
|
||||
uint16_t nak_limit = 0;
|
||||
|
||||
uint8_t rcode = SetAddress(addr, ep, &pep, &nak_limit);
|
||||
@@ -289,7 +289,7 @@ uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, ui
|
||||
|
||||
/* rcode 0 if no errors. rcode 01-0f is relayed from HRSL */
|
||||
uint8_t USB::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data) {
|
||||
EpInfo *pep = NULL;
|
||||
EpInfo *pep = nullptr;
|
||||
uint16_t nak_limit = 0;
|
||||
|
||||
uint8_t rcode = SetAddress(addr, ep, &pep, &nak_limit);
|
||||
@@ -529,7 +529,7 @@ void USB::Task(void) { //USB state machine
|
||||
uint8_t USB::DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed) {
|
||||
//uint8_t buf[12];
|
||||
uint8_t rcode;
|
||||
UsbDevice *p0 = NULL, *p = NULL;
|
||||
UsbDevice *p0 = nullptr, *p = nullptr;
|
||||
|
||||
// Get pointer to pseudo device with address 0 assigned
|
||||
p0 = addrPool.GetUsbDevicePtr(0);
|
||||
@@ -649,8 +649,8 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) {
|
||||
uint8_t rcode = 0;
|
||||
uint8_t buf[sizeof (USB_DEVICE_DESCRIPTOR)];
|
||||
USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR *>(buf);
|
||||
UsbDevice *p = NULL;
|
||||
EpInfo *oldep_ptr = NULL;
|
||||
UsbDevice *p = nullptr;
|
||||
EpInfo *oldep_ptr = nullptr;
|
||||
EpInfo epInfo;
|
||||
|
||||
epInfo.epAddr = 0;
|
||||
@@ -749,12 +749,12 @@ uint8_t USB::ReleaseDevice(uint8_t addr) {
|
||||
//get device descriptor
|
||||
|
||||
uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) {
|
||||
return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, nbytes, dataptr, NULL);
|
||||
return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, nbytes, dataptr, nullptr);
|
||||
}
|
||||
//get configuration descriptor
|
||||
|
||||
uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) {
|
||||
return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, NULL);
|
||||
return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, nullptr);
|
||||
}
|
||||
|
||||
/* Requests Configuration Descriptor. Sends two Get Conf Descr requests. The first one gets the total length of all descriptors, then the second one requests this
|
||||
@@ -777,21 +777,21 @@ uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser
|
||||
//get string descriptor
|
||||
|
||||
uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) {
|
||||
return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns, ns, dataptr, NULL);
|
||||
return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns, ns, dataptr, nullptr);
|
||||
}
|
||||
//set address
|
||||
|
||||
uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) {
|
||||
uint8_t rcode = ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL);
|
||||
uint8_t rcode = ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr);
|
||||
//delay(2); //per USB 2.0 sect.9.2.6.3
|
||||
delay(300); // Older spec says you should wait at least 200ms
|
||||
return rcode;
|
||||
//return ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL);
|
||||
//return ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr);
|
||||
}
|
||||
//set configuration
|
||||
|
||||
uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) {
|
||||
return ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL);
|
||||
return ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr);
|
||||
}
|
||||
|
||||
#endif // defined(USB_METHODS_INLINE)
|
||||
|
@@ -301,12 +301,12 @@ inline uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t nuint8_ts, ui
|
||||
//set address
|
||||
|
||||
inline uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) {
|
||||
return ( ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, NULL));
|
||||
return ( ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, nullptr));
|
||||
}
|
||||
//set configuration
|
||||
|
||||
inline uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) {
|
||||
return ( ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, NULL));
|
||||
return ( ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, nullptr));
|
||||
}
|
||||
|
||||
#endif // defined(USB_METHODS_INLINE)
|
||||
|
@@ -183,7 +183,7 @@ public:
|
||||
virtual UsbDevice* GetUsbDevicePtr(uint8_t addr) {
|
||||
if (!addr) return thePool;
|
||||
uint8_t index = FindAddressIndex(addr);
|
||||
return index ? thePool + index : NULL;
|
||||
return index ? thePool + index : nullptr;
|
||||
}
|
||||
|
||||
// Perform an operation specified by pfunc for each addressed device
|
||||
|
@@ -118,7 +118,7 @@ uint8_t BulkOnly::LockMedia(uint8_t lun, uint8_t lock) {
|
||||
Notify(PSTR("---------\r\n"), 0x80);
|
||||
|
||||
CDB6_t cdb = CDB6_t(SCSI_CMD_PREVENT_REMOVAL, lun, (uint8_t)0, lock);
|
||||
return SCSITransaction6(&cdb, (uint16_t)0, NULL, (uint8_t)MASS_CMD_DIR_IN);
|
||||
return SCSITransaction6(&cdb, (uint16_t)0, nullptr, (uint8_t)MASS_CMD_DIR_IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,7 +136,7 @@ uint8_t BulkOnly::MediaCTL(uint8_t lun, uint8_t ctl) {
|
||||
uint8_t rcode = MASS_ERR_UNIT_NOT_READY;
|
||||
if (bAddress) {
|
||||
CDB6_t cdb = CDB6_t(SCSI_CMD_START_STOP_UNIT, lun, ctl & 0x03, 0);
|
||||
rcode = SCSITransaction6(&cdb, (uint16_t)0, NULL, (uint8_t)MASS_CMD_DIR_OUT);
|
||||
rcode = SCSITransaction6(&cdb, (uint16_t)0, nullptr, (uint8_t)MASS_CMD_DIR_OUT);
|
||||
}
|
||||
else
|
||||
SetCurLUN(lun);
|
||||
@@ -255,8 +255,8 @@ uint8_t BulkOnly::ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed) {
|
||||
uint8_t buf[constBufSize];
|
||||
USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
|
||||
uint8_t rcode;
|
||||
UsbDevice *p = NULL;
|
||||
EpInfo *oldep_ptr = NULL;
|
||||
UsbDevice *p = nullptr;
|
||||
EpInfo *oldep_ptr = nullptr;
|
||||
USBTRACE("MS ConfigureDevice\r\n");
|
||||
ClearAllEP();
|
||||
AddressPool &addrPool = pUsb->GetAddressPool();
|
||||
@@ -668,7 +668,7 @@ uint8_t BulkOnly::Poll() {
|
||||
* @return
|
||||
*/
|
||||
uint8_t BulkOnly::GetMaxLUN(uint8_t *plun) {
|
||||
uint8_t ret = pUsb->ctrlReq(bAddress, 0, bmREQ_MASSIN, MASS_REQ_GET_MAX_LUN, 0, 0, bIface, 1, 1, plun, NULL);
|
||||
uint8_t ret = pUsb->ctrlReq(bAddress, 0, bmREQ_MASSIN, MASS_REQ_GET_MAX_LUN, 0, 0, bIface, 1, 1, plun, nullptr);
|
||||
|
||||
if (ret == hrSTALL)
|
||||
*plun = 0;
|
||||
@@ -709,7 +709,7 @@ uint8_t BulkOnly::TestUnitReady(uint8_t lun) {
|
||||
Notify(PSTR("-----------------\r\n"), 0x80);
|
||||
|
||||
CDB6_t cdb = CDB6_t(SCSI_CMD_TEST_UNIT_READY, lun, (uint8_t)0, 0);
|
||||
return SCSITransaction6(&cdb, 0, NULL, (uint8_t)MASS_CMD_DIR_IN);
|
||||
return SCSITransaction6(&cdb, 0, nullptr, (uint8_t)MASS_CMD_DIR_IN);
|
||||
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ uint8_t BulkOnly::ClearEpHalt(uint8_t index) {
|
||||
|
||||
uint8_t ret = 0;
|
||||
|
||||
while ((ret = (pUsb->ctrlReq(bAddress, 0, USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_STANDARD | USB_SETUP_RECIPIENT_ENDPOINT, USB_REQUEST_CLEAR_FEATURE, USB_FEATURE_ENDPOINT_HALT, 0, ((index == epDataInIndex) ? (0x80 | epInfo[index].epAddr) : epInfo[index].epAddr), 0, 0, NULL, NULL)) == 0x01))
|
||||
while ((ret = (pUsb->ctrlReq(bAddress, 0, USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_STANDARD | USB_SETUP_RECIPIENT_ENDPOINT, USB_REQUEST_CLEAR_FEATURE, USB_FEATURE_ENDPOINT_HALT, 0, ((index == epDataInIndex) ? (0x80 | epInfo[index].epAddr) : epInfo[index].epAddr), 0, 0, nullptr, nullptr)) == 0x01))
|
||||
delay(6);
|
||||
|
||||
if (ret) {
|
||||
@@ -831,7 +831,7 @@ uint8_t BulkOnly::ClearEpHalt(uint8_t index) {
|
||||
*
|
||||
*/
|
||||
void BulkOnly::Reset() {
|
||||
while (pUsb->ctrlReq(bAddress, 0, bmREQ_MASSOUT, MASS_REQ_BOMSR, 0, 0, bIface, 0, 0, NULL, NULL) == 0x01) delay(6);
|
||||
while (pUsb->ctrlReq(bAddress, 0, bmREQ_MASSOUT, MASS_REQ_BOMSR, 0, 0, bIface, 0, 0, nullptr, nullptr) == 0x01) delay(6);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -40,7 +40,7 @@ class MultiByteValueParser {
|
||||
|
||||
public:
|
||||
|
||||
MultiByteValueParser() : pBuf(NULL), countDown(0), valueSize(0) {
|
||||
MultiByteValueParser() : pBuf(nullptr), countDown(0), valueSize(0) {
|
||||
};
|
||||
|
||||
const uint8_t* GetBuffer() { return pBuf; }
|
||||
@@ -60,7 +60,7 @@ class ByteSkipper {
|
||||
|
||||
public:
|
||||
|
||||
ByteSkipper() : pBuf(NULL), nStage(0), countDown(0) {
|
||||
ByteSkipper() : pBuf(nullptr), nStage(0), countDown(0) {
|
||||
}
|
||||
|
||||
void Initialize(MultiValueBuffer *pbuf) {
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
arLenCntdn(0),
|
||||
lenSize(0),
|
||||
valSize(0),
|
||||
pBuf(NULL),
|
||||
pBuf(nullptr),
|
||||
prsMode(modeArray) { }
|
||||
;
|
||||
|
||||
@@ -141,5 +141,5 @@ public:
|
||||
theParser.Initialize(p);
|
||||
}
|
||||
|
||||
bool Parse(uint8_t **pp, uint16_t *pcntdn, PTP_ARRAY_EL_FUNC pf, const void *me = NULL);
|
||||
bool Parse(uint8_t **pp, uint16_t *pcntdn, PTP_ARRAY_EL_FUNC pf, const void *me = nullptr);
|
||||
};
|
||||
|
Reference in New Issue
Block a user