mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-16 20:13:51 +00:00
Modernize project codebase (#906)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides * Add safety checks and fix a issue with vector going OOR
This commit is contained in:
parent
88798b501d
commit
28614b922f
1373 changed files with 20086 additions and 19527 deletions
|
|
@ -11,7 +11,7 @@ bool MinecraftDynamicConfigurations::s_bUpdatedConfigs[MinecraftDynamicConfigura
|
|||
MinecraftDynamicConfigurations::EDynamic_Configs MinecraftDynamicConfigurations::s_eCurrentConfig = MinecraftDynamicConfigurations::eDynamic_Config_Max;
|
||||
size_t MinecraftDynamicConfigurations::s_currentConfigSize = 0;
|
||||
size_t MinecraftDynamicConfigurations::s_dataWrittenSize = 0;
|
||||
byte *MinecraftDynamicConfigurations::s_dataWritten = NULL;
|
||||
byte *MinecraftDynamicConfigurations::s_dataWritten = nullptr;
|
||||
|
||||
void MinecraftDynamicConfigurations::Tick()
|
||||
{
|
||||
|
|
@ -43,7 +43,7 @@ void MinecraftDynamicConfigurations::UpdateNextConfiguration()
|
|||
{
|
||||
if(!s_bUpdatedConfigs[i])
|
||||
{
|
||||
update = (EDynamic_Configs)i;
|
||||
update = static_cast<EDynamic_Configs>(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ void MinecraftDynamicConfigurations::UpdateConfiguration(EDynamic_Configs id)
|
|||
{
|
||||
app.DebugPrintf("DynamicConfig: Attempting to update dynamic configuration %d\n", id);
|
||||
|
||||
HRESULT hr = Sentient::SenDynamicConfigGetSize( id, &s_currentConfigSize, &MinecraftDynamicConfigurations::GetSizeCompletedCallback, NULL);
|
||||
HRESULT hr = Sentient::SenDynamicConfigGetSize( id, &s_currentConfigSize, &MinecraftDynamicConfigurations::GetSizeCompletedCallback, nullptr);
|
||||
|
||||
switch(hr)
|
||||
{
|
||||
|
|
@ -76,7 +76,7 @@ void MinecraftDynamicConfigurations::UpdateConfiguration(EDynamic_Configs id)
|
|||
break;
|
||||
case E_POINTER:
|
||||
app.DebugPrintf("DynamicConfig: Failed to get size for config as pointer is invalid\n");
|
||||
//The out_size pointer is NULL.
|
||||
//The out_size pointer is nullptr.
|
||||
break;
|
||||
}
|
||||
if(FAILED(hr) )
|
||||
|
|
@ -97,7 +97,7 @@ void MinecraftDynamicConfigurations::GetSizeCompletedCallback(HRESULT taskResult
|
|||
&s_dataWrittenSize,
|
||||
s_dataWritten,
|
||||
&MinecraftDynamicConfigurations::GetDataCompletedCallback,
|
||||
NULL
|
||||
nullptr
|
||||
);
|
||||
|
||||
switch(hr)
|
||||
|
|
@ -115,8 +115,8 @@ void MinecraftDynamicConfigurations::GetSizeCompletedCallback(HRESULT taskResult
|
|||
//Sentient is not initialized. You must call SentientInitialize before you call this function.
|
||||
break;
|
||||
case E_POINTER:
|
||||
app.DebugPrintf("DynamicConfig: Failed to get bytes for config as pointer is NULL\n");
|
||||
//The out_size pointer is NULL.
|
||||
app.DebugPrintf("DynamicConfig: Failed to get bytes for config as pointer is nullptr\n");
|
||||
//The out_size pointer is nullptr.
|
||||
break;
|
||||
}
|
||||
if(FAILED(hr) )
|
||||
|
|
@ -160,7 +160,7 @@ void MinecraftDynamicConfigurations::GetDataCompletedCallback(HRESULT taskResu
|
|||
}
|
||||
|
||||
delete [] s_dataWritten;
|
||||
s_dataWritten = NULL;
|
||||
s_dataWritten = nullptr;
|
||||
|
||||
s_bUpdatedConfigs[s_eCurrentConfig] = true;
|
||||
UpdateNextConfiguration();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue