mirror of
https://github.com/afska/gba-link-connection.git
synced 2026-04-26 02:02:25 -05:00
Using nullptr instead of NULL
This commit is contained in:
parent
1aaf84bb27
commit
3e3920096f
|
|
@ -32,7 +32,7 @@ std::string selectedNumber = "";
|
|||
std::string selectedPassword = "";
|
||||
std::string selectedDomain = "";
|
||||
|
||||
LinkMobile* linkMobile = NULL;
|
||||
LinkMobile* linkMobile = nullptr;
|
||||
|
||||
void init() {
|
||||
REG_DISPCNT = DCNT_MODE0 | DCNT_BG0;
|
||||
|
|
@ -86,7 +86,7 @@ start:
|
|||
interrupt_disable(INTR_SERIAL);
|
||||
interrupt_disable(INTR_TIMER3);
|
||||
delete linkMobile;
|
||||
linkMobile = NULL;
|
||||
linkMobile = nullptr;
|
||||
|
||||
if (!didShutdown) {
|
||||
log("Waiting...");
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
void log(std::string text);
|
||||
void waitFor(u16 key);
|
||||
|
||||
LinkUniversal* linkUniversal = NULL;
|
||||
LinkUniversal* linkUniversal = nullptr;
|
||||
|
||||
void init() {
|
||||
REG_DISPCNT = DCNT_MODE0 | DCNT_BG0;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ void wait(u32 verticalLines);
|
|||
void hang();
|
||||
|
||||
LinkWireless::Error lastError;
|
||||
LinkWireless* linkWireless = NULL;
|
||||
LinkWireless* linkWireless = nullptr;
|
||||
bool forwarding, retransmission, asyncACK;
|
||||
u32 maxPlayers;
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ start:
|
|||
interrupt_disable(INTR_TIMER3);
|
||||
interrupt_disable(INTR_TIMER0);
|
||||
delete linkWireless;
|
||||
linkWireless = NULL;
|
||||
linkWireless = nullptr;
|
||||
goto start;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -212,8 +212,8 @@ class LinkRawWireless {
|
|||
|
||||
/**
|
||||
* @brief Calls the Broadcast (`0x16`) command.
|
||||
* @param gameName Game name. Maximum `14` characters + NULL terminator.
|
||||
* @param userName User name. Maximum `8` characters + NULL terminator.
|
||||
* @param gameName Game name. Maximum `14` characters + null terminator.
|
||||
* @param userName User name. Maximum `8` characters + null terminator.
|
||||
* @param gameId `(0 ~ 0x7FFF)` Game ID.
|
||||
*/
|
||||
bool broadcast(const char* gameName = "",
|
||||
|
|
|
|||
|
|
@ -324,8 +324,8 @@ class LinkWireless {
|
|||
* @brief Starts broadcasting a server and changes the state to `SERVING`. You
|
||||
* can optionally provide data that games will be able to read. If the adapter
|
||||
* is already serving, this method only updates the broadcast data.
|
||||
* @param gameName Game name. Maximum `14` characters + NULL terminator.
|
||||
* @param userName User name. Maximum `8` characters + NULL terminator.
|
||||
* @param gameName Game name. Maximum `14` characters + null terminator.
|
||||
* @param userName User name. Maximum `8` characters + null terminator.
|
||||
* @param gameId `(0 ~ 0x7FFF)` Game ID.
|
||||
* \warning Updating broadcast data while serving can fail if the adapter is
|
||||
* busy. In that case, this will return `false` and `getLastError()` will be
|
||||
|
|
|
|||
|
|
@ -125,8 +125,8 @@ class LinkWirelessMultiboot {
|
|||
* @param romSize Size of the ROM in bytes. It must be a number between
|
||||
* `448` and `262144`. It's recommended to use a ROM size that is a multiple
|
||||
* of `16`, as this also ensures compatibility with Multiboot via Link Cable.
|
||||
* @param gameName Game name. Maximum `14` characters + NULL terminator.
|
||||
* @param userName User name. Maximum `8` characters + NULL terminator.
|
||||
* @param gameName Game name. Maximum `14` characters + null terminator.
|
||||
* @param userName User name. Maximum `8` characters + null terminator.
|
||||
* @param gameId `(0 ~ 0x7FFF)` Game ID.
|
||||
* @param players The exact number of consoles that will download the ROM.
|
||||
* Once this number of players is reached, the code will start transmitting
|
||||
|
|
@ -207,7 +207,7 @@ class LinkWirelessMultiboot {
|
|||
maxI = i;
|
||||
}
|
||||
}
|
||||
return maxI > -1 ? &transfers[maxI] : NULL;
|
||||
return maxI > -1 ? &transfers[maxI] : nullptr;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) PendingTransfer* minWithoutAck() {
|
||||
|
|
@ -220,12 +220,12 @@ class LinkWirelessMultiboot {
|
|||
minI = i;
|
||||
}
|
||||
}
|
||||
return minI > -1 ? &transfers[minI] : NULL;
|
||||
return minI > -1 ? &transfers[minI] : nullptr;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) void addIfNeeded(u32 newCursor) {
|
||||
auto maxTransfer = max();
|
||||
if (maxTransfer != NULL && newCursor <= maxTransfer->cursor)
|
||||
if (maxTransfer != nullptr && newCursor <= maxTransfer->cursor)
|
||||
return;
|
||||
|
||||
for (u32 i = 0; i < MAX_INFLIGHT_PACKETS; i++) {
|
||||
|
|
@ -246,8 +246,8 @@ class LinkWirelessMultiboot {
|
|||
transfers[index].ack = true;
|
||||
|
||||
auto maxAckTransfer = max(true);
|
||||
bool canUpdateCursor =
|
||||
maxAckTransfer != NULL && isAckCompleteUpTo(maxAckTransfer->cursor);
|
||||
bool canUpdateCursor = maxAckTransfer != nullptr &&
|
||||
isAckCompleteUpTo(maxAckTransfer->cursor);
|
||||
|
||||
if (canUpdateCursor)
|
||||
cleanup();
|
||||
|
|
@ -307,7 +307,7 @@ class LinkWirelessMultiboot {
|
|||
return pendingTransferList.max()->cursor + 1;
|
||||
} else {
|
||||
auto minWithoutAck = pendingTransferList.minWithoutAck();
|
||||
return minWithoutAck != NULL ? minWithoutAck->cursor : cursor;
|
||||
return minWithoutAck != nullptr ? minWithoutAck->cursor : cursor;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user