diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index f63cfdff..325e949b 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -795,7 +795,7 @@ void ClientConnection::handleSetEntityMotion(shared_ptr p { if (!shouldProcessForEntity(packet->id)) { - if (minecraft->localplayers[m_userIndex] == nullptr || + if (minecraft->localplayers[m_userIndex] == NULL || packet->id != minecraft->localplayers[m_userIndex]->entityId) return; } @@ -1186,7 +1186,7 @@ void ClientConnection::handleMovePlayer(shared_ptr packet) // 4J Added void ClientConnection::handleChunkVisibilityArea(shared_ptr packet) { - if (level == nullptr) return; + if (level == NULL) return; for(int z = packet->m_minZ; z <= packet->m_maxZ; ++z) { for(int x = packet->m_minX; x <= packet->m_maxX; ++x) @@ -1199,7 +1199,7 @@ void ClientConnection::handleChunkVisibilityArea(shared_ptr packet) { - if (level == nullptr) return; + if (level == NULL) return; if (packet->visible) { m_visibleChunks.insert(chunkKey(packet->x, packet->z)); @@ -2996,7 +2996,7 @@ void ClientConnection::handleExplosion(shared_ptr packet) // Per-player knockback — each connection applies to its own local player //app.DebugPrintf("Adding knockback (%f,%f,%f) for player %d\n", packet->getKnockbackX(), packet->getKnockbackY(), packet->getKnockbackZ(), m_userIndex); - if (minecraft->localplayers[m_userIndex] == nullptr) + if (minecraft->localplayers[m_userIndex] == NULL) return; minecraft->localplayers[m_userIndex]->xd += packet->getKnockbackX(); minecraft->localplayers[m_userIndex]->yd += packet->getKnockbackY(); @@ -3007,7 +3007,7 @@ void ClientConnection::handleContainerOpen(shared_ptr packe { bool failed = false; shared_ptr player = minecraft->localplayers[m_userIndex]; - if (player == nullptr) + if (player == NULL) return; switch(packet->type) { diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index 8c4c0261..24c8d39f 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -337,7 +337,7 @@ void SoundEngine::updateMiniAudio() ///////////////////////////////////////////// inline void SoundEngine::pickGameModeMusic(Minecraft* pMinecraft, unsigned int i) { - if (pMinecraft->localplayers[i] != nullptr && pMinecraft->localplayers[i]->abilities.instabuild && pMinecraft->localplayers[i]->abilities.mayfly) + if (pMinecraft->localplayers[i] != NULL && pMinecraft->localplayers[i]->abilities.instabuild && pMinecraft->localplayers[i]->abilities.mayfly) m_musicID = getMusicID(eMusicDomain_Creative); // TODO(3UR): this is a part of minigames also in the future other minigame ids will need to be handled for now TU30 only checks for BATTLE //else if (pMinecraft->GetCustomGameMode() && CustomGameModeInst::GetId() == EMiniGameId::BATTLE) // @3UR: thanks https://github.com/GRAnimated/MinecraftLCE/blob/6947670d152582457bfe02bd909ee30a7ab7eb55/src/Minecraft.World/net/minecraft/world/level/gamemode/minigames/EMiniGameId.h#L3 @@ -1456,18 +1456,20 @@ void SoundEngine::playMusicUpdate() bool playerInEnd=false; bool playerInNether=false; - unsigned int i = 0; - for (i = 0; i < MAX_LOCAL_PLAYERS; i++) + for(unsigned int i=0;ilocalplayers[i] != nullptr) + if(pMinecraft->localplayers[i]!=nullptr) { - if(pMinecraft->localplayers[i]->dimension == LevelData::DIMENSION_END) - playerInEnd = true; - else if(pMinecraft->localplayers[i]->dimension == LevelData::DIMENSION_NETHER) - playerInNether = true; + if(pMinecraft->localplayers[i]->dimension==LevelData::DIMENSION_END) + { + playerInEnd=true; + } + else if(pMinecraft->localplayers[i]->dimension==LevelData::DIMENSION_NETHER) + { + playerInNether=true; + } } } - if(playerInEnd) { m_musicID = getMusicID(eMusicDomain_End); diff --git a/Minecraft.Client/Common/Audio/miniaudio.h b/Minecraft.Client/Common/Audio/miniaudio.h index 15a0656c..01e27040 100644 --- a/Minecraft.Client/Common/Audio/miniaudio.h +++ b/Minecraft.Client/Common/Audio/miniaudio.h @@ -74,7 +74,7 @@ device on the stack, but you could allocate it on the heap if that suits your si config.pUserData = pMyCustomData; // Can be accessed from the device object (device.pUserData). ma_device device; - if (ma_device_init(nullptr, &config, &device) != MA_SUCCESS) { + if (ma_device_init(NULL, &config, &device) != MA_SUCCESS) { return -1; // Failed to initialize the device. } @@ -168,7 +168,7 @@ same for capture. All you need to do is change the device type from `ma_device_t ``` In the data callback you just read from the input buffer (`pInput` in the example above) and leave -the output buffer alone (it will be set to nullptr when the device type is set to +the output buffer alone (it will be set to NULL when the device type is set to `ma_device_type_capture`). These are the available device types and how you should handle the buffers in the callback: @@ -208,7 +208,7 @@ enumerating devices. The example below shows how to enumerate devices. ```c ma_context context; - if (ma_context_init(nullptr, 0, nullptr, &context) != MA_SUCCESS) { + if (ma_context_init(NULL, 0, NULL, &context) != MA_SUCCESS) { // Error. } @@ -247,10 +247,10 @@ enumerating devices. The example below shows how to enumerate devices. The first thing we do in this example is initialize a `ma_context` object with `ma_context_init()`. The first parameter is a pointer to a list of `ma_backend` values which are used to override the -default backend priorities. When this is nullptr, as in this example, miniaudio's default priorities +default backend priorities. When this is NULL, as in this example, miniaudio's default priorities are used. The second parameter is the number of backends listed in the array pointed to by the first parameter. The third parameter is a pointer to a `ma_context_config` object which can be -nullptr, in which case defaults are used. The context configuration is used for setting the logging +NULL, in which case defaults are used. The context configuration is used for setting the logging callback, custom memory allocation callbacks, user-defined data and some backend-specific configurations. @@ -267,7 +267,7 @@ config. It also contains the name of the device which is useful for presenting a to the user via the UI. When creating your own context you will want to pass it to `ma_device_init()` when initializing the -device. Passing in nullptr, like we do in the first example, will result in miniaudio creating the +device. Passing in NULL, like we do in the first example, will result in miniaudio creating the context for you, which you don't want to do since you've already created a context. Note that internally the context is only tracked by it's pointer which means you must not change the location of the `ma_context` object. If this is an issue, consider using `malloc()` to allocate memory for @@ -301,7 +301,7 @@ The code below shows how you can initialize an engine using its default configur ma_result result; ma_engine engine; - result = ma_engine_init(nullptr, &engine); + result = ma_engine_init(NULL, &engine); if (result != MA_SUCCESS) { return result; // Failed to initialize the engine. } @@ -352,7 +352,7 @@ By default the engine will be started, but nothing will be playing because no so initialized. The easiest but least flexible way of playing a sound is like so: ```c - ma_engine_play_sound(&engine, "my_sound.wav", nullptr); + ma_engine_play_sound(&engine, "my_sound.wav", NULL); ``` This plays what miniaudio calls an "inline" sound. It plays the sound once, and then puts the @@ -365,7 +365,7 @@ initialize a sound: ma_result result; ma_sound sound; - result = ma_sound_init_from_file(&engine, "my_sound.wav", 0, nullptr, nullptr, &sound); + result = ma_sound_init_from_file(&engine, "my_sound.wav", 0, NULL, NULL, &sound); if (result != MA_SUCCESS) { return result; } @@ -789,7 +789,7 @@ To read data from a data source: } ``` -If you don't need the number of frames that were successfully read you can pass in `nullptr` to the +If you don't need the number of frames that were successfully read you can pass in `NULL` to the `pFramesRead` parameter. If this returns a value less than the number of frames requested it means the end of the file has been reached. `MA_AT_END` will be returned only when the number of frames read is 0. @@ -809,7 +809,7 @@ you could plug in a decoder like so: } ``` -If you want to seek forward you can pass in `nullptr` to the `pFramesOut` parameter. Alternatively you +If you want to seek forward you can pass in `NULL` to the `pFramesOut` parameter. Alternatively you can use `ma_data_source_seek_pcm_frames()`. To seek to a specific PCM frame: @@ -864,7 +864,7 @@ retrieved like so: } ``` -If you do not need a specific data format property, just pass in nullptr to the respective parameter. +If you do not need a specific data format property, just pass in NULL to the respective parameter. There may be cases where you want to implement something like a sound bank where you only want to read data within a certain range of the underlying data. To do this you can use a range: @@ -1041,7 +1041,7 @@ The most basic way to initialize the engine is with a default config, like so: ma_result result; ma_engine engine; - result = ma_engine_init(nullptr, &engine); + result = ma_engine_init(NULL, &engine); if (result != MA_SUCCESS) { return result; // Failed to initialize the engine. } @@ -1072,7 +1072,7 @@ control of the device's data callback, it's their responsibility to manually cal ```c void playback_data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount) { - ma_engine_read_pcm_frames(&g_Engine, pOutput, frameCount, nullptr); + ma_engine_read_pcm_frames(&g_Engine, pOutput, frameCount, NULL); } ``` @@ -1200,7 +1200,7 @@ you'll want to initialize a sound object: ```c ma_sound sound; - result = ma_sound_init_from_file(&engine, "my_sound.wav", flags, pGroup, nullptr, &sound); + result = ma_sound_init_from_file(&engine, "my_sound.wav", flags, pGroup, NULL, &sound); if (result != MA_SUCCESS) { return result; // Failed to load sound. } @@ -1232,8 +1232,8 @@ standard config/init pattern: ma_sound_config soundConfig; soundConfig = ma_sound_config_init(); - soundConfig.pFilePath = nullptr; // Set this to load from a file path. - soundConfig.pDataSource = nullptr; // Set this to initialize from an existing data source. + soundConfig.pFilePath = NULL; // Set this to load from a file path. + soundConfig.pDataSource = NULL; // Set this to initialize from an existing data source. soundConfig.pInitialAttachment = &someNodeInTheNodeGraph; soundConfig.initialAttachmentInputBusIndex = 0; soundConfig.channelsIn = 1; @@ -1258,7 +1258,7 @@ will be decoded dynamically on the fly. In order to save processing time on the might be beneficial to pre-decode the sound. You can do this with the `MA_SOUND_FLAG_DECODE` flag: ```c - ma_sound_init_from_file(&engine, "my_sound.wav", MA_SOUND_FLAG_DECODE, pGroup, nullptr, &sound); + ma_sound_init_from_file(&engine, "my_sound.wav", MA_SOUND_FLAG_DECODE, pGroup, NULL, &sound); ``` By default, sounds will be loaded synchronously, meaning `ma_sound_init_*()` will not return until @@ -1266,7 +1266,7 @@ the sound has been fully loaded. If this is prohibitive you can instead load sou by specifying the `MA_SOUND_FLAG_ASYNC` flag: ```c - ma_sound_init_from_file(&engine, "my_sound.wav", MA_SOUND_FLAG_DECODE | MA_SOUND_FLAG_ASYNC, pGroup, nullptr, &sound); + ma_sound_init_from_file(&engine, "my_sound.wav", MA_SOUND_FLAG_DECODE | MA_SOUND_FLAG_ASYNC, pGroup, NULL, &sound); ``` This will result in `ma_sound_init_*()` returning quickly, but the sound won't yet have been fully @@ -1303,7 +1303,7 @@ If loading the entire sound into memory is prohibitive, you can also configure t the audio data: ```c - ma_sound_init_from_file(&engine, "my_sound.wav", MA_SOUND_FLAG_STREAM, pGroup, nullptr, &sound); + ma_sound_init_from_file(&engine, "my_sound.wav", MA_SOUND_FLAG_STREAM, pGroup, NULL, &sound); ``` When streaming sounds, 2 seconds worth of audio data is stored in memory. Although it should work @@ -1323,7 +1323,7 @@ only works for sounds that were initialized with `ma_sound_init_from_file()` and `MA_SOUND_FLAG_STREAM` flag. When you initialize a sound, if you specify a sound group the sound will be attached to that group -automatically. If you set it to nullptr, it will be automatically attached to the engine's endpoint. +automatically. If you set it to NULL, it will be automatically attached to the engine's endpoint. If you would instead rather leave the sound unattached by default, you can specify the `MA_SOUND_FLAG_NO_DEFAULT_ATTACHMENT` flag. This is useful if you want to set up a complex node graph. @@ -1345,7 +1345,7 @@ to disable spatialization of a sound: ```c // Disable spatialization at initialization time via a flag: - ma_sound_init_from_file(&engine, "my_sound.wav", MA_SOUND_FLAG_NO_SPATIALIZATION, nullptr, nullptr, &sound); + ma_sound_init_from_file(&engine, "my_sound.wav", MA_SOUND_FLAG_NO_SPATIALIZATION, NULL, NULL, &sound); // Dynamically disable or enable spatialization post-initialization: ma_sound_set_spatialization_enabled(&sound, isSpatializationEnabled); @@ -1589,7 +1589,7 @@ vtables into the resource manager config: resourceManagerConfig.ppCustomDecodingBackendVTables = pCustomBackendVTables; resourceManagerConfig.customDecodingBackendCount = sizeof(pCustomBackendVTables) / sizeof(pCustomBackendVTables[0]); - resourceManagerConfig.pCustomDecodingBackendUserData = nullptr; + resourceManagerConfig.pCustomDecodingBackendUserData = NULL; ``` This system can allow you to support any kind of file format. See the "Decoding" section for @@ -2074,7 +2074,7 @@ standard config/init system: ```c ma_node_graph_config nodeGraphConfig = ma_node_graph_config_init(myChannelCount); - result = ma_node_graph_init(&nodeGraphConfig, nullptr, &nodeGraph); // Second parameter is a pointer to allocation callbacks. + result = ma_node_graph_init(&nodeGraphConfig, NULL, &nodeGraph); // Second parameter is a pointer to allocation callbacks. if (result != MA_SUCCESS) { // Failed to initialize node graph. } @@ -2114,7 +2114,7 @@ of the stock nodes that comes with miniaudio: ma_data_source_node_config config = ma_data_source_node_config_init(pMyDataSource); ma_data_source_node dataSourceNode; - result = ma_data_source_node_init(&nodeGraph, &config, nullptr, &dataSourceNode); + result = ma_data_source_node_init(&nodeGraph, &config, NULL, &dataSourceNode); if (result != MA_SUCCESS) { // Failed to create data source node. } @@ -2172,7 +2172,7 @@ pointer to the processing function and the number of input and output buses. Exa static ma_node_vtable my_custom_node_vtable = { my_custom_node_process_pcm_frames, // The function that will be called to process your custom node. This is where you'd implement your effect processing. - nullptr, // Optional. A callback for calculating the number of input frames that are required to process a specified number of output frames. + NULL, // Optional. A callback for calculating the number of input frames that are required to process a specified number of output frames. 2, // 2 input buses. 1, // 1 output bus. 0 // Default flags. @@ -2195,7 +2195,7 @@ pointer to the processing function and the number of input and output buses. Exa nodeConfig.pOutputChannels = outputChannels; ma_node_base node; - result = ma_node_init(&nodeGraph, &nodeConfig, nullptr, &node); + result = ma_node_init(&nodeGraph, &nodeConfig, NULL, &node); if (result != MA_SUCCESS) { // Failed to initialize node. } @@ -2210,7 +2210,7 @@ to `MA_NODE_BUS_COUNT_UNKNOWN`. In this case, the bus count should be set in the static ma_node_vtable my_custom_node_vtable = { my_custom_node_process_pcm_frames, // The function that will be called process your custom node. This is where you'd implement your effect processing. - nullptr, // Optional. A callback for calculating the number of input frames that are required to process a specified number of output frames. + NULL, // Optional. A callback for calculating the number of input frames that are required to process a specified number of output frames. MA_NODE_BUS_COUNT_UNKNOWN, // The number of input buses is determined on a per-node basis. 1, // 1 output bus. 0 // Default flags. @@ -2284,7 +2284,7 @@ and include the following: | MA_NODE_FLAG_ALLOW_NULL_INPUT | Used in conjunction with | | | `MA_NODE_FLAG_CONTINUOUS_PROCESSING`. When this | | | is set, the `ppFramesIn` parameter of the | - | | processing callback will be set to nullptr when | + | | processing callback will be set to NULL when | | | there are no input frames are available. When | | | this is unset, silence will be posted to the | | | processing callback. | @@ -2313,7 +2313,7 @@ You can use it like this: ma_splitter_node_config splitterNodeConfig = ma_splitter_node_config_init(channels); ma_splitter_node splitterNode; - result = ma_splitter_node_init(&nodeGraph, &splitterNodeConfig, nullptr, &splitterNode); + result = ma_splitter_node_init(&nodeGraph, &splitterNodeConfig, NULL, &splitterNode); if (result != MA_SUCCESS) { // Failed to create node. } @@ -2526,7 +2526,7 @@ an example for loading a decoder from a file: ```c ma_decoder decoder; - ma_result result = ma_decoder_init_file("MySong.mp3", nullptr, &decoder); + ma_result result = ma_decoder_init_file("MySong.mp3", NULL, &decoder); if (result != MA_SUCCESS) { return false; // An error occurred. } @@ -2537,14 +2537,14 @@ an example for loading a decoder from a file: ``` When initializing a decoder, you can optionally pass in a pointer to a `ma_decoder_config` object -(the `nullptr` argument in the example above) which allows you to configure the output format, channel +(the `NULL` argument in the example above) which allows you to configure the output format, channel count, sample rate and channel map: ```c ma_decoder_config config = ma_decoder_config_init(ma_format_f32, 2, 48000); ``` -When passing in `nullptr` for decoder config in `ma_decoder_init*()`, the output format will be the +When passing in `NULL` for decoder config in `ma_decoder_init*()`, the output format will be the same as that defined by the decoding backend. Data is read from the decoder as PCM frames. This will output the number of PCM frames actually @@ -2610,7 +2610,7 @@ to be implemented which is then passed into the decoder config: ... decoderConfig = ma_decoder_config_init_default(); - decoderConfig.pCustomBackendUserData = nullptr; + decoderConfig.pCustomBackendUserData = NULL; decoderConfig.ppCustomBackendVTables = pCustomBackendVTables; decoderConfig.customBackendCount = sizeof(pCustomBackendVTables) / sizeof(pCustomBackendVTables[0]); ``` @@ -2647,7 +2647,7 @@ If memory allocation is required, it should be done so via the specified allocat possible (the `pAllocationCallbacks` parameter). If an error occurs when initializing the decoder, you should leave `ppBackend` unset, or set to -nullptr, and make sure everything is cleaned up appropriately and an appropriate result code returned. +NULL, and make sure everything is cleaned up appropriately and an appropriate result code returned. When multiple custom backends are specified, miniaudio will cycle through the vtables in the order they're listed in the array that's passed into the decoder config so it's important that your initialization routine is clean. @@ -2707,7 +2707,7 @@ example below: ``` The `framesWritten` variable will contain the number of PCM frames that were actually written. This -is optionally and you can pass in `nullptr` if you need this. +is optionally and you can pass in `NULL` if you need this. Encoders must be uninitialized with `ma_encoder_uninit()`. @@ -2772,12 +2772,12 @@ initializing a simple channel converter which converts from mono to stereo. ma_channel_converter_config config = ma_channel_converter_config_init( ma_format, // Sample format 1, // Input channels - nullptr, // Input channel map + NULL, // Input channel map 2, // Output channels - nullptr, // Output channel map + NULL, // Output channel map ma_channel_mix_mode_default); // The mixing algorithm to use when combining channels. - result = ma_channel_converter_init(&config, nullptr, &converter); + result = ma_channel_converter_init(&config, NULL, &converter); if (result != MA_SUCCESS) { // Error. } @@ -2914,7 +2914,7 @@ like the following: ma_resample_algorithm_linear); ma_resampler resampler; - ma_result result = ma_resampler_init(&config, nullptr, &resampler); + ma_result result = ma_resampler_init(&config, NULL, &resampler); if (result != MA_SUCCESS) { // An error occurred... } @@ -2971,9 +2971,9 @@ De-interleaved processing is not supported. To process frames, use `ma_resampler_process_pcm_frames()`. On input, this function takes the number of output frames you can fit in the output buffer and the number of input frames contained in the input buffer. On output these variables contain the number of output frames that were written to the output buffer -and the number of input frames that were consumed in the process. You can pass in nullptr for the +and the number of input frames that were consumed in the process. You can pass in NULL for the input buffer in which case it will be treated as an infinitely large buffer of zeros. The output -buffer can also be nullptr, in which case the processing will be treated as seek. +buffer can also be NULL, in which case the processing will be treated as seek. The sample rate can be changed dynamically on the fly. You can change this with explicit sample rates with `ma_resampler_set_rate()` and also with a decimal ratio with @@ -3041,17 +3041,17 @@ On output, `pFrameCountIn` should be set to the number of input frames that were whereas `pFrameCountOut` should be set to the number of frames that were written to `pFramesOut`. The `onSetRate` callback is optional and is used for dynamically changing the sample rate. If -dynamic rate changes are not supported, you can set this callback to nullptr. +dynamic rate changes are not supported, you can set this callback to NULL. The `onGetInputLatency` and `onGetOutputLatency` functions are used for retrieving the latency in -input and output rates respectively. These can be nullptr in which case latency calculations will be -assumed to be nullptr. +input and output rates respectively. These can be NULL in which case latency calculations will be +assumed to be NULL. The `onGetRequiredInputFrameCount` callback is used to give miniaudio a hint as to how many input frames are required to be available to produce the given number of output frames. Likewise, the `onGetExpectedOutputFrameCount` callback is used to determine how many output frames will be produced given the specified number of input frames. miniaudio will use these as a hint, but they -are optional and can be set to nullptr if you're unable to implement them. +are optional and can be set to NULL if you're unable to implement them. @@ -3074,7 +3074,7 @@ object like this: ); ma_data_converter converter; - ma_result result = ma_data_converter_init(&config, nullptr, &converter); + ma_result result = ma_data_converter_init(&config, NULL, &converter); if (result != MA_SUCCESS) { // An error occurred... } @@ -3099,7 +3099,7 @@ Something like the following may be more suitable depending on your requirements Do the following to uninitialize the data converter: ```c - ma_data_converter_uninit(&converter, nullptr); + ma_data_converter_uninit(&converter, NULL); ``` The following example shows how data can be processed @@ -3131,9 +3131,9 @@ De-interleaved processing is not supported. To process frames, use `ma_data_converter_process_pcm_frames()`. On input, this function takes the number of output frames you can fit in the output buffer and the number of input frames contained in the input buffer. On output these variables contain the number of output frames that were written to the output buffer -and the number of input frames that were consumed in the process. You can pass in nullptr for the +and the number of input frames that were consumed in the process. You can pass in NULL for the input buffer in which case it will be treated as an infinitely large -buffer of zeros. The output buffer can also be nullptr, in which case the processing will be treated +buffer of zeros. The output buffer can also be NULL, in which case the processing will be treated as seek. Sometimes it's useful to know exactly how many input frames will be required to output a specific @@ -3156,7 +3156,7 @@ Biquad filtering is achieved with the `ma_biquad` API. Example: ```c ma_biquad_config config = ma_biquad_config_init(ma_format_f32, channels, b0, b1, b2, a0, a1, a2); - ma_result result = ma_biquad_init(&config, nullptr, &biquad); + ma_result result = ma_biquad_init(&config, NULL, &biquad); if (result != MA_SUCCESS) { // Error. } @@ -3553,7 +3553,7 @@ you will want to use. To initialize a ring buffer, do something like the followi ```c ma_pcm_rb rb; - ma_result result = ma_pcm_rb_init(FORMAT, CHANNELS, BUFFER_SIZE_IN_FRAMES, nullptr, nullptr, &rb); + ma_result result = ma_pcm_rb_init(FORMAT, CHANNELS, BUFFER_SIZE_IN_FRAMES, NULL, NULL, &rb); if (result != MA_SUCCESS) { // Error } @@ -3564,7 +3564,7 @@ it's the PCM variant of the ring buffer API. For the regular ring buffer that op would call `ma_rb_init()` which leaves these out and just takes the size of the buffer in bytes instead of frames. The fourth parameter is an optional pre-allocated buffer and the fifth parameter is a pointer to a `ma_allocation_callbacks` structure for custom memory allocation routines. -Passing in `nullptr` for this results in `MA_MALLOC()` and `MA_FREE()` being used. +Passing in `NULL` for this results in `MA_MALLOC()` and `MA_FREE()` being used. Use `ma_pcm_rb_init_ex()` if you need a deinterleaved buffer. The data for each sub-buffer is offset from each other based on the stride. To manage your sub-buffers you can use @@ -3843,9 +3843,9 @@ typedef void* ma_proc; typedef ma_uint16 wchar_t; #endif -/* Define nullptr for some compilers. */ -#ifndef nullptr -#define nullptr 0 +/* Define NULL for some compilers. */ +#ifndef NULL +#define NULL 0 #endif #if defined(SIZE_MAX) @@ -4503,7 +4503,7 @@ typedef ma_uint32 ma_spinlock; /* -Retrieves the version of miniaudio as separated integers. Each component can be nullptr if it's not required. +Retrieves the version of miniaudio as separated integers. Each component can be NULL if it's not required. */ MA_API void ma_version(ma_uint32* pMajor, ma_uint32* pMinor, ma_uint32* pRevision); @@ -5464,16 +5464,16 @@ ma_resampler_get_expected_output_frame_count() to know how many output frames wi On input, [pFrameCountIn] contains the number of input frames contained in [pFramesIn]. On output it contains the number of whole input frames that were actually processed. You can use ma_resampler_get_required_input_frame_count() to know how many input frames -you should provide for a given number of output frames. [pFramesIn] can be nullptr, in which case zeroes will be used instead. +you should provide for a given number of output frames. [pFramesIn] can be NULL, in which case zeroes will be used instead. -If [pFramesOut] is nullptr, a seek is performed. In this case, if [pFrameCountOut] is not nullptr it will seek by the specified number of -output frames. Otherwise, if [pFramesCountOut] is nullptr and [pFrameCountIn] is not nullptr, it will seek by the specified number of input -frames. When seeking, [pFramesIn] is allowed to nullptr, in which case the internal timing state will be updated, but no input will be +If [pFramesOut] is NULL, a seek is performed. In this case, if [pFrameCountOut] is not NULL it will seek by the specified number of +output frames. Otherwise, if [pFramesCountOut] is NULL and [pFrameCountIn] is not NULL, it will seek by the specified number of input +frames. When seeking, [pFramesIn] is allowed to NULL, in which case the internal timing state will be updated, but no input will be processed. In this case, any internal filter state will be updated as if zeroes were passed in. -It is an error for [pFramesOut] to be non-nullptr and [pFrameCountOut] to be nullptr. +It is an error for [pFramesOut] to be non-NULL and [pFrameCountOut] to be NULL. -It is an error for both [pFrameCountOut] and [pFrameCountIn] to be nullptr. +It is an error for both [pFrameCountOut] and [pFrameCountIn] to be NULL. */ MA_API ma_result ma_resampler_process_pcm_frames(ma_resampler* pResampler, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut); @@ -5744,7 +5744,7 @@ MA_API void ma_channel_map_copy(ma_channel* pOut, const ma_channel* pIn, ma_uint /* Copies a channel map if one is specified, otherwise copies the default channel map. -The output buffer must have a capacity of at least `channels`. If not nullptr, the input channel map must also have a capacity of at least `channels`. +The output buffer must have a capacity of at least `channels`. If not NULL, the input channel map must also have a capacity of at least `channels`. */ MA_API void ma_channel_map_copy_or_default(ma_channel* pOut, size_t channelMapCapOut, const ma_channel* pIn, ma_uint32 channels); @@ -5816,8 +5816,8 @@ Conversion Helpers ************************************************************************************************************************************************************/ /* -High-level helper for doing a full format conversion in one go. Returns the number of output frames. Call this with pOut set to nullptr to -determine the required size of the output buffer. frameCountOut should be set to the capacity of pOut. If pOut is nullptr, frameCountOut is +High-level helper for doing a full format conversion in one go. Returns the number of output frames. Call this with pOut set to NULL to +determine the required size of the output buffer. frameCountOut should be set to the capacity of pOut. If pOut is NULL, frameCountOut is ignored. A return value of 0 indicates an error. @@ -5865,16 +5865,16 @@ typedef struct ma_uint64 rangeEndInFrames; /* Set to -1 for unranged (default). */ ma_uint64 loopBegInFrames; /* Relative to rangeBegInFrames. */ ma_uint64 loopEndInFrames; /* Relative to rangeBegInFrames. Set to -1 for the end of the range. */ - ma_data_source* pCurrent; /* When non-nullptr, the data source being initialized will act as a proxy and will route all operations to pCurrent. Used in conjunction with pNext/onGetNext for seamless chaining. */ - ma_data_source* pNext; /* When set to nullptr, onGetNext will be used. */ - ma_data_source_get_next_proc onGetNext; /* Will be used when pNext is nullptr. If both are nullptr, no next will be used. */ + ma_data_source* pCurrent; /* When non-NULL, the data source being initialized will act as a proxy and will route all operations to pCurrent. Used in conjunction with pNext/onGetNext for seamless chaining. */ + ma_data_source* pNext; /* When set to NULL, onGetNext will be used. */ + ma_data_source_get_next_proc onGetNext; /* Will be used when pNext is NULL. If both are NULL, no next will be used. */ MA_ATOMIC(4, ma_bool32) isLooping; } ma_data_source_base; MA_API ma_result ma_data_source_init(const ma_data_source_config* pConfig, ma_data_source* pDataSource); MA_API void ma_data_source_uninit(ma_data_source* pDataSource); -MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); /* Must support pFramesOut = nullptr in which case a forward seek should be performed. */ -MA_API ma_result ma_data_source_seek_pcm_frames(ma_data_source* pDataSource, ma_uint64 frameCount, ma_uint64* pFramesSeeked); /* Can only seek forward. Equivalent to ma_data_source_read_pcm_frames(pDataSource, nullptr, frameCount, &framesRead); */ +MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); /* Must support pFramesOut = NULL in which case a forward seek should be performed. */ +MA_API ma_result ma_data_source_seek_pcm_frames(ma_data_source* pDataSource, ma_uint64 frameCount, ma_uint64* pFramesSeeked); /* Can only seek forward. Equivalent to ma_data_source_read_pcm_frames(pDataSource, NULL, frameCount, &framesRead); */ MA_API ma_result ma_data_source_seek_to_pcm_frame(ma_data_source* pDataSource, ma_uint64 frameIndex); MA_API ma_result ma_data_source_seek_seconds(ma_data_source* pDataSource, float secondCount, float* pSecondsSeeked); /* Can only seek forward. Abstraction to ma_data_source_seek_pcm_frames() */ MA_API ma_result ma_data_source_seek_to_second(ma_data_source* pDataSource, float seekPointInSeconds); /* Abstraction to ma_data_source_seek_to_pcm_frame() */ @@ -5928,7 +5928,7 @@ typedef struct ma_uint32 channels; ma_uint32 sampleRate; ma_uint64 sizeInFrames; - const void* pData; /* If set to nullptr, will allocate a block of memory for you. */ + const void* pData; /* If set to NULL, will allocate a block of memory for you. */ ma_allocation_callbacks allocationCallbacks; } ma_audio_buffer_config; @@ -6499,7 +6499,7 @@ struct ma_job { /*ma_resource_manager_data_stream**/ void* pDataStream; char* pFilePath; /* Allocated when the job is posted, freed by the job thread after loading. */ - wchar_t* pFilePathW; /* ^ As above ^. Only used if pFilePath is nullptr. */ + wchar_t* pFilePathW; /* ^ As above ^. Only used if pFilePath is NULL. */ ma_uint64 initialSeekPoint; ma_async_notification* pInitNotification; /* Signalled after the first two pages have been decoded and frames can be read from the stream. */ ma_fence* pInitFence; @@ -7248,7 +7248,7 @@ needs to stop and the `onContextEnumerateDevices()` function returns with a succ Detailed device information can be retrieved from a device ID using `onContextGetDeviceInfo()`. This takes as input the device type and ID, and on output returns detailed information about the device in `ma_device_info`. The `onContextGetDeviceInfo()` callback must handle the -case when the device ID is nullptr, in which case information about the default device needs to be retrieved. +case when the device ID is NULL, in which case information about the default device needs to be retrieved. Once the context has been created and the device ID retrieved (if using anything other than the default device), the device can be created. This is a little bit more complicated than initialization of the context due to its more complicated configuration. When initializing a @@ -7794,7 +7794,7 @@ struct ma_device ma_event stopEvent; ma_thread thread; ma_result workResult; /* This is set by the worker thread after it's finished doing a job. */ - ma_bool8 isOwnerOfContext; /* When set to true, uninitializing the device will also uninitialize the context. Set to true when nullptr is passed into ma_device_init(). */ + ma_bool8 isOwnerOfContext; /* When set to true, uninitializing the device will also uninitialize the context. Set to true when NULL is passed into ma_device_init(). */ ma_bool8 noPreSilencedOutputBuffer; ma_bool8 noClip; ma_bool8 noDisableDenormals; @@ -7813,7 +7813,7 @@ struct ma_device } resampling; struct { - ma_device_id* pID; /* Set to nullptr if using default ID, otherwise set to the address of "id". */ + ma_device_id* pID; /* Set to NULL if using default ID, otherwise set to the address of "id". */ ma_device_id id; /* If using an explicit device, will be set to a copy of the ID used for initialization. Otherwise cleared to 0. */ char name[MA_MAX_DEVICE_NAME_LENGTH + 1]; /* Maybe temporary. Likely to be replaced with a query API. */ ma_share_mode shareMode; /* Set to whatever was passed in when the device was initialized. */ @@ -7839,7 +7839,7 @@ struct ma_device } playback; struct { - ma_device_id* pID; /* Set to nullptr if using default ID, otherwise set to the address of "id". */ + ma_device_id* pID; /* Set to NULL if using default ID, otherwise set to the address of "id". */ ma_device_id id; /* If using an explicit device, will be set to a copy of the ID used for initialization. Otherwise cleared to 0. */ char name[MA_MAX_DEVICE_NAME_LENGTH + 1]; /* Maybe temporary. Likely to be replaced with a query API. */ ma_share_mode shareMode; /* Set to whatever was passed in when the device was initialized. */ @@ -8114,10 +8114,10 @@ device. There is one context to many devices, and a device is created from a con Parameters ---------- backends (in, optional) - A list of backends to try initializing, in priority order. Can be nullptr, in which case it uses default priority order. + A list of backends to try initializing, in priority order. Can be NULL, in which case it uses default priority order. backendCount (in, optional) - The number of items in `backend`. Ignored if `backend` is nullptr. + The number of items in `backend`. Ignored if `backend` is NULL. pConfig (in, optional) The context configuration. @@ -8138,7 +8138,7 @@ Unsafe. Do not call this function across multiple threads as some backends read Remarks ------- -When `backends` is nullptr, the default priority order will be used. Below is a list of backends in priority order: +When `backends` is NULL, the default priority order will be used. Below is a list of backends in priority order: |-------------|-----------------------|--------------------------------------------------------| | Name | Enum Name | Supported Operating Systems | @@ -8163,7 +8163,7 @@ The context can be configured via the `pConfig` argument. The config object is i can then be set directly on the structure. Below are the members of the `ma_context_config` object. pLog - A pointer to the `ma_log` to post log messages to. Can be nullptr if the application does not + A pointer to the `ma_log` to post log messages to. Can be NULL if the application does not require logging. See the `ma_log` API for details on how to use the logging system. threadPriority @@ -8265,7 +8265,7 @@ The example below shows how to initialize the context using the default configur ```c ma_context context; -ma_result result = ma_context_init(nullptr, 0, nullptr, &context); +ma_result result = ma_context_init(NULL, 0, NULL, &context); if (result != MA_SUCCESS) { // Error. } @@ -8363,7 +8363,7 @@ You can attach your own logging callback to the log with `ma_log_register_callba Return Value ------------ A pointer to the `ma_log` object that the context uses to post log messages. If some error occurs, -nullptr will be returned. +NULL will be returned. */ MA_API ma_log* ma_context_get_log(ma_context* pContext); @@ -8478,7 +8478,7 @@ Remarks ------- It is _not_ safe to assume the first device in the list is the default device. -You can pass in nullptr for the playback or capture lists in which case they'll be ignored. +You can pass in NULL for the playback or capture lists in which case they'll be ignored. The returned pointers will become invalid upon the next call this this function, or when the context is uninitialized. Do not free the returned pointers. @@ -8666,13 +8666,13 @@ Unsafe. It is not safe to call this inside any callback. Remarks ------- -Setting `pContext` to nullptr will result in miniaudio creating a default context internally and is equivalent to passing in a context initialized like so: +Setting `pContext` to NULL will result in miniaudio creating a default context internally and is equivalent to passing in a context initialized like so: ```c - ma_context_init(nullptr, 0, nullptr, &context); + ma_context_init(NULL, 0, NULL, &context); ``` -Do not set `pContext` to nullptr if you are needing to open multiple devices. You can, however, use nullptr when initializing the first device, and then use +Do not set `pContext` to NULL if you are needing to open multiple devices. You can, however, use NULL when initializing the first device, and then use device.pContext for the initialization of other devices. The device can be configured via the `pConfig` argument. The config object is initialized with `ma_device_config_init()`. Individual configuration settings can @@ -8743,7 +8743,7 @@ then be set directly on the structure. Below are the members of the `ma_device_c `MA_MAX_FILTER_ORDER`. The default value is `min(4, MA_MAX_FILTER_ORDER)`. playback.pDeviceID - A pointer to a `ma_device_id` structure containing the ID of the playback device to initialize. Setting this nullptr (default) will use the system's + A pointer to a `ma_device_id` structure containing the ID of the playback device to initialize. Setting this NULL (default) will use the system's default playback device. Retrieve the device ID from the `ma_device_info` structure, which can be retrieved using device enumeration. playback.format @@ -8764,7 +8764,7 @@ then be set directly on the structure. Below are the members of the `ma_device_c ma_share_mode_shared and reinitializing. capture.pDeviceID - A pointer to a `ma_device_id` structure containing the ID of the capture device to initialize. Setting this nullptr (default) will use the system's + A pointer to a `ma_device_id` structure containing the ID of the capture device to initialize. Setting this NULL (default) will use the system's default capture device. Retrieve the device ID from the `ma_device_info` structure, which can be retrieved using device enumeration. capture.format @@ -8890,7 +8890,7 @@ config.dataCallback = ma_data_callback; config.pMyUserData = pMyUserData; ma_device device; -ma_result result = ma_device_init(nullptr, &config, &device); +ma_result result = ma_device_init(NULL, &config, &device); if (result != MA_SUCCESS) { // Error } @@ -8905,14 +8905,14 @@ enumeration. ```c ma_context context; -ma_result result = ma_context_init(nullptr, 0, nullptr, &context); +ma_result result = ma_context_init(NULL, 0, NULL, &context); if (result != MA_SUCCESS) { // Error } ma_device_info* pPlaybackDeviceInfos; ma_uint32 playbackDeviceCount; -result = ma_context_get_devices(&context, &pPlaybackDeviceInfos, &playbackDeviceCount, nullptr, nullptr); +result = ma_context_get_devices(&context, &pPlaybackDeviceInfos, &playbackDeviceCount, NULL, NULL); if (result != MA_SUCCESS) { // Error } @@ -8958,10 +8958,10 @@ allows you to configure the internally created context. Parameters ---------- backends (in, optional) - A list of backends to try initializing, in priority order. Can be nullptr, in which case it uses default priority order. + A list of backends to try initializing, in priority order. Can be NULL, in which case it uses default priority order. backendCount (in, optional) - The number of items in `backend`. Ignored if `backend` is nullptr. + The number of items in `backend`. Ignored if `backend` is NULL. pContextConfig (in, optional) The context configuration. @@ -9131,7 +9131,7 @@ which may or may not be safe. Remarks ------- -If the name does not fully fit into the output buffer, it'll be truncated. You can pass in nullptr to +If the name does not fully fit into the output buffer, it'll be truncated. You can pass in NULL to `pName` if you want to first get the length of the name for the purpose of memory allocation of the output buffer. Allocating a buffer of size `MA_MAX_DEVICE_NAME_LENGTH + 1` should be enough for most cases and will avoid the need for the inefficiency of calling this function twice. @@ -9387,7 +9387,7 @@ volume (in) Return Value ------------ MA_SUCCESS if the volume was set successfully. -MA_INVALID_ARGS if pDevice is nullptr. +MA_INVALID_ARGS if pDevice is NULL. MA_INVALID_ARGS if volume is negative. @@ -9432,8 +9432,8 @@ pVolume (in) Return Value ------------ MA_SUCCESS if successful. -MA_INVALID_ARGS if pDevice is nullptr. -MA_INVALID_ARGS if pVolume is nullptr. +MA_INVALID_ARGS if pDevice is NULL. +MA_INVALID_ARGS if pVolume is NULL. Thread Safety @@ -9477,7 +9477,7 @@ gainDB (in) Return Value ------------ MA_SUCCESS if the volume was set successfully. -MA_INVALID_ARGS if pDevice is nullptr. +MA_INVALID_ARGS if pDevice is NULL. MA_INVALID_ARGS if the gain is > 0. @@ -9522,8 +9522,8 @@ pGainDB (in) Return Value ------------ MA_SUCCESS if successful. -MA_INVALID_ARGS if pDevice is nullptr. -MA_INVALID_ARGS if pGainDB is nullptr. +MA_INVALID_ARGS if pDevice is NULL. +MA_INVALID_ARGS if pGainDB is NULL. Thread Safety @@ -9560,12 +9560,12 @@ pDevice (in) A pointer to device whose processing the data callback. pOutput (out) - A pointer to the buffer that will receive the output PCM frame data. On a playback device this must not be nullptr. On a duplex device - this can be nullptr, in which case pInput must not be nullptr. + A pointer to the buffer that will receive the output PCM frame data. On a playback device this must not be NULL. On a duplex device + this can be NULL, in which case pInput must not be NULL. pInput (in) - A pointer to the buffer containing input PCM frame data. On a capture device this must not be nullptr. On a duplex device this can be - nullptr, in which case `pOutput` must not be nullptr. + A pointer to the buffer containing input PCM frame data. On a capture device this must not be NULL. On a duplex device this can be + NULL, in which case `pOutput` must not be NULL. frameCount (in) The number of frames being processed. @@ -9589,7 +9589,7 @@ Do not call this from the miniaudio data callback. It should only ever be called Remarks ------- -If both `pOutput` and `pInput` are nullptr, and error will be returned. In duplex scenarios, both `pOutput` and `pInput` can be non-nullptr, in +If both `pOutput` and `pInput` are NULL, and error will be returned. In duplex scenarios, both `pOutput` and `pInput` can be non-NULL, in which case `pInput` will be processed first, followed by `pOutput`. If you are implementing a custom backend, and that backend uses a callback for data delivery, you'll need to call this from inside that @@ -9674,7 +9674,7 @@ Retrieves compile-time enabled backends. Parameters ---------- pBackends (out, optional) - A pointer to the buffer that will receive the enabled backends. Set to nullptr to retrieve the backend count. Setting + A pointer to the buffer that will receive the enabled backends. Set to NULL to retrieve the backend count. Setting the capacity of the buffer to `MA_BACKEND_COUNT` will guarantee it's large enough for all backends. backendCap (in) @@ -9687,7 +9687,7 @@ pBackendCount (out) Return Value ------------ MA_SUCCESS if successful. -MA_INVALID_ARGS if `pBackendCount` is nullptr. +MA_INVALID_ARGS if `pBackendCount` is NULL. MA_NO_SPACE if the capacity of `pBackends` is not large enough. If `MA_NO_SPACE` is returned, the `pBackends` buffer will be filled with `*pBackendCount` values. @@ -9706,7 +9706,7 @@ Safe. Remarks ------- If you want to retrieve the number of backends so you can determine the capacity of `pBackends` buffer, you can call -this function with `pBackends` set to nullptr. +this function with `pBackends` set to NULL. This will also enumerate the null backend. If you don't want to include this you need to check for `ma_backend_null` when you enumerate over the returned backends and handle it appropriately. Alternatively, you can disable it at @@ -10516,7 +10516,7 @@ typedef struct size_t jobThreadStackSize; ma_uint32 jobQueueCapacity; /* The maximum number of jobs that can fit in the queue at a time. Defaults to MA_JOB_TYPE_RESOURCE_MANAGER_QUEUE_CAPACITY. Cannot be zero. */ ma_uint32 flags; - ma_vfs* pVFS; /* Can be nullptr in which case defaults will be used. */ + ma_vfs* pVFS; /* Can be NULL in which case defaults will be used. */ ma_decoding_backend_vtable** ppCustomDecodingBackendVTables; ma_uint32 customDecodingBackendCount; void* pCustomDecodingBackendUserData; @@ -11213,7 +11213,7 @@ typedef struct const char* pFilePath; /* Set this to load from the resource manager. */ const wchar_t* pFilePathW; /* Set this to load from the resource manager. */ ma_data_source* pDataSource; /* Set this to load from an existing data source. */ - ma_node* pInitialAttachment; /* If set, the sound will be attached to an input of this node. This can be set to a ma_sound. If set to nullptr, the sound will be attached directly to the endpoint unless MA_SOUND_FLAG_NO_DEFAULT_ATTACHMENT is set in `flags`. */ + ma_node* pInitialAttachment; /* If set, the sound will be attached to an input of this node. This can be set to a ma_sound. If set to NULL, the sound will be attached directly to the endpoint unless MA_SOUND_FLAG_NO_DEFAULT_ATTACHMENT is set in `flags`. */ ma_uint32 initialAttachmentInputBusIndex; /* The index of the input bus of pInitialAttachment to attach the sound to. */ ma_uint32 channelsIn; /* Ignored if using a data source as input (the data source's channel count will be used always). Otherwise, setting to 0 will cause the engine's channel count to be used. */ ma_uint32 channelsOut; /* Set this to 0 (default) to use the engine's channel count. Set to MA_SOUND_SOURCE_CHANNEL_COUNT to use the data source's channel count (only used if using a data source as input). */ @@ -11290,7 +11290,7 @@ typedef struct ma_device_data_proc dataCallback; /* Can be null. Can be used to provide a custom device data callback. */ ma_device_notification_proc notificationCallback; #endif - ma_log* pLog; /* When set to nullptr, will use the context's log. */ + ma_log* pLog; /* When set to NULL, will use the context's log. */ ma_uint32 listenerCount; /* Must be between 1 and MA_ENGINE_MAX_LISTENERS. */ ma_uint32 channels; /* The number of channels to use when mixing and spatializing. When set to 0, will use the native channel count of the device. */ ma_uint32 sampleRate; /* The sample rate. When set to 0 will use the native sample rate of the device. */ @@ -11304,7 +11304,7 @@ typedef struct ma_bool32 noAutoStart; /* When set to true, requires an explicit call to ma_engine_start(). This is false by default, meaning the engine will be started automatically in ma_engine_init(). */ ma_bool32 noDevice; /* When set to true, don't create a default device. ma_engine_read_pcm_frames() can be called manually to read data. */ ma_mono_expansion_mode monoExpansionMode; /* Controls how the mono channel should be expanded to other channels when spatialization is disabled on a sound. */ - ma_vfs* pResourceManagerVFS; /* A pointer to a pre-allocated VFS object to use with the resource manager. This is ignored if pResourceManager is not nullptr. */ + ma_vfs* pResourceManagerVFS; /* A pointer to a pre-allocated VFS object to use with the resource manager. This is ignored if pResourceManager is not NULL. */ ma_engine_process_proc onProcess; /* Fired at the end of each call to ma_engine_read_pcm_frames(). For engine's that manage their own internal device (the default configuration), this will be fired from the audio thread, and you do not need to call ma_engine_read_pcm_frames() manually in order to trigger this. */ void* pProcessUserData; /* User data that's passed into onProcess. */ ma_resampler_config resourceManagerResampling; /* The resampling config to use with the resource manager. */ @@ -12010,12 +12010,12 @@ static void ma_sleep__posix(ma_uint32 milliseconds) struct timespec ts; ts.tv_sec = milliseconds / 1000; ts.tv_nsec = milliseconds % 1000 * 1000000; - nanosleep(&ts, nullptr); + nanosleep(&ts, NULL); #else struct timeval tv; tv.tv_sec = milliseconds / 1000; tv.tv_usec = milliseconds % 1000 * 1000; - select(0, nullptr, nullptr, nullptr, &tv); + select(0, NULL, NULL, NULL, &tv); #endif #endif } @@ -12337,7 +12337,7 @@ Standard Library Stuff static MA_INLINE void ma_zero_memory_default(void* p, size_t sz) { - if (p == nullptr) { + if (p == NULL) { MA_ASSERT(sz == 0); /* If this is triggered there's an error with the calling code. */ return; } @@ -12684,7 +12684,7 @@ MA_API MA_NO_INLINE int ma_itoa_s(int value, char* dst, size_t dstSizeInBytes, i unsigned int valueU; char* dstEnd; - if (dst == nullptr || dstSizeInBytes == 0) { + if (dst == NULL || dstSizeInBytes == 0) { return 22; } if (radix < 2 || radix > 36) { @@ -12752,8 +12752,8 @@ MA_API MA_NO_INLINE int ma_strcmp(const char* str1, const char* str2) if (str1 == str2) return 0; /* These checks differ from the standard implementation. It's not important, but I prefer it just for sanity. */ - if (str1 == nullptr) return -1; - if (str2 == nullptr) return 1; + if (str1 == NULL) return -1; + if (str2 == NULL) return 1; for (;;) { if (str1[0] == '\0') { @@ -12775,8 +12775,8 @@ MA_API MA_NO_INLINE int ma_wcscmp(const wchar_t* str1, const wchar_t* str2) if (str1 == str2) return 0; /* These checks differ from the standard implementation. It's not important, but I prefer it just for sanity. */ - if (str1 == nullptr) return -1; - if (str2 == nullptr) return 1; + if (str1 == NULL) return -1; + if (str2 == NULL) return 1; for (;;) { if (str1[0] == L'\0') { @@ -12814,7 +12814,7 @@ MA_API MA_NO_INLINE size_t ma_wcslen(const wchar_t* str) { const wchar_t* end; - if (str == nullptr) { + if (str == NULL) { return 0; } @@ -12831,14 +12831,14 @@ MA_API MA_NO_INLINE char* ma_copy_string(const char* src, const ma_allocation_ca size_t sz; char* dst; - if (src == nullptr) { - return nullptr; + if (src == NULL) { + return NULL; } sz = strlen(src)+1; dst = (char*)ma_malloc(sz, pAllocationCallbacks); - if (dst == nullptr) { - return nullptr; + if (dst == NULL) { + return NULL; } ma_strcpy_s(dst, sz, src); @@ -12850,8 +12850,8 @@ MA_API MA_NO_INLINE wchar_t* ma_copy_string_w(const wchar_t* src, const ma_alloc { size_t sz = ma_wcslen(src)+1; wchar_t* dst = (wchar_t*)ma_malloc(sz * sizeof(*dst), pAllocationCallbacks); - if (dst == nullptr) { - return nullptr; + if (dst == NULL) { + return NULL; } ma_wcscpy_s(dst, sz, src); @@ -13271,11 +13271,11 @@ MA_API ma_result ma_fopen(FILE** ppFile, const char* pFilePath, const char* pOpe errno_t err; #endif - if (ppFile != nullptr) { - *ppFile = nullptr; /* Safety. */ + if (ppFile != NULL) { + *ppFile = NULL; /* Safety. */ } - if (pFilePath == nullptr || pOpenMode == nullptr || ppFile == nullptr) { + if (pFilePath == NULL || pOpenMode == NULL || ppFile == NULL) { return MA_INVALID_ARGS; } @@ -13294,10 +13294,10 @@ MA_API ma_result ma_fopen(FILE** ppFile, const char* pFilePath, const char* pOpe *ppFile = fopen(pFilePath, pOpenMode); #endif #endif - if (*ppFile == nullptr) { + if (*ppFile == NULL) { ma_result result = ma_result_from_errno(errno); if (result == MA_SUCCESS) { - result = MA_ERROR; /* Just a safety check to make sure we never ever return success when pFile == nullptr. */ + result = MA_ERROR; /* Just a safety check to make sure we never ever return success when pFile == NULL. */ } return result; @@ -13329,11 +13329,11 @@ fallback, so if you notice your compiler not detecting this properly I'm happy t MA_API ma_result ma_wfopen(FILE** ppFile, const wchar_t* pFilePath, const wchar_t* pOpenMode, const ma_allocation_callbacks* pAllocationCallbacks) { - if (ppFile != nullptr) { - *ppFile = nullptr; /* Safety. */ + if (ppFile != NULL) { + *ppFile = NULL; /* Safety. */ } - if (pFilePath == nullptr || pOpenMode == nullptr || ppFile == nullptr) { + if (pFilePath == NULL || pOpenMode == NULL || ppFile == NULL) { return MA_INVALID_ARGS; } @@ -13350,7 +13350,7 @@ MA_API ma_result ma_wfopen(FILE** ppFile, const wchar_t* pFilePath, const wchar_ #else { *ppFile = _wfopen(pFilePath, pOpenMode); - if (*ppFile == nullptr) { + if (*ppFile == NULL) { return ma_result_from_errno(errno); } } @@ -13368,18 +13368,18 @@ MA_API ma_result ma_wfopen(FILE** ppFile, const wchar_t* pFilePath, const wchar_ mbstate_t mbs; size_t lenMB; const wchar_t* pFilePathTemp = pFilePath; - char* pFilePathMB = nullptr; + char* pFilePathMB = NULL; char pOpenModeMB[32] = {0}; /* Get the length first. */ MA_ZERO_OBJECT(&mbs); - lenMB = wcsrtombs(nullptr, &pFilePathTemp, 0, &mbs); + lenMB = wcsrtombs(NULL, &pFilePathTemp, 0, &mbs); if (lenMB == (size_t)-1) { return ma_result_from_errno(errno); } pFilePathMB = (char*)ma_malloc(lenMB + 1, pAllocationCallbacks); - if (pFilePathMB == nullptr) { + if (pFilePathMB == NULL) { return MA_OUT_OF_MEMORY; } @@ -13408,11 +13408,11 @@ MA_API ma_result ma_wfopen(FILE** ppFile, const wchar_t* pFilePath, const wchar_ #else { /* Getting here means there is no way to open the file with a wide character string. */ - *ppFile = nullptr; + *ppFile = NULL; } #endif - if (*ppFile == nullptr) { + if (*ppFile == NULL) { return MA_ERROR; } @@ -13533,7 +13533,7 @@ static void ma__free_default(void* p, void* pUserData) static ma_allocation_callbacks ma_allocation_callbacks_init_default(void) { ma_allocation_callbacks callbacks; - callbacks.pUserData = nullptr; + callbacks.pUserData = NULL; callbacks.onMalloc = ma__malloc_default; callbacks.onRealloc = ma__realloc_default; callbacks.onFree = ma__free_default; @@ -13543,17 +13543,17 @@ static ma_allocation_callbacks ma_allocation_callbacks_init_default(void) static ma_result ma_allocation_callbacks_init_copy(ma_allocation_callbacks* pDst, const ma_allocation_callbacks* pSrc) { - if (pDst == nullptr) { + if (pDst == NULL) { return MA_INVALID_ARGS; } - if (pSrc == nullptr) { + if (pSrc == NULL) { *pDst = ma_allocation_callbacks_init_default(); } else { - if (pSrc->pUserData == nullptr && pSrc->onFree == nullptr && pSrc->onMalloc == nullptr && pSrc->onRealloc == nullptr) { + if (pSrc->pUserData == NULL && pSrc->onFree == NULL && pSrc->onMalloc == NULL && pSrc->onRealloc == NULL) { *pDst = ma_allocation_callbacks_init_default(); } else { - if (pSrc->onFree == nullptr || (pSrc->onMalloc == nullptr && pSrc->onRealloc == nullptr)) { + if (pSrc->onFree == NULL || (pSrc->onMalloc == NULL && pSrc->onRealloc == NULL)) { return MA_INVALID_ARGS; /* Invalid allocation callbacks. */ } else { *pDst = *pSrc; @@ -13639,7 +13639,7 @@ MA_API ma_log_callback ma_log_callback_init(ma_log_callback_proc onLog, void* pU MA_API ma_result ma_log_init(const ma_allocation_callbacks* pAllocationCallbacks, ma_log* pLog) { - if (pLog == nullptr) { + if (pLog == NULL) { return MA_INVALID_ARGS; } @@ -13659,7 +13659,7 @@ MA_API ma_result ma_log_init(const ma_allocation_callbacks* pAllocationCallbacks /* If we're using debug output, enable it. */ #if defined(MA_DEBUG_OUTPUT) { - ma_log_register_callback(pLog, ma_log_callback_init(ma_log_callback_debug, nullptr)); /* Doesn't really matter if this fails. */ + ma_log_register_callback(pLog, ma_log_callback_init(ma_log_callback_debug, NULL)); /* Doesn't really matter if this fails. */ } #endif @@ -13668,7 +13668,7 @@ MA_API ma_result ma_log_init(const ma_allocation_callbacks* pAllocationCallbacks MA_API void ma_log_uninit(ma_log* pLog) { - if (pLog == nullptr) { + if (pLog == NULL) { return; } @@ -13699,7 +13699,7 @@ MA_API ma_result ma_log_register_callback(ma_log* pLog, ma_log_callback callback { ma_result result = MA_SUCCESS; - if (pLog == nullptr || callback.onLog == nullptr) { + if (pLog == NULL || callback.onLog == NULL) { return MA_INVALID_ARGS; } @@ -13719,7 +13719,7 @@ MA_API ma_result ma_log_register_callback(ma_log* pLog, ma_log_callback callback MA_API ma_result ma_log_unregister_callback(ma_log* pLog, ma_log_callback callback) { - if (pLog == nullptr) { + if (pLog == NULL) { return MA_INVALID_ARGS; } @@ -13748,7 +13748,7 @@ MA_API ma_result ma_log_unregister_callback(ma_log* pLog, ma_log_callback callba MA_API ma_result ma_log_post(ma_log* pLog, ma_uint32 level, const char* pMessage) { - if (pLog == nullptr || pMessage == nullptr) { + if (pLog == NULL || pMessage == NULL) { return MA_INVALID_ARGS; } @@ -13778,17 +13778,17 @@ static int ma_vscprintf(const ma_allocation_callbacks* pAllocationCallbacks, con return _vscprintf(format, args); #else int result; - char* pTempBuffer = nullptr; + char* pTempBuffer = NULL; size_t tempBufferCap = 1024; - if (format == nullptr) { + if (format == NULL) { errno = EINVAL; return -1; } for (;;) { char* pNewTempBuffer = (char*)ma_realloc(pTempBuffer, tempBufferCap, pAllocationCallbacks); - if (pNewTempBuffer == nullptr) { + if (pNewTempBuffer == NULL) { ma_free(pTempBuffer, pAllocationCallbacks); errno = ENOMEM; return -1; /* Out of memory. */ @@ -13797,7 +13797,7 @@ static int ma_vscprintf(const ma_allocation_callbacks* pAllocationCallbacks, con pTempBuffer = pNewTempBuffer; result = _vsnprintf(pTempBuffer, tempBufferCap, format, args); - ma_free(pTempBuffer, nullptr); + ma_free(pTempBuffer, NULL); if (result != -1) { break; /* Got it. */ @@ -13814,7 +13814,7 @@ static int ma_vscprintf(const ma_allocation_callbacks* pAllocationCallbacks, con MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat, va_list args) { - if (pLog == nullptr || pFormat == nullptr) { + if (pLog == NULL || pFormat == NULL) { return MA_INVALID_ARGS; } @@ -13823,7 +13823,7 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat ma_result result; int length; char pFormattedMessageStack[1024]; - char* pFormattedMessageHeap = nullptr; + char* pFormattedMessageHeap = NULL; va_list args2; /* First try formatting into our fixed sized stack allocated buffer. If this is too small we'll fallback to a heap allocation. */ @@ -13843,7 +13843,7 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat } else { /* The stack buffer was too small, try the heap. */ pFormattedMessageHeap = (char*)ma_malloc(length + 1, &pLog->allocationCallbacks); - if (pFormattedMessageHeap == nullptr) { + if (pFormattedMessageHeap == NULL) { return MA_OUT_OF_MEMORY; } @@ -13870,7 +13870,7 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat { ma_result result; int formattedLen; - char* pFormattedMessage = nullptr; + char* pFormattedMessage = NULL; va_list args2; ma_va_copy(args2, args); @@ -13884,7 +13884,7 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat } pFormattedMessage = (char*)ma_malloc(formattedLen + 1, &pLog->allocationCallbacks); - if (pFormattedMessage == nullptr) { + if (pFormattedMessage == NULL) { return MA_OUT_OF_MEMORY; } @@ -13922,7 +13922,7 @@ MA_API ma_result ma_log_postf(ma_log* pLog, ma_uint32 level, const char* pFormat ma_result result; va_list args; - if (pLog == nullptr || pFormat == nullptr) { + if (pLog == NULL || pFormat == NULL) { return MA_INVALID_ARGS; } @@ -14079,7 +14079,7 @@ static ma_lcg g_maLCG = {MA_DEFAULT_LCG_SEED}; /* Non-zero initial seed. Use ma_ static MA_INLINE void ma_lcg_seed(ma_lcg* pLCG, ma_int32 seed) { - MA_ASSERT(pLCG != nullptr); + MA_ASSERT(pLCG != NULL); pLCG->state = seed; } @@ -17522,7 +17522,7 @@ Threading *******************************************************************************/ static MA_INLINE ma_result ma_spinlock_lock_ex(volatile ma_spinlock* pSpinlock, ma_bool32 yield) { - if (pSpinlock == nullptr) { + if (pSpinlock == NULL) { return MA_INVALID_ARGS; } @@ -17553,7 +17553,7 @@ MA_API ma_result ma_spinlock_lock_noyield(volatile ma_spinlock* pSpinlock) MA_API ma_result ma_spinlock_unlock(volatile ma_spinlock* pSpinlock) { - if (pSpinlock == nullptr) { + if (pSpinlock == NULL) { return MA_INVALID_ARGS; } @@ -17577,7 +17577,7 @@ typedef ma_thread_result (MA_THREADCALL * ma_thread_entry_proc)(void* pData); static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority priority, size_t stackSize, ma_thread_entry_proc entryProc, void* pData) { int result; - pthread_attr_t* pAttr = nullptr; + pthread_attr_t* pAttr = NULL; #if !defined(MA_EMSCRIPTEN) && !defined(MA_3DS) && !defined(MA_SWITCH) /* Try setting the thread priority. It's not critical if anything fails here. */ @@ -17674,7 +17674,7 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority result = pthread_create((pthread_t*)pThread, pAttr, entryProc, pData); /* The thread attributes object is no longer required. */ - if (pAttr != nullptr) { + if (pAttr != NULL) { pthread_attr_destroy(pAttr); } @@ -17702,7 +17702,7 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority static void ma_thread_wait__posix(ma_thread* pThread) { - pthread_join((pthread_t)*pThread, nullptr); + pthread_join((pthread_t)*pThread, NULL); } @@ -17710,13 +17710,13 @@ static ma_result ma_mutex_init__posix(ma_mutex* pMutex) { int result; - if (pMutex == nullptr) { + if (pMutex == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pMutex); - result = pthread_mutex_init((pthread_mutex_t*)pMutex, nullptr); + result = pthread_mutex_init((pthread_mutex_t*)pMutex, NULL); if (result != 0) { return ma_result_from_errno(result); } @@ -17744,12 +17744,12 @@ static ma_result ma_event_init__posix(ma_event* pEvent) { int result; - result = pthread_mutex_init((pthread_mutex_t*)&pEvent->lock, nullptr); + result = pthread_mutex_init((pthread_mutex_t*)&pEvent->lock, NULL); if (result != 0) { return ma_result_from_errno(result); } - result = pthread_cond_init((pthread_cond_t*)&pEvent->cond, nullptr); + result = pthread_cond_init((pthread_cond_t*)&pEvent->cond, NULL); if (result != 0) { pthread_mutex_destroy((pthread_mutex_t*)&pEvent->lock); return ma_result_from_errno(result); @@ -17796,18 +17796,18 @@ static ma_result ma_semaphore_init__posix(int initialValue, ma_semaphore* pSemap { int result; - if (pSemaphore == nullptr) { + if (pSemaphore == NULL) { return MA_INVALID_ARGS; } pSemaphore->value = initialValue; - result = pthread_mutex_init((pthread_mutex_t*)&pSemaphore->lock, nullptr); + result = pthread_mutex_init((pthread_mutex_t*)&pSemaphore->lock, NULL); if (result != 0) { return ma_result_from_errno(result); /* Failed to create mutex. */ } - result = pthread_cond_init((pthread_cond_t*)&pSemaphore->cond, nullptr); + result = pthread_cond_init((pthread_cond_t*)&pSemaphore->cond, NULL); if (result != 0) { pthread_mutex_destroy((pthread_mutex_t*)&pSemaphore->lock); return ma_result_from_errno(result); /* Failed to create condition variable. */ @@ -17818,7 +17818,7 @@ static ma_result ma_semaphore_init__posix(int initialValue, ma_semaphore* pSemap static void ma_semaphore_uninit__posix(ma_semaphore* pSemaphore) { - if (pSemaphore == nullptr) { + if (pSemaphore == NULL) { return; } @@ -17828,7 +17828,7 @@ static void ma_semaphore_uninit__posix(ma_semaphore* pSemaphore) static ma_result ma_semaphore_wait__posix(ma_semaphore* pSemaphore) { - if (pSemaphore == nullptr) { + if (pSemaphore == NULL) { return MA_INVALID_ARGS; } @@ -17848,7 +17848,7 @@ static ma_result ma_semaphore_wait__posix(ma_semaphore* pSemaphore) static ma_result ma_semaphore_release__posix(ma_semaphore* pSemaphore) { - if (pSemaphore == nullptr) { + if (pSemaphore == NULL) { return MA_INVALID_ARGS; } @@ -17880,8 +17880,8 @@ static ma_result ma_thread_create__win32(ma_thread* pThread, ma_thread_priority { DWORD threadID; /* Not used. Only used for passing into CreateThread() so it doesn't fail on Windows 98. */ - *pThread = CreateThread(nullptr, stackSize, entryProc, pData, 0, &threadID); - if (*pThread == nullptr) { + *pThread = CreateThread(NULL, stackSize, entryProc, pData, 0, &threadID); + if (*pThread == NULL) { return ma_result_from_GetLastError(GetLastError()); } @@ -17899,8 +17899,8 @@ static void ma_thread_wait__win32(ma_thread* pThread) static ma_result ma_mutex_init__win32(ma_mutex* pMutex) { - *pMutex = CreateEventA(nullptr, FALSE, TRUE, nullptr); - if (*pMutex == nullptr) { + *pMutex = CreateEventA(NULL, FALSE, TRUE, NULL); + if (*pMutex == NULL) { return ma_result_from_GetLastError(GetLastError()); } @@ -17925,8 +17925,8 @@ static void ma_mutex_unlock__win32(ma_mutex* pMutex) static ma_result ma_event_init__win32(ma_event* pEvent) { - *pEvent = CreateEventA(nullptr, FALSE, FALSE, nullptr); - if (*pEvent == nullptr) { + *pEvent = CreateEventA(NULL, FALSE, FALSE, NULL); + if (*pEvent == NULL) { return ma_result_from_GetLastError(GetLastError()); } @@ -17965,8 +17965,8 @@ static ma_result ma_event_signal__win32(ma_event* pEvent) static ma_result ma_semaphore_init__win32(int initialValue, ma_semaphore* pSemaphore) { - *pSemaphore = CreateSemaphore(nullptr, (LONG)initialValue, LONG_MAX, nullptr); - if (*pSemaphore == nullptr) { + *pSemaphore = CreateSemaphore(NULL, (LONG)initialValue, LONG_MAX, NULL); + if (*pSemaphore == NULL) { return ma_result_from_GetLastError(GetLastError()); } @@ -17994,7 +17994,7 @@ static ma_result ma_semaphore_wait__win32(ma_semaphore* pSemaphore) static ma_result ma_semaphore_release__win32(ma_semaphore* pSemaphore) { - BOOL result = ReleaseSemaphore((HANDLE)*pSemaphore, 1, nullptr); + BOOL result = ReleaseSemaphore((HANDLE)*pSemaphore, 1, NULL); if (result == 0) { return ma_result_from_GetLastError(GetLastError()); } @@ -18041,12 +18041,12 @@ static ma_result ma_thread_create(ma_thread* pThread, ma_thread_priority priorit ma_result result; ma_thread_proxy_data* pProxyData; - if (pThread == nullptr || entryProc == nullptr) { + if (pThread == NULL || entryProc == NULL) { return MA_INVALID_ARGS; } pProxyData = (ma_thread_proxy_data*)ma_malloc(sizeof(*pProxyData), pAllocationCallbacks); /* Will be freed by the proxy entry proc. */ - if (pProxyData == nullptr) { + if (pProxyData == NULL) { return MA_OUT_OF_MEMORY; } @@ -18076,7 +18076,7 @@ static ma_result ma_thread_create(ma_thread* pThread, ma_thread_priority priorit static void ma_thread_wait(ma_thread* pThread) { - if (pThread == nullptr) { + if (pThread == NULL) { return; } @@ -18090,7 +18090,7 @@ static void ma_thread_wait(ma_thread* pThread) MA_API ma_result ma_mutex_init(ma_mutex* pMutex) { - if (pMutex == nullptr) { + if (pMutex == NULL) { MA_ASSERT(MA_FALSE); /* Fire an assert so the caller is aware of this bug. */ return MA_INVALID_ARGS; } @@ -18104,7 +18104,7 @@ MA_API ma_result ma_mutex_init(ma_mutex* pMutex) MA_API void ma_mutex_uninit(ma_mutex* pMutex) { - if (pMutex == nullptr) { + if (pMutex == NULL) { return; } @@ -18117,7 +18117,7 @@ MA_API void ma_mutex_uninit(ma_mutex* pMutex) MA_API void ma_mutex_lock(ma_mutex* pMutex) { - if (pMutex == nullptr) { + if (pMutex == NULL) { MA_ASSERT(MA_FALSE); /* Fire an assert so the caller is aware of this bug. */ return; } @@ -18131,7 +18131,7 @@ MA_API void ma_mutex_lock(ma_mutex* pMutex) MA_API void ma_mutex_unlock(ma_mutex* pMutex) { - if (pMutex == nullptr) { + if (pMutex == NULL) { MA_ASSERT(MA_FALSE); /* Fire an assert so the caller is aware of this bug. */ return; } @@ -18146,7 +18146,7 @@ MA_API void ma_mutex_unlock(ma_mutex* pMutex) MA_API ma_result ma_event_init(ma_event* pEvent) { - if (pEvent == nullptr) { + if (pEvent == NULL) { MA_ASSERT(MA_FALSE); /* Fire an assert so the caller is aware of this bug. */ return MA_INVALID_ARGS; } @@ -18164,14 +18164,14 @@ static ma_result ma_event_alloc_and_init(ma_event** ppEvent, ma_allocation_callb ma_result result; ma_event* pEvent; - if (ppEvent == nullptr) { + if (ppEvent == NULL) { return MA_INVALID_ARGS; } - *ppEvent = nullptr; + *ppEvent = NULL; pEvent = ma_malloc(sizeof(*pEvent), pAllocationCallbacks); - if (pEvent == nullptr) { + if (pEvent == NULL) { return MA_OUT_OF_MEMORY; } @@ -18188,7 +18188,7 @@ static ma_result ma_event_alloc_and_init(ma_event** ppEvent, ma_allocation_callb MA_API void ma_event_uninit(ma_event* pEvent) { - if (pEvent == nullptr) { + if (pEvent == NULL) { return; } @@ -18202,7 +18202,7 @@ MA_API void ma_event_uninit(ma_event* pEvent) #if 0 static void ma_event_uninit_and_free(ma_event* pEvent, ma_allocation_callbacks* pAllocationCallbacks) { - if (pEvent == nullptr) { + if (pEvent == NULL) { return; } @@ -18213,7 +18213,7 @@ static void ma_event_uninit_and_free(ma_event* pEvent, ma_allocation_callbacks* MA_API ma_result ma_event_wait(ma_event* pEvent) { - if (pEvent == nullptr) { + if (pEvent == NULL) { MA_ASSERT(MA_FALSE); /* Fire an assert to the caller is aware of this bug. */ return MA_INVALID_ARGS; } @@ -18227,7 +18227,7 @@ MA_API ma_result ma_event_wait(ma_event* pEvent) MA_API ma_result ma_event_signal(ma_event* pEvent) { - if (pEvent == nullptr) { + if (pEvent == NULL) { MA_ASSERT(MA_FALSE); /* Fire an assert to the caller is aware of this bug. */ return MA_INVALID_ARGS; } @@ -18242,7 +18242,7 @@ MA_API ma_result ma_event_signal(ma_event* pEvent) MA_API ma_result ma_semaphore_init(int initialValue, ma_semaphore* pSemaphore) { - if (pSemaphore == nullptr) { + if (pSemaphore == NULL) { MA_ASSERT(MA_FALSE); /* Fire an assert so the caller is aware of this bug. */ return MA_INVALID_ARGS; } @@ -18256,7 +18256,7 @@ MA_API ma_result ma_semaphore_init(int initialValue, ma_semaphore* pSemaphore) MA_API void ma_semaphore_uninit(ma_semaphore* pSemaphore) { - if (pSemaphore == nullptr) { + if (pSemaphore == NULL) { MA_ASSERT(MA_FALSE); /* Fire an assert so the caller is aware of this bug. */ return; } @@ -18270,7 +18270,7 @@ MA_API void ma_semaphore_uninit(ma_semaphore* pSemaphore) MA_API ma_result ma_semaphore_wait(ma_semaphore* pSemaphore) { - if (pSemaphore == nullptr) { + if (pSemaphore == NULL) { MA_ASSERT(MA_FALSE); /* Fire an assert so the caller is aware of this bug. */ return MA_INVALID_ARGS; } @@ -18284,7 +18284,7 @@ MA_API ma_result ma_semaphore_wait(ma_semaphore* pSemaphore) MA_API ma_result ma_semaphore_release(ma_semaphore* pSemaphore) { - if (pSemaphore == nullptr) { + if (pSemaphore == NULL) { MA_ASSERT(MA_FALSE); /* Fire an assert so the caller is aware of this bug. */ return MA_INVALID_ARGS; } @@ -18308,7 +18308,7 @@ MA_API ma_result ma_semaphore_release(ma_semaphore* pSemaphore) MA_API ma_result ma_fence_init(ma_fence* pFence) { - if (pFence == nullptr) { + if (pFence == NULL) { return MA_INVALID_ARGS; } @@ -18331,7 +18331,7 @@ MA_API ma_result ma_fence_init(ma_fence* pFence) MA_API void ma_fence_uninit(ma_fence* pFence) { - if (pFence == nullptr) { + if (pFence == NULL) { return; } @@ -18346,7 +18346,7 @@ MA_API void ma_fence_uninit(ma_fence* pFence) MA_API ma_result ma_fence_acquire(ma_fence* pFence) { - if (pFence == nullptr) { + if (pFence == NULL) { return MA_INVALID_ARGS; } @@ -18376,7 +18376,7 @@ MA_API ma_result ma_fence_acquire(ma_fence* pFence) MA_API ma_result ma_fence_release(ma_fence* pFence) { - if (pFence == nullptr) { + if (pFence == NULL) { return MA_INVALID_ARGS; } @@ -18413,7 +18413,7 @@ MA_API ma_result ma_fence_release(ma_fence* pFence) MA_API ma_result ma_fence_wait(ma_fence* pFence) { - if (pFence == nullptr) { + if (pFence == NULL) { return MA_INVALID_ARGS; } @@ -18451,11 +18451,11 @@ MA_API ma_result ma_async_notification_signal(ma_async_notification* pNotificati { ma_async_notification_callbacks* pNotificationCallbacks = (ma_async_notification_callbacks*)pNotification; - if (pNotification == nullptr) { + if (pNotification == NULL) { return MA_INVALID_ARGS; } - if (pNotificationCallbacks->onSignal == nullptr) { + if (pNotificationCallbacks->onSignal == NULL) { return MA_NOT_IMPLEMENTED; } @@ -18471,7 +18471,7 @@ static void ma_async_notification_poll__on_signal(ma_async_notification* pNotifi MA_API ma_result ma_async_notification_poll_init(ma_async_notification_poll* pNotificationPoll) { - if (pNotificationPoll == nullptr) { + if (pNotificationPoll == NULL) { return MA_INVALID_ARGS; } @@ -18483,7 +18483,7 @@ MA_API ma_result ma_async_notification_poll_init(ma_async_notification_poll* pNo MA_API ma_bool32 ma_async_notification_poll_is_signalled(const ma_async_notification_poll* pNotificationPoll) { - if (pNotificationPoll == nullptr) { + if (pNotificationPoll == NULL) { return MA_FALSE; } @@ -18498,7 +18498,7 @@ static void ma_async_notification_event__on_signal(ma_async_notification* pNotif MA_API ma_result ma_async_notification_event_init(ma_async_notification_event* pNotificationEvent) { - if (pNotificationEvent == nullptr) { + if (pNotificationEvent == NULL) { return MA_INVALID_ARGS; } @@ -18524,7 +18524,7 @@ MA_API ma_result ma_async_notification_event_init(ma_async_notification_event* p MA_API ma_result ma_async_notification_event_uninit(ma_async_notification_event* pNotificationEvent) { - if (pNotificationEvent == nullptr) { + if (pNotificationEvent == NULL) { return MA_INVALID_ARGS; } @@ -18542,7 +18542,7 @@ MA_API ma_result ma_async_notification_event_uninit(ma_async_notification_event* MA_API ma_result ma_async_notification_event_wait(ma_async_notification_event* pNotificationEvent) { - if (pNotificationEvent == nullptr) { + if (pNotificationEvent == NULL) { return MA_INVALID_ARGS; } @@ -18559,7 +18559,7 @@ MA_API ma_result ma_async_notification_event_wait(ma_async_notification_event* p MA_API ma_result ma_async_notification_event_signal(ma_async_notification_event* pNotificationEvent) { - if (pNotificationEvent == nullptr) { + if (pNotificationEvent == NULL) { return MA_INVALID_ARGS; } @@ -18617,11 +18617,11 @@ typedef struct static ma_result ma_slot_allocator_get_heap_layout(const ma_slot_allocator_config* pConfig, ma_slot_allocator_heap_layout* pHeapLayout) { - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -18647,7 +18647,7 @@ MA_API ma_result ma_slot_allocator_get_heap_size(const ma_slot_allocator_config* ma_result result; ma_slot_allocator_heap_layout layout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -18668,13 +18668,13 @@ MA_API ma_result ma_slot_allocator_init_preallocated(const ma_slot_allocator_con ma_result result; ma_slot_allocator_heap_layout heapLayout; - if (pAllocator == nullptr) { + if (pAllocator == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pAllocator); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_INVALID_ARGS; } @@ -18706,11 +18706,11 @@ MA_API ma_result ma_slot_allocator_init(const ma_slot_allocator_config* pConfig, if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_slot_allocator_init_preallocated(pConfig, pHeap, pAllocator); @@ -18725,7 +18725,7 @@ MA_API ma_result ma_slot_allocator_init(const ma_slot_allocator_config* pConfig, MA_API void ma_slot_allocator_uninit(ma_slot_allocator* pAllocator, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocator == nullptr) { + if (pAllocator == NULL) { return; } @@ -18739,7 +18739,7 @@ MA_API ma_result ma_slot_allocator_alloc(ma_slot_allocator* pAllocator, ma_uint6 ma_uint32 iAttempt; const ma_uint32 maxAttempts = 2; /* The number of iterations to perform until returning MA_OUT_OF_MEMORY if no slots can be found. */ - if (pAllocator == nullptr || pSlot == nullptr) { + if (pAllocator == NULL || pSlot == NULL) { return MA_INVALID_ARGS; } @@ -18805,7 +18805,7 @@ MA_API ma_result ma_slot_allocator_free(ma_slot_allocator* pAllocator, ma_uint64 ma_uint32 iGroup; ma_uint32 iBit; - if (pAllocator == nullptr) { + if (pAllocator == NULL) { return MA_INVALID_ARGS; } @@ -18936,7 +18936,7 @@ static ma_job_proc g_jobVTable[MA_JOB_TYPE_COUNT] = MA_API ma_result ma_job_process(ma_job* pJob) { - if (pJob == nullptr) { + if (pJob == NULL) { return MA_INVALID_ARGS; } @@ -18949,7 +18949,7 @@ MA_API ma_result ma_job_process(ma_job* pJob) static ma_result ma_job_process__noop(ma_job* pJob) { - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); /* No-op. */ (void)pJob; @@ -18964,10 +18964,10 @@ static ma_result ma_job_process__quit(ma_job* pJob) static ma_result ma_job_process__custom(ma_job* pJob) { - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); /* No-op if there's no callback. */ - if (pJob->data.custom.proc == nullptr) { + if (pJob->data.custom.proc == NULL) { return MA_SUCCESS; } @@ -18998,11 +18998,11 @@ static ma_result ma_job_queue_get_heap_layout(const ma_job_queue_config* pConfig { ma_result result; - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -19039,7 +19039,7 @@ MA_API ma_result ma_job_queue_get_heap_size(const ma_job_queue_config* pConfig, ma_result result; ma_job_queue_heap_layout layout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -19061,7 +19061,7 @@ MA_API ma_result ma_job_queue_init_preallocated(const ma_job_queue_config* pConf ma_job_queue_heap_layout heapLayout; ma_slot_allocator_config allocatorConfig; - if (pQueue == nullptr) { + if (pQueue == NULL) { return MA_INVALID_ARGS; } @@ -19123,11 +19123,11 @@ MA_API ma_result ma_job_queue_init(const ma_job_queue_config* pConfig, const ma_ if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_job_queue_init_preallocated(pConfig, pHeap, pQueue); @@ -19142,7 +19142,7 @@ MA_API ma_result ma_job_queue_init(const ma_job_queue_config* pConfig, const ma_ MA_API void ma_job_queue_uninit(ma_job_queue* pQueue, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pQueue == nullptr) { + if (pQueue == NULL) { return; } @@ -19182,7 +19182,7 @@ MA_API ma_result ma_job_queue_post(ma_job_queue* pQueue, const ma_job* pJob) ma_uint64 tail; ma_uint64 next; - if (pQueue == nullptr || pJob == nullptr) { + if (pQueue == NULL || pJob == NULL) { return MA_INVALID_ARGS; } @@ -19249,7 +19249,7 @@ MA_API ma_result ma_job_queue_next(ma_job_queue* pQueue, ma_job* pJob) ma_uint64 tail; ma_uint64 next; - if (pQueue == nullptr || pJob == nullptr) { + if (pQueue == NULL || pJob == NULL) { return MA_INVALID_ARGS; } @@ -19359,7 +19359,7 @@ MA_API ma_handle ma_dlopen(ma_log* pLog, const char* filename) /* *sigh* It appears there is no ANSI version of LoadPackagedLibrary()... */ WCHAR filenameW[4096]; if (MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, sizeof(filenameW)) == 0) { - handle = nullptr; + handle = NULL; } else { handle = (ma_handle)LoadPackagedLibrary(filenameW, 0); } @@ -19372,7 +19372,7 @@ MA_API ma_handle ma_dlopen(ma_log* pLog, const char* filename) I'm not considering failure to load a library an error nor a warning because seamlessly falling through to a lower-priority backend is a deliberate design choice. Instead I'm logging it as an informational message. */ - if (handle == nullptr) { + if (handle == NULL) { ma_log_postf(pLog, MA_LOG_LEVEL_INFO, "Failed to load library: %s\n", filename); } @@ -19383,7 +19383,7 @@ MA_API ma_handle ma_dlopen(ma_log* pLog, const char* filename) /* Runtime linking is disabled. */ (void)pLog; (void)filename; - return nullptr; + return NULL; } #endif } @@ -19447,7 +19447,7 @@ MA_API ma_proc ma_dlsym(ma_log* pLog, ma_handle handle, const char* symbol) } #endif - if (proc == nullptr) { + if (proc == NULL) { ma_log_postf(pLog, MA_LOG_LEVEL_WARNING, "Failed to load symbol: %s\n", symbol); } @@ -19460,7 +19460,7 @@ MA_API ma_proc ma_dlsym(ma_log* pLog, ma_handle handle, const char* symbol) (void)pLog; (void)handle; (void)symbol; - return nullptr; + return NULL; } #endif } @@ -19498,7 +19498,7 @@ DEVICE I/O MA_API void ma_device_info_add_native_data_format(ma_device_info* pDeviceInfo, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_uint32 flags) { - if (pDeviceInfo == nullptr) { + if (pDeviceInfo == NULL) { return; } @@ -19550,13 +19550,13 @@ MA_API ma_result ma_get_backend_from_name(const char* pBackendName, ma_backend* { size_t iBackend; - if (pBackendName == nullptr) { + if (pBackendName == NULL) { return MA_INVALID_ARGS; } for (iBackend = 0; iBackend < ma_countof(gBackendInfo); iBackend += 1) { if (ma_strcmp(pBackendName, gBackendInfo[iBackend].pName) == 0) { - if (pBackend != nullptr) { + if (pBackend != NULL) { *pBackend = gBackendInfo[iBackend].backend; } @@ -19689,7 +19689,7 @@ MA_API ma_result ma_get_enabled_backends(ma_backend* pBackends, size_t backendCa size_t iBackend; ma_result result = MA_SUCCESS; - if (pBackendCount == nullptr) { + if (pBackendCount == NULL) { return MA_INVALID_ARGS; } @@ -19710,7 +19710,7 @@ MA_API ma_result ma_get_enabled_backends(ma_backend* pBackends, size_t backendCa } } - if (pBackendCount != nullptr) { + if (pBackendCount != NULL) { *pBackendCount = backendCount; } @@ -20107,7 +20107,7 @@ Timing static MA_INLINE void ma_timer_init(ma_timer* pTimer) { struct timeval newTime; - gettimeofday(&newTime, nullptr); + gettimeofday(&newTime, NULL); pTimer->counter = ((ma_int64)newTime.tv_sec * 1000000) + newTime.tv_usec; } @@ -20118,7 +20118,7 @@ Timing ma_uint64 oldTimeCounter; struct timeval newTime; - gettimeofday(&newTime, nullptr); + gettimeofday(&newTime, NULL); newTimeCounter = ((ma_uint64)newTime.tv_sec * 1000000) + newTime.tv_usec; oldTimeCounter = pTimer->counter; @@ -20164,7 +20164,7 @@ static ma_uint32 ma_get_closest_standard_sample_rate(ma_uint32 sampleRateIn) static MA_INLINE unsigned int ma_device_disable_denormals(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (!pDevice->noDisableDenormals) { return ma_disable_denormals(); @@ -20175,7 +20175,7 @@ static MA_INLINE unsigned int ma_device_disable_denormals(ma_device* pDevice) static MA_INLINE void ma_device_restore_denormals(ma_device* pDevice, unsigned int prevState) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (!pDevice->noDisableDenormals) { ma_restore_denormals(prevState); @@ -20198,14 +20198,14 @@ static ma_device_notification ma_device_notification_init(ma_device* pDevice, ma static void ma_device__on_notification(ma_device_notification notification) { - MA_ASSERT(notification.pDevice != nullptr); + MA_ASSERT(notification.pDevice != NULL); - if (notification.pDevice->onNotification != nullptr) { + if (notification.pDevice->onNotification != NULL) { notification.pDevice->onNotification(¬ification); } /* TEMP FOR COMPATIBILITY: If it's a stopped notification, fire the onStop callback as well. This is only for backwards compatibility and will be removed. */ - if (notification.pDevice->onStop != nullptr && notification.type == ma_device_notification_type_stopped) { + if (notification.pDevice->onStop != NULL && notification.type == ma_device_notification_type_stopped) { notification.pDevice->onStop(notification.pDevice); } } @@ -20244,10 +20244,10 @@ void EMSCRIPTEN_KEEPALIVE ma_device__on_notification_unlocked(ma_device* pDevice static void ma_device__on_data_inner(ma_device* pDevice, void* pFramesOut, const void* pFramesIn, ma_uint32 frameCount) { - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pDevice->onData != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pDevice->onData != NULL); - if (!pDevice->noPreSilencedOutputBuffer && pFramesOut != nullptr) { + if (!pDevice->noPreSilencedOutputBuffer && pFramesOut != NULL) { ma_silence_pcm_frames(pFramesOut, frameCount, pDevice->playback.format, pDevice->playback.channels); } @@ -20256,7 +20256,7 @@ static void ma_device__on_data_inner(ma_device* pDevice, void* pFramesOut, const static void ma_device__on_data(ma_device* pDevice, void* pFramesOut, const void* pFramesIn, ma_uint32 frameCount) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* Don't read more data from the client if we're in the process of stopping. */ if (ma_device_get_state(pDevice) == ma_device_state_stopping) { @@ -20274,7 +20274,7 @@ static void ma_device__on_data(ma_device* pDevice, void* pFramesOut, const void* ma_uint32 totalFramesRemaining = frameCount - totalFramesProcessed; ma_uint32 framesToProcessThisIteration = 0; - if (pFramesIn != nullptr) { + if (pFramesIn != NULL) { /* Capturing. Write to the intermediary buffer. If there's no room, fire the callback to empty it. */ if (pDevice->capture.intermediaryBufferLen < pDevice->capture.intermediaryBufferCap) { /* There's some room left in the intermediary buffer. Write to it without firing the callback. */ @@ -20297,7 +20297,7 @@ static void ma_device__on_data(ma_device* pDevice, void* pFramesOut, const void* if (pDevice->type == ma_device_type_duplex) { /* We'll do the duplex data callback later after we've processed the playback data. */ } else { - ma_device__on_data_inner(pDevice, nullptr, pDevice->capture.pIntermediaryBuffer, pDevice->capture.intermediaryBufferCap); + ma_device__on_data_inner(pDevice, NULL, pDevice->capture.pIntermediaryBuffer, pDevice->capture.intermediaryBufferCap); /* The intermediary buffer has just been drained. */ pDevice->capture.intermediaryBufferLen = 0; @@ -20305,7 +20305,7 @@ static void ma_device__on_data(ma_device* pDevice, void* pFramesOut, const void* } } - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { /* Playing back. Read from the intermediary buffer. If there's nothing in it, fire the callback to fill it. */ if (pDevice->playback.intermediaryBufferLen > 0) { /* There's some content in the intermediary buffer. Read from that without firing the callback. */ @@ -20332,7 +20332,7 @@ static void ma_device__on_data(ma_device* pDevice, void* pFramesOut, const void* if (pDevice->type == ma_device_type_duplex) { /* In duplex mode, the data callback will be fired later. Nothing to do here. */ } else { - ma_device__on_data_inner(pDevice, pDevice->playback.pIntermediaryBuffer, nullptr, pDevice->playback.intermediaryBufferCap); + ma_device__on_data_inner(pDevice, pDevice->playback.pIntermediaryBuffer, NULL, pDevice->playback.intermediaryBufferCap); /* The intermediary buffer has just been filled. */ pDevice->playback.intermediaryBufferLen = pDevice->playback.intermediaryBufferCap; @@ -20366,7 +20366,7 @@ static void ma_device__handle_data_callback(ma_device* pDevice, void* pFramesOut unsigned int prevDenormalState = ma_device_disable_denormals(pDevice); { /* Volume control of input makes things a bit awkward because the input buffer is read-only. We'll need to use a temp buffer and loop in this case. */ - if (pFramesIn != nullptr && masterVolumeFactor != 1) { + if (pFramesIn != NULL && masterVolumeFactor != 1) { ma_uint8 tempFramesIn[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; ma_uint32 bpfCapture = ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels); ma_uint32 bpfPlayback = ma_get_bytes_per_frame(pDevice->playback.format, pDevice->playback.channels); @@ -20388,9 +20388,9 @@ static void ma_device__handle_data_callback(ma_device* pDevice, void* pFramesOut } /* Volume control and clipping for playback devices. */ - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { if (masterVolumeFactor != 1) { - if (pFramesIn == nullptr) { /* <-- In full-duplex situations, the volume will have been applied to the input samples before the data callback. Applying it again post-callback will incorrectly compound it. */ + if (pFramesIn == NULL) { /* <-- In full-duplex situations, the volume will have been applied to the input samples before the data callback. Applying it again post-callback will incorrectly compound it. */ ma_apply_volume_factor_pcm_frames(pFramesOut, frameCount, pDevice->playback.format, pDevice->playback.channels, masterVolumeFactor); } } @@ -20403,7 +20403,7 @@ static void ma_device__handle_data_callback(ma_device* pDevice, void* pFramesOut ma_device_restore_denormals(pDevice, prevDenormalState); } else { /* No data callback. Just silence the output. */ - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { ma_silence_pcm_frames(pFramesOut, frameCount, pDevice->playback.format, pDevice->playback.channels); } } @@ -20414,12 +20414,12 @@ static void ma_device__handle_data_callback(ma_device* pDevice, void* pFramesOut /* A helper function for reading sample data from the client. */ static void ma_device__read_frames_from_client(ma_device* pDevice, ma_uint32 frameCount, void* pFramesOut) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ASSERT(frameCount > 0); - MA_ASSERT(pFramesOut != nullptr); + MA_ASSERT(pFramesOut != NULL); if (pDevice->playback.converter.isPassthrough) { - ma_device__handle_data_callback(pDevice, pFramesOut, nullptr, frameCount); + ma_device__handle_data_callback(pDevice, pFramesOut, NULL, frameCount); } else { ma_result result; ma_uint64 totalFramesReadOut; @@ -20433,7 +20433,7 @@ static void ma_device__read_frames_from_client(ma_device* pDevice, ma_uint32 fra buffer for caching input data. This will be the case if the data converter does not have the ability to retrieve the required input frame count for a given output frame count. */ - if (pDevice->playback.pInputCache != nullptr) { + if (pDevice->playback.pInputCache != NULL) { while (totalFramesReadOut < frameCount) { ma_uint64 framesToReadThisIterationIn; ma_uint64 framesToReadThisIterationOut; @@ -20464,7 +20464,7 @@ static void ma_device__read_frames_from_client(ma_device* pDevice, ma_uint32 fra /* Getting here means there's no data in the cache and we need to fill it up with data from the client. */ if (pDevice->playback.inputCacheRemaining == 0) { - ma_device__handle_data_callback(pDevice, pDevice->playback.pInputCache, nullptr, (ma_uint32)pDevice->playback.inputCacheCap); + ma_device__handle_data_callback(pDevice, pDevice->playback.pInputCache, NULL, (ma_uint32)pDevice->playback.inputCacheCap); pDevice->playback.inputCacheConsumed = 0; pDevice->playback.inputCacheRemaining = pDevice->playback.inputCacheCap; @@ -20491,7 +20491,7 @@ static void ma_device__read_frames_from_client(ma_device* pDevice, ma_uint32 fra framesToReadThisIterationIn = requiredInputFrameCount; } - ma_device__handle_data_callback(pDevice, pIntermediaryBuffer, nullptr, (ma_uint32)framesToReadThisIterationIn); + ma_device__handle_data_callback(pDevice, pIntermediaryBuffer, NULL, (ma_uint32)framesToReadThisIterationIn); /* At this point we have our decoded data in input format and now we need to convert to output format. Note that even if we didn't read any @@ -20518,12 +20518,12 @@ static void ma_device__read_frames_from_client(ma_device* pDevice, ma_uint32 fra /* A helper for sending sample data to the client. */ static void ma_device__send_frames_to_client(ma_device* pDevice, ma_uint32 frameCountInDeviceFormat, const void* pFramesInDeviceFormat) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ASSERT(frameCountInDeviceFormat > 0); - MA_ASSERT(pFramesInDeviceFormat != nullptr); + MA_ASSERT(pFramesInDeviceFormat != NULL); if (pDevice->capture.converter.isPassthrough) { - ma_device__handle_data_callback(pDevice, nullptr, pFramesInDeviceFormat, frameCountInDeviceFormat); + ma_device__handle_data_callback(pDevice, NULL, pFramesInDeviceFormat, frameCountInDeviceFormat); } else { ma_result result; ma_uint8 pFramesInClientFormat[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; @@ -20546,7 +20546,7 @@ static void ma_device__send_frames_to_client(ma_device* pDevice, ma_uint32 frame } if (clientFramesProcessedThisIteration > 0) { - ma_device__handle_data_callback(pDevice, nullptr, pFramesInClientFormat, (ma_uint32)clientFramesProcessedThisIteration); /* Safe cast. */ + ma_device__handle_data_callback(pDevice, NULL, pFramesInClientFormat, (ma_uint32)clientFramesProcessedThisIteration); /* Safe cast. */ } pRunningFramesInDeviceFormat = ma_offset_ptr(pRunningFramesInDeviceFormat, deviceFramesProcessedThisIteration * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels)); @@ -20569,10 +20569,10 @@ static ma_result ma_device__handle_duplex_callback_capture(ma_device* pDevice, m ma_uint32 totalDeviceFramesProcessed = 0; const void* pRunningFramesInDeviceFormat = pFramesInDeviceFormat; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ASSERT(frameCountInDeviceFormat > 0); - MA_ASSERT(pFramesInDeviceFormat != nullptr); - MA_ASSERT(pRB != nullptr); + MA_ASSERT(pFramesInDeviceFormat != NULL); + MA_ASSERT(pRB != NULL); /* Write to the ring buffer. The ring buffer is in the client format which means we need to convert. */ for (;;) { @@ -20626,11 +20626,11 @@ static ma_result ma_device__handle_duplex_callback_playback(ma_device* pDevice, ma_uint8 silentInputFrames[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; ma_uint32 totalFramesReadOut = 0; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ASSERT(frameCount > 0); - MA_ASSERT(pFramesInInternalFormat != nullptr); - MA_ASSERT(pRB != nullptr); - MA_ASSERT(pDevice->playback.pInputCache != nullptr); + MA_ASSERT(pFramesInInternalFormat != NULL); + MA_ASSERT(pRB != NULL); + MA_ASSERT(pDevice->playback.pInputCache != NULL); /* Sitting in the ring buffer should be captured data from the capture callback in external format. If there's not enough data in there for @@ -20714,7 +20714,7 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d static ma_bool32 ma_device_descriptor_is_valid(const ma_device_descriptor* pDeviceDescriptor) { - if (pDeviceDescriptor == nullptr) { + if (pDeviceDescriptor == NULL) { return MA_FALSE; } @@ -20743,11 +20743,11 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice) ma_uint32 capturedDeviceDataCapInFrames = 0; ma_uint32 playbackDeviceDataCapInFrames = 0; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* Just some quick validation on the device type and the available callbacks. */ if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex || pDevice->type == ma_device_type_loopback) { - if (pDevice->pContext->callbacks.onDeviceRead == nullptr) { + if (pDevice->pContext->callbacks.onDeviceRead == NULL) { return MA_NOT_IMPLEMENTED; } @@ -20755,7 +20755,7 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice) } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - if (pDevice->pContext->callbacks.onDeviceWrite == nullptr) { + if (pDevice->pContext->callbacks.onDeviceWrite == NULL) { return MA_NOT_IMPLEMENTED; } @@ -20828,7 +20828,7 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice) break; } - result = pDevice->pContext->callbacks.onDeviceWrite(pDevice, playbackDeviceData, (ma_uint32)convertedDeviceFrameCount, nullptr); /* Safe cast. */ + result = pDevice->pContext->callbacks.onDeviceWrite(pDevice, playbackDeviceData, (ma_uint32)convertedDeviceFrameCount, NULL); /* Safe cast. */ if (result != MA_SUCCESS) { exitLoop = MA_TRUE; break; @@ -20941,7 +20941,7 @@ Null Backend static ma_thread_result MA_THREADCALL ma_device_thread__null(void* pData) { ma_device* pDevice = (ma_device*)pData; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); for (;;) { /* Keep the thread alive until the device is uninitialized. */ ma_uint32 operation; @@ -21052,14 +21052,14 @@ static ma_result ma_context_enumerate_devices__null(ma_context* pContext, ma_enu { ma_bool32 cbResult = MA_TRUE; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); /* Playback. */ if (cbResult) { ma_device_info deviceInfo; MA_ZERO_OBJECT(&deviceInfo); - ma_strncpy_s(deviceInfo.name, sizeof(deviceInfo.name), "nullptr Playback Device", (size_t)-1); + ma_strncpy_s(deviceInfo.name, sizeof(deviceInfo.name), "NULL Playback Device", (size_t)-1); deviceInfo.isDefault = MA_TRUE; /* Only one playback and capture device for the null backend, so might as well mark as default. */ cbResult = callback(pContext, ma_device_type_playback, &deviceInfo, pUserData); } @@ -21068,7 +21068,7 @@ static ma_result ma_context_enumerate_devices__null(ma_context* pContext, ma_enu if (cbResult) { ma_device_info deviceInfo; MA_ZERO_OBJECT(&deviceInfo); - ma_strncpy_s(deviceInfo.name, sizeof(deviceInfo.name), "nullptr Capture Device", (size_t)-1); + ma_strncpy_s(deviceInfo.name, sizeof(deviceInfo.name), "NULL Capture Device", (size_t)-1); deviceInfo.isDefault = MA_TRUE; /* Only one playback and capture device for the null backend, so might as well mark as default. */ cbResult = callback(pContext, ma_device_type_capture, &deviceInfo, pUserData); } @@ -21080,17 +21080,17 @@ static ma_result ma_context_enumerate_devices__null(ma_context* pContext, ma_enu static ma_result ma_context_get_device_info__null(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); - if (pDeviceID != nullptr && pDeviceID->nullbackend != 0) { + if (pDeviceID != NULL && pDeviceID->nullbackend != 0) { return MA_NO_DEVICE; /* Don't know the device. */ } /* Name / Description */ if (deviceType == ma_device_type_playback) { - ma_strncpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), "nullptr Playback Device", (size_t)-1); + ma_strncpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), "NULL Playback Device", (size_t)-1); } else { - ma_strncpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), "nullptr Capture Device", (size_t)-1); + ma_strncpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), "NULL Capture Device", (size_t)-1); } pDeviceInfo->isDefault = MA_TRUE; /* Only one playback and capture device for the null backend, so might as well mark as default. */ @@ -21109,7 +21109,7 @@ static ma_result ma_context_get_device_info__null(ma_context* pContext, ma_devic static ma_result ma_device_uninit__null(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* Keep it clean and wait for the device thread to finish before returning. */ ma_device_do_operation__null(pDevice, MA_DEVICE_OP_KILL__NULL); @@ -21129,7 +21129,7 @@ static ma_result ma_device_init__null(ma_device* pDevice, const ma_device_config { ma_result result; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ZERO_OBJECT(&pDevice->null_device); @@ -21191,7 +21191,7 @@ static ma_result ma_device_init__null(ma_device* pDevice, const ma_device_config static ma_result ma_device_start__null(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); ma_device_do_operation__null(pDevice, MA_DEVICE_OP_START__NULL); @@ -21201,7 +21201,7 @@ static ma_result ma_device_start__null(ma_device* pDevice) static ma_result ma_device_stop__null(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); ma_device_do_operation__null(pDevice, MA_DEVICE_OP_SUSPEND__NULL); @@ -21211,7 +21211,7 @@ static ma_result ma_device_stop__null(ma_device* pDevice) static ma_bool32 ma_device_is_started__null(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); return ma_atomic_bool32_get(&pDevice->null_device.isStarted); } @@ -21222,7 +21222,7 @@ static ma_result ma_device_write__null(ma_device* pDevice, const void* pPCMFrame ma_uint32 totalPCMFramesProcessed; ma_bool32 wasStartedOnEntry; - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = 0; } @@ -21289,7 +21289,7 @@ static ma_result ma_device_write__null(ma_device* pDevice, const void* pPCMFrame pDevice->null_device.currentPeriodFramesRemainingPlayback = pDevice->playback.internalPeriodSizeInFrames; } - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = totalPCMFramesProcessed; } @@ -21301,7 +21301,7 @@ static ma_result ma_device_read__null(ma_device* pDevice, void* pPCMFrames, ma_u ma_result result = MA_SUCCESS; ma_uint32 totalPCMFramesProcessed; - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -21360,7 +21360,7 @@ static ma_result ma_device_read__null(ma_device* pDevice, void* pPCMFrames, ma_u pDevice->null_device.currentPeriodFramesRemainingCapture = pDevice->capture.internalPeriodSizeInFrames; } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalPCMFramesProcessed; } @@ -21369,7 +21369,7 @@ static ma_result ma_device_read__null(ma_device* pDevice, void* pPCMFrames, ma_u static ma_result ma_context_uninit__null(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_null); (void)pContext; @@ -21378,7 +21378,7 @@ static ma_result ma_context_uninit__null(ma_context* pContext) static ma_result ma_context_init__null(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); (void)pConfig; (void)pContext; @@ -21393,7 +21393,7 @@ static ma_result ma_context_init__null(ma_context* pContext, const ma_context_co pCallbacks->onDeviceStop = ma_device_stop__null; pCallbacks->onDeviceRead = ma_device_read__null; pCallbacks->onDeviceWrite = ma_device_write__null; - pCallbacks->onDeviceDataLoop = nullptr; /* Our backend is asynchronous with a blocking read-write API which means we can get miniaudio to deal with the audio thread. */ + pCallbacks->onDeviceDataLoop = NULL; /* Our backend is asynchronous with a blocking read-write API which means we can get miniaudio to deal with the audio thread. */ /* The null backend always works. */ return MA_SUCCESS; @@ -21637,7 +21637,7 @@ static MA_INLINE ma_bool32 ma_is_guid_null(const void* guid) static ma_format ma_format_from_WAVEFORMATEX(const MA_WAVEFORMATEX* pWF) { - MA_ASSERT(pWF != nullptr); + MA_ASSERT(pWF != NULL); if (pWF->wFormatTag == WAVE_FORMAT_EXTENSIBLE) { const MA_WAVEFORMATEXTENSIBLE* pWFEX = (const MA_WAVEFORMATEXTENSIBLE*)pWF; @@ -22262,7 +22262,7 @@ static HRESULT STDMETHODCALLTYPE ma_completion_handler_uwp_QueryInterface(ma_com "implement" this, we just make sure we return pThis when the IAgileObject is requested. */ if (!ma_is_guid_equal(riid, &MA_IID_IUnknown) && !ma_is_guid_equal(riid, &MA_IID_IActivateAudioInterfaceCompletionHandler) && !ma_is_guid_equal(riid, &MA_IID_IAgileObject)) { - *ppObject = nullptr; + *ppObject = NULL; return E_NOINTERFACE; } @@ -22304,13 +22304,13 @@ static ma_completion_handler_uwp_vtbl g_maCompletionHandlerVtblInstance = { static ma_result ma_completion_handler_uwp_init(ma_completion_handler_uwp* pHandler) { - MA_ASSERT(pHandler != nullptr); + MA_ASSERT(pHandler != NULL); MA_ZERO_OBJECT(pHandler); pHandler->lpVtbl = &g_maCompletionHandlerVtblInstance; pHandler->counter = 1; - pHandler->hEvent = CreateEventA(nullptr, FALSE, FALSE, nullptr); - if (pHandler->hEvent == nullptr) { + pHandler->hEvent = CreateEventA(NULL, FALSE, FALSE, NULL); + if (pHandler->hEvent == NULL) { return ma_result_from_GetLastError(GetLastError()); } @@ -22319,7 +22319,7 @@ static ma_result ma_completion_handler_uwp_init(ma_completion_handler_uwp* pHand static void ma_completion_handler_uwp_uninit(ma_completion_handler_uwp* pHandler) { - if (pHandler->hEvent != nullptr) { + if (pHandler->hEvent != NULL) { CloseHandle(pHandler->hEvent); } } @@ -22339,7 +22339,7 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_QueryInterface(ma_IMMN we just return E_NOINTERFACE. Otherwise we need to increment the reference counter and return S_OK. */ if (!ma_is_guid_equal(riid, &MA_IID_IUnknown) && !ma_is_guid_equal(riid, &MA_IID_IMMNotificationClient)) { - *ppObject = nullptr; + *ppObject = NULL; return E_NOINTERFACE; } @@ -22371,7 +22371,7 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDeviceStateChanged(m ma_bool32 isPlayback = MA_FALSE; #ifdef MA_DEBUG_OUTPUT - /*ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "IMMNotificationClient_OnDeviceStateChanged(pDeviceID=%S, dwNewState=%u)\n", (pDeviceID != nullptr) ? pDeviceID : L"(nullptr)", (unsigned int)dwNewState);*/ + /*ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "IMMNotificationClient_OnDeviceStateChanged(pDeviceID=%S, dwNewState=%u)\n", (pDeviceID != NULL) ? pDeviceID : L"(NULL)", (unsigned int)dwNewState);*/ #endif /* @@ -22451,7 +22451,7 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDeviceStateChanged(m static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDeviceAdded(ma_IMMNotificationClient* pThis, const WCHAR* pDeviceID) { #ifdef MA_DEBUG_OUTPUT - /*ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "IMMNotificationClient_OnDeviceAdded(pDeviceID=%S)\n", (pDeviceID != nullptr) ? pDeviceID : L"(nullptr)");*/ + /*ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "IMMNotificationClient_OnDeviceAdded(pDeviceID=%S)\n", (pDeviceID != NULL) ? pDeviceID : L"(NULL)");*/ #endif /* We don't need to worry about this event for our purposes. */ @@ -22463,7 +22463,7 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDeviceAdded(ma_IMMNo static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDeviceRemoved(ma_IMMNotificationClient* pThis, const WCHAR* pDeviceID) { #ifdef MA_DEBUG_OUTPUT - /*ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "IMMNotificationClient_OnDeviceRemoved(pDeviceID=%S)\n", (pDeviceID != nullptr) ? pDeviceID : L"(nullptr)");*/ + /*ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "IMMNotificationClient_OnDeviceRemoved(pDeviceID=%S)\n", (pDeviceID != NULL) ? pDeviceID : L"(NULL)");*/ #endif /* We don't need to worry about this event for our purposes. */ @@ -22475,7 +22475,7 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDeviceRemoved(ma_IMM static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDefaultDeviceChanged(ma_IMMNotificationClient* pThis, ma_EDataFlow dataFlow, ma_ERole role, const WCHAR* pDefaultDeviceID) { #ifdef MA_DEBUG_OUTPUT - /*ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "IMMNotificationClient_OnDefaultDeviceChanged(dataFlow=%d, role=%d, pDefaultDeviceID=%S)\n", dataFlow, role, (pDefaultDeviceID != nullptr) ? pDefaultDeviceID : L"(nullptr)");*/ + /*ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "IMMNotificationClient_OnDefaultDeviceChanged(dataFlow=%d, role=%d, pDefaultDeviceID=%S)\n", dataFlow, role, (pDefaultDeviceID != NULL) ? pDefaultDeviceID : L"(NULL)");*/ #endif (void)role; @@ -22532,7 +22532,7 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDefaultDeviceChanged restartDevice = MA_TRUE; } - if (pDefaultDeviceID != nullptr) { /* <-- The input device ID will be null if there's no other device available. */ + if (pDefaultDeviceID != NULL) { /* <-- The input device ID will be null if there's no other device available. */ ma_mutex_lock(&pThis->pDevice->wasapi.rerouteLock); { if (dataFlow == ma_eRender) { @@ -22578,7 +22578,7 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDefaultDeviceChanged static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnPropertyValueChanged(ma_IMMNotificationClient* pThis, const WCHAR* pDeviceID, const PROPERTYKEY key) { #ifdef MA_DEBUG_OUTPUT - /*ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "IMMNotificationClient_OnPropertyValueChanged(pDeviceID=%S)\n", (pDeviceID != nullptr) ? pDeviceID : L"(nullptr)");*/ + /*ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "IMMNotificationClient_OnPropertyValueChanged(pDeviceID=%S)\n", (pDeviceID != NULL) ? pDeviceID : L"(NULL)");*/ #endif (void)pThis; @@ -22603,13 +22603,13 @@ static const char* ma_to_usage_string__wasapi(ma_wasapi_usage usage) { switch (usage) { - case ma_wasapi_usage_default: return nullptr; + case ma_wasapi_usage_default: return NULL; case ma_wasapi_usage_games: return "Games"; case ma_wasapi_usage_pro_audio: return "Pro Audio"; default: break; } - return nullptr; + return NULL; } #if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK) @@ -22640,10 +22640,10 @@ static ma_result ma_context_post_command__wasapi(ma_context* pContext, const ma_ ma_bool32 isUsingLocalEvent = MA_FALSE; ma_event localEvent; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pCmd != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pCmd != NULL); - if (pCmd->pEvent == nullptr) { + if (pCmd->pEvent == NULL) { isUsingLocalEvent = MA_TRUE; result = ma_event_init(&localEvent); @@ -22685,8 +22685,8 @@ static ma_result ma_context_next_command__wasapi(ma_context* pContext, ma_contex { ma_result result = MA_SUCCESS; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pCmd != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pCmd != NULL); result = ma_semaphore_wait(&pContext->wasapi.commandSem); if (result == MA_SUCCESS) { @@ -22706,7 +22706,7 @@ static ma_thread_result MA_THREADCALL ma_context_command_thread__wasapi(void* pU { ma_result result; ma_context* pContext = (ma_context*)pUserData; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); for (;;) { ma_context_command__wasapi cmd; @@ -22734,16 +22734,16 @@ static ma_thread_result MA_THREADCALL ma_context_command_thread__wasapi(void* pU case MA_CONTEXT_COMMAND_RELEASE_IAUDIOCLIENT__WASAPI: { if (cmd.data.releaseAudioClient.deviceType == ma_device_type_playback) { - if (cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientPlayback != nullptr) { + if (cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientPlayback != NULL) { ma_IAudioClient_Release((ma_IAudioClient*)cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientPlayback); - cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientPlayback = nullptr; + cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientPlayback = NULL; } } if (cmd.data.releaseAudioClient.deviceType == ma_device_type_capture) { - if (cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientCapture != nullptr) { + if (cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientCapture != NULL) { ma_IAudioClient_Release((ma_IAudioClient*)cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientCapture); - cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientCapture = nullptr; + cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientCapture = NULL; } } } break; @@ -22755,7 +22755,7 @@ static ma_thread_result MA_THREADCALL ma_context_command_thread__wasapi(void* pU } break; } - if (cmd.pEvent != nullptr) { + if (cmd.pEvent != NULL) { ma_event_signal(cmd.pEvent); } @@ -22805,8 +22805,8 @@ static ma_result ma_device_release_IAudioClient_service__wasapi(ma_device* pDevi static void ma_add_native_data_format_to_device_info_from_WAVEFORMATEX(const MA_WAVEFORMATEX* pWF, ma_share_mode shareMode, ma_device_info* pInfo) { - MA_ASSERT(pWF != nullptr); - MA_ASSERT(pInfo != nullptr); + MA_ASSERT(pWF != NULL); + MA_ASSERT(pInfo != NULL); if (pInfo->nativeDataFormatCount >= ma_countof(pInfo->nativeDataFormats)) { return; /* Too many data formats. Need to ignore this one. Don't think this should ever happen with WASAPI. */ @@ -22822,10 +22822,10 @@ static void ma_add_native_data_format_to_device_info_from_WAVEFORMATEX(const MA_ static ma_result ma_context_get_device_info_from_IAudioClient__wasapi(ma_context* pContext, /*ma_IMMDevice**/void* pMMDevice, ma_IAudioClient* pAudioClient, ma_device_info* pInfo) { HRESULT hr; - MA_WAVEFORMATEX* pWF = nullptr; + MA_WAVEFORMATEX* pWF = NULL; - MA_ASSERT(pAudioClient != nullptr); - MA_ASSERT(pInfo != nullptr); + MA_ASSERT(pAudioClient != NULL); + MA_ASSERT(pInfo != NULL); /* Shared Mode. We use GetMixFormat() here. */ hr = ma_IAudioClient_GetMixFormat((ma_IAudioClient*)pAudioClient, (MA_WAVEFORMATEX**)&pWF); @@ -22862,7 +22862,7 @@ static ma_result ma_context_get_device_info_from_IAudioClient__wasapi(ma_context In my testing, the format returned by PKEY_AudioEngine_DeviceFormat is suitable for exclusive mode so we check this format first. If this fails, fall back to a search. */ - hr = ma_IAudioClient_IsFormatSupported((ma_IAudioClient*)pAudioClient, MA_AUDCLNT_SHAREMODE_EXCLUSIVE, pWF, nullptr); + hr = ma_IAudioClient_IsFormatSupported((ma_IAudioClient*)pAudioClient, MA_AUDCLNT_SHAREMODE_EXCLUSIVE, pWF, NULL); if (SUCCEEDED(hr)) { /* The format returned by PKEY_AudioEngine_DeviceFormat is supported. */ ma_add_native_data_format_to_device_info_from_WAVEFORMATEX(pWF, ma_share_mode_exclusive, pInfo); @@ -22908,7 +22908,7 @@ static ma_result ma_context_get_device_info_from_IAudioClient__wasapi(ma_context for (iSampleRate = 0; iSampleRate < ma_countof(g_maStandardSampleRatePriorities); ++iSampleRate) { wf.nSamplesPerSec = g_maStandardSampleRatePriorities[iSampleRate]; - hr = ma_IAudioClient_IsFormatSupported((ma_IAudioClient*)pAudioClient, MA_AUDCLNT_SHAREMODE_EXCLUSIVE, (MA_WAVEFORMATEX*)&wf, nullptr); + hr = ma_IAudioClient_IsFormatSupported((ma_IAudioClient*)pAudioClient, MA_AUDCLNT_SHAREMODE_EXCLUSIVE, (MA_WAVEFORMATEX*)&wf, NULL); if (SUCCEEDED(hr)) { ma_add_native_data_format_to_device_info_from_WAVEFORMATEX((MA_WAVEFORMATEX*)&wf, ma_share_mode_exclusive, pInfo); found = MA_TRUE; @@ -22963,12 +22963,12 @@ static ma_result ma_context_create_IMMDeviceEnumerator__wasapi(ma_context* pCont HRESULT hr; ma_IMMDeviceEnumerator* pDeviceEnumerator; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(ppDeviceEnumerator != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(ppDeviceEnumerator != NULL); - *ppDeviceEnumerator = nullptr; /* Safety. */ + *ppDeviceEnumerator = NULL; /* Safety. */ - hr = ma_CoCreateInstance(pContext, &MA_CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, &MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator); + hr = ma_CoCreateInstance(pContext, &MA_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator); if (FAILED(hr)) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to create device enumerator."); return ma_result_from_HRESULT(hr); @@ -22982,13 +22982,13 @@ static ma_result ma_context_create_IMMDeviceEnumerator__wasapi(ma_context* pCont static WCHAR* ma_context_get_default_device_id_from_IMMDeviceEnumerator__wasapi(ma_context* pContext, ma_IMMDeviceEnumerator* pDeviceEnumerator, ma_device_type deviceType) { HRESULT hr; - ma_IMMDevice* pMMDefaultDevice = nullptr; - WCHAR* pDefaultDeviceID = nullptr; + ma_IMMDevice* pMMDefaultDevice = NULL; + WCHAR* pDefaultDeviceID = NULL; ma_EDataFlow dataFlow; ma_ERole role; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pDeviceEnumerator != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pDeviceEnumerator != NULL); (void)pContext; @@ -23000,16 +23000,16 @@ static WCHAR* ma_context_get_default_device_id_from_IMMDeviceEnumerator__wasapi( hr = ma_IMMDeviceEnumerator_GetDefaultAudioEndpoint(pDeviceEnumerator, dataFlow, role, &pMMDefaultDevice); if (FAILED(hr)) { - return nullptr; + return NULL; } hr = ma_IMMDevice_GetId(pMMDefaultDevice, &pDefaultDeviceID); ma_IMMDevice_Release(pMMDefaultDevice); - pMMDefaultDevice = nullptr; + pMMDefaultDevice = NULL; if (FAILED(hr)) { - return nullptr; + return NULL; } return pDefaultDeviceID; @@ -23019,13 +23019,13 @@ static WCHAR* ma_context_get_default_device_id__wasapi(ma_context* pContext, ma_ { ma_result result; ma_IMMDeviceEnumerator* pDeviceEnumerator; - WCHAR* pDefaultDeviceID = nullptr; + WCHAR* pDefaultDeviceID = NULL; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); result = ma_context_create_IMMDeviceEnumerator__wasapi(pContext, &pDeviceEnumerator); if (result != MA_SUCCESS) { - return nullptr; + return NULL; } pDefaultDeviceID = ma_context_get_default_device_id_from_IMMDeviceEnumerator__wasapi(pContext, pDeviceEnumerator, deviceType); @@ -23040,8 +23040,8 @@ static ma_result ma_context_get_MMDevice__wasapi(ma_context* pContext, ma_device HRESULT hr; HRESULT CoInitializeResult; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(ppMMDevice != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(ppMMDevice != NULL); /* This weird COM init/uninit here is a hack to work around a crash when changing devices. What is happening is @@ -23058,9 +23058,9 @@ static ma_result ma_context_get_MMDevice__wasapi(ma_context* pContext, ma_device called with a different COINIT value, and we don't call CoUninitialize in that case. Other errors are possible, so we check for S_OK and S_FALSE specifically. */ - CoInitializeResult = ma_CoInitializeEx(pContext, nullptr, MA_COINIT_VALUE); + CoInitializeResult = ma_CoInitializeEx(pContext, NULL, MA_COINIT_VALUE); { - hr = ma_CoCreateInstance(pContext, &MA_CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, &MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator); + hr = ma_CoCreateInstance(pContext, &MA_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator); } if (CoInitializeResult == S_OK || CoInitializeResult == S_FALSE) { ma_CoUninitialize(pContext); } @@ -23069,7 +23069,7 @@ static ma_result ma_context_get_MMDevice__wasapi(ma_context* pContext, ma_device return ma_result_from_HRESULT(hr); } - if (pDeviceID == nullptr) { + if (pDeviceID == NULL) { hr = ma_IMMDeviceEnumerator_GetDefaultAudioEndpoint(pDeviceEnumerator, (deviceType == ma_device_type_capture) ? ma_eCapture : ma_eRender, ma_eConsole, ppMMDevice); } else { hr = ma_IMMDeviceEnumerator_GetDevice(pDeviceEnumerator, pDeviceID->wasapi, ppMMDevice); @@ -23089,7 +23089,7 @@ static ma_result ma_context_get_device_id_from_MMDevice__wasapi(ma_context* pCon WCHAR* pDeviceIDString; HRESULT hr; - MA_ASSERT(pDeviceID != nullptr); + MA_ASSERT(pDeviceID != NULL); hr = ma_IMMDevice_GetId(pMMDevice, &pDeviceIDString); if (SUCCEEDED(hr)) { @@ -23116,14 +23116,14 @@ static ma_result ma_context_get_device_info_from_MMDevice__wasapi(ma_context* pC ma_result result; HRESULT hr; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pMMDevice != nullptr); - MA_ASSERT(pInfo != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pMMDevice != NULL); + MA_ASSERT(pInfo != NULL); /* ID. */ result = ma_context_get_device_id_from_MMDevice__wasapi(pContext, pMMDevice, &pInfo->id); if (result == MA_SUCCESS) { - if (pDefaultDeviceID != nullptr) { + if (pDefaultDeviceID != NULL) { if (ma_strcmp_WCHAR(pInfo->id.wasapi, pDefaultDeviceID) == 0) { pInfo->isDefault = MA_TRUE; } @@ -23151,7 +23151,7 @@ static ma_result ma_context_get_device_info_from_MMDevice__wasapi(ma_context* pC /* Format */ if (!onlySimpleInfo) { ma_IAudioClient* pAudioClient; - hr = ma_IMMDevice_Activate(pMMDevice, &MA_IID_IAudioClient, CLSCTX_ALL, nullptr, (void**)&pAudioClient); + hr = ma_IMMDevice_Activate(pMMDevice, &MA_IID_IAudioClient, CLSCTX_ALL, NULL, (void**)&pAudioClient); if (SUCCEEDED(hr)) { result = ma_context_get_device_info_from_IAudioClient__wasapi(pContext, pMMDevice, pAudioClient, pInfo); @@ -23172,11 +23172,11 @@ static ma_result ma_context_enumerate_devices_by_type__wasapi(ma_context* pConte UINT deviceCount; HRESULT hr; ma_uint32 iDevice; - WCHAR* pDefaultDeviceID = nullptr; - ma_IMMDeviceCollection* pDeviceCollection = nullptr; + WCHAR* pDefaultDeviceID = NULL; + ma_IMMDeviceCollection* pDeviceCollection = NULL; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); /* Grab the default device. We use this to know whether or not flag the returned device info as being the default. */ pDefaultDeviceID = ma_context_get_default_device_id_from_IMMDeviceEnumerator__wasapi(pContext, pDeviceEnumerator, deviceType); @@ -23213,14 +23213,14 @@ static ma_result ma_context_enumerate_devices_by_type__wasapi(ma_context* pConte } done: - if (pDefaultDeviceID != nullptr) { + if (pDefaultDeviceID != NULL) { ma_CoTaskMemFree(pContext, pDefaultDeviceID); - pDefaultDeviceID = nullptr; + pDefaultDeviceID = NULL; } - if (pDeviceCollection != nullptr) { + if (pDeviceCollection != NULL) { ma_IMMDeviceCollection_Release(pDeviceCollection); - pDeviceCollection = nullptr; + pDeviceCollection = NULL; } return result; @@ -23231,9 +23231,9 @@ static ma_result ma_context_get_IAudioClient_Desktop__wasapi(ma_context* pContex ma_result result; HRESULT hr; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(ppAudioClient != nullptr); - MA_ASSERT(ppMMDevice != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(ppAudioClient != NULL); + MA_ASSERT(ppMMDevice != NULL); result = ma_context_get_MMDevice__wasapi(pContext, deviceType, pDeviceID, ppMMDevice); if (result != MA_SUCCESS) { @@ -23250,7 +23250,7 @@ static ma_result ma_context_get_IAudioClient_Desktop__wasapi(ma_context* pContex #else static ma_result ma_context_get_IAudioClient_UWP__wasapi(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, MA_PROPVARIANT* pActivationParams, ma_IAudioClient** ppAudioClient, ma_IUnknown** ppActivatedInterface) { - ma_IActivateAudioInterfaceAsyncOperation *pAsyncOp = nullptr; + ma_IActivateAudioInterfaceAsyncOperation *pAsyncOp = NULL; ma_completion_handler_uwp completionHandler; IID iid; WCHAR* iidStr; @@ -23259,10 +23259,10 @@ static ma_result ma_context_get_IAudioClient_UWP__wasapi(ma_context* pContext, m HRESULT activateResult; ma_IUnknown* pActivatedInterface; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(ppAudioClient != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(ppAudioClient != NULL); - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { iidStr = (WCHAR*)pDeviceID->wasapi; } else { if (deviceType == ma_device_type_capture) { @@ -23297,7 +23297,7 @@ static ma_result ma_context_get_IAudioClient_UWP__wasapi(ma_context* pContext, m return ma_result_from_HRESULT(hr); } - if (pDeviceID == nullptr) { + if (pDeviceID == NULL) { ma_CoTaskMemFree(pContext, iidStr); } @@ -23385,11 +23385,11 @@ static ma_result ma_context_get_IAudioClient__wasapi(ma_context* pContext, ma_de ma_bool32 usingProcessLoopback = MA_FALSE; MA_AUDIOCLIENT_ACTIVATION_PARAMS audioclientActivationParams; MA_PROPVARIANT activationParams; - MA_PROPVARIANT* pActivationParams = nullptr; + MA_PROPVARIANT* pActivationParams = NULL; ma_device_id virtualDeviceID; /* Activation parameters specific to loopback mode. Note that process-specific loopback will only work when a default device ID is specified. */ - if (deviceType == ma_device_type_loopback && loopbackProcessID != 0 && pDeviceID == nullptr) { + if (deviceType == ma_device_type_loopback && loopbackProcessID != 0 && pDeviceID == NULL) { usingProcessLoopback = MA_TRUE; } @@ -23409,7 +23409,7 @@ static ma_result ma_context_get_IAudioClient__wasapi(ma_context* pContext, ma_de MA_COPY_MEMORY(virtualDeviceID.wasapi, MA_VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK, (ma_wcslen(MA_VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK) + 1) * sizeof(wchar_t)); /* +1 for the null terminator. */ pDeviceID = &virtualDeviceID; } else { - pActivationParams = nullptr; /* No activation parameters required. */ + pActivationParams = NULL; /* No activation parameters required. */ } #if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK) @@ -23441,7 +23441,7 @@ static ma_result ma_context_enumerate_devices__wasapi(ma_context* pContext, ma_e HRESULT hr; ma_IMMDeviceEnumerator* pDeviceEnumerator; - hr = ma_CoCreateInstance(pContext, &MA_CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, &MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator); + hr = ma_CoCreateInstance(pContext, &MA_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator); if (FAILED(hr)) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to create device enumerator."); return ma_result_from_HRESULT(hr); @@ -23490,8 +23490,8 @@ static ma_result ma_context_get_device_info__wasapi(ma_context* pContext, ma_dev { #if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK) ma_result result; - ma_IMMDevice* pMMDevice = nullptr; - WCHAR* pDefaultDeviceID = nullptr; + ma_IMMDevice* pMMDevice = NULL; + WCHAR* pDefaultDeviceID = NULL; result = ma_context_get_MMDevice__wasapi(pContext, deviceType, pDeviceID, &pMMDevice); if (result != MA_SUCCESS) { @@ -23503,9 +23503,9 @@ static ma_result ma_context_get_device_info__wasapi(ma_context* pContext, ma_dev result = ma_context_get_device_info_from_MMDevice__wasapi(pContext, pMMDevice, pDefaultDeviceID, MA_FALSE, pDeviceInfo); /* MA_FALSE = !onlySimpleInfo. */ - if (pDefaultDeviceID != nullptr) { + if (pDefaultDeviceID != NULL) { ma_CoTaskMemFree(pContext, pDefaultDeviceID); - pDefaultDeviceID = nullptr; + pDefaultDeviceID = NULL; } ma_IMMDevice_Release(pMMDevice); @@ -23522,12 +23522,12 @@ static ma_result ma_context_get_device_info__wasapi(ma_context* pContext, ma_dev ma_strncpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), MA_DEFAULT_CAPTURE_DEVICE_NAME, (size_t)-1); } - result = ma_context_get_IAudioClient_UWP__wasapi(pContext, deviceType, pDeviceID, nullptr, &pAudioClient, nullptr); + result = ma_context_get_IAudioClient_UWP__wasapi(pContext, deviceType, pDeviceID, NULL, &pAudioClient, NULL); if (result != MA_SUCCESS) { return result; } - result = ma_context_get_device_info_from_IAudioClient__wasapi(pContext, nullptr, pAudioClient, pDeviceInfo); + result = ma_context_get_device_info_from_IAudioClient__wasapi(pContext, NULL, pAudioClient, pDeviceInfo); pDeviceInfo->isDefault = MA_TRUE; /* UWP only supports default devices. */ @@ -23538,7 +23538,7 @@ static ma_result ma_context_get_device_info__wasapi(ma_context* pContext, ma_dev static ma_result ma_device_uninit__wasapi(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); #if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK) { @@ -23552,9 +23552,9 @@ static ma_result ma_device_uninit__wasapi(ma_device* pDevice) #endif if (pDevice->wasapi.pRenderClient) { - if (pDevice->wasapi.pMappedBufferPlayback != nullptr) { + if (pDevice->wasapi.pMappedBufferPlayback != NULL) { ma_IAudioRenderClient_ReleaseBuffer((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient, pDevice->wasapi.mappedBufferPlaybackCap, 0); - pDevice->wasapi.pMappedBufferPlayback = nullptr; + pDevice->wasapi.pMappedBufferPlayback = NULL; pDevice->wasapi.mappedBufferPlaybackCap = 0; pDevice->wasapi.mappedBufferPlaybackLen = 0; } @@ -23562,9 +23562,9 @@ static ma_result ma_device_uninit__wasapi(ma_device* pDevice) ma_IAudioRenderClient_Release((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient); } if (pDevice->wasapi.pCaptureClient) { - if (pDevice->wasapi.pMappedBufferCapture != nullptr) { + if (pDevice->wasapi.pMappedBufferCapture != NULL) { ma_IAudioCaptureClient_ReleaseBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, pDevice->wasapi.mappedBufferCaptureCap); - pDevice->wasapi.pMappedBufferCapture = nullptr; + pDevice->wasapi.pMappedBufferCapture = NULL; pDevice->wasapi.mappedBufferCaptureCap = 0; pDevice->wasapi.mappedBufferCaptureLen = 0; } @@ -23633,24 +23633,24 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device MA_REFERENCE_TIME periodDurationInMicroseconds; ma_bool32 wasInitializedUsingIAudioClient3 = MA_FALSE; MA_WAVEFORMATEXTENSIBLE wf; - ma_WASAPIDeviceInterface* pDeviceInterface = nullptr; + ma_WASAPIDeviceInterface* pDeviceInterface = NULL; ma_IAudioClient2* pAudioClient2; ma_uint32 nativeSampleRate; ma_bool32 usingProcessLoopback = MA_FALSE; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pData != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pData != NULL); /* This function is only used to initialize one device type: either playback, capture or loopback. Never full-duplex. */ if (deviceType == ma_device_type_duplex) { return MA_INVALID_ARGS; } - usingProcessLoopback = deviceType == ma_device_type_loopback && pData->loopbackProcessID != 0 && pDeviceID == nullptr; + usingProcessLoopback = deviceType == ma_device_type_loopback && pData->loopbackProcessID != 0 && pDeviceID == NULL; - pData->pAudioClient = nullptr; - pData->pRenderClient = nullptr; - pData->pCaptureClient = nullptr; + pData->pAudioClient = NULL; + pData->pRenderClient = NULL; + pData->pCaptureClient = NULL; streamFlags = MA_AUDCLNT_STREAMFLAGS_EVENTCALLBACK; if (!pData->noAutoConvertSRC && pData->sampleRateIn != 0 && pData->shareMode != ma_share_mode_exclusive) { /* <-- Exclusive streams must use the native sample rate. */ @@ -23694,7 +23694,7 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device if (pData->shareMode == ma_share_mode_exclusive) { #if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK) /* In exclusive mode on desktop we always use the backend's native format. */ - ma_IPropertyStore* pStore = nullptr; + ma_IPropertyStore* pStore = NULL; hr = ma_IMMDevice_OpenPropertyStore(pDeviceInterface, STGM_READ, &pStore); if (SUCCEEDED(hr)) { MA_PROPVARIANT prop; @@ -23702,7 +23702,7 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device hr = ma_IPropertyStore_GetValue(pStore, &MA_PKEY_AudioEngine_DeviceFormat, &prop); if (SUCCEEDED(hr)) { MA_WAVEFORMATEX* pActualFormat = (MA_WAVEFORMATEX*)prop.blob.pBlobData; - hr = ma_IAudioClient_IsFormatSupported((ma_IAudioClient*)pData->pAudioClient, MA_AUDCLNT_SHAREMODE_EXCLUSIVE, pActualFormat, nullptr); + hr = ma_IAudioClient_IsFormatSupported((ma_IAudioClient*)pData->pAudioClient, MA_AUDCLNT_SHAREMODE_EXCLUSIVE, pActualFormat, NULL); if (SUCCEEDED(hr)) { MA_COPY_MEMORY(&wf, pActualFormat, sizeof(MA_WAVEFORMATEXTENSIBLE)); } @@ -23731,7 +23731,7 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device } } else { /* In shared mode we are always using the format reported by the operating system. */ - MA_WAVEFORMATEXTENSIBLE* pNativeFormat = nullptr; + MA_WAVEFORMATEXTENSIBLE* pNativeFormat = NULL; hr = ma_IAudioClient_GetMixFormat((ma_IAudioClient*)pData->pAudioClient, (MA_WAVEFORMATEX**)&pNativeFormat); if (hr != S_OK) { /* When using process-specific loopback, GetMixFormat() seems to always fail. */ @@ -23855,7 +23855,7 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device */ hr = E_FAIL; for (;;) { - hr = ma_IAudioClient_Initialize((ma_IAudioClient*)pData->pAudioClient, shareMode, streamFlags, bufferDuration, bufferDuration, (MA_WAVEFORMATEX*)&wf, nullptr); + hr = ma_IAudioClient_Initialize((ma_IAudioClient*)pData->pAudioClient, shareMode, streamFlags, bufferDuration, bufferDuration, (MA_WAVEFORMATEX*)&wf, NULL); if (hr == MA_AUDCLNT_E_INVALID_DEVICE_PERIOD) { if (bufferDuration > 500*10000) { break; @@ -23882,13 +23882,13 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device ma_IAudioClient_Release((ma_IAudioClient*)pData->pAudioClient); #if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK) - hr = ma_IMMDevice_Activate(pDeviceInterface, &MA_IID_IAudioClient, CLSCTX_ALL, nullptr, (void**)&pData->pAudioClient); + hr = ma_IMMDevice_Activate(pDeviceInterface, &MA_IID_IAudioClient, CLSCTX_ALL, NULL, (void**)&pData->pAudioClient); #else hr = ma_IUnknown_QueryInterface(pDeviceInterface, &MA_IID_IAudioClient, (void**)&pData->pAudioClient); #endif if (SUCCEEDED(hr)) { - hr = ma_IAudioClient_Initialize((ma_IAudioClient*)pData->pAudioClient, shareMode, streamFlags, bufferDuration, bufferDuration, (MA_WAVEFORMATEX*)&wf, nullptr); + hr = ma_IAudioClient_Initialize((ma_IAudioClient*)pData->pAudioClient, shareMode, streamFlags, bufferDuration, bufferDuration, (MA_WAVEFORMATEX*)&wf, NULL); } } } @@ -23920,7 +23920,7 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device #ifndef MA_WASAPI_NO_LOW_LATENCY_SHARED_MODE { if ((streamFlags & MA_AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM) == 0 || nativeSampleRate == wf.nSamplesPerSec) { - ma_IAudioClient3* pAudioClient3 = nullptr; + ma_IAudioClient3* pAudioClient3 = NULL; hr = ma_IAudioClient_QueryInterface(pData->pAudioClient, &MA_IID_IAudioClient3, (void**)&pAudioClient3); if (SUCCEEDED(hr)) { ma_uint32 defaultPeriodInFrames; @@ -23951,7 +23951,7 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device MA_AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM | MA_AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY must not be in the stream flags. If either of these are specified, IAudioClient3_InitializeSharedAudioStream() will fail. */ - hr = ma_IAudioClient3_InitializeSharedAudioStream(pAudioClient3, streamFlags & ~(MA_AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM | MA_AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY), actualPeriodInFrames, (MA_WAVEFORMATEX*)&wf, nullptr); + hr = ma_IAudioClient3_InitializeSharedAudioStream(pAudioClient3, streamFlags & ~(MA_AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM | MA_AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY), actualPeriodInFrames, (MA_WAVEFORMATEX*)&wf, NULL); if (SUCCEEDED(hr)) { wasInitializedUsingIAudioClient3 = MA_TRUE; pData->periodSizeInFramesOut = actualPeriodInFrames; @@ -23969,7 +23969,7 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device } ma_IAudioClient3_Release(pAudioClient3); - pAudioClient3 = nullptr; + pAudioClient3 = NULL; } } } @@ -23982,7 +23982,7 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device /* If we don't have an IAudioClient3 then we need to use the normal initialization routine. */ if (!wasInitializedUsingIAudioClient3) { MA_REFERENCE_TIME bufferDuration = periodDurationInMicroseconds * pData->periodsOut * 10; /* <-- Multiply by 10 for microseconds to 100-nanoseconds. */ - hr = ma_IAudioClient_Initialize((ma_IAudioClient*)pData->pAudioClient, shareMode, streamFlags, bufferDuration, 0, (const MA_WAVEFORMATEX*)&wf, nullptr); + hr = ma_IAudioClient_Initialize((ma_IAudioClient*)pData->pAudioClient, shareMode, streamFlags, bufferDuration, 0, (const MA_WAVEFORMATEX*)&wf, NULL); if (FAILED(hr)) { if (hr == E_ACCESSDENIED) { errorMsg = "[WASAPI] Failed to initialize device. Access denied.", result = MA_ACCESS_DENIED; @@ -24072,11 +24072,11 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device done: /* Clean up. */ #if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK) - if (pDeviceInterface != nullptr) { + if (pDeviceInterface != NULL) { ma_IMMDevice_Release(pDeviceInterface); } #else - if (pDeviceInterface != nullptr) { + if (pDeviceInterface != NULL) { ma_IUnknown_Release(pDeviceInterface); } #endif @@ -24084,18 +24084,18 @@ done: if (result != MA_SUCCESS) { if (pData->pRenderClient) { ma_IAudioRenderClient_Release((ma_IAudioRenderClient*)pData->pRenderClient); - pData->pRenderClient = nullptr; + pData->pRenderClient = NULL; } if (pData->pCaptureClient) { ma_IAudioCaptureClient_Release((ma_IAudioCaptureClient*)pData->pCaptureClient); - pData->pCaptureClient = nullptr; + pData->pCaptureClient = NULL; } if (pData->pAudioClient) { ma_IAudioClient_Release((ma_IAudioClient*)pData->pAudioClient); - pData->pAudioClient = nullptr; + pData->pAudioClient = NULL; } - if (errorMsg != nullptr && errorMsg[0] != '\0') { + if (errorMsg != NULL && errorMsg[0] != '\0') { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "%s\n", errorMsg); } @@ -24110,7 +24110,7 @@ static ma_result ma_device_reinit__wasapi(ma_device* pDevice, ma_device_type dev ma_device_init_internal_data__wasapi data; ma_result result; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* We only re-initialize the playback or capture device. Never a full-duplex device. */ if (deviceType == ma_device_type_duplex) { @@ -24131,24 +24131,24 @@ static ma_result ma_device_reinit__wasapi(ma_device* pDevice, ma_device_type dev if (deviceType == ma_device_type_capture || deviceType == ma_device_type_loopback) { if (pDevice->wasapi.pCaptureClient) { ma_IAudioCaptureClient_Release((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient); - pDevice->wasapi.pCaptureClient = nullptr; + pDevice->wasapi.pCaptureClient = NULL; } if (pDevice->wasapi.pAudioClientCapture) { /*ma_device_release_IAudioClient_service__wasapi(pDevice, ma_device_type_capture);*/ - pDevice->wasapi.pAudioClientCapture = nullptr; + pDevice->wasapi.pAudioClientCapture = NULL; } } if (deviceType == ma_device_type_playback) { if (pDevice->wasapi.pRenderClient) { ma_IAudioRenderClient_Release((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient); - pDevice->wasapi.pRenderClient = nullptr; + pDevice->wasapi.pRenderClient = NULL; } if (pDevice->wasapi.pAudioClientPlayback) { /*ma_device_release_IAudioClient_service__wasapi(pDevice, ma_device_type_playback);*/ - pDevice->wasapi.pAudioClientPlayback = nullptr; + pDevice->wasapi.pAudioClientPlayback = NULL; } } @@ -24175,7 +24175,7 @@ static ma_result ma_device_reinit__wasapi(ma_device* pDevice, ma_device_type dev data.noHardwareOffloading = pDevice->wasapi.noHardwareOffloading; data.loopbackProcessID = pDevice->wasapi.loopbackProcessID; data.loopbackProcessExclude = pDevice->wasapi.loopbackProcessExclude; - result = ma_device_init_internal__wasapi(pDevice->pContext, deviceType, nullptr, &data); + result = ma_device_init_internal__wasapi(pDevice->pContext, deviceType, NULL, &data); if (result != MA_SUCCESS) { return result; } @@ -24235,7 +24235,7 @@ static ma_result ma_device_init__wasapi(ma_device* pDevice, const ma_device_conf ma_IMMDeviceEnumerator* pDeviceEnumerator; #endif - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ZERO_OBJECT(&pDevice->wasapi); pDevice->wasapi.usage = pConfig->wasapi.usage; @@ -24283,17 +24283,17 @@ static ma_result ma_device_init__wasapi(ma_device* pDevice, const ma_device_conf The event for capture needs to be manual reset for the same reason as playback. We keep the initial state set to unsignaled, however, because we want to block until we actually have something for the first call to ma_device_read(). */ - pDevice->wasapi.hEventCapture = (ma_handle)CreateEventA(nullptr, FALSE, FALSE, nullptr); /* Auto reset, unsignaled by default. */ - if (pDevice->wasapi.hEventCapture == nullptr) { + pDevice->wasapi.hEventCapture = (ma_handle)CreateEventA(NULL, FALSE, FALSE, NULL); /* Auto reset, unsignaled by default. */ + if (pDevice->wasapi.hEventCapture == NULL) { result = ma_result_from_GetLastError(GetLastError()); - if (pDevice->wasapi.pCaptureClient != nullptr) { + if (pDevice->wasapi.pCaptureClient != NULL) { ma_IAudioCaptureClient_Release((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient); - pDevice->wasapi.pCaptureClient = nullptr; + pDevice->wasapi.pCaptureClient = NULL; } - if (pDevice->wasapi.pAudioClientCapture != nullptr) { + if (pDevice->wasapi.pAudioClientCapture != NULL) { ma_IAudioClient_Release((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); - pDevice->wasapi.pAudioClientCapture = nullptr; + pDevice->wasapi.pAudioClientCapture = NULL; } ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to create event for capture."); @@ -24336,17 +24336,17 @@ static ma_result ma_device_init__wasapi(ma_device* pDevice, const ma_device_conf result = ma_device_init_internal__wasapi(pDevice->pContext, ma_device_type_playback, pDescriptorPlayback->pDeviceID, &data); if (result != MA_SUCCESS) { if (pConfig->deviceType == ma_device_type_duplex) { - if (pDevice->wasapi.pCaptureClient != nullptr) { + if (pDevice->wasapi.pCaptureClient != NULL) { ma_IAudioCaptureClient_Release((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient); - pDevice->wasapi.pCaptureClient = nullptr; + pDevice->wasapi.pCaptureClient = NULL; } - if (pDevice->wasapi.pAudioClientCapture != nullptr) { + if (pDevice->wasapi.pAudioClientCapture != NULL) { ma_IAudioClient_Release((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); - pDevice->wasapi.pAudioClientCapture = nullptr; + pDevice->wasapi.pAudioClientCapture = NULL; } CloseHandle((HANDLE)pDevice->wasapi.hEventCapture); - pDevice->wasapi.hEventCapture = nullptr; + pDevice->wasapi.hEventCapture = NULL; } return result; } @@ -24365,31 +24365,31 @@ static ma_result ma_device_init__wasapi(ma_device* pDevice, const ma_device_conf The playback event also needs to be initially set to a signaled state so that the first call to ma_device_write() is able to get passed WaitForMultipleObjects(). */ - pDevice->wasapi.hEventPlayback = (ma_handle)CreateEventA(nullptr, FALSE, TRUE, nullptr); /* Auto reset, signaled by default. */ - if (pDevice->wasapi.hEventPlayback == nullptr) { + pDevice->wasapi.hEventPlayback = (ma_handle)CreateEventA(NULL, FALSE, TRUE, NULL); /* Auto reset, signaled by default. */ + if (pDevice->wasapi.hEventPlayback == NULL) { result = ma_result_from_GetLastError(GetLastError()); if (pConfig->deviceType == ma_device_type_duplex) { - if (pDevice->wasapi.pCaptureClient != nullptr) { + if (pDevice->wasapi.pCaptureClient != NULL) { ma_IAudioCaptureClient_Release((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient); - pDevice->wasapi.pCaptureClient = nullptr; + pDevice->wasapi.pCaptureClient = NULL; } - if (pDevice->wasapi.pAudioClientCapture != nullptr) { + if (pDevice->wasapi.pAudioClientCapture != NULL) { ma_IAudioClient_Release((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); - pDevice->wasapi.pAudioClientCapture = nullptr; + pDevice->wasapi.pAudioClientCapture = NULL; } CloseHandle((HANDLE)pDevice->wasapi.hEventCapture); - pDevice->wasapi.hEventCapture = nullptr; + pDevice->wasapi.hEventCapture = NULL; } - if (pDevice->wasapi.pRenderClient != nullptr) { + if (pDevice->wasapi.pRenderClient != NULL) { ma_IAudioRenderClient_Release((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient); - pDevice->wasapi.pRenderClient = nullptr; + pDevice->wasapi.pRenderClient = NULL; } - if (pDevice->wasapi.pAudioClientPlayback != nullptr) { + if (pDevice->wasapi.pAudioClientPlayback != NULL) { ma_IAudioClient_Release((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback); - pDevice->wasapi.pAudioClientPlayback = nullptr; + pDevice->wasapi.pAudioClientPlayback = NULL; } ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to create event for playback."); @@ -24419,17 +24419,17 @@ static ma_result ma_device_init__wasapi(ma_device* pDevice, const ma_device_conf */ #if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK) if (pConfig->wasapi.noAutoStreamRouting == MA_FALSE) { - if ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex || pConfig->deviceType == ma_device_type_loopback) && pConfig->capture.pDeviceID == nullptr) { + if ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex || pConfig->deviceType == ma_device_type_loopback) && pConfig->capture.pDeviceID == NULL) { pDevice->wasapi.allowCaptureAutoStreamRouting = MA_TRUE; } - if ((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pConfig->playback.pDeviceID == nullptr) { + if ((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pConfig->playback.pDeviceID == NULL) { pDevice->wasapi.allowPlaybackAutoStreamRouting = MA_TRUE; } } ma_mutex_init(&pDevice->wasapi.rerouteLock); - hr = ma_CoCreateInstance(pDevice->pContext, &MA_CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, &MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator); + hr = ma_CoCreateInstance(pDevice->pContext, &MA_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator); if (FAILED(hr)) { ma_device_uninit__wasapi(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to create device enumerator."); @@ -24461,8 +24461,8 @@ static ma_result ma_device__get_available_frames__wasapi(ma_device* pDevice, ma_ HRESULT hr; ma_share_mode shareMode; - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pFrameCount != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pFrameCount != NULL); *pFrameCount = 0; @@ -24574,7 +24574,7 @@ static ma_result ma_device_start__wasapi(ma_device* pDevice) { ma_result result; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* Wait for any rerouting to finish before attempting to start the device. */ ma_mutex_lock(&pDevice->wasapi.rerouteLock); @@ -24591,18 +24591,18 @@ static ma_result ma_device_stop__wasapi_nolock(ma_device* pDevice) ma_result result; HRESULT hr; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->wasapi.hAvrtHandle) { ((MA_PFN_AvRevertMmThreadCharacteristics)pDevice->pContext->wasapi.AvRevertMmThreadcharacteristics)((HANDLE)pDevice->wasapi.hAvrtHandle); - pDevice->wasapi.hAvrtHandle = nullptr; + pDevice->wasapi.hAvrtHandle = NULL; } if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex || pDevice->type == ma_device_type_loopback) { /* If we have a mapped buffer we need to release it. */ - if (pDevice->wasapi.pMappedBufferCapture != nullptr) { + if (pDevice->wasapi.pMappedBufferCapture != NULL) { ma_IAudioCaptureClient_ReleaseBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, pDevice->wasapi.mappedBufferCaptureCap); - pDevice->wasapi.pMappedBufferCapture = nullptr; + pDevice->wasapi.pMappedBufferCapture = NULL; pDevice->wasapi.mappedBufferCaptureCap = 0; pDevice->wasapi.mappedBufferCaptureLen = 0; } @@ -24624,14 +24624,14 @@ static ma_result ma_device_stop__wasapi_nolock(ma_device* pDevice) } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - if (pDevice->wasapi.pMappedBufferPlayback != nullptr) { + if (pDevice->wasapi.pMappedBufferPlayback != NULL) { ma_silence_pcm_frames( ma_offset_pcm_frames_ptr(pDevice->wasapi.pMappedBufferPlayback, pDevice->wasapi.mappedBufferPlaybackLen, pDevice->playback.internalFormat, pDevice->playback.internalChannels), pDevice->wasapi.mappedBufferPlaybackCap - pDevice->wasapi.mappedBufferPlaybackLen, pDevice->playback.internalFormat, pDevice->playback.internalChannels ); ma_IAudioRenderClient_ReleaseBuffer((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient, pDevice->wasapi.mappedBufferPlaybackCap, 0); - pDevice->wasapi.pMappedBufferPlayback = nullptr; + pDevice->wasapi.pMappedBufferPlayback = NULL; pDevice->wasapi.mappedBufferPlaybackCap = 0; pDevice->wasapi.mappedBufferPlaybackLen = 0; } @@ -24705,7 +24705,7 @@ static ma_result ma_device_stop__wasapi(ma_device* pDevice) { ma_result result; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* Wait for any rerouting to finish before attempting to stop the device. */ ma_mutex_lock(&pDevice->wasapi.rerouteLock); @@ -24738,7 +24738,7 @@ static ma_result ma_device_read__wasapi(ma_device* pDevice, void* pFrames, ma_ui ma_uint32 framesRemaining = frameCount - totalFramesProcessed; /* If we have a mapped data buffer, consume that first. */ - if (pDevice->wasapi.pMappedBufferCapture != nullptr) { + if (pDevice->wasapi.pMappedBufferCapture != NULL) { /* We have a cached data pointer so consume that before grabbing another one from WASAPI. */ ma_uint32 framesToProcessNow = framesRemaining; if (framesToProcessNow > pDevice->wasapi.mappedBufferCaptureLen) { @@ -24759,7 +24759,7 @@ static ma_result ma_device_read__wasapi(ma_device* pDevice, void* pFrames, ma_ui /* If the data buffer has been fully consumed we need to release it. */ if (pDevice->wasapi.mappedBufferCaptureLen == 0) { ma_IAudioCaptureClient_ReleaseBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, pDevice->wasapi.mappedBufferCaptureCap); - pDevice->wasapi.pMappedBufferCapture = nullptr; + pDevice->wasapi.pMappedBufferCapture = NULL; pDevice->wasapi.mappedBufferCaptureCap = 0; } } else { @@ -24768,7 +24768,7 @@ static ma_result ma_device_read__wasapi(ma_device* pDevice, void* pFrames, ma_ui DWORD flags = 0; /* First just ask WASAPI for a data buffer. If it's not available, we'll wait for more. */ - hr = ma_IAudioCaptureClient_GetBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, (BYTE**)&pDevice->wasapi.pMappedBufferCapture, &pDevice->wasapi.mappedBufferCaptureCap, &flags, nullptr, nullptr); + hr = ma_IAudioCaptureClient_GetBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, (BYTE**)&pDevice->wasapi.pMappedBufferCapture, &pDevice->wasapi.mappedBufferCaptureCap, &flags, NULL, NULL); if (hr == S_OK) { /* We got a data buffer. Continue to the next loop iteration which will then read from the mapped pointer. */ pDevice->wasapi.mappedBufferCaptureLen = pDevice->wasapi.mappedBufferCaptureCap; @@ -24828,14 +24828,14 @@ static ma_result ma_device_read__wasapi(ma_device* pDevice, void* pFrames, ma_ui } flags = 0; - hr = ma_IAudioCaptureClient_GetBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, (BYTE**)&pDevice->wasapi.pMappedBufferCapture, &pDevice->wasapi.mappedBufferCaptureCap, &flags, nullptr, nullptr); + hr = ma_IAudioCaptureClient_GetBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, (BYTE**)&pDevice->wasapi.pMappedBufferCapture, &pDevice->wasapi.mappedBufferCaptureCap, &flags, NULL, NULL); if (hr == MA_AUDCLNT_S_BUFFER_EMPTY || FAILED(hr)) { /* The buffer has been completely emptied or an error occurred. In this case we'll need to reset the state of the mapped buffer which will trigger the next iteration to get a fresh buffer from WASAPI. */ - pDevice->wasapi.pMappedBufferCapture = nullptr; + pDevice->wasapi.pMappedBufferCapture = NULL; pDevice->wasapi.mappedBufferCaptureCap = 0; pDevice->wasapi.mappedBufferCaptureLen = 0; @@ -24856,7 +24856,7 @@ static ma_result ma_device_read__wasapi(ma_device* pDevice, void* pFrames, ma_ui } /* If at this point we have a valid buffer mapped, make sure the buffer length is set appropriately. */ - if (pDevice->wasapi.pMappedBufferCapture != nullptr) { + if (pDevice->wasapi.pMappedBufferCapture != NULL) { pDevice->wasapi.mappedBufferCaptureLen = pDevice->wasapi.mappedBufferCaptureCap; } } @@ -24905,14 +24905,14 @@ static ma_result ma_device_read__wasapi(ma_device* pDevice, void* pFrames, ma_ui there's a good chance either an error occurred or the device was stopped mid-read. In this case we'll need to make sure the buffer is released. */ - if (totalFramesProcessed < frameCount && pDevice->wasapi.pMappedBufferCapture != nullptr) { + if (totalFramesProcessed < frameCount && pDevice->wasapi.pMappedBufferCapture != NULL) { ma_IAudioCaptureClient_ReleaseBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, pDevice->wasapi.mappedBufferCaptureCap); - pDevice->wasapi.pMappedBufferCapture = nullptr; + pDevice->wasapi.pMappedBufferCapture = NULL; pDevice->wasapi.mappedBufferCaptureCap = 0; pDevice->wasapi.mappedBufferCaptureLen = 0; } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesProcessed; } @@ -24934,7 +24934,7 @@ static ma_result ma_device_write__wasapi(ma_device* pDevice, const void* pFrames a requested buffer size equal to our actual period size. If it returns AUDCLNT_E_BUFFER_TOO_LARGE it means we need to wait for some data to become available. */ - if (pDevice->wasapi.pMappedBufferPlayback != nullptr) { + if (pDevice->wasapi.pMappedBufferPlayback != NULL) { /* We still have some space available in the mapped data buffer. Write to it. */ ma_uint32 framesToProcessNow = framesRemaining; if (framesToProcessNow > (pDevice->wasapi.mappedBufferPlaybackCap - pDevice->wasapi.mappedBufferPlaybackLen)) { @@ -24955,7 +24955,7 @@ static ma_result ma_device_write__wasapi(ma_device* pDevice, const void* pFrames /* If the data buffer has been fully consumed we need to release it. */ if (pDevice->wasapi.mappedBufferPlaybackLen == pDevice->wasapi.mappedBufferPlaybackCap) { ma_IAudioRenderClient_ReleaseBuffer((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient, pDevice->wasapi.mappedBufferPlaybackCap, 0); - pDevice->wasapi.pMappedBufferPlayback = nullptr; + pDevice->wasapi.pMappedBufferPlayback = NULL; pDevice->wasapi.mappedBufferPlaybackCap = 0; pDevice->wasapi.mappedBufferPlaybackLen = 0; @@ -25005,7 +25005,7 @@ static ma_result ma_device_write__wasapi(ma_device* pDevice, const void* pFrames } } - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = totalFramesProcessed; } @@ -25014,7 +25014,7 @@ static ma_result ma_device_write__wasapi(ma_device* pDevice, const void* pFrames static ma_result ma_device_data_loop_wakeup__wasapi(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex || pDevice->type == ma_device_type_loopback) { SetEvent((HANDLE)pDevice->wasapi.hEventCapture); @@ -25032,7 +25032,7 @@ static ma_result ma_context_uninit__wasapi(ma_context* pContext) { ma_context_command__wasapi cmd = ma_context_init_command__wasapi(MA_CONTEXT_COMMAND_QUIT__WASAPI); - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_wasapi); ma_context_post_command__wasapi(pContext, &cmd); @@ -25040,14 +25040,14 @@ static ma_result ma_context_uninit__wasapi(ma_context* pContext) if (pContext->wasapi.hAvrt) { ma_dlclose(ma_context_get_log(pContext), pContext->wasapi.hAvrt); - pContext->wasapi.hAvrt = nullptr; + pContext->wasapi.hAvrt = NULL; } #if defined(MA_WIN32_UWP) { if (pContext->wasapi.hMMDevapi) { ma_dlclose(ma_context_get_log(pContext), pContext->wasapi.hMMDevapi); - pContext->wasapi.hMMDevapi = nullptr; + pContext->wasapi.hMMDevapi = NULL; } } #endif @@ -25063,7 +25063,7 @@ static ma_result ma_context_init__wasapi(ma_context* pContext, const ma_context_ { ma_result result = MA_SUCCESS; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); (void)pConfig; @@ -25081,13 +25081,13 @@ static ma_result ma_context_init__wasapi(ma_context* pContext, const ma_context_ ma_PFNVerSetConditionMask _VerSetConditionMask; kernel32DLL = ma_dlopen(ma_context_get_log(pContext), "kernel32.dll"); - if (kernel32DLL == nullptr) { + if (kernel32DLL == NULL) { return MA_NO_BACKEND; } _VerifyVersionInfoW = (ma_PFNVerifyVersionInfoW )ma_dlsym(ma_context_get_log(pContext), kernel32DLL, "VerifyVersionInfoW"); _VerSetConditionMask = (ma_PFNVerSetConditionMask)ma_dlsym(ma_context_get_log(pContext), kernel32DLL, "VerSetConditionMask"); - if (_VerifyVersionInfoW == nullptr || _VerSetConditionMask == nullptr) { + if (_VerifyVersionInfoW == NULL || _VerSetConditionMask == NULL) { ma_dlclose(ma_context_get_log(pContext), kernel32DLL); return MA_NO_BACKEND; } @@ -25120,7 +25120,7 @@ static ma_result ma_context_init__wasapi(ma_context* pContext, const ma_context_ pContext->wasapi.hMMDevapi = ma_dlopen(ma_context_get_log(pContext), "mmdevapi.dll"); if (pContext->wasapi.hMMDevapi) { pContext->wasapi.ActivateAudioInterfaceAsync = ma_dlsym(ma_context_get_log(pContext), pContext->wasapi.hMMDevapi, "ActivateAudioInterfaceAsync"); - if (pContext->wasapi.ActivateAudioInterfaceAsync == nullptr) { + if (pContext->wasapi.ActivateAudioInterfaceAsync == NULL) { ma_dlclose(ma_context_get_log(pContext), pContext->wasapi.hMMDevapi); return MA_NO_BACKEND; /* ActivateAudioInterfaceAsync() could not be loaded. */ } @@ -25138,10 +25138,10 @@ static ma_result ma_context_init__wasapi(ma_context* pContext, const ma_context_ /* If either function could not be found, disable use of avrt entirely. */ if (!pContext->wasapi.AvSetMmThreadCharacteristicsA || !pContext->wasapi.AvRevertMmThreadcharacteristics) { - pContext->wasapi.AvSetMmThreadCharacteristicsA = nullptr; - pContext->wasapi.AvRevertMmThreadcharacteristics = nullptr; + pContext->wasapi.AvSetMmThreadCharacteristicsA = NULL; + pContext->wasapi.AvRevertMmThreadcharacteristics = NULL; ma_dlclose(ma_context_get_log(pContext), pContext->wasapi.hAvrt); - pContext->wasapi.hAvrt = nullptr; + pContext->wasapi.hAvrt = NULL; } } @@ -25202,7 +25202,7 @@ static ma_result ma_context_init__wasapi(ma_context* pContext, const ma_context_ pCallbacks->onDeviceStop = ma_device_stop__wasapi; pCallbacks->onDeviceRead = ma_device_read__wasapi; pCallbacks->onDeviceWrite = ma_device_write__wasapi; - pCallbacks->onDeviceDataLoop = nullptr; + pCallbacks->onDeviceDataLoop = NULL; pCallbacks->onDeviceDataLoopWakeup = ma_device_data_loop_wakeup__wasapi; return MA_SUCCESS; @@ -25583,12 +25583,12 @@ static void ma_get_channels_from_speaker_config__dsound(DWORD speakerConfig, WOR DWORD channelMap; channels = 0; - if (pChannelsOut != nullptr) { + if (pChannelsOut != NULL) { channels = *pChannelsOut; } channelMap = 0; - if (pChannelMapOut != nullptr) { + if (pChannelMapOut != NULL) { channelMap = *pChannelMapOut; } @@ -25609,11 +25609,11 @@ static void ma_get_channels_from_speaker_config__dsound(DWORD speakerConfig, WOR default: break; } - if (pChannelsOut != nullptr) { + if (pChannelsOut != NULL) { *pChannelsOut = channels; } - if (pChannelMapOut != nullptr) { + if (pChannelMapOut != NULL) { *pChannelMapOut = channelMap; } } @@ -25625,13 +25625,13 @@ static ma_result ma_context_create_IDirectSound__dsound(ma_context* pContext, ma HWND hWnd; HRESULT hr; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(ppDirectSound != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(ppDirectSound != NULL); - *ppDirectSound = nullptr; - pDirectSound = nullptr; + *ppDirectSound = NULL; + pDirectSound = NULL; - if (FAILED(((ma_DirectSoundCreateProc)pContext->dsound.DirectSoundCreate)((pDeviceID == nullptr) ? nullptr : (const GUID*)pDeviceID->dsound, &pDirectSound, nullptr))) { + if (FAILED(((ma_DirectSoundCreateProc)pContext->dsound.DirectSoundCreate)((pDeviceID == NULL) ? NULL : (const GUID*)pDeviceID->dsound, &pDirectSound, NULL))) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[DirectSound] DirectSoundCreate() failed for playback device."); return MA_FAILED_TO_OPEN_BACKEND_DEVICE; } @@ -25660,18 +25660,18 @@ static ma_result ma_context_create_IDirectSoundCapture__dsound(ma_context* pCont ma_IDirectSoundCapture* pDirectSoundCapture; HRESULT hr; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(ppDirectSoundCapture != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(ppDirectSoundCapture != NULL); /* DirectSound does not support exclusive mode for capture. */ if (shareMode == ma_share_mode_exclusive) { return MA_SHARE_MODE_NOT_SUPPORTED; } - *ppDirectSoundCapture = nullptr; - pDirectSoundCapture = nullptr; + *ppDirectSoundCapture = NULL; + pDirectSoundCapture = NULL; - hr = ((ma_DirectSoundCaptureCreateProc)pContext->dsound.DirectSoundCaptureCreate)((pDeviceID == nullptr) ? nullptr : (const GUID*)pDeviceID->dsound, &pDirectSoundCapture, nullptr); + hr = ((ma_DirectSoundCaptureCreateProc)pContext->dsound.DirectSoundCaptureCreate)((pDeviceID == NULL) ? NULL : (const GUID*)pDeviceID->dsound, &pDirectSoundCapture, NULL); if (FAILED(hr)) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[DirectSound] DirectSoundCaptureCreate() failed for capture device."); return ma_result_from_HRESULT(hr); @@ -25688,8 +25688,8 @@ static ma_result ma_context_get_format_info_for_IDirectSoundCapture__dsound(ma_c WORD bitsPerSample; DWORD sampleRate; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pDirectSoundCapture != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pDirectSoundCapture != NULL); if (pChannels) { *pChannels = 0; @@ -25803,7 +25803,7 @@ static BOOL CALLBACK ma_context_enumerate_devices_callback__dsound(GUID* lpGuid, MA_ZERO_OBJECT(&deviceInfo); /* ID. */ - if (lpGuid != nullptr) { + if (lpGuid != NULL) { MA_COPY_MEMORY(deviceInfo.id.dsound, lpGuid, 16); } else { MA_ZERO_MEMORY(deviceInfo.id.dsound, 16); @@ -25815,7 +25815,7 @@ static BOOL CALLBACK ma_context_enumerate_devices_callback__dsound(GUID* lpGuid, /* Call the callback function, but make sure we stop enumerating if the callee requested so. */ - MA_ASSERT(pData != nullptr); + MA_ASSERT(pData != NULL); pData->terminated = (pData->callback(pData->pContext, pData->deviceType, &deviceInfo, pData->pUserData) == MA_FALSE); if (pData->terminated) { return FALSE; /* Stop enumeration. */ @@ -25828,8 +25828,8 @@ static ma_result ma_context_enumerate_devices__dsound(ma_context* pContext, ma_e { ma_context_enumerate_devices_callback_data__dsound data; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); data.pContext = pContext; data.callback = callback; @@ -25862,9 +25862,9 @@ typedef struct static BOOL CALLBACK ma_context_get_device_info_callback__dsound(GUID* lpGuid, const char* lpcstrDescription, const char* lpcstrModule, void* lpContext) { ma_context_get_device_info_callback_data__dsound* pData = (ma_context_get_device_info_callback_data__dsound*)lpContext; - MA_ASSERT(pData != nullptr); + MA_ASSERT(pData != NULL); - if ((pData->pDeviceID == nullptr || ma_is_guid_null(pData->pDeviceID->dsound)) && (lpGuid == nullptr || ma_is_guid_null(lpGuid))) { + if ((pData->pDeviceID == NULL || ma_is_guid_null(pData->pDeviceID->dsound)) && (lpGuid == NULL || ma_is_guid_null(lpGuid))) { /* Default device. */ ma_strncpy_s(pData->pDeviceInfo->name, sizeof(pData->pDeviceInfo->name), lpcstrDescription, (size_t)-1); pData->pDeviceInfo->isDefault = MA_TRUE; @@ -25872,7 +25872,7 @@ static BOOL CALLBACK ma_context_get_device_info_callback__dsound(GUID* lpGuid, c return FALSE; /* Stop enumeration. */ } else { /* Not the default device. */ - if (lpGuid != nullptr && pData->pDeviceID != nullptr) { + if (lpGuid != NULL && pData->pDeviceID != NULL) { if (memcmp(pData->pDeviceID->dsound, lpGuid, sizeof(pData->pDeviceID->dsound)) == 0) { ma_strncpy_s(pData->pDeviceInfo->name, sizeof(pData->pDeviceInfo->name), lpcstrDescription, (size_t)-1); pData->found = MA_TRUE; @@ -25890,7 +25890,7 @@ static ma_result ma_context_get_device_info__dsound(ma_context* pContext, ma_dev ma_result result; HRESULT hr; - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { ma_context_get_device_info_callback_data__dsound data; /* ID. */ @@ -25956,7 +25956,7 @@ static ma_result ma_context_get_device_info__dsound(ma_context* pContext, ma_dev /* Look at the speaker configuration to get a better idea on the channel count. */ hr = ma_IDirectSound_GetSpeakerConfig(pDirectSound, &speakerConfig); if (SUCCEEDED(hr)) { - ma_get_channels_from_speaker_config__dsound(speakerConfig, &channels, nullptr); + ma_get_channels_from_speaker_config__dsound(speakerConfig, &channels, NULL); } } else { /* It does not support stereo, which means we are stuck with mono. */ @@ -26042,22 +26042,22 @@ static ma_result ma_context_get_device_info__dsound(ma_context* pContext, ma_dev static ma_result ma_device_uninit__dsound(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); - if (pDevice->dsound.pCaptureBuffer != nullptr) { + if (pDevice->dsound.pCaptureBuffer != NULL) { ma_IDirectSoundCaptureBuffer_Release((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer); } - if (pDevice->dsound.pCapture != nullptr) { + if (pDevice->dsound.pCapture != NULL) { ma_IDirectSoundCapture_Release((ma_IDirectSoundCapture*)pDevice->dsound.pCapture); } - if (pDevice->dsound.pPlaybackBuffer != nullptr) { + if (pDevice->dsound.pPlaybackBuffer != NULL) { ma_IDirectSoundBuffer_Release((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackBuffer); } - if (pDevice->dsound.pPlaybackPrimaryBuffer != nullptr) { + if (pDevice->dsound.pPlaybackPrimaryBuffer != NULL) { ma_IDirectSoundBuffer_Release((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackPrimaryBuffer); } - if (pDevice->dsound.pPlayback != nullptr) { + if (pDevice->dsound.pPlayback != NULL) { ma_IDirectSound_Release((ma_IDirectSound*)pDevice->dsound.pPlayback); } @@ -26137,7 +26137,7 @@ static ma_result ma_device_init__dsound(ma_device* pDevice, const ma_device_conf ma_result result; HRESULT hr; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ZERO_OBJECT(&pDevice->dsound); @@ -26189,7 +26189,7 @@ static ma_result ma_device_init__dsound(ma_device* pDevice, const ma_device_conf descDS.dwFlags = 0; descDS.dwBufferBytes = periodSizeInFrames * periodCount * wf.nBlockAlign; descDS.lpwfxFormat = (MA_WAVEFORMATEX*)&wf; - hr = ma_IDirectSoundCapture_CreateCaptureBuffer((ma_IDirectSoundCapture*)pDevice->dsound.pCapture, &descDS, (ma_IDirectSoundCaptureBuffer**)&pDevice->dsound.pCaptureBuffer, nullptr); + hr = ma_IDirectSoundCapture_CreateCaptureBuffer((ma_IDirectSoundCapture*)pDevice->dsound.pCapture, &descDS, (ma_IDirectSoundCaptureBuffer**)&pDevice->dsound.pCaptureBuffer, NULL); if (FAILED(hr)) { ma_device_uninit__dsound(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] IDirectSoundCapture_CreateCaptureBuffer() failed for capture device."); @@ -26198,7 +26198,7 @@ static ma_result ma_device_init__dsound(ma_device* pDevice, const ma_device_conf /* Get the _actual_ properties of the buffer. */ pActualFormat = (MA_WAVEFORMATEXTENSIBLE*)rawdata; - hr = ma_IDirectSoundCaptureBuffer_GetFormat((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer, (MA_WAVEFORMATEX*)pActualFormat, sizeof(rawdata), nullptr); + hr = ma_IDirectSoundCaptureBuffer_GetFormat((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer, (MA_WAVEFORMATEX*)pActualFormat, sizeof(rawdata), NULL); if (FAILED(hr)) { ma_device_uninit__dsound(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Failed to retrieve the actual format of the capture device's buffer."); @@ -26225,7 +26225,7 @@ static ma_result ma_device_init__dsound(ma_device* pDevice, const ma_device_conf descDS.dwBufferBytes = periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorCapture->format, pDescriptorCapture->channels) * periodCount; ma_IDirectSoundCaptureBuffer_Release((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer); - hr = ma_IDirectSoundCapture_CreateCaptureBuffer((ma_IDirectSoundCapture*)pDevice->dsound.pCapture, &descDS, (ma_IDirectSoundCaptureBuffer**)&pDevice->dsound.pCaptureBuffer, nullptr); + hr = ma_IDirectSoundCapture_CreateCaptureBuffer((ma_IDirectSoundCapture*)pDevice->dsound.pCapture, &descDS, (ma_IDirectSoundCaptureBuffer**)&pDevice->dsound.pCaptureBuffer, NULL); if (FAILED(hr)) { ma_device_uninit__dsound(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Second attempt at IDirectSoundCapture_CreateCaptureBuffer() failed for capture device."); @@ -26264,7 +26264,7 @@ static ma_result ma_device_init__dsound(ma_device* pDevice, const ma_device_conf MA_ZERO_OBJECT(&descDSPrimary); descDSPrimary.dwSize = sizeof(MA_DSBUFFERDESC); descDSPrimary.dwFlags = MA_DSBCAPS_PRIMARYBUFFER | MA_DSBCAPS_CTRLVOLUME; - hr = ma_IDirectSound_CreateSoundBuffer((ma_IDirectSound*)pDevice->dsound.pPlayback, &descDSPrimary, (ma_IDirectSoundBuffer**)&pDevice->dsound.pPlaybackPrimaryBuffer, nullptr); + hr = ma_IDirectSound_CreateSoundBuffer((ma_IDirectSound*)pDevice->dsound.pPlayback, &descDSPrimary, (ma_IDirectSoundBuffer**)&pDevice->dsound.pPlaybackPrimaryBuffer, NULL); if (FAILED(hr)) { ma_device_uninit__dsound(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] IDirectSound_CreateSoundBuffer() failed for playback device's primary buffer."); @@ -26348,7 +26348,7 @@ static ma_result ma_device_init__dsound(ma_device* pDevice, const ma_device_conf /* Get the _actual_ properties of the buffer. */ pActualFormat = (MA_WAVEFORMATEXTENSIBLE*)rawdata; - hr = ma_IDirectSoundBuffer_GetFormat((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackPrimaryBuffer, (MA_WAVEFORMATEX*)pActualFormat, sizeof(rawdata), nullptr); + hr = ma_IDirectSoundBuffer_GetFormat((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackPrimaryBuffer, (MA_WAVEFORMATEX*)pActualFormat, sizeof(rawdata), NULL); if (FAILED(hr)) { ma_device_uninit__dsound(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Failed to retrieve the actual format of the playback device's primary buffer."); @@ -26391,7 +26391,7 @@ static ma_result ma_device_init__dsound(ma_device* pDevice, const ma_device_conf descDS.dwFlags = MA_DSBCAPS_CTRLPOSITIONNOTIFY | MA_DSBCAPS_GLOBALFOCUS | MA_DSBCAPS_GETCURRENTPOSITION2; descDS.dwBufferBytes = periodSizeInFrames * periodCount * ma_get_bytes_per_frame(pDescriptorPlayback->format, pDescriptorPlayback->channels); descDS.lpwfxFormat = (MA_WAVEFORMATEX*)pActualFormat; - hr = ma_IDirectSound_CreateSoundBuffer((ma_IDirectSound*)pDevice->dsound.pPlayback, &descDS, (ma_IDirectSoundBuffer**)&pDevice->dsound.pPlaybackBuffer, nullptr); + hr = ma_IDirectSound_CreateSoundBuffer((ma_IDirectSound*)pDevice->dsound.pPlayback, &descDS, (ma_IDirectSoundBuffer**)&pDevice->dsound.pPlaybackBuffer, NULL); if (FAILED(hr)) { ma_device_uninit__dsound(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] IDirectSound_CreateSoundBuffer() failed for playback device's secondary buffer."); @@ -26432,7 +26432,7 @@ static ma_result ma_device_data_loop__dsound(ma_device* pDevice) ma_uint32 waitTimeInMilliseconds = 1; DWORD playbackBufferStatus = 0; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* The first thing to do is start the capture device. The playback device is only started after the first period is written. */ if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { @@ -26490,7 +26490,7 @@ static ma_result ma_device_data_loop__dsound(ma_device* pDevice) continue; /* Nothing is available in the capture buffer. */ } - hr = ma_IDirectSoundCaptureBuffer_Lock((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer, lockOffsetInBytesCapture, lockSizeInBytesCapture, &pMappedDeviceBufferCapture, &mappedSizeInBytesCapture, nullptr, nullptr, 0); + hr = ma_IDirectSoundCaptureBuffer_Lock((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer, lockOffsetInBytesCapture, lockSizeInBytesCapture, &pMappedDeviceBufferCapture, &mappedSizeInBytesCapture, NULL, NULL, 0); if (FAILED(hr)) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Failed to map buffer from capture device in preparation for writing to the device."); return ma_result_from_HRESULT(hr); @@ -26589,7 +26589,7 @@ static ma_result ma_device_data_loop__dsound(ma_device* pDevice) lockSizeInBytesPlayback = physicalPlayCursorInBytes - virtualWriteCursorInBytesPlayback; } - hr = ma_IDirectSoundBuffer_Lock((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackBuffer, lockOffsetInBytesPlayback, lockSizeInBytesPlayback, &pMappedDeviceBufferPlayback, &mappedSizeInBytesPlayback, nullptr, nullptr, 0); + hr = ma_IDirectSoundBuffer_Lock((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackBuffer, lockOffsetInBytesPlayback, lockSizeInBytesPlayback, &pMappedDeviceBufferPlayback, &mappedSizeInBytesPlayback, NULL, NULL, 0); if (FAILED(hr)) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Failed to map buffer from playback device in preparation for writing to the device."); result = ma_result_from_HRESULT(hr); @@ -26632,7 +26632,7 @@ static ma_result ma_device_data_loop__dsound(ma_device* pDevice) } - hr = ma_IDirectSoundBuffer_Unlock((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackBuffer, pMappedDeviceBufferPlayback, framesWrittenThisIteration*bpfDevicePlayback, nullptr, 0); + hr = ma_IDirectSoundBuffer_Unlock((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackBuffer, pMappedDeviceBufferPlayback, framesWrittenThisIteration*bpfDevicePlayback, NULL, 0); if (FAILED(hr)) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Failed to unlock internal buffer from playback device after writing to the device."); result = ma_result_from_HRESULT(hr); @@ -26672,7 +26672,7 @@ static ma_result ma_device_data_loop__dsound(ma_device* pDevice) /* At this point we're done with the mapped portion of the capture buffer. */ - hr = ma_IDirectSoundCaptureBuffer_Unlock((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer, pMappedDeviceBufferCapture, mappedSizeInBytesCapture, nullptr, 0); + hr = ma_IDirectSoundCaptureBuffer_Unlock((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer, pMappedDeviceBufferCapture, mappedSizeInBytesCapture, NULL, 0); if (FAILED(hr)) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Failed to unlock internal buffer from capture device after reading from the device."); return ma_result_from_HRESULT(hr); @@ -26723,7 +26723,7 @@ static ma_result ma_device_data_loop__dsound(ma_device* pDevice) continue; /* Nothing is available in the capture buffer. */ } - hr = ma_IDirectSoundCaptureBuffer_Lock((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer, lockOffsetInBytesCapture, lockSizeInBytesCapture, &pMappedDeviceBufferCapture, &mappedSizeInBytesCapture, nullptr, nullptr, 0); + hr = ma_IDirectSoundCaptureBuffer_Lock((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer, lockOffsetInBytesCapture, lockSizeInBytesCapture, &pMappedDeviceBufferCapture, &mappedSizeInBytesCapture, NULL, NULL, 0); if (FAILED(hr)) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Failed to map buffer from capture device in preparation for writing to the device."); result = ma_result_from_HRESULT(hr); @@ -26735,7 +26735,7 @@ static ma_result ma_device_data_loop__dsound(ma_device* pDevice) ma_device__send_frames_to_client(pDevice, mappedSizeInBytesCapture/bpfDeviceCapture, pMappedDeviceBufferCapture); - hr = ma_IDirectSoundCaptureBuffer_Unlock((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer, pMappedDeviceBufferCapture, mappedSizeInBytesCapture, nullptr, 0); + hr = ma_IDirectSoundCaptureBuffer_Unlock((ma_IDirectSoundCaptureBuffer*)pDevice->dsound.pCaptureBuffer, pMappedDeviceBufferCapture, mappedSizeInBytesCapture, NULL, 0); if (FAILED(hr)) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Failed to unlock internal buffer from capture device after reading from the device."); return ma_result_from_HRESULT(hr); @@ -26826,7 +26826,7 @@ static ma_result ma_device_data_loop__dsound(ma_device* pDevice) lockSizeInBytesPlayback = physicalPlayCursorInBytes - virtualWriteCursorInBytesPlayback; } - hr = ma_IDirectSoundBuffer_Lock((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackBuffer, lockOffsetInBytesPlayback, lockSizeInBytesPlayback, &pMappedDeviceBufferPlayback, &mappedSizeInBytesPlayback, nullptr, nullptr, 0); + hr = ma_IDirectSoundBuffer_Lock((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackBuffer, lockOffsetInBytesPlayback, lockSizeInBytesPlayback, &pMappedDeviceBufferPlayback, &mappedSizeInBytesPlayback, NULL, NULL, 0); if (FAILED(hr)) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Failed to map buffer from playback device in preparation for writing to the device."); result = ma_result_from_HRESULT(hr); @@ -26836,7 +26836,7 @@ static ma_result ma_device_data_loop__dsound(ma_device* pDevice) /* At this point we have a buffer for output. */ ma_device__read_frames_from_client(pDevice, (mappedSizeInBytesPlayback/bpfDevicePlayback), pMappedDeviceBufferPlayback); - hr = ma_IDirectSoundBuffer_Unlock((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackBuffer, pMappedDeviceBufferPlayback, mappedSizeInBytesPlayback, nullptr, 0); + hr = ma_IDirectSoundBuffer_Unlock((ma_IDirectSoundBuffer*)pDevice->dsound.pPlaybackBuffer, pMappedDeviceBufferPlayback, mappedSizeInBytesPlayback, NULL, 0); if (FAILED(hr)) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[DirectSound] Failed to unlock internal buffer from playback device after writing to the device."); result = ma_result_from_HRESULT(hr); @@ -26938,7 +26938,7 @@ static ma_result ma_device_data_loop__dsound(ma_device* pDevice) static ma_result ma_context_uninit__dsound(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_dsound); ma_dlclose(ma_context_get_log(pContext), pContext->dsound.hDSoundDLL); @@ -26948,12 +26948,12 @@ static ma_result ma_context_uninit__dsound(ma_context* pContext) static ma_result ma_context_init__dsound(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); (void)pConfig; pContext->dsound.hDSoundDLL = ma_dlopen(ma_context_get_log(pContext), "dsound.dll"); - if (pContext->dsound.hDSoundDLL == nullptr) { + if (pContext->dsound.hDSoundDLL == NULL) { return MA_API_NOT_FOUND; } @@ -26967,10 +26967,10 @@ static ma_result ma_context_init__dsound(ma_context* pContext, const ma_context_ well in my testing. For example, it's missing DirectSoundCaptureEnumerateA(). This is a convenient place to just disable the DirectSound backend for Windows 95. */ - if (pContext->dsound.DirectSoundCreate == nullptr || - pContext->dsound.DirectSoundEnumerateA == nullptr || - pContext->dsound.DirectSoundCaptureCreate == nullptr || - pContext->dsound.DirectSoundCaptureEnumerateA == nullptr) { + if (pContext->dsound.DirectSoundCreate == NULL || + pContext->dsound.DirectSoundEnumerateA == NULL || + pContext->dsound.DirectSoundCaptureCreate == NULL || + pContext->dsound.DirectSoundCaptureEnumerateA == NULL) { return MA_API_NOT_FOUND; } @@ -26982,10 +26982,10 @@ static ma_result ma_context_init__dsound(ma_context* pContext, const ma_context_ pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__dsound; pCallbacks->onDeviceInit = ma_device_init__dsound; pCallbacks->onDeviceUninit = ma_device_uninit__dsound; - pCallbacks->onDeviceStart = nullptr; /* Not used. Started in onDeviceDataLoop. */ - pCallbacks->onDeviceStop = nullptr; /* Not used. Stopped in onDeviceDataLoop. */ - pCallbacks->onDeviceRead = nullptr; /* Not used. Data is read directly in onDeviceDataLoop. */ - pCallbacks->onDeviceWrite = nullptr; /* Not used. Data is written directly in onDeviceDataLoop. */ + pCallbacks->onDeviceStart = NULL; /* Not used. Started in onDeviceDataLoop. */ + pCallbacks->onDeviceStop = NULL; /* Not used. Stopped in onDeviceDataLoop. */ + pCallbacks->onDeviceRead = NULL; /* Not used. Data is read directly in onDeviceDataLoop. */ + pCallbacks->onDeviceWrite = NULL; /* Not used. Data is written directly in onDeviceDataLoop. */ pCallbacks->onDeviceDataLoop = ma_device_data_loop__dsound; return MA_SUCCESS; @@ -27132,11 +27132,11 @@ static char* ma_find_last_character(char* str, char ch) { char* last; - if (str == nullptr) { - return nullptr; + if (str == NULL) { + return NULL; } - last = nullptr; + last = NULL; while (*str != '\0') { if (*str == ch) { last = str; @@ -27250,7 +27250,7 @@ static ma_result ma_formats_flags_to_WAVEFORMATEX__winmm(DWORD dwFormats, WORD c { ma_result result; - MA_ASSERT(pWF != nullptr); + MA_ASSERT(pWF != NULL); MA_ZERO_OBJECT(pWF); pWF->cbSize = sizeof(*pWF); @@ -27277,9 +27277,9 @@ static ma_result ma_context_get_device_info_from_WAVECAPS(ma_context* pContext, DWORD sampleRate; ma_result result; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pCaps != nullptr); - MA_ASSERT(pDeviceInfo != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pCaps != NULL); + MA_ASSERT(pDeviceInfo != NULL); /* Name / Description @@ -27317,7 +27317,7 @@ static ma_result ma_context_get_device_info_from_WAVECAPS(ma_context* pContext, if (((MA_PFN_RegOpenKeyExA)pContext->win32.RegOpenKeyExA)(HKEY_LOCAL_MACHINE, keyStr, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { BYTE nameFromReg[512]; DWORD nameFromRegSize = sizeof(nameFromReg); - LONG resultWin32 = ((MA_PFN_RegQueryValueExA)pContext->win32.RegQueryValueExA)(hKey, "Name", 0, nullptr, (BYTE*)nameFromReg, (DWORD*)&nameFromRegSize); + LONG resultWin32 = ((MA_PFN_RegQueryValueExA)pContext->win32.RegQueryValueExA)(hKey, "Name", 0, NULL, (BYTE*)nameFromReg, (DWORD*)&nameFromRegSize); ((MA_PFN_RegCloseKey)pContext->win32.RegCloseKey)(hKey); if (resultWin32 == ERROR_SUCCESS) { @@ -27325,7 +27325,7 @@ static ma_result ma_context_get_device_info_from_WAVECAPS(ma_context* pContext, char name[1024]; if (ma_strcpy_s(name, sizeof(name), pDeviceInfo->name) == 0) { char* nameBeg = ma_find_last_character(name, '('); - if (nameBeg != nullptr) { + if (nameBeg != NULL) { size_t leadingLen = (nameBeg - name); ma_strncpy_s(nameBeg + 1, sizeof(name) - leadingLen, (const char*)nameFromReg, (size_t)-1); @@ -27371,9 +27371,9 @@ static ma_result ma_context_get_device_info_from_WAVEOUTCAPS2(ma_context* pConte { MA_WAVECAPSA caps; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pCaps != nullptr); - MA_ASSERT(pDeviceInfo != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pCaps != NULL); + MA_ASSERT(pDeviceInfo != NULL); MA_COPY_MEMORY(caps.szPname, pCaps->szPname, sizeof(caps.szPname)); caps.dwFormats = pCaps->dwFormats; @@ -27386,9 +27386,9 @@ static ma_result ma_context_get_device_info_from_WAVEINCAPS2(ma_context* pContex { MA_WAVECAPSA caps; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pCaps != nullptr); - MA_ASSERT(pDeviceInfo != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pCaps != NULL); + MA_ASSERT(pDeviceInfo != NULL); MA_COPY_MEMORY(caps.szPname, pCaps->szPname, sizeof(caps.szPname)); caps.dwFormats = pCaps->dwFormats; @@ -27405,8 +27405,8 @@ static ma_result ma_context_enumerate_devices__winmm(ma_context* pContext, ma_en UINT iPlaybackDevice; UINT iCaptureDevice; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); /* Playback. */ playbackDeviceCount = ((MA_PFN_waveOutGetNumDevs)pContext->winmm.waveOutGetNumDevs)(); @@ -27473,10 +27473,10 @@ static ma_result ma_context_get_device_info__winmm(ma_context* pContext, ma_devi { UINT winMMDeviceID; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); winMMDeviceID = 0; - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { winMMDeviceID = (UINT)pDeviceID->winmm; } @@ -27515,7 +27515,7 @@ static ma_result ma_context_get_device_info__winmm(ma_context* pContext, ma_devi static ma_result ma_device_uninit__winmm(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { ((MA_PFN_waveInClose)pDevice->pContext->winmm.waveInClose)((MA_HWAVEIN)pDevice->winmm.hDeviceCapture); @@ -27558,7 +27558,7 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi UINT winMMDeviceIDPlayback = 0; UINT winMMDeviceIDCapture = 0; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ZERO_OBJECT(&pDevice->winmm); @@ -27572,10 +27572,10 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi return MA_SHARE_MODE_NOT_SUPPORTED; } - if (pDescriptorPlayback->pDeviceID != nullptr) { + if (pDescriptorPlayback->pDeviceID != NULL) { winMMDeviceIDPlayback = (UINT)pDescriptorPlayback->pDeviceID->winmm; } - if (pDescriptorCapture->pDeviceID != nullptr) { + if (pDescriptorCapture->pDeviceID != NULL) { winMMDeviceIDCapture = (UINT)pDescriptorCapture->pDeviceID->winmm; } @@ -27586,8 +27586,8 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi MA_MMRESULT resultMM; /* We use an event to know when a new fragment needs to be enqueued. */ - pDevice->winmm.hEventCapture = (ma_handle)CreateEventA(nullptr, TRUE, TRUE, nullptr); - if (pDevice->winmm.hEventCapture == nullptr) { + pDevice->winmm.hEventCapture = (ma_handle)CreateEventA(NULL, TRUE, TRUE, NULL); + if (pDevice->winmm.hEventCapture == NULL) { errorMsg = "[WinMM] Failed to create event for fragment enqueuing for the capture device.", errorCode = ma_result_from_GetLastError(GetLastError()); goto on_error; } @@ -27624,8 +27624,8 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi MA_MMRESULT resultMM; /* We use an event to know when a new fragment needs to be enqueued. */ - pDevice->winmm.hEventPlayback = (ma_handle)CreateEventA(nullptr, TRUE, TRUE, nullptr); - if (pDevice->winmm.hEventPlayback == nullptr) { + pDevice->winmm.hEventPlayback = (ma_handle)CreateEventA(NULL, TRUE, TRUE, NULL); + if (pDevice->winmm.hEventPlayback == NULL) { errorMsg = "[WinMM] Failed to create event for fragment enqueuing for the playback device.", errorCode = ma_result_from_GetLastError(GetLastError()); goto on_error; } @@ -27670,7 +27670,7 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi } pDevice->winmm._pHeapData = (ma_uint8*)ma_calloc(heapSize, &pDevice->pContext->allocationCallbacks); - if (pDevice->winmm._pHeapData == nullptr) { + if (pDevice->winmm._pHeapData == NULL) { errorMsg = "[WinMM] Failed to allocate memory for the intermediary buffer.", errorCode = MA_OUT_OF_MEMORY; goto on_error; } @@ -27739,7 +27739,7 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi on_error: if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { - if (pDevice->winmm.pWAVEHDRCapture != nullptr) { + if (pDevice->winmm.pWAVEHDRCapture != NULL) { ma_uint32 iPeriod; for (iPeriod = 0; iPeriod < pDescriptorCapture->periodCount; ++iPeriod) { ((MA_PFN_waveInUnprepareHeader)pDevice->pContext->winmm.waveInUnprepareHeader)((MA_HWAVEIN)pDevice->winmm.hDeviceCapture, &((MA_WAVEHDR*)pDevice->winmm.pWAVEHDRCapture)[iPeriod], sizeof(MA_WAVEHDR)); @@ -27750,7 +27750,7 @@ on_error: } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - if (pDevice->winmm.pWAVEHDRCapture != nullptr) { + if (pDevice->winmm.pWAVEHDRCapture != NULL) { ma_uint32 iPeriod; for (iPeriod = 0; iPeriod < pDescriptorPlayback->periodCount; ++iPeriod) { ((MA_PFN_waveOutUnprepareHeader)pDevice->pContext->winmm.waveOutUnprepareHeader)((MA_HWAVEOUT)pDevice->winmm.hDevicePlayback, &((MA_WAVEHDR*)pDevice->winmm.pWAVEHDRPlayback)[iPeriod], sizeof(MA_WAVEHDR)); @@ -27762,7 +27762,7 @@ on_error: ma_free(pDevice->winmm._pHeapData, &pDevice->pContext->allocationCallbacks); - if (errorMsg != nullptr && errorMsg[0] != '\0') { + if (errorMsg != NULL && errorMsg[0] != '\0') { ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "%s", errorMsg); } @@ -27771,7 +27771,7 @@ on_error: static ma_result ma_device_start__winmm(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { MA_MMRESULT resultMM; @@ -27814,10 +27814,10 @@ static ma_result ma_device_stop__winmm(ma_device* pDevice) { MA_MMRESULT resultMM; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { - if (pDevice->winmm.hDeviceCapture == nullptr) { + if (pDevice->winmm.hDeviceCapture == NULL) { return MA_INVALID_ARGS; } @@ -27831,7 +27831,7 @@ static ma_result ma_device_stop__winmm(ma_device* pDevice) ma_uint32 iPeriod; MA_WAVEHDR* pWAVEHDR; - if (pDevice->winmm.hDevicePlayback == nullptr) { + if (pDevice->winmm.hDevicePlayback == NULL) { return MA_INVALID_ARGS; } @@ -27863,10 +27863,10 @@ static ma_result ma_device_write__winmm(ma_device* pDevice, const void* pPCMFram ma_uint32 totalFramesWritten; MA_WAVEHDR* pWAVEHDR; - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pPCMFrames != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pPCMFrames != NULL); - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = 0; } @@ -27941,7 +27941,7 @@ static ma_result ma_device_write__winmm(ma_device* pDevice, const void* pPCMFram } } - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = totalFramesWritten; } @@ -27955,10 +27955,10 @@ static ma_result ma_device_read__winmm(ma_device* pDevice, void* pPCMFrames, ma_ ma_uint32 totalFramesRead; MA_WAVEHDR* pWAVEHDR; - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pPCMFrames != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pPCMFrames != NULL); - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -28030,7 +28030,7 @@ static ma_result ma_device_read__winmm(ma_device* pDevice, void* pPCMFrames, ma_ } } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesRead; } @@ -28039,7 +28039,7 @@ static ma_result ma_device_read__winmm(ma_device* pDevice, void* pPCMFrames, ma_ static ma_result ma_context_uninit__winmm(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_winmm); ma_dlclose(ma_context_get_log(pContext), pContext->winmm.hWinMM); @@ -28048,12 +28048,12 @@ static ma_result ma_context_uninit__winmm(ma_context* pContext) static ma_result ma_context_init__winmm(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); (void)pConfig; pContext->winmm.hWinMM = ma_dlopen(ma_context_get_log(pContext), "winmm.dll"); - if (pContext->winmm.hWinMM == nullptr) { + if (pContext->winmm.hWinMM == NULL) { return MA_NO_BACKEND; } @@ -28085,7 +28085,7 @@ static ma_result ma_context_init__winmm(ma_context* pContext, const ma_context_c pCallbacks->onDeviceStop = ma_device_stop__winmm; pCallbacks->onDeviceRead = ma_device_read__winmm; pCallbacks->onDeviceWrite = ma_device_write__winmm; - pCallbacks->onDeviceDataLoop = nullptr; /* This is a blocking read-write API, so this can be nullptr since miniaudio will manage the audio thread for us. */ + pCallbacks->onDeviceDataLoop = NULL; /* This is a blocking read-write API, so this can be NULL since miniaudio will manage the audio thread for us. */ return MA_SUCCESS; } @@ -28546,7 +28546,7 @@ static const char* ma_find_char(const char* str, char c, int* index) for (;;) { if (str[i] == '\0') { if (index) *index = -1; - return nullptr; + return NULL; } if (str[i] == c) { @@ -28559,7 +28559,7 @@ static const char* ma_find_char(const char* str, char c, int* index) /* Should never get here, but treat it as though the character was not found to make me feel better inside. */ if (index) *index = -1; - return nullptr; + return NULL; } static ma_bool32 ma_is_device_name_in_hw_format__alsa(const char* hwid) @@ -28570,7 +28570,7 @@ static ma_bool32 ma_is_device_name_in_hw_format__alsa(const char* hwid) const char* dev; int i; - if (hwid == nullptr) { + if (hwid == NULL) { return MA_FALSE; } @@ -28581,7 +28581,7 @@ static ma_bool32 ma_is_device_name_in_hw_format__alsa(const char* hwid) hwid += 3; dev = ma_find_char(hwid, ',', &commaPos); - if (dev == nullptr) { + if (dev == NULL) { return MA_FALSE; } else { dev += 1; /* Skip past the ",". */ @@ -28616,7 +28616,7 @@ static int ma_convert_device_name_to_hw_format__alsa(ma_context* pContext, char* const char* dev; int cardIndex; - if (dst == nullptr) { + if (dst == NULL) { return -1; } if (dstSize < 7) { @@ -28624,7 +28624,7 @@ static int ma_convert_device_name_to_hw_format__alsa(ma_context* pContext, char* } *dst = '\0'; /* Safety. */ - if (src == nullptr) { + if (src == NULL) { return -1; } @@ -28634,12 +28634,12 @@ static int ma_convert_device_name_to_hw_format__alsa(ma_context* pContext, char* } src = ma_find_char(src, ':', &colonPos); - if (src == nullptr) { + if (src == NULL) { return -1; /* Couldn't find a colon */ } dev = ma_find_char(src, ',', &commaPos); - if (dev == nullptr) { + if (dev == NULL) { dev = "0"; ma_strncpy_s(card, sizeof(card), src+6, (size_t)-1); /* +6 = ":CARD=" */ } else { @@ -28672,7 +28672,7 @@ static ma_bool32 ma_does_id_exist_in_list__alsa(ma_device_id* pUniqueIDs, ma_uin { ma_uint32 i; - MA_ASSERT(pHWID != nullptr); + MA_ASSERT(pHWID != NULL); for (i = 0; i < count; ++i) { if (ma_strcmp(pUniqueIDs[i].alsa, pHWID) == 0) { @@ -28689,15 +28689,15 @@ static ma_result ma_context_open_pcm__alsa(ma_context* pContext, ma_share_mode s ma_snd_pcm_t* pPCM; ma_snd_pcm_stream_t stream; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(ppPCM != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(ppPCM != NULL); - *ppPCM = nullptr; - pPCM = nullptr; + *ppPCM = NULL; + pPCM = NULL; stream = (deviceType == ma_device_type_playback) ? MA_SND_PCM_STREAM_PLAYBACK : MA_SND_PCM_STREAM_CAPTURE; - if (pDeviceID == nullptr) { + if (pDeviceID == NULL) { ma_bool32 isDeviceOpen; size_t i; @@ -28707,12 +28707,12 @@ static ma_result ma_context_open_pcm__alsa(ma_context* pContext, ma_share_mode s */ const char* defaultDeviceNames[] = { "default", - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr + NULL, + NULL, + NULL, + NULL, + NULL, + NULL }; if (shareMode == ma_share_mode_exclusive) { @@ -28736,7 +28736,7 @@ static ma_result ma_context_open_pcm__alsa(ma_context* pContext, ma_share_mode s isDeviceOpen = MA_FALSE; for (i = 0; i < ma_countof(defaultDeviceNames); ++i) { - if (defaultDeviceNames[i] != nullptr && defaultDeviceNames[i][0] != '\0') { + if (defaultDeviceNames[i] != NULL && defaultDeviceNames[i][0] != '\0') { if (((ma_snd_pcm_open_proc)pContext->alsa.snd_pcm_open)(&pPCM, defaultDeviceNames[i], stream, openMode) == 0) { isDeviceOpen = MA_TRUE; break; @@ -28809,12 +28809,12 @@ static ma_result ma_context_enumerate_devices__alsa(ma_context* pContext, ma_enu int resultALSA; ma_bool32 cbResult = MA_TRUE; char** ppDeviceHints; - ma_device_id* pUniqueIDs = nullptr; + ma_device_id* pUniqueIDs = NULL; ma_uint32 uniqueIDCount = 0; char** ppNextDeviceHint; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); ma_mutex_lock(&pContext->alsa.internalDeviceEnumLock); @@ -28825,7 +28825,7 @@ static ma_result ma_context_enumerate_devices__alsa(ma_context* pContext, ma_enu } ppNextDeviceHint = ppDeviceHints; - while (*ppNextDeviceHint != nullptr) { + while (*ppNextDeviceHint != NULL) { char* NAME = ((ma_snd_device_name_get_hint_proc)pContext->alsa.snd_device_name_get_hint)(*ppNextDeviceHint, "NAME"); char* DESC = ((ma_snd_device_name_get_hint_proc)pContext->alsa.snd_device_name_get_hint)(*ppNextDeviceHint, "DESC"); char* IOID = ((ma_snd_device_name_get_hint_proc)pContext->alsa.snd_device_name_get_hint)(*ppNextDeviceHint, "IOID"); @@ -28834,14 +28834,14 @@ static ma_result ma_context_enumerate_devices__alsa(ma_context* pContext, ma_enu char hwid[sizeof(pUniqueIDs->alsa)]; ma_device_info deviceInfo; - if ((IOID == nullptr || ma_strcmp(IOID, "Output") == 0)) { + if ((IOID == NULL || ma_strcmp(IOID, "Output") == 0)) { deviceType = ma_device_type_playback; } - if ((IOID != nullptr && ma_strcmp(IOID, "Input" ) == 0)) { + if ((IOID != NULL && ma_strcmp(IOID, "Input" ) == 0)) { deviceType = ma_device_type_capture; } - if (NAME != nullptr) { + if (NAME != NULL) { if (pContext->alsa.useVerboseDeviceEnumeration) { /* Verbose mode. Use the name exactly as-is. */ ma_strncpy_s(hwid, sizeof(hwid), NAME, (size_t)-1); @@ -28868,7 +28868,7 @@ static ma_result ma_context_enumerate_devices__alsa(ma_context* pContext, ma_enu /* The device has not yet been enumerated. Make sure it's added to our list so that it's not enumerated again. */ size_t newCapacity = sizeof(*pUniqueIDs) * (uniqueIDCount + 1); ma_device_id* pNewUniqueIDs = (ma_device_id*)ma_realloc(pUniqueIDs, newCapacity, &pContext->allocationCallbacks); - if (pNewUniqueIDs == nullptr) { + if (pNewUniqueIDs == NULL) { goto next_device; /* Failed to allocate memory. */ } @@ -28904,10 +28904,10 @@ static ma_result ma_context_enumerate_devices__alsa(ma_context* pContext, ma_enu it makes formatting ugly and annoying. I'm therefore deciding to put it all on a single line with the second line being put into parentheses. In simplified mode I'm just stripping the second line entirely. */ - if (DESC != nullptr) { + if (DESC != NULL) { int lfPos; const char* line2 = ma_find_char(DESC, '\n', &lfPos); - if (line2 != nullptr) { + if (line2 != NULL) { line2 += 1; /* Skip past the new-line character. */ if (pContext->alsa.useVerboseDeviceEnumeration) { @@ -28932,11 +28932,11 @@ static ma_result ma_context_enumerate_devices__alsa(ma_context* pContext, ma_enu /* Some devices are both playback and capture, but they are only enumerated by ALSA once. We need to fire the callback - again for the other device type in this case. We do this for known devices and where the IOID hint is nullptr, which + again for the other device type in this case. We do this for known devices and where the IOID hint is NULL, which means both Input and Output. */ if (cbResult) { - if (ma_is_common_device_name__alsa(NAME) || IOID == nullptr) { + if (ma_is_common_device_name__alsa(NAME) || IOID == NULL) { if (deviceType == ma_device_type_playback) { if (!ma_is_capture_device_blacklisted__alsa(NAME)) { cbResult = callback(pContext, ma_device_type_capture, &deviceInfo, pUserData); @@ -28986,15 +28986,15 @@ typedef struct static ma_bool32 ma_context_get_device_info_enum_callback__alsa(ma_context* pContext, ma_device_type deviceType, const ma_device_info* pDeviceInfo, void* pUserData) { ma_context_get_device_info_enum_callback_data__alsa* pData = (ma_context_get_device_info_enum_callback_data__alsa*)pUserData; - MA_ASSERT(pData != nullptr); + MA_ASSERT(pData != NULL); (void)pContext; - if (pData->pDeviceID == nullptr && ma_strcmp(pDeviceInfo->id.alsa, "default") == 0) { + if (pData->pDeviceID == NULL && ma_strcmp(pDeviceInfo->id.alsa, "default") == 0) { ma_strncpy_s(pData->pDeviceInfo->name, sizeof(pData->pDeviceInfo->name), pDeviceInfo->name, (size_t)-1); pData->foundDevice = MA_TRUE; } else { - if (pData->deviceType == deviceType && (pData->pDeviceID != nullptr && ma_strcmp(pData->pDeviceID->alsa, pDeviceInfo->id.alsa) == 0)) { + if (pData->deviceType == deviceType && (pData->pDeviceID != NULL && ma_strcmp(pData->pDeviceID->alsa, pDeviceInfo->id.alsa) == 0)) { ma_strncpy_s(pData->pDeviceInfo->name, sizeof(pData->pDeviceInfo->name), pDeviceInfo->name, (size_t)-1); pData->foundDevice = MA_TRUE; } @@ -29006,9 +29006,9 @@ static ma_bool32 ma_context_get_device_info_enum_callback__alsa(ma_context* pCon static void ma_context_test_rate_and_add_native_data_format__alsa(ma_context* pContext, ma_snd_pcm_t* pPCM, ma_snd_pcm_hw_params_t* pHWParams, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_uint32 flags, ma_device_info* pDeviceInfo) { - MA_ASSERT(pPCM != nullptr); - MA_ASSERT(pHWParams != nullptr); - MA_ASSERT(pDeviceInfo != nullptr); + MA_ASSERT(pPCM != NULL); + MA_ASSERT(pHWParams != NULL); + MA_ASSERT(pDeviceInfo != NULL); if (pDeviceInfo->nativeDataFormatCount < ma_countof(pDeviceInfo->nativeDataFormats) && ((ma_snd_pcm_hw_params_test_rate_proc)pContext->alsa.snd_pcm_hw_params_test_rate)(pPCM, pHWParams, sampleRate, 0) == 0) { pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].format = format; @@ -29062,7 +29062,7 @@ static ma_result ma_context_get_device_info__alsa(ma_context* pContext, ma_devic ma_uint32 iFormat; ma_uint32 iChannel; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); /* We just enumerate to find basic information about the device. */ data.deviceType = deviceType; @@ -29090,7 +29090,7 @@ static ma_result ma_context_get_device_info__alsa(ma_context* pContext, ma_devic /* We need to initialize a HW parameters object in order to know what formats are supported. */ pHWParams = (ma_snd_pcm_hw_params_t*)ma_calloc(((ma_snd_pcm_hw_params_sizeof_proc)pContext->alsa.snd_pcm_hw_params_sizeof)(), &pContext->allocationCallbacks); - if (pHWParams == nullptr) { + if (pHWParams == NULL) { ((ma_snd_pcm_close_proc)pContext->alsa.snd_pcm_close)(pPCM); return MA_OUT_OF_MEMORY; } @@ -29192,7 +29192,7 @@ static ma_result ma_context_get_device_info__alsa(ma_context* pContext, ma_devic static ma_result ma_device_uninit__alsa(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if ((ma_snd_pcm_t*)pDevice->alsa.pPCMCapture) { ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)((ma_snd_pcm_t*)pDevice->alsa.pPCMCapture); @@ -29230,9 +29230,9 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic struct pollfd* pPollDescriptors; int wakeupfd; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); MA_ASSERT(deviceType != ma_device_type_duplex); /* This function should only be called for playback _or_ capture, never duplex. */ - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); formatALSA = ma_convert_ma_format_to_alsa_format(pDescriptor->format); @@ -29255,7 +29255,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic /* Hardware parameters. */ pHWParams = (ma_snd_pcm_hw_params_t*)ma_calloc(((ma_snd_pcm_hw_params_sizeof_proc)pDevice->pContext->alsa.snd_pcm_hw_params_sizeof)(), &pDevice->pContext->allocationCallbacks); - if (pHWParams == nullptr) { + if (pHWParams == NULL) { ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[ALSA] Failed to allocate memory for hardware parameters."); return MA_OUT_OF_MEMORY; @@ -29400,7 +29400,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic { ma_uint32 periods = pDescriptor->periodCount; - resultALSA = ((ma_snd_pcm_hw_params_set_periods_near_proc)pDevice->pContext->alsa.snd_pcm_hw_params_set_periods_near)(pPCM, pHWParams, &periods, nullptr); + resultALSA = ((ma_snd_pcm_hw_params_set_periods_near_proc)pDevice->pContext->alsa.snd_pcm_hw_params_set_periods_near)(pPCM, pHWParams, &periods, NULL); if (resultALSA < 0) { ma_free(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); @@ -29436,12 +29436,12 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic } ma_free(pHWParams, &pDevice->pContext->allocationCallbacks); - pHWParams = nullptr; + pHWParams = NULL; /* Software parameters. */ pSWParams = (ma_snd_pcm_sw_params_t*)ma_calloc(((ma_snd_pcm_sw_params_sizeof_proc)pDevice->pContext->alsa.snd_pcm_sw_params_sizeof)(), &pDevice->pContext->allocationCallbacks); - if (pSWParams == nullptr) { + if (pSWParams == NULL) { ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[ALSA] Failed to allocate memory for software parameters."); return MA_OUT_OF_MEMORY; @@ -29499,17 +29499,17 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic } ma_free(pSWParams, &pDevice->pContext->allocationCallbacks); - pSWParams = nullptr; + pSWParams = NULL; /* Grab the internal channel map. For now we're not going to bother trying to change the channel map and instead just do it ourselves. */ { - ma_snd_pcm_chmap_t* pChmap = nullptr; - if (pDevice->pContext->alsa.snd_pcm_get_chmap != nullptr) { + ma_snd_pcm_chmap_t* pChmap = NULL; + if (pDevice->pContext->alsa.snd_pcm_get_chmap != NULL) { pChmap = ((ma_snd_pcm_get_chmap_proc)pDevice->pContext->alsa.snd_pcm_get_chmap)(pPCM); } - if (pChmap != nullptr) { + if (pChmap != NULL) { ma_uint32 iChannel; /* There are cases where the returned channel map can have a different channel count than was returned by snd_pcm_hw_params_set_channels_near(). */ @@ -29553,7 +29553,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic } free(pChmap); - pChmap = nullptr; + pChmap = NULL; } else { /* Could not retrieve the channel map. Fall back to a hard-coded assumption. */ ma_channel_map_init_standard(ma_standard_channel_map_alsa, internalChannelMap, ma_countof(internalChannelMap), internalChannels); @@ -29574,7 +29574,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic } pPollDescriptors = (struct pollfd*)ma_malloc(sizeof(*pPollDescriptors) * (pollDescriptorCount + 1), &pDevice->pContext->allocationCallbacks); /* +1 because we want room for the wakeup descriptor. */ - if (pPollDescriptors == nullptr) { + if (pPollDescriptors == NULL) { ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[ALSA] Failed to allocate memory for poll descriptors."); return MA_OUT_OF_MEMORY; @@ -29649,7 +29649,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic static ma_result ma_device_init__alsa(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ZERO_OBJECT(&pDevice->alsa); @@ -29843,10 +29843,10 @@ static ma_result ma_device_read__alsa(ma_device* pDevice, void* pFramesOut, ma_u { ma_snd_pcm_sframes_t resultALSA = 0; - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pFramesOut != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pFramesOut != NULL); - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -29888,7 +29888,7 @@ static ma_result ma_device_read__alsa(ma_device* pDevice, void* pFramesOut, ma_u } } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = resultALSA; } @@ -29899,10 +29899,10 @@ static ma_result ma_device_write__alsa(ma_device* pDevice, const void* pFrames, { ma_snd_pcm_sframes_t resultALSA = 0; - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pFrames != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pFrames != NULL); - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = 0; } @@ -29950,7 +29950,7 @@ static ma_result ma_device_write__alsa(ma_device* pDevice, const void* pFrames, } } - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = resultALSA; } @@ -29962,15 +29962,15 @@ static ma_result ma_device_data_loop_wakeup__alsa(ma_device* pDevice) ma_uint64 t = 1; int resultWrite = 0; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "[ALSA] Waking up...\n"); /* Write to an eventfd to trigger a wakeup from poll() and abort any reading or writing. */ - if (pDevice->alsa.pPollDescriptorsCapture != nullptr) { + if (pDevice->alsa.pPollDescriptorsCapture != NULL) { resultWrite = write(pDevice->alsa.wakeupfdCapture, &t, sizeof(t)); } - if (pDevice->alsa.pPollDescriptorsPlayback != nullptr) { + if (pDevice->alsa.pPollDescriptorsPlayback != NULL) { resultWrite = write(pDevice->alsa.wakeupfdPlayback, &t, sizeof(t)); } @@ -29986,7 +29986,7 @@ static ma_result ma_device_data_loop_wakeup__alsa(ma_device* pDevice) static ma_result ma_context_uninit__alsa(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_alsa); /* Clean up memory for memory leak checkers. */ @@ -30013,12 +30013,12 @@ static ma_result ma_context_init__alsa(ma_context* pContext, const ma_context_co for (i = 0; i < ma_countof(libasoundNames); ++i) { pContext->alsa.asoundSO = ma_dlopen(ma_context_get_log(pContext), libasoundNames[i]); - if (pContext->alsa.asoundSO != nullptr) { + if (pContext->alsa.asoundSO != NULL) { break; } } - if (pContext->alsa.asoundSO == nullptr) { + if (pContext->alsa.asoundSO == NULL) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_DEBUG, "[ALSA] Failed to open shared object.\n"); return MA_NO_BACKEND; } @@ -30246,7 +30246,7 @@ static ma_result ma_context_init__alsa(ma_context* pContext, const ma_context_co pCallbacks->onDeviceStop = ma_device_stop__alsa; pCallbacks->onDeviceRead = ma_device_read__alsa; pCallbacks->onDeviceWrite = ma_device_write__alsa; - pCallbacks->onDeviceDataLoop = nullptr; + pCallbacks->onDeviceDataLoop = NULL; pCallbacks->onDeviceDataLoopWakeup = ma_device_data_loop_wakeup__alsa; return MA_SUCCESS; @@ -31131,8 +31131,8 @@ static ma_result ma_wait_for_operation__pulse(ma_context* pContext, ma_ptr pMain int resultPA; ma_pa_operation_state_t state; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pOP != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pOP != NULL); for (;;) { state = ((ma_pa_operation_get_state_proc)pContext->pulse.pa_operation_get_state)(pOP); @@ -31140,7 +31140,7 @@ static ma_result ma_wait_for_operation__pulse(ma_context* pContext, ma_ptr pMain break; /* Done. */ } - resultPA = ((ma_pa_mainloop_iterate_proc)pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pMainLoop, 1, nullptr); + resultPA = ((ma_pa_mainloop_iterate_proc)pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pMainLoop, 1, NULL); if (resultPA < 0) { return ma_result_from_pulse(resultPA); } @@ -31153,7 +31153,7 @@ static ma_result ma_wait_for_operation_and_unref__pulse(ma_context* pContext, ma { ma_result result; - if (pOP == nullptr) { + if (pOP == NULL) { return MA_INVALID_ARGS; } @@ -31179,7 +31179,7 @@ static ma_result ma_wait_for_pa_context_to_connect__pulse(ma_context* pContext, return MA_ERROR; } - resultPA = ((ma_pa_mainloop_iterate_proc)pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pMainLoop, 1, nullptr); + resultPA = ((ma_pa_mainloop_iterate_proc)pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pMainLoop, 1, NULL); if (resultPA < 0) { return ma_result_from_pulse(resultPA); } @@ -31205,7 +31205,7 @@ static ma_result ma_wait_for_pa_stream_to_connect__pulse(ma_context* pContext, m return MA_ERROR; } - resultPA = ((ma_pa_mainloop_iterate_proc)pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pMainLoop, 1, nullptr); + resultPA = ((ma_pa_mainloop_iterate_proc)pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pMainLoop, 1, NULL); if (resultPA < 0) { return ma_result_from_pulse(resultPA); } @@ -31221,25 +31221,25 @@ static ma_result ma_init_pa_mainloop_and_pa_context__pulse(ma_context* pContext, ma_ptr pMainLoop; ma_ptr pPulseContext; - MA_ASSERT(ppMainLoop != nullptr); - MA_ASSERT(ppPulseContext != nullptr); + MA_ASSERT(ppMainLoop != NULL); + MA_ASSERT(ppPulseContext != NULL); /* The PulseAudio context maps well to miniaudio's notion of a context. The pa_context object will be initialized as part of the ma_context. */ pMainLoop = ((ma_pa_mainloop_new_proc)pContext->pulse.pa_mainloop_new)(); - if (pMainLoop == nullptr) { + if (pMainLoop == NULL) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to create mainloop."); return MA_FAILED_TO_INIT_BACKEND; } pPulseContext = ((ma_pa_context_new_proc)pContext->pulse.pa_context_new)(((ma_pa_mainloop_get_api_proc)pContext->pulse.pa_mainloop_get_api)((ma_pa_mainloop*)pMainLoop), pApplicationName); - if (pPulseContext == nullptr) { + if (pPulseContext == NULL) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to create PulseAudio context."); ((ma_pa_mainloop_free_proc)pContext->pulse.pa_mainloop_free)((ma_pa_mainloop*)(pMainLoop)); return MA_FAILED_TO_INIT_BACKEND; } /* Now we need to connect to the context. Everything is asynchronous so we need to wait for it to connect before returning. */ - result = ma_result_from_pulse(((ma_pa_context_connect_proc)pContext->pulse.pa_context_connect)((ma_pa_context*)pPulseContext, pServerName, (tryAutoSpawn) ? MA_PA_CONTEXT_NOFLAGS : MA_PA_CONTEXT_NOAUTOSPAWN, nullptr)); + result = ma_result_from_pulse(((ma_pa_context_connect_proc)pContext->pulse.pa_context_connect)((ma_pa_context*)pPulseContext, pServerName, (tryAutoSpawn) ? MA_PA_CONTEXT_NOFLAGS : MA_PA_CONTEXT_NOAUTOSPAWN, NULL)); if (result != MA_SUCCESS) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to connect PulseAudio context."); ((ma_pa_context_unref_proc)pContext->pulse.pa_context_unref)((ma_pa_context*)(pPulseContext)); @@ -31275,12 +31275,12 @@ static void ma_device_sink_info_callback(ma_pa_context* pPulseContext, const ma_ There has been a report that indicates that pInfo can be null which results in a null pointer dereference below. We'll check for this for safety. */ - if (pInfo == nullptr) { + if (pInfo == NULL) { return; } pInfoOut = (ma_pa_sink_info*)pUserData; - MA_ASSERT(pInfoOut != nullptr); + MA_ASSERT(pInfoOut != NULL); *pInfoOut = *pInfo; @@ -31299,12 +31299,12 @@ static void ma_device_source_info_callback(ma_pa_context* pPulseContext, const m There has been a report that indicates that pInfo can be null which results in a null pointer dereference below. We'll check for this for safety. */ - if (pInfo == nullptr) { + if (pInfo == NULL) { return; } pInfoOut = (ma_pa_source_info*)pUserData; - MA_ASSERT(pInfoOut != nullptr); + MA_ASSERT(pInfoOut != NULL); *pInfoOut = *pInfo; @@ -31321,7 +31321,7 @@ static void ma_device_sink_name_callback(ma_pa_context* pPulseContext, const ma_ } pDevice = (ma_device*)pUserData; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), pInfo->description, (size_t)-1); @@ -31337,7 +31337,7 @@ static void ma_device_source_name_callback(ma_pa_context* pPulseContext, const m } pDevice = (ma_device*)pUserData; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), pInfo->description, (size_t)-1); @@ -31350,7 +31350,7 @@ static ma_result ma_context_get_sink_info__pulse(ma_context* pContext, const cha ma_pa_operation* pOP; pOP = ((ma_pa_context_get_sink_info_by_name_proc)pContext->pulse.pa_context_get_sink_info_by_name)((ma_pa_context*)pContext->pulse.pPulseContext, pDeviceName, ma_device_sink_info_callback, pSinkInfo); - if (pOP == nullptr) { + if (pOP == NULL) { return MA_ERROR; } @@ -31362,7 +31362,7 @@ static ma_result ma_context_get_source_info__pulse(ma_context* pContext, const c ma_pa_operation* pOP; pOP = ((ma_pa_context_get_source_info_by_name_proc)pContext->pulse.pa_context_get_source_info_by_name)((ma_pa_context*)pContext->pulse.pPulseContext, pDeviceName, ma_device_source_info_callback, pSourceInfo); - if (pOP == nullptr) { + if (pOP == NULL) { return MA_ERROR; } @@ -31373,33 +31373,33 @@ static ma_result ma_context_get_default_device_index__pulse(ma_context* pContext { ma_result result; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pIndex != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pIndex != NULL); - if (pIndex != nullptr) { + if (pIndex != NULL) { *pIndex = (ma_uint32)-1; } if (deviceType == ma_device_type_playback) { ma_pa_sink_info sinkInfo; - result = ma_context_get_sink_info__pulse(pContext, nullptr, &sinkInfo); + result = ma_context_get_sink_info__pulse(pContext, NULL, &sinkInfo); if (result != MA_SUCCESS) { return result; } - if (pIndex != nullptr) { + if (pIndex != NULL) { *pIndex = sinkInfo.index; } } if (deviceType == ma_device_type_capture) { ma_pa_source_info sourceInfo; - result = ma_context_get_source_info__pulse(pContext, nullptr, &sourceInfo); + result = ma_context_get_source_info__pulse(pContext, NULL, &sourceInfo); if (result != MA_SUCCESS) { return result; } - if (pIndex != nullptr) { + if (pIndex != NULL) { *pIndex = sourceInfo.index; } } @@ -31423,7 +31423,7 @@ static void ma_context_enumerate_devices_sink_callback__pulse(ma_pa_context* pPu ma_context_enumerate_devices_callback_data__pulse* pData = (ma_context_enumerate_devices_callback_data__pulse*)pUserData; ma_device_info deviceInfo; - MA_ASSERT(pData != nullptr); + MA_ASSERT(pData != NULL); if (endOfList || pData->isTerminated) { return; @@ -31432,12 +31432,12 @@ static void ma_context_enumerate_devices_sink_callback__pulse(ma_pa_context* pPu MA_ZERO_OBJECT(&deviceInfo); /* The name from PulseAudio is the ID for miniaudio. */ - if (pSinkInfo->name != nullptr) { + if (pSinkInfo->name != NULL) { ma_strncpy_s(deviceInfo.id.pulse, sizeof(deviceInfo.id.pulse), pSinkInfo->name, (size_t)-1); } /* The description from PulseAudio is the name for miniaudio. */ - if (pSinkInfo->description != nullptr) { + if (pSinkInfo->description != NULL) { ma_strncpy_s(deviceInfo.name, sizeof(deviceInfo.name), pSinkInfo->description, (size_t)-1); } @@ -31455,7 +31455,7 @@ static void ma_context_enumerate_devices_source_callback__pulse(ma_pa_context* p ma_context_enumerate_devices_callback_data__pulse* pData = (ma_context_enumerate_devices_callback_data__pulse*)pUserData; ma_device_info deviceInfo; - MA_ASSERT(pData != nullptr); + MA_ASSERT(pData != NULL); if (endOfList || pData->isTerminated) { return; @@ -31464,12 +31464,12 @@ static void ma_context_enumerate_devices_source_callback__pulse(ma_pa_context* p MA_ZERO_OBJECT(&deviceInfo); /* The name from PulseAudio is the ID for miniaudio. */ - if (pSourceInfo->name != nullptr) { + if (pSourceInfo->name != NULL) { ma_strncpy_s(deviceInfo.id.pulse, sizeof(deviceInfo.id.pulse), pSourceInfo->name, (size_t)-1); } /* The description from PulseAudio is the name for miniaudio. */ - if (pSourceInfo->description != nullptr) { + if (pSourceInfo->description != NULL) { ma_strncpy_s(deviceInfo.name, sizeof(deviceInfo.name), pSourceInfo->description, (size_t)-1); } @@ -31486,10 +31486,10 @@ static ma_result ma_context_enumerate_devices__pulse(ma_context* pContext, ma_en { ma_result result = MA_SUCCESS; ma_context_enumerate_devices_callback_data__pulse callbackData; - ma_pa_operation* pOP = nullptr; + ma_pa_operation* pOP = NULL; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); callbackData.pContext = pContext; callbackData.callback = callback; @@ -31505,7 +31505,7 @@ static ma_result ma_context_enumerate_devices__pulse(ma_context* pContext, ma_en /* Playback. */ if (!callbackData.isTerminated) { pOP = ((ma_pa_context_get_sink_info_list_proc)pContext->pulse.pa_context_get_sink_info_list)((ma_pa_context*)(pContext->pulse.pPulseContext), ma_context_enumerate_devices_sink_callback__pulse, &callbackData); - if (pOP == nullptr) { + if (pOP == NULL) { result = MA_ERROR; goto done; } @@ -31522,7 +31522,7 @@ static ma_result ma_context_enumerate_devices__pulse(ma_context* pContext, ma_en /* Capture. */ if (!callbackData.isTerminated) { pOP = ((ma_pa_context_get_source_info_list_proc)pContext->pulse.pa_context_get_source_info_list)((ma_pa_context*)(pContext->pulse.pPulseContext), ma_context_enumerate_devices_source_callback__pulse, &callbackData); - if (pOP == nullptr) { + if (pOP == NULL) { result = MA_ERROR; goto done; } @@ -31555,14 +31555,14 @@ static void ma_context_get_device_info_sink_callback__pulse(ma_pa_context* pPuls return; } - MA_ASSERT(pData != nullptr); + MA_ASSERT(pData != NULL); pData->foundDevice = MA_TRUE; - if (pInfo->name != nullptr) { + if (pInfo->name != NULL) { ma_strncpy_s(pData->pDeviceInfo->id.pulse, sizeof(pData->pDeviceInfo->id.pulse), pInfo->name, (size_t)-1); } - if (pInfo->description != nullptr) { + if (pInfo->description != NULL) { ma_strncpy_s(pData->pDeviceInfo->name, sizeof(pData->pDeviceInfo->name), pInfo->description, (size_t)-1); } @@ -31592,14 +31592,14 @@ static void ma_context_get_device_info_source_callback__pulse(ma_pa_context* pPu return; } - MA_ASSERT(pData != nullptr); + MA_ASSERT(pData != NULL); pData->foundDevice = MA_TRUE; - if (pInfo->name != nullptr) { + if (pInfo->name != NULL) { ma_strncpy_s(pData->pDeviceInfo->id.pulse, sizeof(pData->pDeviceInfo->id.pulse), pInfo->name, (size_t)-1); } - if (pInfo->description != nullptr) { + if (pInfo->description != NULL) { ma_strncpy_s(pData->pDeviceInfo->name, sizeof(pData->pDeviceInfo->name), pInfo->description, (size_t)-1); } @@ -31625,18 +31625,18 @@ static ma_result ma_context_get_device_info__pulse(ma_context* pContext, ma_devi { ma_result result = MA_SUCCESS; ma_context_get_device_info_callback_data__pulse callbackData; - ma_pa_operation* pOP = nullptr; - const char* pDeviceName = nullptr; + ma_pa_operation* pOP = NULL; + const char* pDeviceName = NULL; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); callbackData.pDeviceInfo = pDeviceInfo; callbackData.foundDevice = MA_FALSE; - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { pDeviceName = pDeviceID->pulse; } else { - pDeviceName = nullptr; + pDeviceName = NULL; } result = ma_context_get_default_device_index__pulse(pContext, deviceType, &callbackData.defaultDeviceIndex); @@ -31647,7 +31647,7 @@ static ma_result ma_context_get_device_info__pulse(ma_context* pContext, ma_devi pOP = ((ma_pa_context_get_source_info_by_name_proc)pContext->pulse.pa_context_get_source_info_by_name)((ma_pa_context*)(pContext->pulse.pPulseContext), pDeviceName, ma_context_get_device_info_source_callback__pulse, &callbackData); } - if (pOP != nullptr) { + if (pOP != NULL) { ma_wait_for_operation_and_unref__pulse(pContext, pContext->pulse.pMainLoop, pOP); } else { result = MA_ERROR; @@ -31667,10 +31667,10 @@ static ma_result ma_device_uninit__pulse(ma_device* pDevice) { ma_context* pContext; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); pContext = pDevice->pContext; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { ((ma_pa_stream_disconnect_proc)pContext->pulse.pa_stream_disconnect)((ma_pa_stream*)pDevice->pulse.pStreamCapture); @@ -31710,7 +31710,7 @@ static ma_pa_stream* ma_device__pa_stream_new__pulse(ma_device* pDevice, const c static ma_atomic_uint32 g_StreamCounter = { 0 }; char actualStreamName[256]; - if (pStreamName != nullptr) { + if (pStreamName != NULL) { ma_strncpy_s(actualStreamName, sizeof(actualStreamName), pStreamName, (size_t)-1); } else { const char* pBaseName = "miniaudio:"; @@ -31732,7 +31732,7 @@ static void ma_device_on_read__pulse(ma_pa_stream* pStream, size_t byteCount, vo ma_uint64 frameCount; ma_uint64 framesProcessed; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* Don't do anything if the device isn't initialized yet. Yes, this can happen because PulseAudio @@ -31761,8 +31761,8 @@ static void ma_device_on_read__pulse(ma_pa_stream* pStream, size_t byteCount, vo framesMapped = bytesMapped / bpf; if (framesMapped > 0) { - if (pMappedPCMFrames != nullptr) { - ma_device_handle_backend_data_callback(pDevice, nullptr, pMappedPCMFrames, framesMapped); + if (pMappedPCMFrames != NULL) { + ma_device_handle_backend_data_callback(pDevice, NULL, pMappedPCMFrames, framesMapped); } else { /* It's a hole. */ ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "[PulseAudio] ma_device_on_read__pulse: Hole.\n"); @@ -31790,8 +31790,8 @@ static ma_result ma_device_write_to_stream__pulse(ma_device* pDevice, ma_pa_stre ma_uint32 bpf; ma_uint32 deviceState; - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pStream != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pStream != NULL); bpf = ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); MA_ASSERT(bpf > 0); @@ -31812,13 +31812,13 @@ static ma_result ma_device_write_to_stream__pulse(ma_device* pDevice, ma_pa_stre framesMapped = bytesMapped / bpf; if (deviceState == ma_device_state_started || deviceState == ma_device_state_starting) { /* Check for starting state just in case this is being used to do the initial fill. */ - ma_device_handle_backend_data_callback(pDevice, pMappedPCMFrames, nullptr, framesMapped); + ma_device_handle_backend_data_callback(pDevice, pMappedPCMFrames, NULL, framesMapped); } else { /* Device is not started. Write silence. */ ma_silence_pcm_frames(pMappedPCMFrames, framesMapped, pDevice->playback.format, pDevice->playback.channels); } - pulseResult = ((ma_pa_stream_write_proc)pDevice->pContext->pulse.pa_stream_write)(pStream, pMappedPCMFrames, bytesMapped, nullptr, 0, MA_PA_SEEK_RELATIVE); + pulseResult = ((ma_pa_stream_write_proc)pDevice->pContext->pulse.pa_stream_write)(pStream, pMappedPCMFrames, bytesMapped, NULL, 0, MA_PA_SEEK_RELATIVE); if (pulseResult < 0) { result = ma_result_from_pulse(pulseResult); goto done; /* Failed to write data to stream. */ @@ -31835,7 +31835,7 @@ static ma_result ma_device_write_to_stream__pulse(ma_device* pDevice, ma_pa_stre } done: - if (pFramesProcessed != nullptr) { + if (pFramesProcessed != NULL) { *pFramesProcessed = framesProcessed; } @@ -31851,7 +31851,7 @@ static void ma_device_on_write__pulse(ma_pa_stream* pStream, size_t byteCount, v ma_uint32 deviceState; ma_result result; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* Don't do anything if the device isn't initialized yet. Yes, this can happen because PulseAudio @@ -31960,8 +31960,8 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi ma_result result = MA_SUCCESS; int error = 0; - const char* devPlayback = nullptr; - const char* devCapture = nullptr; + const char* devPlayback = NULL; + const char* devCapture = NULL; ma_format format = ma_format_unknown; ma_uint32 channels = 0; ma_uint32 sampleRate = 0; @@ -31970,13 +31970,13 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi ma_pa_sample_spec ss; ma_pa_channel_map cmap; ma_pa_buffer_attr attr; - const ma_pa_sample_spec* pActualSS = nullptr; - const ma_pa_buffer_attr* pActualAttr = nullptr; - const ma_pa_channel_map* pActualChannelMap = nullptr; + const ma_pa_sample_spec* pActualSS = NULL; + const ma_pa_buffer_attr* pActualAttr = NULL; + const ma_pa_channel_map* pActualChannelMap = NULL; ma_uint32 iChannel; int streamFlags; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ZERO_OBJECT(&pDevice->pulse); if (pConfig->deviceType == ma_device_type_loopback) { @@ -31990,7 +31990,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi } if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - if (pDescriptorPlayback->pDeviceID != nullptr) { + if (pDescriptorPlayback->pDeviceID != NULL) { devPlayback = pDescriptorPlayback->pDeviceID->pulse; } @@ -32000,7 +32000,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi } if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { - if (pDescriptorCapture->pDeviceID != nullptr) { + if (pDescriptorCapture->pDeviceID != NULL) { devCapture = pDescriptorCapture->pDeviceID->pulse; } @@ -32073,7 +32073,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, "[PulseAudio] Capture attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; periodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDescriptorCapture->periodSizeInFrames); pDevice->pulse.pStreamCapture = ma_device__pa_stream_new__pulse(pDevice, pConfig->pulse.pStreamNameCapture, &ss, &cmap); - if (pDevice->pulse.pStreamCapture == nullptr) { + if (pDevice->pulse.pStreamCapture == NULL) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to create PulseAudio capture stream.\n"); result = MA_ERROR; goto on_error0; @@ -32091,7 +32091,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi /* Connect after we've got all of our internal state set up. */ - if (devCapture != nullptr) { + if (devCapture != NULL) { streamFlags |= MA_PA_STREAM_DONT_MOVE; } @@ -32110,7 +32110,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi /* Internal format. */ pActualSS = ((ma_pa_stream_get_sample_spec_proc)pDevice->pContext->pulse.pa_stream_get_sample_spec)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - if (pActualSS != nullptr) { + if (pActualSS != NULL) { ss = *pActualSS; ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, "[PulseAudio] Capture sample spec: format=%s, channels=%d, rate=%d\n", ma_get_format_name(ma_format_from_pulse(ss.format)), ss.channels, ss.rate); } else { @@ -32130,7 +32130,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi /* Internal channel map. */ pActualChannelMap = ((ma_pa_stream_get_channel_map_proc)pDevice->pContext->pulse.pa_stream_get_channel_map)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - if (pActualChannelMap == nullptr) { + if (pActualChannelMap == NULL) { pActualChannelMap = &cmap; /* Fallback just in case. */ } @@ -32160,7 +32160,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi /* Buffer. */ pActualAttr = ((ma_pa_stream_get_buffer_attr_proc)pDevice->pContext->pulse.pa_stream_get_buffer_attr)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - if (pActualAttr != nullptr) { + if (pActualAttr != NULL) { attr = *pActualAttr; } @@ -32232,7 +32232,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, "[PulseAudio] Playback attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; periodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDescriptorPlayback->periodSizeInFrames); pDevice->pulse.pStreamPlayback = ma_device__pa_stream_new__pulse(pDevice, pConfig->pulse.pStreamNamePlayback, &ss, &cmap); - if (pDevice->pulse.pStreamPlayback == nullptr) { + if (pDevice->pulse.pStreamPlayback == NULL) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to create PulseAudio playback stream.\n"); result = MA_ERROR; goto on_error2; @@ -32253,11 +32253,11 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi /* Connect after we've got all of our internal state set up. */ - if (devPlayback != nullptr) { + if (devPlayback != NULL) { streamFlags |= MA_PA_STREAM_DONT_MOVE; } - error = ((ma_pa_stream_connect_playback_proc)pDevice->pContext->pulse.pa_stream_connect_playback)((ma_pa_stream*)pDevice->pulse.pStreamPlayback, devPlayback, &attr, (ma_pa_stream_flags_t)streamFlags, nullptr, nullptr); + error = ((ma_pa_stream_connect_playback_proc)pDevice->pContext->pulse.pa_stream_connect_playback)((ma_pa_stream*)pDevice->pulse.pStreamPlayback, devPlayback, &attr, (ma_pa_stream_flags_t)streamFlags, NULL, NULL); if (error != MA_PA_OK) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to connect PulseAudio playback stream."); result = ma_result_from_pulse(error); @@ -32272,7 +32272,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi /* Internal format. */ pActualSS = ((ma_pa_stream_get_sample_spec_proc)pDevice->pContext->pulse.pa_stream_get_sample_spec)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - if (pActualSS != nullptr) { + if (pActualSS != NULL) { ss = *pActualSS; ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, "[PulseAudio] Playback sample spec: format=%s, channels=%d, rate=%d\n", ma_get_format_name(ma_format_from_pulse(ss.format)), ss.channels, ss.rate); } else { @@ -32292,7 +32292,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi /* Internal channel map. */ pActualChannelMap = ((ma_pa_stream_get_channel_map_proc)pDevice->pContext->pulse.pa_stream_get_channel_map)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - if (pActualChannelMap == nullptr) { + if (pActualChannelMap == NULL) { pActualChannelMap = &cmap; /* Fallback just in case. */ } @@ -32322,7 +32322,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi /* Buffer. */ pActualAttr = ((ma_pa_stream_get_buffer_attr_proc)pDevice->pContext->pulse.pa_stream_get_buffer_attr)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - if (pActualAttr != nullptr) { + if (pActualAttr != NULL) { attr = *pActualAttr; } @@ -32341,7 +32341,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi We need a ring buffer for handling duplex mode. We can use the main duplex ring buffer in the main part of the ma_device struct. We cannot, however, depend on ma_device_init() initializing this for us later on because that will only do it if it's a fully asynchronous backend - i.e. the - onDeviceDataLoop callback is nullptr, which is not the case for PulseAudio. + onDeviceDataLoop callback is NULL, which is not the case for PulseAudio. */ if (pConfig->deviceType == ma_device_type_duplex) { ma_format rbFormat = (format != ma_format_unknown) ? format : pDescriptorCapture->format; @@ -32382,7 +32382,7 @@ on_error0: static void ma_pulse_operation_complete_callback(ma_pa_stream* pStream, int success, void* pUserData) { ma_bool32* pIsSuccessful = (ma_bool32*)pUserData; - MA_ASSERT(pIsSuccessful != nullptr); + MA_ASSERT(pIsSuccessful != NULL); *pIsSuccessful = (ma_bool32)success; @@ -32405,10 +32405,10 @@ static ma_result ma_device__cork_stream__pulse(ma_device* pDevice, ma_device_typ wasSuccessful = MA_FALSE; pStream = (ma_pa_stream*)((deviceType == ma_device_type_capture) ? pDevice->pulse.pStreamCapture : pDevice->pulse.pStreamPlayback); - MA_ASSERT(pStream != nullptr); + MA_ASSERT(pStream != NULL); pOP = ((ma_pa_stream_cork_proc)pContext->pulse.pa_stream_cork)(pStream, cork, ma_pulse_operation_complete_callback, &wasSuccessful); - if (pOP == nullptr) { + if (pOP == NULL) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to cork PulseAudio stream."); return MA_ERROR; } @@ -32431,7 +32431,7 @@ static ma_result ma_device_start__pulse(ma_device* pDevice) { ma_result result; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { result = ma_device__cork_stream__pulse(pDevice, ma_device_type_capture, 0); @@ -32446,7 +32446,7 @@ static ma_result ma_device_start__pulse(ma_device* pDevice) never getting fired. We're not going to abort if writing fails because I still want the device to get uncorked. */ - ma_device_write_to_stream__pulse(pDevice, (ma_pa_stream*)(pDevice->pulse.pStreamPlayback), nullptr); /* No need to check the result here. Always want to fall through an uncork.*/ + ma_device_write_to_stream__pulse(pDevice, (ma_pa_stream*)(pDevice->pulse.pStreamPlayback), NULL); /* No need to check the result here. Always want to fall through an uncork.*/ result = ma_device__cork_stream__pulse(pDevice, ma_device_type_playback, 0); if (result != MA_SUCCESS) { @@ -32461,7 +32461,7 @@ static ma_result ma_device_stop__pulse(ma_device* pDevice) { ma_result result; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { result = ma_device__cork_stream__pulse(pDevice, ma_device_type_capture, 1); @@ -32495,7 +32495,7 @@ static ma_result ma_device_data_loop__pulse(ma_device* pDevice) { int resultPA; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* NOTE: Don't start the device here. It'll be done at a higher level. */ @@ -32504,7 +32504,7 @@ static ma_result ma_device_data_loop__pulse(ma_device* pDevice) the callbacks deal with it. */ while (ma_device_get_state(pDevice) == ma_device_state_started) { - resultPA = ((ma_pa_mainloop_iterate_proc)pDevice->pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pDevice->pulse.pMainLoop, 1, nullptr); + resultPA = ((ma_pa_mainloop_iterate_proc)pDevice->pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pDevice->pulse.pMainLoop, 1, NULL); if (resultPA < 0) { break; } @@ -32516,7 +32516,7 @@ static ma_result ma_device_data_loop__pulse(ma_device* pDevice) static ma_result ma_device_data_loop_wakeup__pulse(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); ((ma_pa_mainloop_wakeup_proc)pDevice->pContext->pulse.pa_mainloop_wakeup)((ma_pa_mainloop*)pDevice->pulse.pMainLoop); @@ -32525,7 +32525,7 @@ static ma_result ma_device_data_loop_wakeup__pulse(ma_device* pDevice) static ma_result ma_context_uninit__pulse(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_pulseaudio); ((ma_pa_context_disconnect_proc)pContext->pulse.pa_context_disconnect)((ma_pa_context*)pContext->pulse.pPulseContext); @@ -32554,12 +32554,12 @@ static ma_result ma_context_init__pulse(ma_context* pContext, const ma_context_c for (i = 0; i < ma_countof(libpulseNames); ++i) { pContext->pulse.pulseSO = ma_dlopen(ma_context_get_log(pContext), libpulseNames[i]); - if (pContext->pulse.pulseSO != nullptr) { + if (pContext->pulse.pulseSO != NULL) { break; } } - if (pContext->pulse.pulseSO == nullptr) { + if (pContext->pulse.pulseSO == NULL) { return MA_NO_BACKEND; } @@ -32753,12 +32753,12 @@ static ma_result ma_context_init__pulse(ma_context* pContext, const ma_context_c /* We need to make a copy of the application and server names so we can pass them to the pa_context of each device. */ pContext->pulse.pApplicationName = ma_copy_string(pConfig->pulse.pApplicationName, &pContext->allocationCallbacks); - if (pContext->pulse.pApplicationName == nullptr && pConfig->pulse.pApplicationName != nullptr) { + if (pContext->pulse.pApplicationName == NULL && pConfig->pulse.pApplicationName != NULL) { return MA_OUT_OF_MEMORY; } pContext->pulse.pServerName = ma_copy_string(pConfig->pulse.pServerName, &pContext->allocationCallbacks); - if (pContext->pulse.pServerName == nullptr && pConfig->pulse.pServerName != nullptr) { + if (pContext->pulse.pServerName == NULL && pConfig->pulse.pServerName != NULL) { ma_free(pContext->pulse.pApplicationName, &pContext->allocationCallbacks); return MA_OUT_OF_MEMORY; } @@ -32782,8 +32782,8 @@ static ma_result ma_context_init__pulse(ma_context* pContext, const ma_context_c pCallbacks->onDeviceUninit = ma_device_uninit__pulse; pCallbacks->onDeviceStart = ma_device_start__pulse; pCallbacks->onDeviceStop = ma_device_stop__pulse; - pCallbacks->onDeviceRead = nullptr; /* Not used because we're implementing onDeviceDataLoop. */ - pCallbacks->onDeviceWrite = nullptr; /* Not used because we're implementing onDeviceDataLoop. */ + pCallbacks->onDeviceRead = NULL; /* Not used because we're implementing onDeviceDataLoop. */ + pCallbacks->onDeviceWrite = NULL; /* Not used because we're implementing onDeviceDataLoop. */ pCallbacks->onDeviceDataLoop = ma_device_data_loop__pulse; pCallbacks->onDeviceDataLoopWakeup = ma_device_data_loop_wakeup__pulse; @@ -32858,18 +32858,18 @@ static ma_result ma_context_open_client__jack(ma_context* pContext, ma_jack_clie ma_jack_status_t status; ma_jack_client_t* pClient; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(ppClient != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(ppClient != NULL); if (ppClient) { - *ppClient = nullptr; + *ppClient = NULL; } maxClientNameSize = ((ma_jack_client_name_size_proc)pContext->jack.jack_client_name_size)(); /* Includes null terminator. */ - ma_strncpy_s(clientName, ma_min(sizeof(clientName), maxClientNameSize), (pContext->jack.pClientName != nullptr) ? pContext->jack.pClientName : "miniaudio", (size_t)-1); + ma_strncpy_s(clientName, ma_min(sizeof(clientName), maxClientNameSize), (pContext->jack.pClientName != NULL) ? pContext->jack.pClientName : "miniaudio", (size_t)-1); - pClient = ((ma_jack_client_open_proc)pContext->jack.jack_client_open)(clientName, (pContext->jack.tryStartServer) ? ma_JackNullOption : ma_JackNoStartServer, &status, nullptr); - if (pClient == nullptr) { + pClient = ((ma_jack_client_open_proc)pContext->jack.jack_client_open)(clientName, (pContext->jack.tryStartServer) ? ma_JackNullOption : ma_JackNoStartServer, &status, NULL); + if (pClient == NULL) { return MA_FAILED_TO_OPEN_BACKEND_DEVICE; } @@ -32885,8 +32885,8 @@ static ma_result ma_context_enumerate_devices__jack(ma_context* pContext, ma_enu { ma_bool32 cbResult = MA_TRUE; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); /* Playback. */ if (cbResult) { @@ -32917,9 +32917,9 @@ static ma_result ma_context_get_device_info__jack(ma_context* pContext, ma_devic ma_result result; const char** ppPorts; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); - if (pDeviceID != nullptr && pDeviceID->jack != 0) { + if (pDeviceID != NULL && pDeviceID->jack != 0) { return MA_NO_DEVICE; /* Don't know the device. */ } @@ -32946,14 +32946,14 @@ static ma_result ma_context_get_device_info__jack(ma_context* pContext, ma_devic pDeviceInfo->nativeDataFormats[0].sampleRate = ((ma_jack_get_sample_rate_proc)pContext->jack.jack_get_sample_rate)((ma_jack_client_t*)pClient); pDeviceInfo->nativeDataFormats[0].channels = 0; - ppPorts = ((ma_jack_get_ports_proc)pContext->jack.jack_get_ports)((ma_jack_client_t*)pClient, nullptr, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ((deviceType == ma_device_type_playback) ? ma_JackPortIsInput : ma_JackPortIsOutput)); - if (ppPorts == nullptr) { + ppPorts = ((ma_jack_get_ports_proc)pContext->jack.jack_get_ports)((ma_jack_client_t*)pClient, NULL, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ((deviceType == ma_device_type_playback) ? ma_JackPortIsInput : ma_JackPortIsOutput)); + if (ppPorts == NULL) { ((ma_jack_client_close_proc)pContext->jack.jack_client_close)((ma_jack_client_t*)pClient); ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[JACK] Failed to query physical ports."); return MA_FAILED_TO_OPEN_BACKEND_DEVICE; } - while (ppPorts[pDeviceInfo->nativeDataFormats[0].channels] != nullptr) { + while (ppPorts[pDeviceInfo->nativeDataFormats[0].channels] != NULL) { pDeviceInfo->nativeDataFormats[0].channels += 1; } @@ -32972,12 +32972,12 @@ static ma_result ma_device_uninit__jack(ma_device* pDevice) { ma_context* pContext; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); pContext = pDevice->pContext; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); - if (pDevice->jack.pClient != nullptr) { + if (pDevice->jack.pClient != NULL) { ((ma_jack_client_close_proc)pContext->jack.jack_client_close)((ma_jack_client_t*)pDevice->jack.pClient); } @@ -32998,7 +32998,7 @@ static void ma_device__jack_shutdown_callback(void* pUserData) { /* JACK died. Stop the device. */ ma_device* pDevice = (ma_device*)pUserData; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); ma_device_stop(pDevice); } @@ -33006,12 +33006,12 @@ static void ma_device__jack_shutdown_callback(void* pUserData) static int ma_device__jack_buffer_size_callback(ma_jack_nframes_t frameCount, void* pUserData) { ma_device* pDevice = (ma_device*)pUserData; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { size_t newBufferSize = frameCount * (pDevice->capture.internalChannels * ma_get_bytes_per_sample(pDevice->capture.internalFormat)); float* pNewBuffer = (float*)ma_calloc(newBufferSize, &pDevice->pContext->allocationCallbacks); - if (pNewBuffer == nullptr) { + if (pNewBuffer == NULL) { return MA_OUT_OF_MEMORY; } @@ -33024,7 +33024,7 @@ static int ma_device__jack_buffer_size_callback(ma_jack_nframes_t frameCount, vo if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { size_t newBufferSize = frameCount * (pDevice->playback.internalChannels * ma_get_bytes_per_sample(pDevice->playback.internalFormat)); float* pNewBuffer = (float*)ma_calloc(newBufferSize, &pDevice->pContext->allocationCallbacks); - if (pNewBuffer == nullptr) { + if (pNewBuffer == NULL) { return MA_OUT_OF_MEMORY; } @@ -33044,16 +33044,16 @@ static int ma_device__jack_process_callback(ma_jack_nframes_t frameCount, void* ma_uint32 iChannel; pDevice = (ma_device*)pUserData; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); pContext = pDevice->pContext; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { /* Channels need to be interleaved. */ for (iChannel = 0; iChannel < pDevice->capture.internalChannels; ++iChannel) { const float* pSrc = (const float*)((ma_jack_port_get_buffer_proc)pContext->jack.jack_port_get_buffer)((ma_jack_port_t*)pDevice->jack.ppPortsCapture[iChannel], frameCount); - if (pSrc != nullptr) { + if (pSrc != NULL) { float* pDst = pDevice->jack.pIntermediaryBufferCapture + iChannel; ma_jack_nframes_t iFrame; for (iFrame = 0; iFrame < frameCount; ++iFrame) { @@ -33065,16 +33065,16 @@ static int ma_device__jack_process_callback(ma_jack_nframes_t frameCount, void* } } - ma_device_handle_backend_data_callback(pDevice, nullptr, pDevice->jack.pIntermediaryBufferCapture, frameCount); + ma_device_handle_backend_data_callback(pDevice, NULL, pDevice->jack.pIntermediaryBufferCapture, frameCount); } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - ma_device_handle_backend_data_callback(pDevice, pDevice->jack.pIntermediaryBufferPlayback, nullptr, frameCount); + ma_device_handle_backend_data_callback(pDevice, pDevice->jack.pIntermediaryBufferPlayback, NULL, frameCount); /* Channels need to be deinterleaved. */ for (iChannel = 0; iChannel < pDevice->playback.internalChannels; ++iChannel) { float* pDst = (float*)((ma_jack_port_get_buffer_proc)pContext->jack.jack_port_get_buffer)((ma_jack_port_t*)pDevice->jack.ppPortsPlayback[iChannel], frameCount); - if (pDst != nullptr) { + if (pDst != NULL) { const float* pSrc = pDevice->jack.pIntermediaryBufferPlayback + iChannel; ma_jack_nframes_t iFrame; for (iFrame = 0; iFrame < frameCount; ++iFrame) { @@ -33095,8 +33095,8 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config ma_result result; ma_uint32 periodSizeInFrames; - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDevice != NULL); if (pConfig->deviceType == ma_device_type_loopback) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[JACK] Loopback mode not supported."); @@ -33104,8 +33104,8 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config } /* Only supporting default devices with JACK. */ - if (((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pDescriptorPlayback->pDeviceID != nullptr && pDescriptorPlayback->pDeviceID->jack != 0) || - ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pDescriptorCapture->pDeviceID != nullptr && pDescriptorCapture->pDeviceID->jack != 0)) { + if (((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pDescriptorPlayback->pDeviceID != NULL && pDescriptorPlayback->pDeviceID->jack != 0) || + ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pDescriptorCapture->pDeviceID != NULL && pDescriptorCapture->pDeviceID->jack != 0)) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[JACK] Only default devices are supported."); return MA_NO_DEVICE; } @@ -33149,19 +33149,19 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config pDescriptorCapture->sampleRate = ((ma_jack_get_sample_rate_proc)pDevice->pContext->jack.jack_get_sample_rate)((ma_jack_client_t*)pDevice->jack.pClient); ma_channel_map_init_standard(ma_standard_channel_map_alsa, pDescriptorCapture->channelMap, ma_countof(pDescriptorCapture->channelMap), pDescriptorCapture->channels); - ppPorts = ((ma_jack_get_ports_proc)pDevice->pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, nullptr, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsOutput); - if (ppPorts == nullptr) { + ppPorts = ((ma_jack_get_ports_proc)pDevice->pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, NULL, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsOutput); + if (ppPorts == NULL) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[JACK] Failed to query physical ports."); return MA_FAILED_TO_OPEN_BACKEND_DEVICE; } /* Need to count the number of ports first so we can allocate some memory. */ - while (ppPorts[pDescriptorCapture->channels] != nullptr) { + while (ppPorts[pDescriptorCapture->channels] != NULL) { pDescriptorCapture->channels += 1; } pDevice->jack.ppPortsCapture = (ma_ptr*)ma_malloc(sizeof(*pDevice->jack.ppPortsCapture) * pDescriptorCapture->channels, &pDevice->pContext->allocationCallbacks); - if (pDevice->jack.ppPortsCapture == nullptr) { + if (pDevice->jack.ppPortsCapture == NULL) { return MA_OUT_OF_MEMORY; } @@ -33171,7 +33171,7 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config ma_itoa_s((int)iPort, name+7, sizeof(name)-7, 10); /* 7 = length of "capture" */ pDevice->jack.ppPortsCapture[iPort] = ((ma_jack_port_register_proc)pDevice->pContext->jack.jack_port_register)((ma_jack_client_t*)pDevice->jack.pClient, name, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsInput, 0); - if (pDevice->jack.ppPortsCapture[iPort] == nullptr) { + if (pDevice->jack.ppPortsCapture[iPort] == NULL) { ((ma_jack_free_proc)pDevice->pContext->jack.jack_free)((void*)ppPorts); ma_device_uninit__jack(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[JACK] Failed to register ports."); @@ -33185,7 +33185,7 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config pDescriptorCapture->periodCount = 1; /* There's no notion of a period in JACK. Just set to 1. */ pDevice->jack.pIntermediaryBufferCapture = (float*)ma_calloc(pDescriptorCapture->periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorCapture->format, pDescriptorCapture->channels), &pDevice->pContext->allocationCallbacks); - if (pDevice->jack.pIntermediaryBufferCapture == nullptr) { + if (pDevice->jack.pIntermediaryBufferCapture == NULL) { ma_device_uninit__jack(pDevice); return MA_OUT_OF_MEMORY; } @@ -33200,19 +33200,19 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config pDescriptorPlayback->sampleRate = ((ma_jack_get_sample_rate_proc)pDevice->pContext->jack.jack_get_sample_rate)((ma_jack_client_t*)pDevice->jack.pClient); ma_channel_map_init_standard(ma_standard_channel_map_alsa, pDescriptorPlayback->channelMap, ma_countof(pDescriptorPlayback->channelMap), pDescriptorPlayback->channels); - ppPorts = ((ma_jack_get_ports_proc)pDevice->pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, nullptr, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsInput); - if (ppPorts == nullptr) { + ppPorts = ((ma_jack_get_ports_proc)pDevice->pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, NULL, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsInput); + if (ppPorts == NULL) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[JACK] Failed to query physical ports."); return MA_FAILED_TO_OPEN_BACKEND_DEVICE; } /* Need to count the number of ports first so we can allocate some memory. */ - while (ppPorts[pDescriptorPlayback->channels] != nullptr) { + while (ppPorts[pDescriptorPlayback->channels] != NULL) { pDescriptorPlayback->channels += 1; } pDevice->jack.ppPortsPlayback = (ma_ptr*)ma_malloc(sizeof(*pDevice->jack.ppPortsPlayback) * pDescriptorPlayback->channels, &pDevice->pContext->allocationCallbacks); - if (pDevice->jack.ppPortsPlayback == nullptr) { + if (pDevice->jack.ppPortsPlayback == NULL) { ma_free(pDevice->jack.ppPortsCapture, &pDevice->pContext->allocationCallbacks); return MA_OUT_OF_MEMORY; } @@ -33223,7 +33223,7 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config ma_itoa_s((int)iPort, name+8, sizeof(name)-8, 10); /* 8 = length of "playback" */ pDevice->jack.ppPortsPlayback[iPort] = ((ma_jack_port_register_proc)pDevice->pContext->jack.jack_port_register)((ma_jack_client_t*)pDevice->jack.pClient, name, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsOutput, 0); - if (pDevice->jack.ppPortsPlayback[iPort] == nullptr) { + if (pDevice->jack.ppPortsPlayback[iPort] == NULL) { ((ma_jack_free_proc)pDevice->pContext->jack.jack_free)((void*)ppPorts); ma_device_uninit__jack(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[JACK] Failed to register ports."); @@ -33237,7 +33237,7 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config pDescriptorPlayback->periodCount = 1; /* There's no notion of a period in JACK. Just set to 1. */ pDevice->jack.pIntermediaryBufferPlayback = (float*)ma_calloc(pDescriptorPlayback->periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorPlayback->format, pDescriptorPlayback->channels), &pDevice->pContext->allocationCallbacks); - if (pDevice->jack.pIntermediaryBufferPlayback == nullptr) { + if (pDevice->jack.pIntermediaryBufferPlayback == NULL) { ma_device_uninit__jack(pDevice); return MA_OUT_OF_MEMORY; } @@ -33260,14 +33260,14 @@ static ma_result ma_device_start__jack(ma_device* pDevice) } if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { - const char** ppServerPorts = ((ma_jack_get_ports_proc)pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, nullptr, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsOutput); - if (ppServerPorts == nullptr) { + const char** ppServerPorts = ((ma_jack_get_ports_proc)pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, NULL, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsOutput); + if (ppServerPorts == NULL) { ((ma_jack_deactivate_proc)pContext->jack.jack_deactivate)((ma_jack_client_t*)pDevice->jack.pClient); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[JACK] Failed to retrieve physical ports."); return MA_ERROR; } - for (i = 0; ppServerPorts[i] != nullptr; ++i) { + for (i = 0; ppServerPorts[i] != NULL; ++i) { const char* pServerPort = ppServerPorts[i]; const char* pClientPort = ((ma_jack_port_name_proc)pContext->jack.jack_port_name)((ma_jack_port_t*)pDevice->jack.ppPortsCapture[i]); @@ -33284,14 +33284,14 @@ static ma_result ma_device_start__jack(ma_device* pDevice) } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - const char** ppServerPorts = ((ma_jack_get_ports_proc)pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, nullptr, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsInput); - if (ppServerPorts == nullptr) { + const char** ppServerPorts = ((ma_jack_get_ports_proc)pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, NULL, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsInput); + if (ppServerPorts == NULL) { ((ma_jack_deactivate_proc)pContext->jack.jack_deactivate)((ma_jack_client_t*)pDevice->jack.pClient); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[JACK] Failed to retrieve physical ports."); return MA_ERROR; } - for (i = 0; ppServerPorts[i] != nullptr; ++i) { + for (i = 0; ppServerPorts[i] != NULL; ++i) { const char* pServerPort = ppServerPorts[i]; const char* pClientPort = ((ma_jack_port_name_proc)pContext->jack.jack_port_name)((ma_jack_port_t*)pDevice->jack.ppPortsPlayback[i]); @@ -33327,11 +33327,11 @@ static ma_result ma_device_stop__jack(ma_device* pDevice) static ma_result ma_context_uninit__jack(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_jack); ma_free(pContext->jack.pClientName, &pContext->allocationCallbacks); - pContext->jack.pClientName = nullptr; + pContext->jack.pClientName = NULL; #ifndef MA_NO_RUNTIME_LINKING ma_dlclose(ma_context_get_log(pContext), pContext->jack.jackSO); @@ -33357,12 +33357,12 @@ static ma_result ma_context_init__jack(ma_context* pContext, const ma_context_co for (i = 0; i < ma_countof(libjackNames); ++i) { pContext->jack.jackSO = ma_dlopen(ma_context_get_log(pContext), libjackNames[i]); - if (pContext->jack.jackSO != nullptr) { + if (pContext->jack.jackSO != NULL) { break; } } - if (pContext->jack.jackSO == nullptr) { + if (pContext->jack.jackSO == NULL) { return MA_NO_BACKEND; } @@ -33422,7 +33422,7 @@ static ma_result ma_context_init__jack(ma_context* pContext, const ma_context_co pContext->jack.jack_free = (ma_proc)_jack_free; #endif - if (pConfig->jack.pClientName != nullptr) { + if (pConfig->jack.pClientName != NULL) { pContext->jack.pClientName = ma_copy_string(pConfig->jack.pClientName, &pContext->allocationCallbacks); } pContext->jack.tryStartServer = pConfig->jack.tryStartServer; @@ -33454,9 +33454,9 @@ static ma_result ma_context_init__jack(ma_context* pContext, const ma_context_co pCallbacks->onDeviceUninit = ma_device_uninit__jack; pCallbacks->onDeviceStart = ma_device_start__jack; pCallbacks->onDeviceStop = ma_device_stop__jack; - pCallbacks->onDeviceRead = nullptr; /* Not used because JACK is asynchronous. */ - pCallbacks->onDeviceWrite = nullptr; /* Not used because JACK is asynchronous. */ - pCallbacks->onDeviceDataLoop = nullptr; /* Not used because JACK is asynchronous. */ + pCallbacks->onDeviceRead = NULL; /* Not used because JACK is asynchronous. */ + pCallbacks->onDeviceWrite = NULL; /* Not used because JACK is asynchronous. */ + pCallbacks->onDeviceDataLoop = NULL; /* Not used because JACK is asynchronous. */ return MA_SUCCESS; } @@ -33635,8 +33635,8 @@ static ma_channel ma_channel_from_AudioChannelBitmap(AudioChannelBitmap bit) static ma_result ma_format_from_AudioStreamBasicDescription(const AudioStreamBasicDescription* pDescription, ma_format* pFormatOut) { - MA_ASSERT(pDescription != nullptr); - MA_ASSERT(pFormatOut != nullptr); + MA_ASSERT(pDescription != NULL); + MA_ASSERT(pFormatOut != NULL); *pFormatOut = ma_format_unknown; /* Safety. */ @@ -33795,7 +33795,7 @@ static ma_channel ma_channel_from_AudioChannelLabel(AudioChannelLabel label) static ma_result ma_get_channel_map_from_AudioChannelLayout(AudioChannelLayout* pChannelLayout, ma_channel* pChannelMap, size_t channelMapCap) { - MA_ASSERT(pChannelLayout != nullptr); + MA_ASSERT(pChannelLayout != NULL); if (pChannelLayout->mChannelLayoutTag == kAudioChannelLayoutTag_UseChannelDescriptions) { UInt32 iChannel; @@ -33899,29 +33899,29 @@ static ma_result ma_get_device_object_ids__coreaudio(ma_context* pContext, UInt3 OSStatus status; AudioObjectID* pDeviceObjectIDs; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pDeviceCount != nullptr); - MA_ASSERT(ppDeviceObjectIDs != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pDeviceCount != NULL); + MA_ASSERT(ppDeviceObjectIDs != NULL); /* Safety. */ *pDeviceCount = 0; - *ppDeviceObjectIDs = nullptr; + *ppDeviceObjectIDs = NULL; propAddressDevices.mSelector = kAudioHardwarePropertyDevices; propAddressDevices.mScope = kAudioObjectPropertyScopeGlobal; propAddressDevices.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; - status = ((ma_AudioObjectGetPropertyDataSize_proc)pContext->coreaudio.AudioObjectGetPropertyDataSize)(kAudioObjectSystemObject, &propAddressDevices, 0, nullptr, &deviceObjectsDataSize); + status = ((ma_AudioObjectGetPropertyDataSize_proc)pContext->coreaudio.AudioObjectGetPropertyDataSize)(kAudioObjectSystemObject, &propAddressDevices, 0, NULL, &deviceObjectsDataSize); if (status != noErr) { return ma_result_from_OSStatus(status); } pDeviceObjectIDs = (AudioObjectID*)ma_malloc(deviceObjectsDataSize, &pContext->allocationCallbacks); - if (pDeviceObjectIDs == nullptr) { + if (pDeviceObjectIDs == NULL) { return MA_OUT_OF_MEMORY; } - status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(kAudioObjectSystemObject, &propAddressDevices, 0, nullptr, &deviceObjectsDataSize, pDeviceObjectIDs); + status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(kAudioObjectSystemObject, &propAddressDevices, 0, NULL, &deviceObjectsDataSize, pDeviceObjectIDs); if (status != noErr) { ma_free(pDeviceObjectIDs, &pContext->allocationCallbacks); return ma_result_from_OSStatus(status); @@ -33939,14 +33939,14 @@ static ma_result ma_get_AudioObject_uid_as_CFStringRef(ma_context* pContext, Aud UInt32 dataSize; OSStatus status; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); propAddress.mSelector = kAudioDevicePropertyDeviceUID; propAddress.mScope = kAudioObjectPropertyScopeGlobal; propAddress.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; dataSize = sizeof(*pUID); - status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(objectID, &propAddress, 0, nullptr, &dataSize, pUID); + status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(objectID, &propAddress, 0, NULL, &dataSize, pUID); if (status != noErr) { return ma_result_from_OSStatus(status); } @@ -33959,7 +33959,7 @@ static ma_result ma_get_AudioObject_uid(ma_context* pContext, AudioObjectID obje CFStringRef uid; ma_result result; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); result = ma_get_AudioObject_uid_as_CFStringRef(pContext, objectID, &uid); if (result != MA_SUCCESS) { @@ -33977,18 +33977,18 @@ static ma_result ma_get_AudioObject_uid(ma_context* pContext, AudioObjectID obje static ma_result ma_get_AudioObject_name(ma_context* pContext, AudioObjectID objectID, size_t bufferSize, char* bufferOut) { AudioObjectPropertyAddress propAddress; - CFStringRef deviceName = nullptr; + CFStringRef deviceName = NULL; UInt32 dataSize; OSStatus status; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); propAddress.mSelector = kAudioDevicePropertyDeviceNameCFString; propAddress.mScope = kAudioObjectPropertyScopeGlobal; propAddress.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; dataSize = sizeof(deviceName); - status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(objectID, &propAddress, 0, nullptr, &dataSize, &deviceName); + status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(objectID, &propAddress, 0, NULL, &dataSize, &deviceName); if (status != noErr) { return ma_result_from_OSStatus(status); } @@ -34009,24 +34009,24 @@ static ma_bool32 ma_does_AudioObject_support_scope(ma_context* pContext, AudioOb AudioBufferList* pBufferList; ma_bool32 isSupported; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); /* To know whether or not a device is an input device we need ot look at the stream configuration. If it has an output channel it's a playback device. */ propAddress.mSelector = kAudioDevicePropertyStreamConfiguration; propAddress.mScope = scope; propAddress.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; - status = ((ma_AudioObjectGetPropertyDataSize_proc)pContext->coreaudio.AudioObjectGetPropertyDataSize)(deviceObjectID, &propAddress, 0, nullptr, &dataSize); + status = ((ma_AudioObjectGetPropertyDataSize_proc)pContext->coreaudio.AudioObjectGetPropertyDataSize)(deviceObjectID, &propAddress, 0, NULL, &dataSize); if (status != noErr) { return MA_FALSE; } pBufferList = (AudioBufferList*)ma_malloc(dataSize, &pContext->allocationCallbacks); - if (pBufferList == nullptr) { + if (pBufferList == NULL) { return MA_FALSE; /* Out of memory. */ } - status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, nullptr, &dataSize, pBufferList); + status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, NULL, &dataSize, pBufferList); if (status != noErr) { ma_free(pBufferList, &pContext->allocationCallbacks); return MA_FALSE; @@ -34059,9 +34059,9 @@ static ma_result ma_get_AudioObject_stream_descriptions(ma_context* pContext, Au OSStatus status; AudioStreamRangedDescription* pDescriptions; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pDescriptionCount != nullptr); - MA_ASSERT(ppDescriptions != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pDescriptionCount != NULL); + MA_ASSERT(ppDescriptions != NULL); /* TODO: Experiment with kAudioStreamPropertyAvailablePhysicalFormats instead of (or in addition to) kAudioStreamPropertyAvailableVirtualFormats. My @@ -34071,17 +34071,17 @@ static ma_result ma_get_AudioObject_stream_descriptions(ma_context* pContext, Au propAddress.mScope = (deviceType == ma_device_type_playback) ? kAudioObjectPropertyScopeOutput : kAudioObjectPropertyScopeInput; propAddress.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; - status = ((ma_AudioObjectGetPropertyDataSize_proc)pContext->coreaudio.AudioObjectGetPropertyDataSize)(deviceObjectID, &propAddress, 0, nullptr, &dataSize); + status = ((ma_AudioObjectGetPropertyDataSize_proc)pContext->coreaudio.AudioObjectGetPropertyDataSize)(deviceObjectID, &propAddress, 0, NULL, &dataSize); if (status != noErr) { return ma_result_from_OSStatus(status); } pDescriptions = (AudioStreamRangedDescription*)ma_malloc(dataSize, &pContext->allocationCallbacks); - if (pDescriptions == nullptr) { + if (pDescriptions == NULL) { return MA_OUT_OF_MEMORY; } - status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, nullptr, &dataSize, pDescriptions); + status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, NULL, &dataSize, pDescriptions); if (status != noErr) { ma_free(pDescriptions, &pContext->allocationCallbacks); return ma_result_from_OSStatus(status); @@ -34100,26 +34100,26 @@ static ma_result ma_get_AudioObject_channel_layout(ma_context* pContext, AudioOb OSStatus status; AudioChannelLayout* pChannelLayout; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(ppChannelLayout != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(ppChannelLayout != NULL); - *ppChannelLayout = nullptr; /* Safety. */ + *ppChannelLayout = NULL; /* Safety. */ propAddress.mSelector = kAudioDevicePropertyPreferredChannelLayout; propAddress.mScope = (deviceType == ma_device_type_playback) ? kAudioObjectPropertyScopeOutput : kAudioObjectPropertyScopeInput; propAddress.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; - status = ((ma_AudioObjectGetPropertyDataSize_proc)pContext->coreaudio.AudioObjectGetPropertyDataSize)(deviceObjectID, &propAddress, 0, nullptr, &dataSize); + status = ((ma_AudioObjectGetPropertyDataSize_proc)pContext->coreaudio.AudioObjectGetPropertyDataSize)(deviceObjectID, &propAddress, 0, NULL, &dataSize); if (status != noErr) { return ma_result_from_OSStatus(status); } pChannelLayout = (AudioChannelLayout*)ma_malloc(dataSize, &pContext->allocationCallbacks); - if (pChannelLayout == nullptr) { + if (pChannelLayout == NULL) { return MA_OUT_OF_MEMORY; } - status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, nullptr, &dataSize, pChannelLayout); + status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, NULL, &dataSize, pChannelLayout); if (status != noErr) { ma_free(pChannelLayout, &pContext->allocationCallbacks); return ma_result_from_OSStatus(status); @@ -34134,8 +34134,8 @@ static ma_result ma_get_AudioObject_channel_count(ma_context* pContext, AudioObj AudioChannelLayout* pChannelLayout; ma_result result; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pChannelCount != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pChannelCount != NULL); *pChannelCount = 0; /* Safety. */ @@ -34162,7 +34162,7 @@ static ma_result ma_get_AudioObject_channel_map(ma_context* pContext, AudioObjec AudioChannelLayout* pChannelLayout; ma_result result; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); result = ma_get_AudioObject_channel_layout(pContext, deviceObjectID, deviceType, &pChannelLayout); if (result != MA_SUCCESS) { @@ -34187,29 +34187,29 @@ static ma_result ma_get_AudioObject_sample_rates(ma_context* pContext, AudioObje OSStatus status; AudioValueRange* pSampleRateRanges; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pSampleRateRangesCount != nullptr); - MA_ASSERT(ppSampleRateRanges != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pSampleRateRangesCount != NULL); + MA_ASSERT(ppSampleRateRanges != NULL); /* Safety. */ *pSampleRateRangesCount = 0; - *ppSampleRateRanges = nullptr; + *ppSampleRateRanges = NULL; propAddress.mSelector = kAudioDevicePropertyAvailableNominalSampleRates; propAddress.mScope = (deviceType == ma_device_type_playback) ? kAudioObjectPropertyScopeOutput : kAudioObjectPropertyScopeInput; propAddress.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; - status = ((ma_AudioObjectGetPropertyDataSize_proc)pContext->coreaudio.AudioObjectGetPropertyDataSize)(deviceObjectID, &propAddress, 0, nullptr, &dataSize); + status = ((ma_AudioObjectGetPropertyDataSize_proc)pContext->coreaudio.AudioObjectGetPropertyDataSize)(deviceObjectID, &propAddress, 0, NULL, &dataSize); if (status != noErr) { return ma_result_from_OSStatus(status); } pSampleRateRanges = (AudioValueRange*)ma_malloc(dataSize, &pContext->allocationCallbacks); - if (pSampleRateRanges == nullptr) { + if (pSampleRateRanges == NULL) { return MA_OUT_OF_MEMORY; } - status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, nullptr, &dataSize, pSampleRateRanges); + status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, NULL, &dataSize, pSampleRateRanges); if (status != noErr) { ma_free(pSampleRateRanges, &pContext->allocationCallbacks); return ma_result_from_OSStatus(status); @@ -34227,8 +34227,8 @@ static ma_result ma_get_AudioObject_get_closest_sample_rate(ma_context* pContext AudioValueRange* pSampleRateRanges; ma_result result; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pSampleRateOut != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pSampleRateOut != NULL); *pSampleRateOut = 0; /* Safety. */ @@ -34312,8 +34312,8 @@ static ma_result ma_get_AudioObject_closest_buffer_size_in_frames(ma_context* pC UInt32 dataSize; OSStatus status; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pBufferSizeInFramesOut != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pBufferSizeInFramesOut != NULL); *pBufferSizeInFramesOut = 0; /* Safety. */ @@ -34322,7 +34322,7 @@ static ma_result ma_get_AudioObject_closest_buffer_size_in_frames(ma_context* pC propAddress.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; dataSize = sizeof(bufferSizeRange); - status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, nullptr, &dataSize, &bufferSizeRange); + status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, NULL, &dataSize, &bufferSizeRange); if (status != noErr) { return ma_result_from_OSStatus(status); } @@ -34347,7 +34347,7 @@ static ma_result ma_set_AudioObject_buffer_size_in_frames(ma_context* pContext, UInt32 dataSize; OSStatus status; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); result = ma_get_AudioObject_closest_buffer_size_in_frames(pContext, deviceObjectID, deviceType, *pPeriodSizeInOut, &chosenBufferSizeInFrames); if (result != MA_SUCCESS) { @@ -34359,11 +34359,11 @@ static ma_result ma_set_AudioObject_buffer_size_in_frames(ma_context* pContext, propAddress.mScope = (deviceType == ma_device_type_playback) ? kAudioObjectPropertyScopeOutput : kAudioObjectPropertyScopeInput; propAddress.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; - ((ma_AudioObjectSetPropertyData_proc)pContext->coreaudio.AudioObjectSetPropertyData)(deviceObjectID, &propAddress, 0, nullptr, sizeof(chosenBufferSizeInFrames), &chosenBufferSizeInFrames); + ((ma_AudioObjectSetPropertyData_proc)pContext->coreaudio.AudioObjectSetPropertyData)(deviceObjectID, &propAddress, 0, NULL, sizeof(chosenBufferSizeInFrames), &chosenBufferSizeInFrames); /* Get the actual size of the buffer. */ dataSize = sizeof(*pPeriodSizeInOut); - status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, nullptr, &dataSize, &chosenBufferSizeInFrames); + status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(deviceObjectID, &propAddress, 0, NULL, &dataSize, &chosenBufferSizeInFrames); if (status != noErr) { return ma_result_from_OSStatus(status); } @@ -34379,8 +34379,8 @@ static ma_result ma_find_default_AudioObjectID(ma_context* pContext, ma_device_t AudioObjectID defaultDeviceObjectID; OSStatus status; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pDeviceObjectID != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pDeviceObjectID != NULL); /* Safety. */ *pDeviceObjectID = 0; @@ -34394,7 +34394,7 @@ static ma_result ma_find_default_AudioObjectID(ma_context* pContext, ma_device_t } defaultDeviceObjectIDSize = sizeof(AudioObjectID); - status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(kAudioObjectSystemObject, &propAddressDefaultDevice, 0, nullptr, &defaultDeviceObjectIDSize, &defaultDeviceObjectID); + status = ((ma_AudioObjectGetPropertyData_proc)pContext->coreaudio.AudioObjectGetPropertyData)(kAudioObjectSystemObject, &propAddressDefaultDevice, 0, NULL, &defaultDeviceObjectIDSize, &defaultDeviceObjectID); if (status == noErr) { *pDeviceObjectID = defaultDeviceObjectID; return MA_SUCCESS; @@ -34406,13 +34406,13 @@ static ma_result ma_find_default_AudioObjectID(ma_context* pContext, ma_device_t static ma_result ma_find_AudioObjectID(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, AudioObjectID* pDeviceObjectID) { - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pDeviceObjectID != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pDeviceObjectID != NULL); /* Safety. */ *pDeviceObjectID = 0; - if (pDeviceID == nullptr) { + if (pDeviceID == NULL) { /* Default device. */ return ma_find_default_AudioObjectID(pContext, deviceType, pDeviceObjectID); } else { @@ -34651,7 +34651,7 @@ static ma_result ma_get_AudioUnit_channel_map(ma_context* pContext, AudioUnit au AudioChannelLayout* pChannelLayout; ma_result result; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); if (deviceType == ma_device_type_playback) { deviceScope = kAudioUnitScope_Input; @@ -34661,13 +34661,13 @@ static ma_result ma_get_AudioUnit_channel_map(ma_context* pContext, AudioUnit au deviceBus = MA_COREAUDIO_INPUT_BUS; } - status = ((ma_AudioUnitGetPropertyInfo_proc)pContext->coreaudio.AudioUnitGetPropertyInfo)(audioUnit, kAudioUnitProperty_AudioChannelLayout, deviceScope, deviceBus, &channelLayoutSize, nullptr); + status = ((ma_AudioUnitGetPropertyInfo_proc)pContext->coreaudio.AudioUnitGetPropertyInfo)(audioUnit, kAudioUnitProperty_AudioChannelLayout, deviceScope, deviceBus, &channelLayoutSize, NULL); if (status != noErr) { return ma_result_from_OSStatus(status); } pChannelLayout = (AudioChannelLayout*)ma_malloc(channelLayoutSize, &pContext->allocationCallbacks); - if (pChannelLayout == nullptr) { + if (pChannelLayout == NULL) { return MA_OUT_OF_MEMORY; } @@ -34776,7 +34776,7 @@ static ma_result ma_context_get_device_info__coreaudio(ma_context* pContext, ma_ { ma_result result; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); #if defined(MA_APPLE_DESKTOP) /* Desktop */ @@ -34919,7 +34919,7 @@ static ma_result ma_context_get_device_info__coreaudio(ma_context* pContext, ma_ UInt32 propSize; /* We want to ensure we use a consistent device name to device enumeration. */ - if (pDeviceID != nullptr && pDeviceID->coreaudio[0] != '\0') { + if (pDeviceID != NULL && pDeviceID->coreaudio[0] != '\0') { ma_bool32 found = MA_FALSE; if (deviceType == ma_device_type_playback) { NSArray *pOutputs = [[[AVAudioSession sharedInstance] currentRoute] outputs]; @@ -34964,8 +34964,8 @@ static ma_result ma_context_get_device_info__coreaudio(ma_context* pContext, ma_ desc.componentFlags = 0; desc.componentFlagsMask = 0; - component = ((ma_AudioComponentFindNext_proc)pContext->coreaudio.AudioComponentFindNext)(nullptr, &desc); - if (component == nullptr) { + component = ((ma_AudioComponentFindNext_proc)pContext->coreaudio.AudioComponentFindNext)(NULL, &desc); + if (component == NULL) { return MA_FAILED_TO_INIT_BACKEND; } @@ -34985,7 +34985,7 @@ static ma_result ma_context_get_device_info__coreaudio(ma_context* pContext, ma_ } ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(audioUnit); - audioUnit = nullptr; + audioUnit = NULL; /* Only a single format is being reported for iOS. */ pDeviceInfo->nativeDataFormatCount = 1; @@ -35003,7 +35003,7 @@ static ma_result ma_context_get_device_info__coreaudio(ma_context* pContext, ma_ */ @autoreleasepool { AVAudioSession* pAudioSession = [AVAudioSession sharedInstance]; - MA_ASSERT(pAudioSession != nullptr); + MA_ASSERT(pAudioSession != NULL); pDeviceInfo->nativeDataFormats[0].sampleRate = (ma_uint32)pAudioSession.sampleRate; } @@ -35036,8 +35036,8 @@ static AudioBufferList* ma_allocate_AudioBufferList__coreaudio(ma_uint32 sizeInF allocationSize += sizeInFrames * ma_get_bytes_per_frame(format, channels); pBufferList = (AudioBufferList*)ma_malloc(allocationSize, pAllocationCallbacks); - if (pBufferList == nullptr) { - return nullptr; + if (pBufferList == NULL) { + return NULL; } audioBufferSizeInBytes = (UInt32)(sizeInFrames * ma_get_bytes_per_sample(format)); @@ -35062,7 +35062,7 @@ static AudioBufferList* ma_allocate_AudioBufferList__coreaudio(ma_uint32 sizeInF static ma_result ma_device_realloc_AudioBufferList__coreaudio(ma_device* pDevice, ma_uint32 sizeInFrames, ma_format format, ma_uint32 channels, ma_stream_layout layout) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ASSERT(format != ma_format_unknown); MA_ASSERT(channels > 0); @@ -35071,7 +35071,7 @@ static ma_result ma_device_realloc_AudioBufferList__coreaudio(ma_device* pDevice AudioBufferList* pNewAudioBufferList; pNewAudioBufferList = ma_allocate_AudioBufferList__coreaudio(sizeInFrames, format, channels, layout, &pDevice->pContext->allocationCallbacks); - if (pNewAudioBufferList == nullptr) { + if (pNewAudioBufferList == NULL) { return MA_OUT_OF_MEMORY; } @@ -35091,7 +35091,7 @@ static OSStatus ma_on_output__coreaudio(void* pUserData, AudioUnitRenderActionFl ma_device* pDevice = (ma_device*)pUserData; ma_stream_layout layout; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /*ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "INFO: Output Callback: busNumber=%d, frameCount=%d, mNumberBuffers=%d\n", (int)busNumber, (int)frameCount, (int)pBufferList->mNumberBuffers);*/ @@ -35108,7 +35108,7 @@ static OSStatus ma_on_output__coreaudio(void* pUserData, AudioUnitRenderActionFl if (pBufferList->mBuffers[iBuffer].mNumberChannels == pDevice->playback.internalChannels) { ma_uint32 frameCountForThisBuffer = pBufferList->mBuffers[iBuffer].mDataByteSize / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); if (frameCountForThisBuffer > 0) { - ma_device_handle_backend_data_callback(pDevice, pBufferList->mBuffers[iBuffer].mData, nullptr, frameCountForThisBuffer); + ma_device_handle_backend_data_callback(pDevice, pBufferList->mBuffers[iBuffer].mData, NULL, frameCountForThisBuffer); } /*a_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, " frameCount=%d, mNumberChannels=%d, mDataByteSize=%d\n", (int)frameCount, (int)pBufferList->mBuffers[iBuffer].mNumberChannels, (int)pBufferList->mBuffers[iBuffer].mDataByteSize);*/ @@ -35146,7 +35146,7 @@ static OSStatus ma_on_output__coreaudio(void* pUserData, AudioUnitRenderActionFl framesToRead = framesRemaining; } - ma_device_handle_backend_data_callback(pDevice, tempBuffer, nullptr, framesToRead); + ma_device_handle_backend_data_callback(pDevice, tempBuffer, NULL, framesToRead); for (iChannel = 0; iChannel < pDevice->playback.internalChannels; ++iChannel) { ppDeinterleavedBuffers[iChannel] = (void*)ma_offset_ptr(pBufferList->mBuffers[iBuffer+iChannel].mData, (frameCountPerBuffer - framesRemaining) * ma_get_bytes_per_sample(pDevice->playback.internalFormat)); @@ -35177,7 +35177,7 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla ma_uint32 iBuffer; OSStatus status; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); pRenderedBufferList = (AudioBufferList*)pDevice->coreaudio.pAudioBufferList; MA_ASSERT(pRenderedBufferList); @@ -35227,7 +35227,7 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla if (layout == ma_stream_layout_interleaved) { for (iBuffer = 0; iBuffer < pRenderedBufferList->mNumberBuffers; ++iBuffer) { if (pRenderedBufferList->mBuffers[iBuffer].mNumberChannels == pDevice->capture.internalChannels) { - ma_device_handle_backend_data_callback(pDevice, nullptr, pRenderedBufferList->mBuffers[iBuffer].mData, frameCount); + ma_device_handle_backend_data_callback(pDevice, NULL, pRenderedBufferList->mBuffers[iBuffer].mData, frameCount); /*ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, " mDataByteSize=%d.\n", (int)pRenderedBufferList->mBuffers[iBuffer].mDataByteSize);*/ } else { /* @@ -35246,7 +35246,7 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla framesToSend = framesRemaining; } - ma_device_handle_backend_data_callback(pDevice, nullptr, silentBuffer, framesToSend); + ma_device_handle_backend_data_callback(pDevice, NULL, silentBuffer, framesToSend); framesRemaining -= framesToSend; } @@ -35279,7 +35279,7 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla } ma_interleave_pcm_frames(pDevice->capture.internalFormat, pDevice->capture.internalChannels, framesToSend, (const void**)ppDeinterleavedBuffers, tempBuffer); - ma_device_handle_backend_data_callback(pDevice, nullptr, tempBuffer, framesToSend); + ma_device_handle_backend_data_callback(pDevice, NULL, tempBuffer, framesToSend); framesRemaining -= framesToSend; } @@ -35299,7 +35299,7 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla static void on_start_stop__coreaudio(void* pUserData, AudioUnit audioUnit, AudioUnitPropertyID propertyID, AudioUnitScope scope, AudioUnitElement element) { ma_device* pDevice = (ma_device*)pUserData; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* Don't do anything if it looks like we're just reinitializing due to a device switch. */ if (((audioUnit == pDevice->coreaudio.audioUnitPlayback) && pDevice->coreaudio.isSwitchingPlaybackDevice) || @@ -35371,7 +35371,7 @@ done: static ma_spinlock g_DeviceTrackingInitLock_CoreAudio = 0; /* A spinlock for mutal exclusion of the init/uninit of the global tracking data. Initialization to 0 is what we need. */ static ma_uint32 g_DeviceTrackingInitCounter_CoreAudio = 0; static ma_mutex g_DeviceTrackingMutex_CoreAudio; -static ma_device** g_ppTrackedDevices_CoreAudio = nullptr; +static ma_device** g_ppTrackedDevices_CoreAudio = NULL; static ma_uint32 g_TrackedDeviceCap_CoreAudio = 0; static ma_uint32 g_TrackedDeviceCount_CoreAudio = 0; @@ -35452,7 +35452,7 @@ static OSStatus ma_default_device_changed__coreaudio(AudioObjectID objectID, UIn static ma_result ma_context__init_device_tracking__coreaudio(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); ma_spinlock_lock(&g_DeviceTrackingInitLock_CoreAudio); { @@ -35465,10 +35465,10 @@ static ma_result ma_context__init_device_tracking__coreaudio(ma_context* pContex ma_mutex_init(&g_DeviceTrackingMutex_CoreAudio); propAddress.mSelector = kAudioHardwarePropertyDefaultInputDevice; - ((ma_AudioObjectAddPropertyListener_proc)pContext->coreaudio.AudioObjectAddPropertyListener)(kAudioObjectSystemObject, &propAddress, &ma_default_device_changed__coreaudio, nullptr); + ((ma_AudioObjectAddPropertyListener_proc)pContext->coreaudio.AudioObjectAddPropertyListener)(kAudioObjectSystemObject, &propAddress, &ma_default_device_changed__coreaudio, NULL); propAddress.mSelector = kAudioHardwarePropertyDefaultOutputDevice; - ((ma_AudioObjectAddPropertyListener_proc)pContext->coreaudio.AudioObjectAddPropertyListener)(kAudioObjectSystemObject, &propAddress, &ma_default_device_changed__coreaudio, nullptr); + ((ma_AudioObjectAddPropertyListener_proc)pContext->coreaudio.AudioObjectAddPropertyListener)(kAudioObjectSystemObject, &propAddress, &ma_default_device_changed__coreaudio, NULL); } g_DeviceTrackingInitCounter_CoreAudio += 1; @@ -35480,7 +35480,7 @@ static ma_result ma_context__init_device_tracking__coreaudio(ma_context* pContex static ma_result ma_context__uninit_device_tracking__coreaudio(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); ma_spinlock_lock(&g_DeviceTrackingInitLock_CoreAudio); { @@ -35493,13 +35493,13 @@ static ma_result ma_context__uninit_device_tracking__coreaudio(ma_context* pCont propAddress.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; propAddress.mSelector = kAudioHardwarePropertyDefaultInputDevice; - ((ma_AudioObjectRemovePropertyListener_proc)pContext->coreaudio.AudioObjectRemovePropertyListener)(kAudioObjectSystemObject, &propAddress, &ma_default_device_changed__coreaudio, nullptr); + ((ma_AudioObjectRemovePropertyListener_proc)pContext->coreaudio.AudioObjectRemovePropertyListener)(kAudioObjectSystemObject, &propAddress, &ma_default_device_changed__coreaudio, NULL); propAddress.mSelector = kAudioHardwarePropertyDefaultOutputDevice; - ((ma_AudioObjectRemovePropertyListener_proc)pContext->coreaudio.AudioObjectRemovePropertyListener)(kAudioObjectSystemObject, &propAddress, &ma_default_device_changed__coreaudio, nullptr); + ((ma_AudioObjectRemovePropertyListener_proc)pContext->coreaudio.AudioObjectRemovePropertyListener)(kAudioObjectSystemObject, &propAddress, &ma_default_device_changed__coreaudio, NULL); /* At this point there should be no tracked devices. If not there's an error somewhere. */ - if (g_ppTrackedDevices_CoreAudio != nullptr) { + if (g_ppTrackedDevices_CoreAudio != NULL) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_WARNING, "You have uninitialized all contexts while an associated device is still active."); ma_spinlock_unlock(&g_DeviceTrackingInitLock_CoreAudio); return MA_INVALID_OPERATION; @@ -35515,7 +35515,7 @@ static ma_result ma_context__uninit_device_tracking__coreaudio(ma_context* pCont static ma_result ma_device__track__coreaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); ma_mutex_lock(&g_DeviceTrackingMutex_CoreAudio); { @@ -35530,7 +35530,7 @@ static ma_result ma_device__track__coreaudio(ma_device* pDevice) } ppNewDevices = (ma_device**)ma_realloc(g_ppTrackedDevices_CoreAudio, sizeof(*g_ppTrackedDevices_CoreAudio)*newCap, &pDevice->pContext->allocationCallbacks); - if (ppNewDevices == nullptr) { + if (ppNewDevices == NULL) { ma_mutex_unlock(&g_DeviceTrackingMutex_CoreAudio); return MA_OUT_OF_MEMORY; } @@ -35549,7 +35549,7 @@ static ma_result ma_device__track__coreaudio(ma_device* pDevice) static ma_result ma_device__untrack__coreaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); ma_mutex_lock(&g_DeviceTrackingMutex_CoreAudio); { @@ -35567,7 +35567,7 @@ static ma_result ma_device__untrack__coreaudio(ma_device* pDevice) /* If there's nothing else in the list we need to free memory. */ if (g_TrackedDeviceCount_CoreAudio == 0) { ma_free(g_ppTrackedDevices_CoreAudio, &pDevice->pContext->allocationCallbacks); - g_ppTrackedDevices_CoreAudio = nullptr; + g_ppTrackedDevices_CoreAudio = NULL; g_TrackedDeviceCap_CoreAudio = 0; } @@ -35703,7 +35703,7 @@ static ma_result ma_device__untrack__coreaudio(ma_device* pDevice) static ma_result ma_device_uninit__coreaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ASSERT(ma_device_get_state(pDevice) == ma_device_state_uninitialized); #if defined(MA_APPLE_DESKTOP) @@ -35714,16 +35714,16 @@ static ma_result ma_device_uninit__coreaudio(ma_device* pDevice) ma_device__untrack__coreaudio(pDevice); #endif #if defined(MA_APPLE_MOBILE) - if (pDevice->coreaudio.pNotificationHandler != nullptr) { + if (pDevice->coreaudio.pNotificationHandler != NULL) { ma_ios_notification_handler* pNotificationHandler = (MA_BRIDGE_TRANSFER ma_ios_notification_handler*)pDevice->coreaudio.pNotificationHandler; [pNotificationHandler remove_handler]; } #endif - if (pDevice->coreaudio.audioUnitCapture != nullptr) { + if (pDevice->coreaudio.audioUnitCapture != NULL) { ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitCapture); } - if (pDevice->coreaudio.audioUnitPlayback != nullptr) { + if (pDevice->coreaudio.audioUnitPlayback != NULL) { ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitPlayback); } @@ -35783,15 +35783,15 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev return MA_INVALID_ARGS; } - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(deviceType == ma_device_type_playback || deviceType == ma_device_type_capture); #if defined(MA_APPLE_DESKTOP) pData->deviceObjectID = 0; #endif - pData->component = nullptr; - pData->audioUnit = nullptr; - pData->pAudioBufferList = nullptr; + pData->component = NULL; + pData->audioUnit = NULL; + pData->pAudioBufferList = NULL; #if defined(MA_APPLE_DESKTOP) result = ma_find_AudioObjectID(pContext, deviceType, pDeviceID, &deviceObjectID); @@ -35851,7 +35851,7 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev For some reason it looks like Apple is only allowing selection of the input device. There does not appear to be any way to change the default output route. I have no idea why this is like this, but for now we'll only be able to configure capture devices. */ - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { if (deviceType == ma_device_type_capture) { ma_bool32 found = MA_FALSE; NSArray *pInputs = [[[AVAudioSession sharedInstance] currentRoute] inputs]; @@ -35943,7 +35943,7 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev propAddress.mScope = (deviceType == ma_device_type_playback) ? kAudioObjectPropertyScopeOutput : kAudioObjectPropertyScopeInput; propAddress.mElement = AUDIO_OBJECT_PROPERTY_ELEMENT; - status = ((ma_AudioObjectSetPropertyData_proc)pContext->coreaudio.AudioObjectSetPropertyData)(deviceObjectID, &propAddress, 0, nullptr, sizeof(sampleRateRange), &sampleRateRange); + status = ((ma_AudioObjectSetPropertyData_proc)pContext->coreaudio.AudioObjectSetPropertyData)(deviceObjectID, &propAddress, 0, NULL, sizeof(sampleRateRange), &sampleRateRange); if (status != noErr) { bestFormat.mSampleRate = origFormat.mSampleRate; } @@ -35967,7 +35967,7 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev */ @autoreleasepool { AVAudioSession* pAudioSession = [AVAudioSession sharedInstance]; - MA_ASSERT(pAudioSession != nullptr); + MA_ASSERT(pAudioSession != NULL); [pAudioSession setPreferredSampleRate:(double)pData->sampleRateIn error:nil]; bestFormat.mSampleRate = pAudioSession.sampleRate; @@ -36079,7 +36079,7 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev */ @autoreleasepool { AVAudioSession* pAudioSession = [AVAudioSession sharedInstance]; - MA_ASSERT(pAudioSession != nullptr); + MA_ASSERT(pAudioSession != NULL); [pAudioSession setPreferredIOBufferDuration:((float)actualPeriodSizeInFrames / pAudioSession.sampleRate) error:nil]; actualPeriodSizeInFrames = ma_next_power_of_2((ma_uint32)(pAudioSession.IOBufferDuration * pAudioSession.sampleRate)); @@ -36109,7 +36109,7 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev AudioBufferList* pBufferList; pBufferList = ma_allocate_AudioBufferList__coreaudio(pData->periodSizeInFramesOut, pData->formatOut, pData->channelsOut, (isInterleaved) ? ma_stream_layout_interleaved : ma_stream_layout_deinterleaved, &pContext->allocationCallbacks); - if (pBufferList == nullptr) { + if (pBufferList == NULL) { ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit); return MA_OUT_OF_MEMORY; } @@ -36148,7 +36148,7 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev status = ((ma_AudioUnitInitialize_proc)pContext->coreaudio.AudioUnitInitialize)(pData->audioUnit); if (status != noErr) { ma_free(pData->pAudioBufferList, &pContext->allocationCallbacks); - pData->pAudioBufferList = nullptr; + pData->pAudioBufferList = NULL; ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit); return ma_result_from_OSStatus(status); } @@ -36219,7 +36219,7 @@ static ma_result ma_device_reinit_internal__coreaudio(ma_device* pDevice, ma_dev data.periodsIn = 3; } - result = ma_device_init_internal__coreaudio(pDevice->pContext, deviceType, nullptr, &data, (void*)pDevice); + result = ma_device_init_internal__coreaudio(pDevice->pContext, deviceType, NULL, &data, (void*)pDevice); if (result != MA_SUCCESS) { return result; } @@ -36262,8 +36262,8 @@ static ma_result ma_device_init__coreaudio(ma_device* pDevice, const ma_device_c { ma_result result; - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pConfig != NULL); if (pConfig->deviceType == ma_device_type_loopback) { return MA_DEVICE_TYPE_NOT_SUPPORTED; @@ -36300,7 +36300,7 @@ static ma_result ma_device_init__coreaudio(ma_device* pDevice, const ma_device_c return result; } - pDevice->coreaudio.isDefaultCaptureDevice = (pConfig->capture.pDeviceID == nullptr); + pDevice->coreaudio.isDefaultCaptureDevice = (pConfig->capture.pDeviceID == NULL); #if defined(MA_APPLE_DESKTOP) pDevice->coreaudio.deviceObjectIDCapture = (ma_uint32)data.deviceObjectID; #endif @@ -36326,7 +36326,7 @@ static ma_result ma_device_init__coreaudio(ma_device* pDevice, const ma_device_c If we are using the default device we'll need to listen for changes to the system's default device so we can seamlessly switch the device in the background. */ - if (pConfig->capture.pDeviceID == nullptr) { + if (pConfig->capture.pDeviceID == NULL) { ma_device__track__coreaudio(pDevice); } #endif @@ -36366,7 +36366,7 @@ static ma_result ma_device_init__coreaudio(ma_device* pDevice, const ma_device_c return result; } - pDevice->coreaudio.isDefaultPlaybackDevice = (pConfig->playback.pDeviceID == nullptr); + pDevice->coreaudio.isDefaultPlaybackDevice = (pConfig->playback.pDeviceID == NULL); #if defined(MA_APPLE_DESKTOP) pDevice->coreaudio.deviceObjectIDPlayback = (ma_uint32)data.deviceObjectID; #endif @@ -36390,7 +36390,7 @@ static ma_result ma_device_init__coreaudio(ma_device* pDevice, const ma_device_c If we are using the default device we'll need to listen for changes to the system's default device so we can seamlessly switch the device in the background. */ - if (pDescriptorPlayback->pDeviceID == nullptr && (pConfig->deviceType != ma_device_type_duplex || pDescriptorCapture->pDeviceID != nullptr)) { + if (pDescriptorPlayback->pDeviceID == NULL && (pConfig->deviceType != ma_device_type_duplex || pDescriptorCapture->pDeviceID != NULL)) { ma_device__track__coreaudio(pDevice); } #endif @@ -36418,7 +36418,7 @@ static ma_result ma_device_init__coreaudio(ma_device* pDevice, const ma_device_c static ma_result ma_device_start__coreaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { OSStatus status = ((ma_AudioOutputUnitStart_proc)pDevice->pContext->coreaudio.AudioOutputUnitStart)((AudioUnit)pDevice->coreaudio.audioUnitCapture); @@ -36442,7 +36442,7 @@ static ma_result ma_device_start__coreaudio(ma_device* pDevice) static ma_result ma_device_stop__coreaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* It's not clear from the documentation whether or not AudioOutputUnitStop() actually drains the device or not. */ @@ -36468,7 +36468,7 @@ static ma_result ma_device_stop__coreaudio(ma_device* pDevice) static ma_result ma_context_uninit__coreaudio(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_coreaudio); #if defined(MA_APPLE_MOBILE) @@ -36521,15 +36521,15 @@ static ma_result ma_context_init__coreaudio(ma_context* pContext, const ma_conte ma_result result; #endif - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pContext != NULL); #if defined(MA_APPLE_MOBILE) @autoreleasepool { AVAudioSession* pAudioSession = [AVAudioSession sharedInstance]; AVAudioSessionCategoryOptions options = pConfig->coreaudio.sessionCategoryOptions; - MA_ASSERT(pAudioSession != nullptr); + MA_ASSERT(pAudioSession != NULL); if (pConfig->coreaudio.sessionCategory == ma_ios_session_category_default) { /* @@ -36573,7 +36573,7 @@ static ma_result ma_context_init__coreaudio(ma_context* pContext, const ma_conte #if !defined(MA_NO_RUNTIME_LINKING) && !defined(MA_APPLE_MOBILE) pContext->coreaudio.hCoreFoundation = ma_dlopen(ma_context_get_log(pContext), "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"); - if (pContext->coreaudio.hCoreFoundation == nullptr) { + if (pContext->coreaudio.hCoreFoundation == NULL) { return MA_API_NOT_FOUND; } @@ -36582,7 +36582,7 @@ static ma_result ma_context_init__coreaudio(ma_context* pContext, const ma_conte pContext->coreaudio.hCoreAudio = ma_dlopen(ma_context_get_log(pContext), "/System/Library/Frameworks/CoreAudio.framework/CoreAudio"); - if (pContext->coreaudio.hCoreAudio == nullptr) { + if (pContext->coreaudio.hCoreAudio == NULL) { ma_dlclose(ma_context_get_log(pContext), pContext->coreaudio.hCoreFoundation); return MA_API_NOT_FOUND; } @@ -36600,17 +36600,17 @@ static ma_result ma_context_init__coreaudio(ma_context* pContext, const ma_conte AudioToolbox. */ pContext->coreaudio.hAudioUnit = ma_dlopen(ma_context_get_log(pContext), "/System/Library/Frameworks/AudioUnit.framework/AudioUnit"); - if (pContext->coreaudio.hAudioUnit == nullptr) { + if (pContext->coreaudio.hAudioUnit == NULL) { ma_dlclose(ma_context_get_log(pContext), pContext->coreaudio.hCoreAudio); ma_dlclose(ma_context_get_log(pContext), pContext->coreaudio.hCoreFoundation); return MA_API_NOT_FOUND; } - if (ma_dlsym(ma_context_get_log(pContext), pContext->coreaudio.hAudioUnit, "AudioComponentFindNext") == nullptr) { + if (ma_dlsym(ma_context_get_log(pContext), pContext->coreaudio.hAudioUnit, "AudioComponentFindNext") == NULL) { /* Couldn't find the required symbols in AudioUnit, so fall back to AudioToolbox. */ ma_dlclose(ma_context_get_log(pContext), pContext->coreaudio.hAudioUnit); pContext->coreaudio.hAudioUnit = ma_dlopen(ma_context_get_log(pContext), "/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox"); - if (pContext->coreaudio.hAudioUnit == nullptr) { + if (pContext->coreaudio.hAudioUnit == NULL) { ma_dlclose(ma_context_get_log(pContext), pContext->coreaudio.hCoreAudio); ma_dlclose(ma_context_get_log(pContext), pContext->coreaudio.hCoreFoundation); return MA_API_NOT_FOUND; @@ -36666,8 +36666,8 @@ static ma_result ma_context_init__coreaudio(ma_context* pContext, const ma_conte desc.componentFlags = 0; desc.componentFlagsMask = 0; - pContext->coreaudio.component = ((ma_AudioComponentFindNext_proc)pContext->coreaudio.AudioComponentFindNext)(nullptr, &desc); - if (pContext->coreaudio.component == nullptr) { + pContext->coreaudio.component = ((ma_AudioComponentFindNext_proc)pContext->coreaudio.AudioComponentFindNext)(NULL, &desc); + if (pContext->coreaudio.component == NULL) { #if !defined(MA_NO_RUNTIME_LINKING) && !defined(MA_APPLE_MOBILE) ma_dlclose(ma_context_get_log(pContext), pContext->coreaudio.hAudioUnit); ma_dlclose(ma_context_get_log(pContext), pContext->coreaudio.hCoreAudio); @@ -36699,9 +36699,9 @@ static ma_result ma_context_init__coreaudio(ma_context* pContext, const ma_conte pCallbacks->onDeviceUninit = ma_device_uninit__coreaudio; pCallbacks->onDeviceStart = ma_device_start__coreaudio; pCallbacks->onDeviceStop = ma_device_stop__coreaudio; - pCallbacks->onDeviceRead = nullptr; - pCallbacks->onDeviceWrite = nullptr; - pCallbacks->onDeviceDataLoop = nullptr; + pCallbacks->onDeviceRead = NULL; + pCallbacks->onDeviceWrite = NULL; + pCallbacks->onDeviceDataLoop = NULL; return MA_SUCCESS; } @@ -36842,7 +36842,7 @@ static ma_format ma_find_best_format_from_sio_cap__sndio(struct ma_sio_cap* caps ma_format bestFormat; unsigned int iConfig; - MA_ASSERT(caps != nullptr); + MA_ASSERT(caps != NULL); bestFormat = ma_format_unknown; for (iConfig = 0; iConfig < caps->nconf; iConfig += 1) { @@ -36887,7 +36887,7 @@ static ma_uint32 ma_find_best_channels_from_sio_cap__sndio(struct ma_sio_cap* ca ma_uint32 maxChannels; unsigned int iConfig; - MA_ASSERT(caps != nullptr); + MA_ASSERT(caps != NULL); MA_ASSERT(requiredFormat != ma_format_unknown); /* Just pick whatever configuration has the most channels. */ @@ -36955,7 +36955,7 @@ static ma_uint32 ma_find_best_sample_rate_from_sio_cap__sndio(struct ma_sio_cap* ma_uint32 bestSampleRate; unsigned int iConfig; - MA_ASSERT(caps != nullptr); + MA_ASSERT(caps != NULL); MA_ASSERT(requiredFormat != ma_format_unknown); MA_ASSERT(requiredChannels > 0); MA_ASSERT(requiredChannels <= MA_MAX_CHANNELS); @@ -37052,15 +37052,15 @@ static ma_result ma_context_enumerate_devices__sndio(ma_context* pContext, ma_en ma_bool32 isTerminating = MA_FALSE; struct ma_sio_hdl* handle; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); /* sndio doesn't seem to have a good device enumeration API, so I'm therefore only enumerating over default devices for now. */ /* Playback. */ if (!isTerminating) { handle = ((ma_sio_open_proc)pContext->sndio.sio_open)(MA_SIO_DEVANY, MA_SIO_PLAY, 0); - if (handle != nullptr) { + if (handle != NULL) { /* Supports playback. */ ma_device_info deviceInfo; MA_ZERO_OBJECT(&deviceInfo); @@ -37076,7 +37076,7 @@ static ma_result ma_context_enumerate_devices__sndio(ma_context* pContext, ma_en /* Capture. */ if (!isTerminating) { handle = ((ma_sio_open_proc)pContext->sndio.sio_open)(MA_SIO_DEVANY, MA_SIO_REC, 0); - if (handle != nullptr) { + if (handle != NULL) { /* Supports capture. */ ma_device_info deviceInfo; MA_ZERO_OBJECT(&deviceInfo); @@ -37099,10 +37099,10 @@ static ma_result ma_context_get_device_info__sndio(ma_context* pContext, ma_devi struct ma_sio_cap caps; unsigned int iConfig; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); /* We need to open the device before we can get information about it. */ - if (pDeviceID == nullptr) { + if (pDeviceID == NULL) { ma_strcpy_s(devid, sizeof(devid), MA_SIO_DEVANY); ma_strcpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), (deviceType == ma_device_type_playback) ? MA_DEFAULT_PLAYBACK_DEVICE_NAME : MA_DEFAULT_CAPTURE_DEVICE_NAME); } else { @@ -37111,7 +37111,7 @@ static ma_result ma_context_get_device_info__sndio(ma_context* pContext, ma_devi } handle = ((ma_sio_open_proc)pContext->sndio.sio_open)(devid, (deviceType == ma_device_type_playback) ? MA_SIO_PLAY : MA_SIO_REC, 0); - if (handle == nullptr) { + if (handle == NULL) { return MA_NO_DEVICE; } @@ -37191,7 +37191,7 @@ static ma_result ma_context_get_device_info__sndio(ma_context* pContext, ma_devi static ma_result ma_device_uninit__sndio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { ((ma_sio_close_proc)pDevice->pContext->sndio.sio_close)((struct ma_sio_hdl*)pDevice->sndio.handleCapture); @@ -37221,9 +37221,9 @@ static ma_result ma_device_init_handle__sndio(ma_device* pDevice, const ma_devic ma_uint32 internalPeriodSizeInFrames; ma_uint32 internalPeriods; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); MA_ASSERT(deviceType != ma_device_type_duplex); - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (deviceType == ma_device_type_capture) { openFlags = MA_SIO_REC; @@ -37237,12 +37237,12 @@ static ma_result ma_device_init_handle__sndio(ma_device* pDevice, const ma_devic sampleRate = pDescriptor->sampleRate; pDeviceName = MA_SIO_DEVANY; - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { pDeviceName = pDeviceID->sndio; } handle = (ma_ptr)((ma_sio_open_proc)pDevice->pContext->sndio.sio_open)(pDeviceName, openFlags, 0); - if (handle == nullptr) { + if (handle == NULL) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[sndio] Failed to open device."); return MA_FAILED_TO_OPEN_BACKEND_DEVICE; } @@ -37379,7 +37379,7 @@ static ma_result ma_device_init_handle__sndio(ma_device* pDevice, const ma_devic static ma_result ma_device_init__sndio(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ZERO_OBJECT(&pDevice->sndio); @@ -37406,7 +37406,7 @@ static ma_result ma_device_init__sndio(ma_device* pDevice, const ma_device_confi static ma_result ma_device_start__sndio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { ((ma_sio_start_proc)pDevice->pContext->sndio.sio_start)((struct ma_sio_hdl*)pDevice->sndio.handleCapture); @@ -37421,7 +37421,7 @@ static ma_result ma_device_start__sndio(ma_device* pDevice) static ma_result ma_device_stop__sndio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* From the documentation: @@ -37448,7 +37448,7 @@ static ma_result ma_device_write__sndio(ma_device* pDevice, const void* pPCMFram { int result; - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = 0; } @@ -37458,7 +37458,7 @@ static ma_result ma_device_write__sndio(ma_device* pDevice, const void* pPCMFram return MA_IO_ERROR; } - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = frameCount; } @@ -37469,7 +37469,7 @@ static ma_result ma_device_read__sndio(ma_device* pDevice, void* pPCMFrames, ma_ { int result; - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -37479,7 +37479,7 @@ static ma_result ma_device_read__sndio(ma_device* pDevice, void* pPCMFrames, ma_ return MA_IO_ERROR; } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = frameCount; } @@ -37488,7 +37488,7 @@ static ma_result ma_device_read__sndio(ma_device* pDevice, void* pPCMFrames, ma_ static ma_result ma_context_uninit__sndio(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_sndio); (void)pContext; @@ -37505,12 +37505,12 @@ static ma_result ma_context_init__sndio(ma_context* pContext, const ma_context_c for (i = 0; i < ma_countof(libsndioNames); ++i) { pContext->sndio.sndioSO = ma_dlopen(ma_context_get_log(pContext), libsndioNames[i]); - if (pContext->sndio.sndioSO != nullptr) { + if (pContext->sndio.sndioSO != NULL) { break; } } - if (pContext->sndio.sndioSO == nullptr) { + if (pContext->sndio.sndioSO == NULL) { return MA_NO_BACKEND; } @@ -37547,7 +37547,7 @@ static ma_result ma_context_init__sndio(ma_context* pContext, const ma_context_c pCallbacks->onDeviceStop = ma_device_stop__sndio; pCallbacks->onDeviceRead = ma_device_read__sndio; pCallbacks->onDeviceWrite = ma_device_write__sndio; - pCallbacks->onDeviceDataLoop = nullptr; + pCallbacks->onDeviceDataLoop = NULL; (void)pConfig; return MA_SUCCESS; @@ -37585,7 +37585,7 @@ static void ma_construct_device_id__audio4(char* id, size_t idSize, const char* { size_t baseLen; - MA_ASSERT(id != nullptr); + MA_ASSERT(id != NULL); MA_ASSERT(idSize > 0); MA_ASSERT(deviceIndex >= 0); @@ -37602,9 +37602,9 @@ static ma_result ma_extract_device_index_from_id__audio4(const char* id, const c size_t baseLen; const char* deviceIndexStr; - MA_ASSERT(id != nullptr); - MA_ASSERT(base != nullptr); - MA_ASSERT(pIndexOut != nullptr); + MA_ASSERT(id != NULL); + MA_ASSERT(base != NULL); + MA_ASSERT(pIndexOut != NULL); idLen = strlen(id); baseLen = strlen(base); @@ -37659,8 +37659,8 @@ static ma_format ma_format_from_encoding__audio4(unsigned int encoding, unsigned static void ma_encoding_from_format__audio4(ma_format format, unsigned int* pEncoding, unsigned int* pPrecision) { - MA_ASSERT(pEncoding != nullptr); - MA_ASSERT(pPrecision != nullptr); + MA_ASSERT(pEncoding != NULL); + MA_ASSERT(pPrecision != NULL); switch (format) { @@ -37772,9 +37772,9 @@ static ma_result ma_context_get_device_info_from_fd__audio4(ma_context* pContext { audio_device_t fdDevice; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(fd >= 0); - MA_ASSERT(pDeviceInfo != nullptr); + MA_ASSERT(pDeviceInfo != NULL); (void)pContext; (void)deviceType; @@ -37869,8 +37869,8 @@ static ma_result ma_context_enumerate_devices__audio4(ma_context* pContext, ma_e char devpath[256]; int iDevice; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); /* Every device will be named "/dev/audioN", with a "/dev/audioctlN" equivalent. We use the "/dev/audioctlN" @@ -37937,13 +37937,13 @@ static ma_result ma_context_get_device_info__audio4(ma_context* pContext, ma_dev char ctlid[256]; ma_result result; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); /* We need to open the "/dev/audioctlN" device to get the info. To do this we need to extract the number from the device ID which will be in "/dev/audioN" format. */ - if (pDeviceID == nullptr) { + if (pDeviceID == NULL) { /* Default device. */ ma_strcpy_s(ctlid, sizeof(ctlid), "/dev/audioctl"); } else { @@ -37975,7 +37975,7 @@ static ma_result ma_context_get_device_info__audio4(ma_context* pContext, ma_dev static ma_result ma_device_uninit__audio4(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { close(pDevice->audio4.fdCapture); @@ -38007,9 +38007,9 @@ static ma_result ma_device_init_fd__audio4(ma_device* pDevice, const ma_device_c ma_uint32 internalPeriodSizeInFrames; ma_uint32 internalPeriods; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); MA_ASSERT(deviceType != ma_device_type_duplex); - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* The first thing to do is open the file. */ if (deviceType == ma_device_type_capture) { @@ -38020,7 +38020,7 @@ static ma_result ma_device_init_fd__audio4(ma_device* pDevice, const ma_device_c /*fdFlags |= O_NONBLOCK;*/ /* Find the index of the default device as a start. We'll use this index later. Set it to (size_t)-1 otherwise. */ - if (pDescriptor->pDeviceID == nullptr) { + if (pDescriptor->pDeviceID == NULL) { /* Default device. */ for (iDefaultDevice = 0; iDefaultDevice < ma_countof(pDefaultDeviceNames); ++iDefaultDevice) { fd = open(pDefaultDeviceNames[iDefaultDevice], fdFlags, 0); @@ -38262,7 +38262,7 @@ static ma_result ma_device_init_fd__audio4(ma_device* pDevice, const ma_device_c static ma_result ma_device_init__audio4(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ZERO_OBJECT(&pDevice->audio4); @@ -38310,7 +38310,7 @@ static ma_result ma_device_init__audio4(ma_device* pDevice, const ma_device_conf static ma_result ma_device_start__audio4(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { if (pDevice->audio4.fdCapture == -1) { @@ -38350,7 +38350,7 @@ static ma_result ma_device_stop_fd__audio4(ma_device* pDevice, int fd) static ma_result ma_device_stop__audio4(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { ma_result result; @@ -38383,7 +38383,7 @@ static ma_result ma_device_write__audio4(ma_device* pDevice, const void* pPCMFra { int result; - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = 0; } @@ -38393,7 +38393,7 @@ static ma_result ma_device_write__audio4(ma_device* pDevice, const void* pPCMFra return ma_result_from_errno(errno); } - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = (ma_uint32)result / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); } @@ -38404,7 +38404,7 @@ static ma_result ma_device_read__audio4(ma_device* pDevice, void* pPCMFrames, ma { int result; - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -38414,7 +38414,7 @@ static ma_result ma_device_read__audio4(ma_device* pDevice, void* pPCMFrames, ma return ma_result_from_errno(errno); } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = (ma_uint32)result / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); } @@ -38423,7 +38423,7 @@ static ma_result ma_device_read__audio4(ma_device* pDevice, void* pPCMFrames, ma static ma_result ma_context_uninit__audio4(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_audio4); (void)pContext; @@ -38432,7 +38432,7 @@ static ma_result ma_context_uninit__audio4(ma_context* pContext) static ma_result ma_context_init__audio4(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); (void)pConfig; @@ -38446,7 +38446,7 @@ static ma_result ma_context_init__audio4(ma_context* pContext, const ma_context_ pCallbacks->onDeviceStop = ma_device_stop__audio4; pCallbacks->onDeviceRead = ma_device_read__audio4; pCallbacks->onDeviceWrite = ma_device_write__audio4; - pCallbacks->onDeviceDataLoop = nullptr; + pCallbacks->onDeviceDataLoop = NULL; return MA_SUCCESS; } @@ -38486,8 +38486,8 @@ static ma_result ma_context_open_device__oss(ma_context* pContext, ma_device_typ const char* deviceName; int flags; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pfd != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pfd != NULL); (void)pContext; *pfd = -1; @@ -38498,7 +38498,7 @@ static ma_result ma_context_open_device__oss(ma_context* pContext, ma_device_typ } deviceName = MA_OSS_DEFAULT_DEVICE_NAME; - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { deviceName = pDeviceID->oss; } @@ -38521,8 +38521,8 @@ static ma_result ma_context_enumerate_devices__oss(ma_context* pContext, ma_enum oss_sysinfo si; int result; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); fd = ma_open_temp_device__oss(); if (fd == -1) { @@ -38588,9 +38588,9 @@ static void ma_context_add_native_data_format__oss(ma_context* pContext, oss_aud unsigned int maxChannels; unsigned int iRate; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pAudioInfo != nullptr); - MA_ASSERT(pDeviceInfo != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pAudioInfo != NULL); + MA_ASSERT(pDeviceInfo != NULL); /* If we support all channels we just report 0. */ minChannels = ma_clamp(pAudioInfo->min_channels, MA_MIN_CHANNELS, MA_MAX_CHANNELS); @@ -38639,10 +38639,10 @@ static ma_result ma_context_get_device_info__oss(ma_context* pContext, ma_device oss_sysinfo si; int result; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); /* Handle the default device a little differently. */ - if (pDeviceID == nullptr) { + if (pDeviceID == NULL) { if (deviceType == ma_device_type_playback) { ma_strncpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), MA_DEFAULT_PLAYBACK_DEVICE_NAME, (size_t)-1); } else { @@ -38733,7 +38733,7 @@ static ma_result ma_context_get_device_info__oss(ma_context* pContext, ma_device static ma_result ma_device_uninit__oss(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { close(pDevice->oss.fdCapture); @@ -38789,15 +38789,15 @@ static ma_result ma_device_init_fd__oss(ma_device* pDevice, const ma_device_conf ma_result result; int ossResult; int fd; - const ma_device_id* pDeviceID = nullptr; + const ma_device_id* pDeviceID = NULL; ma_share_mode shareMode; int ossFormat; int ossChannels; int ossSampleRate; int ossFragment; - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pConfig != NULL); MA_ASSERT(deviceType != ma_device_type_duplex); pDeviceID = pDescriptor->pDeviceID; @@ -38903,8 +38903,8 @@ static ma_result ma_device_init_fd__oss(ma_device* pDevice, const ma_device_conf static ma_result ma_device_init__oss(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pConfig != NULL); MA_ZERO_OBJECT(&pDevice->oss); @@ -38952,7 +38952,7 @@ When starting the device, OSS will automatically start it when write() or read() */ static ma_result ma_device_start__oss(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* The device is automatically started with reading and writing. */ (void)pDevice; @@ -38962,7 +38962,7 @@ static ma_result ma_device_start__oss(ma_device* pDevice) static ma_result ma_device_stop__oss(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* See note above on why this is empty. */ (void)pDevice; @@ -38975,7 +38975,7 @@ static ma_result ma_device_write__oss(ma_device* pDevice, const void* pPCMFrames int resultOSS; ma_uint32 deviceState; - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = 0; } @@ -38991,7 +38991,7 @@ static ma_result ma_device_write__oss(ma_device* pDevice, const void* pPCMFrames return ma_result_from_errno(errno); } - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = (ma_uint32)resultOSS / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); } @@ -39003,7 +39003,7 @@ static ma_result ma_device_read__oss(ma_device* pDevice, void* pPCMFrames, ma_ui int resultOSS; ma_uint32 deviceState; - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -39019,7 +39019,7 @@ static ma_result ma_device_read__oss(ma_device* pDevice, void* pPCMFrames, ma_ui return ma_result_from_errno(errno); } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = (ma_uint32)resultOSS / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); } @@ -39028,7 +39028,7 @@ static ma_result ma_device_read__oss(ma_device* pDevice, void* pPCMFrames, ma_ui static ma_result ma_context_uninit__oss(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_oss); (void)pContext; @@ -39041,7 +39041,7 @@ static ma_result ma_context_init__oss(ma_context* pContext, const ma_context_con int ossVersion; int result; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); (void)pConfig; @@ -39077,7 +39077,7 @@ static ma_result ma_context_init__oss(ma_context* pContext, const ma_context_con pCallbacks->onDeviceStop = ma_device_stop__oss; pCallbacks->onDeviceRead = ma_device_read__oss; pCallbacks->onDeviceWrite = ma_device_write__oss; - pCallbacks->onDeviceDataLoop = nullptr; + pCallbacks->onDeviceDataLoop = NULL; return MA_SUCCESS; } @@ -39306,7 +39306,7 @@ static void ma_stream_error_callback__aaudio(ma_AAudioStream* pStream, void* pUs ma_result result; ma_job job; ma_device* pDevice = (ma_device*)pUserData; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); (void)error; ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, "[AAudio] ERROR CALLBACK: error=%d, AAudioStream_getState()=%d\n", error, ((MA_PFN_AAudioStream_getState)pDevice->pContext->aaudio.AAudioStream_getState)(pStream)); @@ -39340,10 +39340,10 @@ static void ma_stream_error_callback__aaudio(ma_AAudioStream* pStream, void* pUs static ma_aaudio_data_callback_result_t ma_stream_data_callback_capture__aaudio(ma_AAudioStream* pStream, void* pUserData, void* pAudioData, int32_t frameCount) { ma_device* pDevice = (ma_device*)pUserData; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (frameCount > 0) { - ma_device_handle_backend_data_callback(pDevice, nullptr, pAudioData, (ma_uint32)frameCount); + ma_device_handle_backend_data_callback(pDevice, NULL, pAudioData, (ma_uint32)frameCount); } (void)pStream; @@ -39353,7 +39353,7 @@ static ma_aaudio_data_callback_result_t ma_stream_data_callback_capture__aaudio( static ma_aaudio_data_callback_result_t ma_stream_data_callback_playback__aaudio(ma_AAudioStream* pStream, void* pUserData, void* pAudioData, int32_t frameCount) { ma_device* pDevice = (ma_device*)pUserData; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* I've had a report that AAudio can sometimes post a frame count of 0. We need to check for that here @@ -39361,7 +39361,7 @@ static ma_aaudio_data_callback_result_t ma_stream_data_callback_playback__aaudio though I've not yet had any reports about that one. */ if (frameCount > 0) { - ma_device_handle_backend_data_callback(pDevice, pAudioData, nullptr, (ma_uint32)frameCount); + ma_device_handle_backend_data_callback(pDevice, pAudioData, NULL, (ma_uint32)frameCount); } (void)pStream; @@ -39374,14 +39374,14 @@ static ma_result ma_create_and_configure_AAudioStreamBuilder__aaudio(ma_context* ma_aaudio_result_t resultAA; /* Safety. */ - *ppBuilder = nullptr; + *ppBuilder = NULL; resultAA = ((MA_PFN_AAudio_createStreamBuilder)pContext->aaudio.AAudio_createStreamBuilder)(&pBuilder); if (resultAA != MA_AAUDIO_OK) { return ma_result_from_aaudio(resultAA); } - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { ((MA_PFN_AAudioStreamBuilder_setDeviceId)pContext->aaudio.AAudioStreamBuilder_setDeviceId)(pBuilder, pDeviceID->aaudio); } @@ -39390,8 +39390,8 @@ static ma_result ma_create_and_configure_AAudioStreamBuilder__aaudio(ma_context* /* If we have a device descriptor make sure we configure the stream builder to take our requested parameters. */ - if (pDescriptor != nullptr) { - MA_ASSERT(pConfig != nullptr); /* We must have a device config if we also have a descriptor. The config is required for AAudio specific configuration options. */ + if (pDescriptor != NULL) { + MA_ASSERT(pConfig != NULL); /* We must have a device config if we also have a descriptor. The config is required for AAudio specific configuration options. */ if (pDescriptor->sampleRate != 0) { ((MA_PFN_AAudioStreamBuilder_setSampleRate)pContext->aaudio.AAudioStreamBuilder_setSampleRate)(pBuilder, pDescriptor->sampleRate); @@ -39428,21 +39428,21 @@ static ma_result ma_create_and_configure_AAudioStreamBuilder__aaudio(ma_context* } if (deviceType == ma_device_type_capture) { - if (pConfig->aaudio.inputPreset != ma_aaudio_input_preset_default && pContext->aaudio.AAudioStreamBuilder_setInputPreset != nullptr) { + if (pConfig->aaudio.inputPreset != ma_aaudio_input_preset_default && pContext->aaudio.AAudioStreamBuilder_setInputPreset != NULL) { ((MA_PFN_AAudioStreamBuilder_setInputPreset)pContext->aaudio.AAudioStreamBuilder_setInputPreset)(pBuilder, ma_to_input_preset__aaudio(pConfig->aaudio.inputPreset)); } ((MA_PFN_AAudioStreamBuilder_setDataCallback)pContext->aaudio.AAudioStreamBuilder_setDataCallback)(pBuilder, ma_stream_data_callback_capture__aaudio, (void*)pDevice); } else { - if (pConfig->aaudio.usage != ma_aaudio_usage_default && pContext->aaudio.AAudioStreamBuilder_setUsage != nullptr) { + if (pConfig->aaudio.usage != ma_aaudio_usage_default && pContext->aaudio.AAudioStreamBuilder_setUsage != NULL) { ((MA_PFN_AAudioStreamBuilder_setUsage)pContext->aaudio.AAudioStreamBuilder_setUsage)(pBuilder, ma_to_usage__aaudio(pConfig->aaudio.usage)); } - if (pConfig->aaudio.contentType != ma_aaudio_content_type_default && pContext->aaudio.AAudioStreamBuilder_setContentType != nullptr) { + if (pConfig->aaudio.contentType != ma_aaudio_content_type_default && pContext->aaudio.AAudioStreamBuilder_setContentType != NULL) { ((MA_PFN_AAudioStreamBuilder_setContentType)pContext->aaudio.AAudioStreamBuilder_setContentType)(pBuilder, ma_to_content_type__aaudio(pConfig->aaudio.contentType)); } - if (pConfig->aaudio.allowedCapturePolicy != ma_aaudio_allow_capture_default && pContext->aaudio.AAudioStreamBuilder_setAllowedCapturePolicy != nullptr) { + if (pConfig->aaudio.allowedCapturePolicy != ma_aaudio_allow_capture_default && pContext->aaudio.AAudioStreamBuilder_setAllowedCapturePolicy != NULL) { ((MA_PFN_AAudioStreamBuilder_setAllowedCapturePolicy)pContext->aaudio.AAudioStreamBuilder_setAllowedCapturePolicy)(pBuilder, ma_to_allowed_capture_policy__aaudio(pConfig->aaudio.allowedCapturePolicy)); } @@ -39457,7 +39457,7 @@ static ma_result ma_create_and_configure_AAudioStreamBuilder__aaudio(ma_context* ((MA_PFN_AAudioStreamBuilder_setPerformanceMode)pContext->aaudio.AAudioStreamBuilder_setPerformanceMode)(pBuilder, (pConfig->performanceProfile == ma_performance_profile_low_latency) ? MA_AAUDIO_PERFORMANCE_MODE_LOW_LATENCY : MA_AAUDIO_PERFORMANCE_MODE_NONE); /* We need to set an error callback to detect device changes. */ - if (pDevice != nullptr) { /* <-- pDevice should never be null if pDescriptor is not null, which is always the case if we hit this branch. Check anyway for safety. */ + if (pDevice != NULL) { /* <-- pDevice should never be null if pDescriptor is not null, which is always the case if we hit this branch. Check anyway for safety. */ ((MA_PFN_AAudioStreamBuilder_setErrorCallback)pContext->aaudio.AAudioStreamBuilder_setErrorCallback)(pBuilder, ma_stream_error_callback__aaudio, (void*)pDevice); } } @@ -39482,9 +39482,9 @@ static ma_result ma_open_stream_basic__aaudio(ma_context* pContext, const ma_dev ma_result result; ma_AAudioStreamBuilder* pBuilder; - *ppStream = nullptr; + *ppStream = NULL; - result = ma_create_and_configure_AAudioStreamBuilder__aaudio(pContext, pDeviceID, deviceType, shareMode, nullptr, nullptr, nullptr, &pBuilder); + result = ma_create_and_configure_AAudioStreamBuilder__aaudio(pContext, pDeviceID, deviceType, shareMode, NULL, NULL, NULL, &pBuilder); if (result != MA_SUCCESS) { return result; } @@ -39500,11 +39500,11 @@ static ma_result ma_open_stream__aaudio(ma_device* pDevice, const ma_device_conf ma_result result; ma_AAudioStreamBuilder* pBuilder; - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pDescriptor != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pDescriptor != NULL); MA_ASSERT(deviceType != ma_device_type_duplex); /* This function should not be called for a full-duplex device type. */ - *ppStream = nullptr; + *ppStream = NULL; result = ma_create_and_configure_AAudioStreamBuilder__aaudio(pDevice->pContext, pDescriptor->pDeviceID, deviceType, pDescriptor->shareMode, pDescriptor, pConfig, pDevice, &pBuilder); if (result != MA_SUCCESS) { @@ -39516,7 +39516,7 @@ static ma_result ma_open_stream__aaudio(ma_device* pDevice, const ma_device_conf static ma_result ma_close_stream__aaudio(ma_context* pContext, ma_AAudioStream* pStream) { - if (pStream == nullptr) { + if (pStream == NULL) { return MA_INVALID_ARGS; } @@ -39527,7 +39527,7 @@ static ma_bool32 ma_has_default_device__aaudio(ma_context* pContext, ma_device_t { /* The only way to know this is to try creating a stream. */ ma_AAudioStream* pStream; - ma_result result = ma_open_stream_basic__aaudio(pContext, nullptr, deviceType, ma_share_mode_shared, &pStream); + ma_result result = ma_open_stream_basic__aaudio(pContext, NULL, deviceType, ma_share_mode_shared, &pStream); if (result != MA_SUCCESS) { return MA_FALSE; } @@ -39556,8 +39556,8 @@ static ma_result ma_context_enumerate_devices__aaudio(ma_context* pContext, ma_e { ma_bool32 cbResult = MA_TRUE; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); /* Unfortunately AAudio does not have an enumeration API. Therefore I'm only going to report default devices, but only if it can instantiate a stream. */ @@ -39590,9 +39590,9 @@ static ma_result ma_context_enumerate_devices__aaudio(ma_context* pContext, ma_e static void ma_context_add_native_data_format_from_AAudioStream_ex__aaudio(ma_context* pContext, ma_AAudioStream* pStream, ma_format format, ma_uint32 flags, ma_device_info* pDeviceInfo) { - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pStream != nullptr); - MA_ASSERT(pDeviceInfo != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pStream != NULL); + MA_ASSERT(pDeviceInfo != NULL); pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].format = format; pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].channels = ((MA_PFN_AAudioStream_getChannelCount)pContext->aaudio.AAudioStream_getChannelCount)(pStream); @@ -39613,10 +39613,10 @@ static ma_result ma_context_get_device_info__aaudio(ma_context* pContext, ma_dev ma_AAudioStream* pStream; ma_result result; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); /* ID */ - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { pDeviceInfo->id.aaudio = pDeviceID->aaudio; } else { pDeviceInfo->id.aaudio = MA_AAUDIO_UNSPECIFIED; @@ -39641,23 +39641,23 @@ static ma_result ma_context_get_device_info__aaudio(ma_context* pContext, ma_dev ma_context_add_native_data_format_from_AAudioStream__aaudio(pContext, pStream, 0, pDeviceInfo); ma_close_stream__aaudio(pContext, pStream); - pStream = nullptr; + pStream = NULL; return MA_SUCCESS; } static ma_result ma_close_streams__aaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* When rerouting, streams may have been closed and never re-opened. Hence the extra checks below. */ if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamCapture); - pDevice->aaudio.pStreamCapture = nullptr; + pDevice->aaudio.pStreamCapture = NULL; } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamPlayback); - pDevice->aaudio.pStreamPlayback = nullptr; + pDevice->aaudio.pStreamPlayback = NULL; } return MA_SUCCESS; @@ -39665,7 +39665,7 @@ static ma_result ma_close_streams__aaudio(ma_device* pDevice) static ma_result ma_device_uninit__aaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* Note: Closing the streams may cause a timeout error, which would then trigger rerouting in our error callback. @@ -39693,11 +39693,11 @@ static ma_result ma_device_init_by_type__aaudio(ma_device* pDevice, const ma_dev int32_t framesPerDataCallback; ma_AAudioStream* pStream; - MA_ASSERT(pDevice != nullptr); - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDescriptor != nullptr); + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDescriptor != NULL); - *ppStream = nullptr; /* Safety. */ + *ppStream = NULL; /* Safety. */ /* First step is to open the stream. From there we'll be able to extract the internal configuration. */ result = ma_open_stream__aaudio(pDevice, pConfig, deviceType, pDescriptor, &pStream); @@ -39737,7 +39737,7 @@ static ma_result ma_device_init_streams__aaudio(ma_device* pDevice, const ma_dev { ma_result result; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pConfig->deviceType == ma_device_type_loopback) { return MA_DEVICE_TYPE_NOT_SUPPORTED; @@ -39770,7 +39770,7 @@ static ma_result ma_device_init__aaudio(ma_device* pDevice, const ma_device_conf { ma_result result; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); result = ma_device_init_streams__aaudio(pDevice, pConfig, pDescriptorPlayback, pDescriptorCapture); if (result != MA_SUCCESS) { @@ -39790,9 +39790,9 @@ static ma_result ma_device_start_stream__aaudio(ma_device* pDevice, ma_AAudioStr ma_aaudio_result_t resultAA; ma_aaudio_stream_state_t currentState; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); - if (pStream == nullptr) { + if (pStream == NULL) { return MA_INVALID_ARGS; } @@ -39826,9 +39826,9 @@ static ma_result ma_device_stop_stream__aaudio(ma_device* pDevice, ma_AAudioStre ma_aaudio_result_t resultAA; ma_aaudio_stream_state_t currentState; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); - if (pStream == nullptr) { + if (pStream == NULL) { return MA_INVALID_ARGS; } @@ -39869,7 +39869,7 @@ static ma_result ma_device_stop_stream__aaudio(ma_device* pDevice, ma_AAudioStre static ma_result ma_device_start__aaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { ma_result result = ma_device_start_stream__aaudio(pDevice, (ma_AAudioStream*)pDevice->aaudio.pStreamCapture); @@ -39893,7 +39893,7 @@ static ma_result ma_device_start__aaudio(ma_device* pDevice) static ma_result ma_device_stop__aaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { ma_result result = ma_device_stop_stream__aaudio(pDevice, (ma_AAudioStream*)pDevice->aaudio.pStreamCapture); @@ -39921,7 +39921,7 @@ static ma_result ma_device_reinit__aaudio(ma_device* pDevice, ma_device_type dev ma_result result; ma_int32 iAttempt; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* We got disconnected! Retry a few times, until we find a connected device! */ iAttempt = 0; @@ -39941,11 +39941,11 @@ static ma_result ma_device_reinit__aaudio(ma_device* pDevice, ma_device_type dev ma_device_descriptor descriptorCapture; deviceConfig = ma_device_config_init(deviceType); - deviceConfig.playback.pDeviceID = nullptr; /* Only doing rerouting with default devices. */ + deviceConfig.playback.pDeviceID = NULL; /* Only doing rerouting with default devices. */ deviceConfig.playback.shareMode = pDevice->playback.shareMode; deviceConfig.playback.format = pDevice->playback.format; deviceConfig.playback.channels = pDevice->playback.channels; - deviceConfig.capture.pDeviceID = nullptr; /* Only doing rerouting with default devices. */ + deviceConfig.capture.pDeviceID = NULL; /* Only doing rerouting with default devices. */ deviceConfig.capture.shareMode = pDevice->capture.shareMode; deviceConfig.capture.format = pDevice->capture.format; deviceConfig.capture.channels = pDevice->capture.channels; @@ -40029,11 +40029,11 @@ static ma_result ma_device_reinit__aaudio(ma_device* pDevice, ma_device_type dev static ma_result ma_device_get_info__aaudio(ma_device* pDevice, ma_device_type type, ma_device_info* pDeviceInfo) { - ma_AAudioStream* pStream = nullptr; + ma_AAudioStream* pStream = NULL; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ASSERT(type != ma_device_type_duplex); - MA_ASSERT(pDeviceInfo != nullptr); + MA_ASSERT(pDeviceInfo != NULL); if (type == ma_device_type_capture) { pStream = (ma_AAudioStream*)pDevice->aaudio.pStreamCapture; @@ -40047,7 +40047,7 @@ static ma_result ma_device_get_info__aaudio(ma_device* pDevice, ma_device_type t } /* Safety. Should never happen. */ - if (pStream == nullptr) { + if (pStream == NULL) { return MA_INVALID_OPERATION; } @@ -40060,13 +40060,13 @@ static ma_result ma_device_get_info__aaudio(ma_device* pDevice, ma_device_type t static ma_result ma_context_uninit__aaudio(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_aaudio); ma_device_job_thread_uninit(&pContext->aaudio.jobThread, &pContext->allocationCallbacks); ma_dlclose(ma_context_get_log(pContext), pContext->aaudio.hAAudio); - pContext->aaudio.hAAudio = nullptr; + pContext->aaudio.hAAudio = NULL; return MA_SUCCESS; } @@ -40081,12 +40081,12 @@ static ma_result ma_context_init__aaudio(ma_context* pContext, const ma_context_ for (i = 0; i < ma_countof(libNames); ++i) { pContext->aaudio.hAAudio = ma_dlopen(ma_context_get_log(pContext), libNames[i]); - if (pContext->aaudio.hAAudio != nullptr) { + if (pContext->aaudio.hAAudio != NULL) { break; } } - if (pContext->aaudio.hAAudio == nullptr) { + if (pContext->aaudio.hAAudio == NULL) { return MA_FAILED_TO_INIT_BACKEND; } @@ -40161,9 +40161,9 @@ static ma_result ma_context_init__aaudio(ma_context* pContext, const ma_context_ pCallbacks->onDeviceUninit = ma_device_uninit__aaudio; pCallbacks->onDeviceStart = ma_device_start__aaudio; pCallbacks->onDeviceStop = ma_device_stop__aaudio; - pCallbacks->onDeviceRead = nullptr; /* Not used because AAudio is asynchronous. */ - pCallbacks->onDeviceWrite = nullptr; /* Not used because AAudio is asynchronous. */ - pCallbacks->onDeviceDataLoop = nullptr; /* Not used because AAudio is asynchronous. */ + pCallbacks->onDeviceRead = NULL; /* Not used because AAudio is asynchronous. */ + pCallbacks->onDeviceWrite = NULL; /* Not used because AAudio is asynchronous. */ + pCallbacks->onDeviceDataLoop = NULL; /* Not used because AAudio is asynchronous. */ pCallbacks->onDeviceGetInfo = ma_device_get_info__aaudio; @@ -40177,7 +40177,7 @@ static ma_result ma_context_init__aaudio(ma_context* pContext, const ma_context_ result = ma_device_job_thread_init(&jobThreadConfig, &pContext->allocationCallbacks, &pContext->aaudio.jobThread); if (result != MA_SUCCESS) { ma_dlclose(ma_context_get_log(pContext), pContext->aaudio.hAAudio); - pContext->aaudio.hAAudio = nullptr; + pContext->aaudio.hAAudio = NULL; return result; } } @@ -40192,10 +40192,10 @@ static ma_result ma_job_process__device__aaudio_reroute(ma_job* pJob) ma_result result = MA_SUCCESS; ma_device* pDevice; - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); pDevice = (ma_device*)pJob->data.device.aaudio.reroute.pDevice; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); ma_mutex_lock(&pDevice->aaudio.rerouteLock); { @@ -40237,8 +40237,8 @@ OpenSL|ES Backend typedef SLresult (SLAPIENTRY * ma_slCreateEngine_proc)(SLObjectItf* pEngine, SLuint32 numOptions, SLEngineOption* pEngineOptions, SLuint32 numInterfaces, SLInterfaceID* pInterfaceIds, SLboolean* pInterfaceRequired); /* OpenSL|ES has one-per-application objects :( */ -static SLObjectItf g_maEngineObjectSL = nullptr; -static SLEngineItf g_maEngineSL = nullptr; +static SLObjectItf g_maEngineObjectSL = NULL; +static SLEngineItf g_maEngineSL = NULL; static ma_uint32 g_maOpenSLInitCounter = 0; static ma_spinlock g_maOpenSLSpinlock = 0; /* For init/uninit. */ @@ -40456,8 +40456,8 @@ static ma_result ma_context_enumerate_devices__opensl(ma_context* pContext, ma_e { ma_bool32 cbResult; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); MA_ASSERT(g_maOpenSLInitCounter > 0); /* <-- If you trigger this it means you've either not initialized the context, or you've uninitialized it and then attempted to enumerate devices. */ if (g_maOpenSLInitCounter == 0) { @@ -40565,8 +40565,8 @@ return_default_device:; static void ma_context_add_data_format_ex__opensl(ma_context* pContext, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_device_info* pDeviceInfo) { - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pDeviceInfo != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pDeviceInfo != NULL); pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].format = format; pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].channels = channels; @@ -40584,8 +40584,8 @@ static void ma_context_add_data_format__opensl(ma_context* pContext, ma_format f ma_uint32 iChannel; ma_uint32 iSampleRate; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(pDeviceInfo != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(pDeviceInfo != NULL); /* Each sample format can support mono and stereo, and we'll support a small subset of standard @@ -40603,7 +40603,7 @@ static void ma_context_add_data_format__opensl(ma_context* pContext, ma_format f static ma_result ma_context_get_device_info__opensl(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(g_maOpenSLInitCounter > 0); /* <-- If you trigger this it means you've either not initialized the context, or you've uninitialized it and then attempted to get device info. */ if (g_maOpenSLInitCounter == 0) { @@ -40647,7 +40647,7 @@ static ma_result ma_context_get_device_info__opensl(ma_context* pContext, ma_dev #endif return_default_device: - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { if ((deviceType == ma_device_type_playback && pDeviceID->opensl != SL_DEFAULTDEVICEID_AUDIOOUTPUT) || (deviceType == ma_device_type_capture && pDeviceID->opensl != SL_DEFAULTDEVICEID_AUDIOINPUT)) { return MA_NO_DEVICE; /* Don't know the device. */ @@ -40695,7 +40695,7 @@ static void ma_buffer_queue_callback_capture__opensl_android(SLAndroidSimpleBuff ma_uint8* pBuffer; SLresult resultSL; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); (void)pBufferQueue; @@ -40718,7 +40718,7 @@ static void ma_buffer_queue_callback_capture__opensl_android(SLAndroidSimpleBuff periodSizeInBytes = pDevice->capture.internalPeriodSizeInFrames * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); pBuffer = pDevice->opensl.pBufferCapture + (pDevice->opensl.currentBufferIndexCapture * periodSizeInBytes); - ma_device_handle_backend_data_callback(pDevice, nullptr, pBuffer, pDevice->capture.internalPeriodSizeInFrames); + ma_device_handle_backend_data_callback(pDevice, NULL, pBuffer, pDevice->capture.internalPeriodSizeInFrames); resultSL = MA_OPENSL_BUFFERQUEUE(pDevice->opensl.pBufferQueueCapture)->Enqueue((SLAndroidSimpleBufferQueueItf)pDevice->opensl.pBufferQueueCapture, pBuffer, periodSizeInBytes); if (resultSL != SL_RESULT_SUCCESS) { @@ -40735,7 +40735,7 @@ static void ma_buffer_queue_callback_playback__opensl_android(SLAndroidSimpleBuf ma_uint8* pBuffer; SLresult resultSL; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); (void)pBufferQueue; @@ -40752,7 +40752,7 @@ static void ma_buffer_queue_callback_playback__opensl_android(SLAndroidSimpleBuf periodSizeInBytes = pDevice->playback.internalPeriodSizeInFrames * ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); pBuffer = pDevice->opensl.pBufferPlayback + (pDevice->opensl.currentBufferIndexPlayback * periodSizeInBytes); - ma_device_handle_backend_data_callback(pDevice, pBuffer, nullptr, pDevice->playback.internalPeriodSizeInFrames); + ma_device_handle_backend_data_callback(pDevice, pBuffer, NULL, pDevice->playback.internalPeriodSizeInFrames); resultSL = MA_OPENSL_BUFFERQUEUE(pDevice->opensl.pBufferQueuePlayback)->Enqueue((SLAndroidSimpleBufferQueueItf)pDevice->opensl.pBufferQueuePlayback, pBuffer, periodSizeInBytes); if (resultSL != SL_RESULT_SUCCESS) { @@ -40765,7 +40765,7 @@ static void ma_buffer_queue_callback_playback__opensl_android(SLAndroidSimpleBuf static ma_result ma_device_uninit__opensl(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ASSERT(g_maOpenSLInitCounter > 0); /* <-- If you trigger this it means you've either not initialized the context, or you've uninitialized it before uninitializing the device. */ if (g_maOpenSLInitCounter == 0) { @@ -40937,7 +40937,7 @@ static ma_result ma_device_init__opensl(ma_device* pDevice, const ma_device_conf } /* Now we can start initializing the device properly. */ - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ZERO_OBJECT(&pDevice->opensl); queue.locatorType = SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE; @@ -40954,10 +40954,10 @@ static ma_result ma_device_init__opensl(ma_device* pDevice, const ma_device_conf locatorDevice.locatorType = SL_DATALOCATOR_IODEVICE; locatorDevice.deviceType = SL_IODEVICE_AUDIOINPUT; locatorDevice.deviceID = SL_DEFAULTDEVICEID_AUDIOINPUT; /* Must always use the default device with Android. */ - locatorDevice.device = nullptr; + locatorDevice.device = NULL; source.pLocator = &locatorDevice; - source.pFormat = nullptr; + source.pFormat = NULL; queue.numBuffers = pDescriptorCapture->periodCount; @@ -41032,7 +41032,7 @@ static ma_result ma_device_init__opensl(ma_device* pDevice, const ma_device_conf bufferSizeInBytes = pDescriptorCapture->periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorCapture->format, pDescriptorCapture->channels) * pDescriptorCapture->periodCount; pDevice->opensl.pBufferCapture = (ma_uint8*)ma_calloc(bufferSizeInBytes, &pDevice->pContext->allocationCallbacks); - if (pDevice->opensl.pBufferCapture == nullptr) { + if (pDevice->opensl.pBufferCapture == NULL) { ma_device_uninit__opensl(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to allocate memory for data buffer."); return MA_OUT_OF_MEMORY; @@ -41049,7 +41049,7 @@ static ma_result ma_device_init__opensl(ma_device* pDevice, const ma_device_conf ma_SLDataFormat_PCM_init__opensl(pDescriptorPlayback->format, pDescriptorPlayback->channels, pDescriptorPlayback->sampleRate, pDescriptorPlayback->channelMap, &pcm); - resultSL = (*g_maEngineSL)->CreateOutputMix(g_maEngineSL, (SLObjectItf*)&pDevice->opensl.pOutputMixObj, 0, nullptr, nullptr); + resultSL = (*g_maEngineSL)->CreateOutputMix(g_maEngineSL, (SLObjectItf*)&pDevice->opensl.pOutputMixObj, 0, NULL, NULL); if (resultSL != SL_RESULT_SUCCESS) { ma_device_uninit__opensl(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to create output mix."); @@ -41071,7 +41071,7 @@ static ma_result ma_device_init__opensl(ma_device* pDevice, const ma_device_conf } /* Set the output device. */ - if (pDescriptorPlayback->pDeviceID != nullptr) { + if (pDescriptorPlayback->pDeviceID != NULL) { SLuint32 deviceID_OpenSL = pDescriptorPlayback->pDeviceID->opensl; MA_OPENSL_OUTPUTMIX(pDevice->opensl.pOutputMix)->ReRoute((SLOutputMixItf)pDevice->opensl.pOutputMix, 1, &deviceID_OpenSL); } @@ -41085,7 +41085,7 @@ static ma_result ma_device_init__opensl(ma_device* pDevice, const ma_device_conf outmixLocator.outputMix = (SLObjectItf)pDevice->opensl.pOutputMixObj; sink.pLocator = &outmixLocator; - sink.pFormat = nullptr; + sink.pFormat = NULL; resultSL = (*g_maEngineSL)->CreateAudioPlayer(g_maEngineSL, (SLObjectItf*)&pDevice->opensl.pAudioPlayerObj, &source, &sink, ma_countof(itfIDs), itfIDs, itfIDsRequired); if (resultSL == SL_RESULT_CONTENT_UNSUPPORTED || resultSL == SL_RESULT_PARAMETER_INVALID) { @@ -41155,7 +41155,7 @@ static ma_result ma_device_init__opensl(ma_device* pDevice, const ma_device_conf bufferSizeInBytes = pDescriptorPlayback->periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorPlayback->format, pDescriptorPlayback->channels) * pDescriptorPlayback->periodCount; pDevice->opensl.pBufferPlayback = (ma_uint8*)ma_calloc(bufferSizeInBytes, &pDevice->pContext->allocationCallbacks); - if (pDevice->opensl.pBufferPlayback == nullptr) { + if (pDevice->opensl.pBufferPlayback == NULL) { ma_device_uninit__opensl(pDevice); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to allocate memory for data buffer."); return MA_OUT_OF_MEMORY; @@ -41175,7 +41175,7 @@ static ma_result ma_device_start__opensl(ma_device* pDevice) size_t periodSizeInBytes; ma_uint32 iPeriod; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ASSERT(g_maOpenSLInitCounter > 0); /* <-- If you trigger this it means you've either not initialized the context, or you've uninitialized it and then attempted to start the device. */ if (g_maOpenSLInitCounter == 0) { @@ -41266,7 +41266,7 @@ static ma_result ma_device_stop__opensl(ma_device* pDevice) { SLresult resultSL; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); MA_ASSERT(g_maOpenSLInitCounter > 0); /* <-- If you trigger this it means you've either not initialized the context, or you've uninitialized it before stopping/uninitializing the device. */ if (g_maOpenSLInitCounter == 0) { @@ -41306,7 +41306,7 @@ static ma_result ma_device_stop__opensl(ma_device* pDevice) static ma_result ma_context_uninit__opensl(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_opensl); (void)pContext; @@ -41329,7 +41329,7 @@ static ma_result ma_dlsym_SLInterfaceID__opensl(ma_context* pContext, const char { /* We need to return an error if the symbol cannot be found. This is important because there have been reports that some symbols do not exist. */ ma_handle* p = (ma_handle*)ma_dlsym(ma_context_get_log(pContext), pContext->opensl.libOpenSLES, pName); - if (p == nullptr) { + if (p == NULL) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_INFO, "[OpenSL] Cannot find symbol %s", pName); return MA_NO_BACKEND; } @@ -41344,7 +41344,7 @@ static ma_result ma_context_init_engine_nolock__opensl(ma_context* pContext) if (g_maOpenSLInitCounter == 1) { SLresult resultSL; - resultSL = ((ma_slCreateEngine_proc)pContext->opensl.slCreateEngine)(&g_maEngineObjectSL, 0, nullptr, 0, nullptr, nullptr); + resultSL = ((ma_slCreateEngine_proc)pContext->opensl.slCreateEngine)(&g_maEngineObjectSL, 0, NULL, 0, NULL, NULL); if (resultSL != SL_RESULT_SUCCESS) { g_maOpenSLInitCounter -= 1; return ma_result_from_OpenSL(resultSL); @@ -41374,7 +41374,7 @@ static ma_result ma_context_init__opensl(ma_context* pContext, const ma_context_ }; #endif - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); (void)pConfig; @@ -41387,12 +41387,12 @@ static ma_result ma_context_init__opensl(ma_context* pContext, const ma_context_ */ for (i = 0; i < ma_countof(libOpenSLESNames); i += 1) { pContext->opensl.libOpenSLES = ma_dlopen(ma_context_get_log(pContext), libOpenSLESNames[i]); - if (pContext->opensl.libOpenSLES != nullptr) { + if (pContext->opensl.libOpenSLES != NULL) { break; } } - if (pContext->opensl.libOpenSLES == nullptr) { + if (pContext->opensl.libOpenSLES == NULL) { ma_log_post(ma_context_get_log(pContext), MA_LOG_LEVEL_INFO, "[OpenSL] Could not find libOpenSLES.so"); return MA_NO_BACKEND; } @@ -41440,7 +41440,7 @@ static ma_result ma_context_init__opensl(ma_context* pContext, const ma_context_ } pContext->opensl.slCreateEngine = (ma_proc)ma_dlsym(ma_context_get_log(pContext), pContext->opensl.libOpenSLES, "slCreateEngine"); - if (pContext->opensl.slCreateEngine == nullptr) { + if (pContext->opensl.slCreateEngine == NULL) { ma_dlclose(ma_context_get_log(pContext), pContext->opensl.libOpenSLES); ma_log_post(ma_context_get_log(pContext), MA_LOG_LEVEL_INFO, "[OpenSL] Cannot find symbol slCreateEngine."); return MA_NO_BACKEND; @@ -41478,9 +41478,9 @@ static ma_result ma_context_init__opensl(ma_context* pContext, const ma_context_ pCallbacks->onDeviceUninit = ma_device_uninit__opensl; pCallbacks->onDeviceStart = ma_device_start__opensl; pCallbacks->onDeviceStop = ma_device_stop__opensl; - pCallbacks->onDeviceRead = nullptr; /* Not needed because OpenSL|ES is asynchronous. */ - pCallbacks->onDeviceWrite = nullptr; /* Not needed because OpenSL|ES is asynchronous. */ - pCallbacks->onDeviceDataLoop = nullptr; /* Not needed because OpenSL|ES is asynchronous. */ + pCallbacks->onDeviceRead = NULL; /* Not needed because OpenSL|ES is asynchronous. */ + pCallbacks->onDeviceWrite = NULL; /* Not needed because OpenSL|ES is asynchronous. */ + pCallbacks->onDeviceDataLoop = NULL; /* Not needed because OpenSL|ES is asynchronous. */ return MA_SUCCESS; } @@ -41544,12 +41544,12 @@ void EMSCRIPTEN_KEEPALIVE ma_free_emscripten(void* p, const ma_allocation_callba void EMSCRIPTEN_KEEPALIVE ma_device_process_pcm_frames_capture__webaudio(ma_device* pDevice, int frameCount, float* pFrames) { - ma_device_handle_backend_data_callback(pDevice, nullptr, pFrames, (ma_uint32)frameCount); + ma_device_handle_backend_data_callback(pDevice, NULL, pFrames, (ma_uint32)frameCount); } void EMSCRIPTEN_KEEPALIVE ma_device_process_pcm_frames_playback__webaudio(ma_device* pDevice, int frameCount, float* pFrames) { - ma_device_handle_backend_data_callback(pDevice, pFrames, nullptr, (ma_uint32)frameCount); + ma_device_handle_backend_data_callback(pDevice, pFrames, NULL, (ma_uint32)frameCount); } #ifdef __cplusplus } @@ -41559,8 +41559,8 @@ static ma_result ma_context_enumerate_devices__webaudio(ma_context* pContext, ma { ma_bool32 cbResult = MA_TRUE; - MA_ASSERT(pContext != nullptr); - MA_ASSERT(callback != nullptr); + MA_ASSERT(pContext != NULL); + MA_ASSERT(callback != NULL); /* Only supporting default devices for now. */ @@ -41589,7 +41589,7 @@ static ma_result ma_context_enumerate_devices__webaudio(ma_context* pContext, ma static ma_result ma_context_get_device_info__webaudio(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); if (deviceType == ma_device_type_capture && !ma_is_capture_supported__webaudio()) { return MA_NO_DEVICE; @@ -41634,7 +41634,7 @@ static ma_result ma_context_get_device_info__webaudio(ma_context* pContext, ma_d static ma_result ma_device_uninit__webaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); #if defined(MA_USE_AUDIO_WORKLETS) { @@ -41872,7 +41872,7 @@ static void ma_audio_worklet_processor_created__webaudio(EMSCRIPTEN_WEBAUDIO_T a #endif pParameters->pDevice->webaudio.pIntermediaryBuffer = (float*)ma_malloc(intermediaryBufferSizeInFrames * (ma_uint32)channels * sizeof(float), &pParameters->pDevice->pContext->allocationCallbacks); - if (pParameters->pDevice->webaudio.pIntermediaryBuffer == nullptr) { + if (pParameters->pDevice->webaudio.pIntermediaryBuffer == NULL) { pParameters->pDevice->webaudio.initResult = MA_OUT_OF_MEMORY; ma_free(pParameters, &pParameters->pDevice->pContext->allocationCallbacks); return; @@ -41931,7 +41931,7 @@ static void ma_audio_worklet_processor_created__webaudio(EMSCRIPTEN_WEBAUDIO_T a /* We need to update the descriptors so that they reflect the internal data format. Both capture and playback should be the same. */ sampleRate = EM_ASM_INT({ return emscriptenGetAudioObject($0).sampleRate; }, audioContext); - if (pParameters->pDescriptorCapture != nullptr) { + if (pParameters->pDescriptorCapture != NULL) { pParameters->pDescriptorCapture->format = ma_format_f32; pParameters->pDescriptorCapture->channels = (ma_uint32)channels; pParameters->pDescriptorCapture->sampleRate = (ma_uint32)sampleRate; @@ -41940,7 +41940,7 @@ static void ma_audio_worklet_processor_created__webaudio(EMSCRIPTEN_WEBAUDIO_T a pParameters->pDescriptorCapture->periodCount = 1; } - if (pParameters->pDescriptorPlayback != nullptr) { + if (pParameters->pDescriptorPlayback != NULL) { pParameters->pDescriptorPlayback->format = ma_format_f32; pParameters->pDescriptorPlayback->channels = (ma_uint32)channels; pParameters->pDescriptorPlayback->sampleRate = (ma_uint32)sampleRate; @@ -41960,7 +41960,7 @@ static void ma_audio_worklet_thread_initialized__webaudio(EMSCRIPTEN_WEBAUDIO_T ma_audio_worklet_thread_initialized_data* pParameters = (ma_audio_worklet_thread_initialized_data*)pUserData; WebAudioWorkletProcessorCreateOptions workletProcessorOptions; - MA_ASSERT(pParameters != nullptr); + MA_ASSERT(pParameters != NULL); if (success == EM_FALSE) { pParameters->pDevice->webaudio.initResult = MA_ERROR; @@ -42028,14 +42028,14 @@ static ma_result ma_device_init__webaudio(ma_device* pDevice, const ma_device_co allocate this on the heap to keep it simple. */ pStackBuffer = ma_aligned_malloc(MA_AUDIO_WORKLETS_THREAD_STACK_SIZE, 16, &pDevice->pContext->allocationCallbacks); - if (pStackBuffer == nullptr) { + if (pStackBuffer == NULL) { emscripten_destroy_audio_context(pDevice->webaudio.audioContext); return MA_OUT_OF_MEMORY; } /* Our thread initialization parameters need to be allocated on the heap so they don't go out of scope. */ pInitParameters = (ma_audio_worklet_thread_initialized_data*)ma_malloc(sizeof(*pInitParameters), &pDevice->pContext->allocationCallbacks); - if (pInitParameters == nullptr) { + if (pInitParameters == NULL) { ma_free(pStackBuffer, &pDevice->pContext->allocationCallbacks); emscripten_destroy_audio_context(pDevice->webaudio.audioContext); return MA_OUT_OF_MEMORY; @@ -42108,7 +42108,7 @@ static ma_result ma_device_init__webaudio(ma_device* pDevice, const ma_device_co /* We need an intermediary buffer for doing interleaving and deinterleaving. */ pDevice->webaudio.pIntermediaryBuffer = (float*)ma_malloc(periodSizeInFrames * channels * sizeof(float), &pDevice->pContext->allocationCallbacks); - if (pDevice->webaudio.pIntermediaryBuffer == nullptr) { + if (pDevice->webaudio.pIntermediaryBuffer == NULL) { return MA_OUT_OF_MEMORY; } @@ -42219,7 +42219,7 @@ static ma_result ma_device_init__webaudio(ma_device* pDevice, const ma_device_co /* Grab the sample rate from the audio context directly. */ sampleRate = (ma_uint32)EM_ASM_INT({ return window.miniaudio.get_device_by_index($0).webaudio.sampleRate; }, deviceIndex); - if (pDescriptorCapture != nullptr) { + if (pDescriptorCapture != NULL) { pDescriptorCapture->format = ma_format_f32; pDescriptorCapture->channels = channels; pDescriptorCapture->sampleRate = sampleRate; @@ -42228,7 +42228,7 @@ static ma_result ma_device_init__webaudio(ma_device* pDevice, const ma_device_co pDescriptorCapture->periodCount = 1; } - if (pDescriptorPlayback != nullptr) { + if (pDescriptorPlayback != NULL) { pDescriptorPlayback->format = ma_format_f32; pDescriptorPlayback->channels = channels; pDescriptorPlayback->sampleRate = sampleRate; @@ -42244,7 +42244,7 @@ static ma_result ma_device_init__webaudio(ma_device* pDevice, const ma_device_co static ma_result ma_device_start__webaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); EM_ASM({ var device = window.miniaudio.get_device_by_index($0); @@ -42257,7 +42257,7 @@ static ma_result ma_device_start__webaudio(ma_device* pDevice) static ma_result ma_device_stop__webaudio(ma_device* pDevice) { - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); /* From the WebAudio API documentation for AudioContext.suspend(): @@ -42281,7 +42281,7 @@ static ma_result ma_device_stop__webaudio(ma_device* pDevice) static ma_result ma_context_uninit__webaudio(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_webaudio); (void)pContext; /* Unused. */ @@ -42307,7 +42307,7 @@ static ma_result ma_context_init__webaudio(ma_context* pContext, const ma_contex { int resultFromJS; - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); (void)pConfig; /* Unused. */ @@ -42422,9 +42422,9 @@ static ma_result ma_context_init__webaudio(ma_context* pContext, const ma_contex pCallbacks->onDeviceUninit = ma_device_uninit__webaudio; pCallbacks->onDeviceStart = ma_device_start__webaudio; pCallbacks->onDeviceStop = ma_device_stop__webaudio; - pCallbacks->onDeviceRead = nullptr; /* Not needed because WebAudio is asynchronous. */ - pCallbacks->onDeviceWrite = nullptr; /* Not needed because WebAudio is asynchronous. */ - pCallbacks->onDeviceDataLoop = nullptr; /* Not needed because WebAudio is asynchronous. */ + pCallbacks->onDeviceRead = NULL; /* Not needed because WebAudio is asynchronous. */ + pCallbacks->onDeviceWrite = NULL; /* Not needed because WebAudio is asynchronous. */ + pCallbacks->onDeviceDataLoop = NULL; /* Not needed because WebAudio is asynchronous. */ return MA_SUCCESS; } @@ -42435,7 +42435,7 @@ static ma_result ma_context_init__webaudio(ma_context* pContext, const ma_contex static ma_bool32 ma__is_channel_map_valid(const ma_channel* pChannelMap, ma_uint32 channels) { /* A blank channel map should be allowed, in which case it should use an appropriate default which will depend on context. */ - if (pChannelMap != nullptr && pChannelMap[0] != MA_CHANNEL_NONE) { + if (pChannelMap != NULL && pChannelMap[0] != MA_CHANNEL_NONE) { ma_uint32 iChannel; if (channels == 0 || channels > MA_MAX_CHANNELS) { @@ -42459,10 +42459,10 @@ static ma_bool32 ma__is_channel_map_valid(const ma_channel* pChannelMap, ma_uint static ma_bool32 ma_context_is_backend_asynchronous(ma_context* pContext) { - MA_ASSERT(pContext != nullptr); + MA_ASSERT(pContext != NULL); - if (pContext->callbacks.onDeviceRead == nullptr && pContext->callbacks.onDeviceWrite == nullptr) { - if (pContext->callbacks.onDeviceDataLoop == nullptr) { + if (pContext->callbacks.onDeviceRead == NULL && pContext->callbacks.onDeviceWrite == NULL) { + if (pContext->callbacks.onDeviceDataLoop == NULL) { return MA_TRUE; } else { return MA_FALSE; @@ -42477,7 +42477,7 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d { ma_result result; - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); if (deviceType == ma_device_type_capture || deviceType == ma_device_type_duplex || deviceType == ma_device_type_loopback) { if (pDevice->capture.format == ma_format_unknown) { @@ -42629,15 +42629,15 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d newInputCacheSizeInBytes = newInputCacheCap * ma_get_bytes_per_frame(pDevice->playback.format, pDevice->playback.channels); if (newInputCacheSizeInBytes > MA_SIZE_MAX) { ma_free(pDevice->playback.pInputCache, &pDevice->pContext->allocationCallbacks); - pDevice->playback.pInputCache = nullptr; + pDevice->playback.pInputCache = NULL; pDevice->playback.inputCacheCap = 0; return MA_OUT_OF_MEMORY; /* Allocation too big. Should never hit this, but makes the cast below safer for 32-bit builds. */ } pNewInputCache = ma_realloc(pDevice->playback.pInputCache, (size_t)newInputCacheSizeInBytes, &pDevice->pContext->allocationCallbacks); - if (pNewInputCache == nullptr) { + if (pNewInputCache == NULL) { ma_free(pDevice->playback.pInputCache, &pDevice->pContext->allocationCallbacks); - pDevice->playback.pInputCache = nullptr; + pDevice->playback.pInputCache = NULL; pDevice->playback.inputCacheCap = 0; return MA_OUT_OF_MEMORY; } @@ -42647,7 +42647,7 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d } else { /* Heap allocation not required. Make sure we clear out the old cache just in case this function was called in response to a route change. */ ma_free(pDevice->playback.pInputCache, &pDevice->pContext->allocationCallbacks); - pDevice->playback.pInputCache = nullptr; + pDevice->playback.pInputCache = NULL; pDevice->playback.inputCacheCap = 0; } } @@ -42659,7 +42659,7 @@ MA_API ma_result ma_device_post_init(ma_device* pDevice, ma_device_type deviceTy { ma_result result; - if (pDevice == nullptr) { + if (pDevice == NULL) { return MA_INVALID_ARGS; } @@ -42712,7 +42712,7 @@ MA_API ma_result ma_device_post_init(ma_device* pDevice, ma_device_type deviceTy ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), deviceInfo.name, (size_t)-1); } else { /* We failed to retrieve the device info. Fall back to a default name. */ - if (pDescriptorCapture->pDeviceID == nullptr) { + if (pDescriptorCapture->pDeviceID == NULL) { ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), MA_DEFAULT_CAPTURE_DEVICE_NAME, (size_t)-1); } else { ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), "Capture Device", (size_t)-1); @@ -42726,7 +42726,7 @@ MA_API ma_result ma_device_post_init(ma_device* pDevice, ma_device_type deviceTy ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), deviceInfo.name, (size_t)-1); } else { /* We failed to retrieve the device info. Fall back to a default name. */ - if (pDescriptorPlayback->pDeviceID == nullptr) { + if (pDescriptorPlayback->pDeviceID == NULL) { ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), MA_DEFAULT_PLAYBACK_DEVICE_NAME, (size_t)-1); } else { ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), "Playback Device", (size_t)-1); @@ -42747,10 +42747,10 @@ static ma_thread_result MA_THREADCALL ma_worker_thread(void* pData) HRESULT CoInitializeResult; #endif - MA_ASSERT(pDevice != nullptr); + MA_ASSERT(pDevice != NULL); #if defined(MA_WIN32) && !defined(MA_XBOX) - CoInitializeResult = ma_CoInitializeEx(pDevice->pContext, nullptr, MA_COINIT_VALUE); + CoInitializeResult = ma_CoInitializeEx(pDevice->pContext, NULL, MA_COINIT_VALUE); #endif /* @@ -42785,7 +42785,7 @@ static ma_thread_result MA_THREADCALL ma_worker_thread(void* pData) MA_ASSERT(ma_device_get_state(pDevice) == ma_device_state_starting); /* If the device has a start callback, start it now. */ - if (pDevice->pContext->callbacks.onDeviceStart != nullptr) { + if (pDevice->pContext->callbacks.onDeviceStart != NULL) { startResult = pDevice->pContext->callbacks.onDeviceStart(pDevice); } else { startResult = MA_SUCCESS; @@ -42807,7 +42807,7 @@ static ma_thread_result MA_THREADCALL ma_worker_thread(void* pData) ma_device__on_notification_started(pDevice); - if (pDevice->pContext->callbacks.onDeviceDataLoop != nullptr) { + if (pDevice->pContext->callbacks.onDeviceDataLoop != NULL) { pDevice->pContext->callbacks.onDeviceDataLoop(pDevice); } else { /* The backend is not using a custom main loop implementation, so now fall back to the blocking read-write implementation. */ @@ -42815,7 +42815,7 @@ static ma_thread_result MA_THREADCALL ma_worker_thread(void* pData) } /* Getting here means we have broken from the main loop which happens the application has requested that device be stopped. */ - if (pDevice->pContext->callbacks.onDeviceStop != nullptr) { + if (pDevice->pContext->callbacks.onDeviceStop != NULL) { stopResult = pDevice->pContext->callbacks.onDeviceStop(pDevice); } else { stopResult = MA_SUCCESS; /* No stop callback with the backend. Just assume successful. */ @@ -42853,7 +42853,7 @@ static ma_thread_result MA_THREADCALL ma_worker_thread(void* pData) /* Helper for determining whether or not the given device is initialized. */ static ma_bool32 ma_device__is_initialized(ma_device* pDevice) { - if (pDevice == nullptr) { + if (pDevice == NULL) { return MA_FALSE; } @@ -42904,7 +42904,7 @@ static ma_result ma_context_init_backend_apis__win32(ma_context* pContext) { /* User32.dll */ pContext->win32.hUser32DLL = ma_dlopen(ma_context_get_log(pContext), "user32.dll"); - if (pContext->win32.hUser32DLL == nullptr) { + if (pContext->win32.hUser32DLL == NULL) { return MA_FAILED_TO_INIT_BACKEND; } @@ -42914,7 +42914,7 @@ static ma_result ma_context_init_backend_apis__win32(ma_context* pContext) /* Advapi32.dll */ pContext->win32.hAdvapi32DLL = ma_dlopen(ma_context_get_log(pContext), "advapi32.dll"); - if (pContext->win32.hAdvapi32DLL == nullptr) { + if (pContext->win32.hAdvapi32DLL == NULL) { return MA_FAILED_TO_INIT_BACKEND; } @@ -42926,7 +42926,7 @@ static ma_result ma_context_init_backend_apis__win32(ma_context* pContext) /* Ole32.dll */ pContext->win32.hOle32DLL = ma_dlopen(ma_context_get_log(pContext), "ole32.dll"); - if (pContext->win32.hOle32DLL == nullptr) { + if (pContext->win32.hOle32DLL == NULL) { return MA_FAILED_TO_INIT_BACKEND; } @@ -42947,7 +42947,7 @@ static ma_result ma_context_init_backend_apis__win32(ma_context* pContext) /* TODO: Remove this once the new single threaded backend system is in place in 0.12. */ #if !defined(MA_XBOX) { - pContext->win32.CoInitializeResult = ma_CoInitializeEx(pContext, nullptr, MA_COINIT_VALUE); + pContext->win32.CoInitializeResult = ma_CoInitializeEx(pContext, NULL, MA_COINIT_VALUE); } #endif @@ -43015,7 +43015,7 @@ MA_API ma_device_job_thread_config ma_device_job_thread_config_init(void) static ma_thread_result MA_THREADCALL ma_device_job_thread_entry(void* pUserData) { ma_device_job_thread* pJobThread = (ma_device_job_thread*)pUserData; - MA_ASSERT(pJobThread != nullptr); + MA_ASSERT(pJobThread != NULL); for (;;) { ma_result result; @@ -43041,13 +43041,13 @@ MA_API ma_result ma_device_job_thread_init(const ma_device_job_thread_config* pC ma_result result; ma_job_queue_config jobQueueConfig; - if (pJobThread == nullptr) { + if (pJobThread == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pJobThread); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -43080,7 +43080,7 @@ MA_API ma_result ma_device_job_thread_init(const ma_device_job_thread_config* pC MA_API void ma_device_job_thread_uninit(ma_device_job_thread* pJobThread, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pJobThread == nullptr) { + if (pJobThread == NULL) { return; } @@ -43101,7 +43101,7 @@ MA_API void ma_device_job_thread_uninit(ma_device_job_thread* pJobThread, const MA_API ma_result ma_device_job_thread_post(ma_device_job_thread* pJobThread, const ma_job* pJob) { - if (pJobThread == nullptr || pJob == nullptr) { + if (pJobThread == NULL || pJob == NULL) { return MA_INVALID_ARGS; } @@ -43110,13 +43110,13 @@ MA_API ma_result ma_device_job_thread_post(ma_device_job_thread* pJobThread, con MA_API ma_result ma_device_job_thread_next(ma_device_job_thread* pJobThread, ma_job* pJob) { - if (pJob == nullptr) { + if (pJob == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pJob); - if (pJobThread == nullptr) { + if (pJobThread == NULL) { return MA_INVALID_ARGS; } @@ -43128,7 +43128,7 @@ MA_API ma_bool32 ma_device_id_equal(const ma_device_id* pA, const ma_device_id* { size_t i; - if (pA == nullptr || pB == nullptr) { + if (pA == NULL || pB == NULL) { return MA_FALSE; } @@ -43160,14 +43160,14 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC ma_backend* pBackendsToIterate; ma_uint32 backendsToIterateCount; - if (pContext == nullptr) { + if (pContext == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pContext); /* Always make sure the config is set first to ensure properties are available as soon as possible. */ - if (pConfig == nullptr) { + if (pConfig == NULL) { defaultConfig = ma_context_config_init(); pConfig = &defaultConfig; } @@ -43179,14 +43179,14 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC } /* Get a lot set up first so we can start logging ASAP. */ - if (pConfig->pLog != nullptr) { + if (pConfig->pLog != NULL) { pContext->pLog = pConfig->pLog; } else { result = ma_log_init(&pContext->allocationCallbacks, &pContext->log); if (result == MA_SUCCESS) { pContext->pLog = &pContext->log; } else { - pContext->pLog = nullptr; /* Logging is not available. */ + pContext->pLog = NULL; /* Logging is not available. */ } } @@ -43206,12 +43206,12 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC pBackendsToIterate = (ma_backend*)backends; backendsToIterateCount = backendCount; - if (pBackendsToIterate == nullptr) { + if (pBackendsToIterate == NULL) { pBackendsToIterate = (ma_backend*)defaultBackends; backendsToIterateCount = ma_countof(defaultBackends); } - MA_ASSERT(pBackendsToIterate != nullptr); + MA_ASSERT(pBackendsToIterate != NULL); for (iBackend = 0; iBackend < backendsToIterateCount; iBackend += 1) { ma_backend backend = pBackendsToIterate[iBackend]; @@ -43320,7 +43320,7 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC default: break; } - if (pContext->callbacks.onContextInit != nullptr) { + if (pContext->callbacks.onContextInit != NULL) { ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_DEBUG, "Attempting to initialize %s backend...\n", ma_get_backend_name(backend)); result = pContext->callbacks.onContextInit(pContext, pConfig, &pContext->callbacks); } else { @@ -43372,11 +43372,11 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC MA_API ma_result ma_context_uninit(ma_context* pContext) { - if (pContext == nullptr) { + if (pContext == NULL) { return MA_INVALID_ARGS; } - if (pContext->callbacks.onContextUninit != nullptr) { + if (pContext->callbacks.onContextUninit != NULL) { pContext->callbacks.onContextUninit(pContext); } @@ -43400,8 +43400,8 @@ MA_API size_t ma_context_sizeof(void) MA_API ma_log* ma_context_get_log(ma_context* pContext) { - if (pContext == nullptr) { - return nullptr; + if (pContext == NULL) { + return NULL; } return pContext->pLog; @@ -43412,11 +43412,11 @@ MA_API ma_result ma_context_enumerate_devices(ma_context* pContext, ma_enum_devi { ma_result result; - if (pContext == nullptr || callback == nullptr) { + if (pContext == NULL || callback == NULL) { return MA_INVALID_ARGS; } - if (pContext->callbacks.onContextEnumerateDevices == nullptr) { + if (pContext->callbacks.onContextEnumerateDevices == NULL) { return MA_INVALID_OPERATION; } @@ -43447,7 +43447,7 @@ static ma_bool32 ma_context_get_devices__enum_callback(ma_context* pContext, ma_ if (totalDeviceInfoCount >= pContext->deviceInfoCapacity) { ma_uint32 newCapacity = pContext->deviceInfoCapacity + bufferExpansionCount; ma_device_info* pNewInfos = (ma_device_info*)ma_realloc(pContext->pDeviceInfos, sizeof(*pContext->pDeviceInfos)*newCapacity, &pContext->allocationCallbacks); - if (pNewInfos == nullptr) { + if (pNewInfos == NULL) { return MA_FALSE; /* Out of memory. */ } @@ -43483,16 +43483,16 @@ MA_API ma_result ma_context_get_devices(ma_context* pContext, ma_device_info** p ma_result result; /* Safety. */ - if (ppPlaybackDeviceInfos != nullptr) *ppPlaybackDeviceInfos = nullptr; - if (pPlaybackDeviceCount != nullptr) *pPlaybackDeviceCount = 0; - if (ppCaptureDeviceInfos != nullptr) *ppCaptureDeviceInfos = nullptr; - if (pCaptureDeviceCount != nullptr) *pCaptureDeviceCount = 0; + if (ppPlaybackDeviceInfos != NULL) *ppPlaybackDeviceInfos = NULL; + if (pPlaybackDeviceCount != NULL) *pPlaybackDeviceCount = 0; + if (ppCaptureDeviceInfos != NULL) *ppCaptureDeviceInfos = NULL; + if (pCaptureDeviceCount != NULL) *pCaptureDeviceCount = 0; - if (pContext == nullptr) { + if (pContext == NULL) { return MA_INVALID_ARGS; } - if (pContext->callbacks.onContextEnumerateDevices == nullptr) { + if (pContext->callbacks.onContextEnumerateDevices == NULL) { return MA_INVALID_OPERATION; } @@ -43504,26 +43504,26 @@ MA_API ma_result ma_context_get_devices(ma_context* pContext, ma_device_info** p pContext->captureDeviceInfoCount = 0; /* Now enumerate over available devices. */ - result = pContext->callbacks.onContextEnumerateDevices(pContext, ma_context_get_devices__enum_callback, nullptr); + result = pContext->callbacks.onContextEnumerateDevices(pContext, ma_context_get_devices__enum_callback, NULL); if (result == MA_SUCCESS) { /* Playback devices. */ - if (ppPlaybackDeviceInfos != nullptr) { + if (ppPlaybackDeviceInfos != NULL) { *ppPlaybackDeviceInfos = pContext->pDeviceInfos; } - if (pPlaybackDeviceCount != nullptr) { + if (pPlaybackDeviceCount != NULL) { *pPlaybackDeviceCount = pContext->playbackDeviceInfoCount; } /* Capture devices. */ - if (ppCaptureDeviceInfos != nullptr) { + if (ppCaptureDeviceInfos != NULL) { *ppCaptureDeviceInfos = pContext->pDeviceInfos; /* Capture devices come after playback devices. */ if (pContext->playbackDeviceInfoCount > 0) { - /* Conditional, because nullptr+0 is undefined behavior. */ + /* Conditional, because NULL+0 is undefined behavior. */ *ppCaptureDeviceInfos += pContext->playbackDeviceInfoCount; } } - if (pCaptureDeviceCount != nullptr) { + if (pCaptureDeviceCount != NULL) { *pCaptureDeviceCount = pContext->captureDeviceInfoCount; } } @@ -43539,18 +43539,18 @@ MA_API ma_result ma_context_get_device_info(ma_context* pContext, ma_device_type ma_device_info deviceInfo; /* NOTE: Do not clear pDeviceInfo on entry. The reason is the pDeviceID may actually point to pDeviceInfo->id which will break things. */ - if (pContext == nullptr || pDeviceInfo == nullptr) { + if (pContext == NULL || pDeviceInfo == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(&deviceInfo); /* Help the backend out by copying over the device ID if we have one. */ - if (pDeviceID != nullptr) { + if (pDeviceID != NULL) { MA_COPY_MEMORY(&deviceInfo.id, pDeviceID, sizeof(*pDeviceID)); } - if (pContext->callbacks.onContextGetDeviceInfo == nullptr) { + if (pContext->callbacks.onContextGetDeviceInfo == NULL) { return MA_INVALID_OPERATION; } @@ -43566,7 +43566,7 @@ MA_API ma_result ma_context_get_device_info(ma_context* pContext, ma_device_type MA_API ma_bool32 ma_context_is_loopback_supported(ma_context* pContext) { - if (pContext == nullptr) { + if (pContext == NULL) { return MA_FALSE; } @@ -43591,22 +43591,22 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC ma_device_descriptor descriptorCapture; /* The context can be null, in which case we self-manage it. */ - if (pContext == nullptr) { - return ma_device_init_ex(nullptr, 0, nullptr, pConfig, pDevice); + if (pContext == NULL) { + return ma_device_init_ex(NULL, 0, NULL, pConfig, pDevice); } - if (pDevice == nullptr) { + if (pDevice == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pDevice); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } /* Check that we have our callbacks defined. */ - if (pContext->callbacks.onDeviceInit == nullptr) { + if (pContext->callbacks.onDeviceInit == NULL) { return MA_INVALID_OPERATION; } @@ -43639,18 +43639,18 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC pDevice->onNotification = pConfig->notificationCallback; pDevice->onStop = pConfig->stopCallback; - if (pConfig->playback.pDeviceID != nullptr) { + if (pConfig->playback.pDeviceID != NULL) { MA_COPY_MEMORY(&pDevice->playback.id, pConfig->playback.pDeviceID, sizeof(pDevice->playback.id)); pDevice->playback.pID = &pDevice->playback.id; } else { - pDevice->playback.pID = nullptr; + pDevice->playback.pID = NULL; } - if (pConfig->capture.pDeviceID != nullptr) { + if (pConfig->capture.pDeviceID != NULL) { MA_COPY_MEMORY(&pDevice->capture.id, pConfig->capture.pDeviceID, sizeof(pDevice->capture.id)); pDevice->capture.pID = &pDevice->capture.id; } else { - pDevice->capture.pID = nullptr; + pDevice->capture.pID = NULL; } pDevice->noPreSilencedOutputBuffer = pConfig->noPreSilencedOutputBuffer; @@ -43809,7 +43809,7 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), deviceInfo.name, (size_t)-1); } else { /* We failed to retrieve the device info. Fall back to a default name. */ - if (descriptorCapture.pDeviceID == nullptr) { + if (descriptorCapture.pDeviceID == NULL) { ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), MA_DEFAULT_CAPTURE_DEVICE_NAME, (size_t)-1); } else { ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), "Capture Device", (size_t)-1); @@ -43823,7 +43823,7 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), deviceInfo.name, (size_t)-1); } else { /* We failed to retrieve the device info. Fall back to a default name. */ - if (descriptorPlayback.pDeviceID == nullptr) { + if (descriptorPlayback.pDeviceID == NULL) { ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), MA_DEFAULT_PLAYBACK_DEVICE_NAME, (size_t)-1); } else { ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), "Playback Device", (size_t)-1); @@ -43866,7 +43866,7 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC intermediaryBufferSizeInBytes = pDevice->capture.intermediaryBufferCap * ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels); pDevice->capture.pIntermediaryBuffer = ma_malloc((size_t)intermediaryBufferSizeInBytes, &pContext->allocationCallbacks); - if (pDevice->capture.pIntermediaryBuffer == nullptr) { + if (pDevice->capture.pIntermediaryBuffer == NULL) { ma_device_uninit(pDevice); return MA_OUT_OF_MEMORY; } @@ -43892,7 +43892,7 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC intermediaryBufferSizeInBytes = pDevice->playback.intermediaryBufferCap * ma_get_bytes_per_frame(pDevice->playback.format, pDevice->playback.channels); pDevice->playback.pIntermediaryBuffer = ma_malloc((size_t)intermediaryBufferSizeInBytes, &pContext->allocationCallbacks); - if (pDevice->playback.pIntermediaryBuffer == nullptr) { + if (pDevice->playback.pIntermediaryBuffer == NULL) { ma_device_uninit(pDevice); return MA_OUT_OF_MEMORY; } @@ -43941,7 +43941,7 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, "[%s]\n", ma_get_backend_name(pDevice->pContext->backend)); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex || pDevice->type == ma_device_type_loopback) { char name[MA_MAX_DEVICE_NAME_LENGTH + 1]; - ma_device_get_name(pDevice, ma_device_type_capture, name, sizeof(name), nullptr); + ma_device_get_name(pDevice, ma_device_type_capture, name, sizeof(name), NULL); ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, " %s (%s)\n", name, "Capture"); ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, " Format: %s -> %s\n", ma_get_format_name(pDevice->capture.internalFormat), ma_get_format_name(pDevice->capture.format)); @@ -43965,7 +43965,7 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { char name[MA_MAX_DEVICE_NAME_LENGTH + 1]; - ma_device_get_name(pDevice, ma_device_type_playback, name, sizeof(name), nullptr); + ma_device_get_name(pDevice, ma_device_type_playback, name, sizeof(name), NULL); ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, " %s (%s)\n", name, "Playback"); ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, " Format: %s -> %s\n", ma_get_format_name(pDevice->playback.format), ma_get_format_name(pDevice->playback.internalFormat)); @@ -44003,11 +44003,11 @@ MA_API ma_result ma_device_init_ex(const ma_backend backends[], ma_uint32 backen ma_uint32 backendsToIterateCount; ma_allocation_callbacks allocationCallbacks; - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } - if (pContextConfig != nullptr) { + if (pContextConfig != NULL) { result = ma_allocation_callbacks_init_copy(&allocationCallbacks, &pContextConfig->allocationCallbacks); if (result != MA_SUCCESS) { return result; @@ -44017,7 +44017,7 @@ MA_API ma_result ma_device_init_ex(const ma_backend backends[], ma_uint32 backen } pContext = (ma_context*)ma_malloc(sizeof(*pContext), &allocationCallbacks); - if (pContext == nullptr) { + if (pContext == NULL) { return MA_OUT_OF_MEMORY; } @@ -44027,7 +44027,7 @@ MA_API ma_result ma_device_init_ex(const ma_backend backends[], ma_uint32 backen pBackendsToIterate = (ma_backend*)backends; backendsToIterateCount = backendCount; - if (pBackendsToIterate == nullptr) { + if (pBackendsToIterate == NULL) { pBackendsToIterate = (ma_backend*)defaultBackends; backendsToIterateCount = ma_countof(defaultBackends); } @@ -44037,13 +44037,13 @@ MA_API ma_result ma_device_init_ex(const ma_backend backends[], ma_uint32 backen for (iBackend = 0; iBackend < backendsToIterateCount; ++iBackend) { /* This is a hack for iOS. If the context config is null, there's a good chance the - `ma_device_init(nullptr, &deviceConfig, pDevice);` pattern is being used. In this + `ma_device_init(NULL, &deviceConfig, pDevice);` pattern is being used. In this case, set the session category based on the device type. */ #if defined(MA_APPLE_MOBILE) ma_context_config contextConfig; - if (pContextConfig == nullptr) { + if (pContextConfig == NULL) { contextConfig = ma_context_config_init(); switch (pConfig->deviceType) { case ma_device_type_duplex: { @@ -44115,7 +44115,7 @@ MA_API void ma_device_uninit(ma_device* pDevice) ma_thread_wait(&pDevice->thread); } - if (pDevice->pContext->callbacks.onDeviceUninit != nullptr) { + if (pDevice->pContext->callbacks.onDeviceUninit != NULL) { pDevice->pContext->callbacks.onDeviceUninit(pDevice); } @@ -44138,14 +44138,14 @@ MA_API void ma_device_uninit(ma_device* pDevice) ma_data_converter_uninit(&pDevice->playback.converter, &pDevice->pContext->allocationCallbacks); } - if (pDevice->playback.pInputCache != nullptr) { + if (pDevice->playback.pInputCache != NULL) { ma_free(pDevice->playback.pInputCache, &pDevice->pContext->allocationCallbacks); } - if (pDevice->capture.pIntermediaryBuffer != nullptr) { + if (pDevice->capture.pIntermediaryBuffer != NULL) { ma_free(pDevice->capture.pIntermediaryBuffer, &pDevice->pContext->allocationCallbacks); } - if (pDevice->playback.pIntermediaryBuffer != nullptr) { + if (pDevice->playback.pIntermediaryBuffer != NULL) { ma_free(pDevice->playback.pIntermediaryBuffer, &pDevice->pContext->allocationCallbacks); } @@ -44161,8 +44161,8 @@ MA_API void ma_device_uninit(ma_device* pDevice) MA_API ma_context* ma_device_get_context(ma_device* pDevice) { - if (pDevice == nullptr) { - return nullptr; + if (pDevice == NULL) { + return NULL; } return pDevice->pContext; @@ -44175,18 +44175,18 @@ MA_API ma_log* ma_device_get_log(ma_device* pDevice) MA_API ma_result ma_device_get_info(ma_device* pDevice, ma_device_type type, ma_device_info* pDeviceInfo) { - if (pDeviceInfo == nullptr) { + if (pDeviceInfo == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pDeviceInfo); - if (pDevice == nullptr) { + if (pDevice == NULL) { return MA_INVALID_ARGS; } /* If the onDeviceGetInfo() callback is set, use that. Otherwise we'll fall back to ma_context_get_device_info(). */ - if (pDevice->pContext->callbacks.onDeviceGetInfo != nullptr) { + if (pDevice->pContext->callbacks.onDeviceGetInfo != NULL) { return pDevice->pContext->callbacks.onDeviceGetInfo(pDevice, type, pDeviceInfo); } @@ -44201,7 +44201,7 @@ MA_API ma_result ma_device_get_info(ma_device* pDevice, ma_device_type type, ma_ capture device, where in fact for loopback we want the default *playback* device. We'll do a bit of a hack here to make sure we get the correct info. */ - if (pDevice->type == ma_device_type_loopback && pDevice->capture.pID == nullptr) { + if (pDevice->type == ma_device_type_loopback && pDevice->capture.pID == NULL) { type = ma_device_type_playback; } @@ -44214,11 +44214,11 @@ MA_API ma_result ma_device_get_name(ma_device* pDevice, ma_device_type type, cha ma_result result; ma_device_info deviceInfo; - if (pLengthNotIncludingNullTerminator != nullptr) { + if (pLengthNotIncludingNullTerminator != NULL) { *pLengthNotIncludingNullTerminator = 0; } - if (pName != nullptr && nameCap > 0) { + if (pName != NULL && nameCap > 0) { pName[0] = '\0'; } @@ -44227,7 +44227,7 @@ MA_API ma_result ma_device_get_name(ma_device* pDevice, ma_device_type type, cha return result; } - if (pName != nullptr) { + if (pName != NULL) { ma_strncpy_s(pName, nameCap, deviceInfo.name, (size_t)-1); /* @@ -44235,12 +44235,12 @@ MA_API ma_result ma_device_get_name(ma_device* pDevice, ma_device_type type, cha source. Otherwise the caller might assume the output buffer contains more content than it actually does. */ - if (pLengthNotIncludingNullTerminator != nullptr) { + if (pLengthNotIncludingNullTerminator != NULL) { *pLengthNotIncludingNullTerminator = strlen(pName); } } else { /* Name not specified. Just report the length of the source string. */ - if (pLengthNotIncludingNullTerminator != nullptr) { + if (pLengthNotIncludingNullTerminator != NULL) { *pLengthNotIncludingNullTerminator = strlen(deviceInfo.name); } } @@ -44252,7 +44252,7 @@ MA_API ma_result ma_device_start(ma_device* pDevice) { ma_result result; - if (pDevice == nullptr) { + if (pDevice == NULL) { return MA_INVALID_ARGS; } @@ -44282,7 +44282,7 @@ MA_API ma_result ma_device_start(ma_device* pDevice) /* Asynchronous backends need to be handled differently. */ if (ma_context_is_backend_asynchronous(pDevice->pContext)) { - if (pDevice->pContext->callbacks.onDeviceStart != nullptr) { + if (pDevice->pContext->callbacks.onDeviceStart != NULL) { result = pDevice->pContext->callbacks.onDeviceStart(pDevice); } else { result = MA_INVALID_OPERATION; @@ -44321,7 +44321,7 @@ MA_API ma_result ma_device_stop(ma_device* pDevice) { ma_result result; - if (pDevice == nullptr) { + if (pDevice == NULL) { return MA_INVALID_ARGS; } @@ -44352,7 +44352,7 @@ MA_API ma_result ma_device_stop(ma_device* pDevice) /* Asynchronous backends need to be handled differently. */ if (ma_context_is_backend_asynchronous(pDevice->pContext)) { /* Asynchronous backends must have a stop operation. */ - if (pDevice->pContext->callbacks.onDeviceStop != nullptr) { + if (pDevice->pContext->callbacks.onDeviceStop != NULL) { result = pDevice->pContext->callbacks.onDeviceStop(pDevice); } else { result = MA_INVALID_OPERATION; @@ -44368,7 +44368,7 @@ MA_API ma_result ma_device_stop(ma_device* pDevice) */ MA_ASSERT(ma_device_get_state(pDevice) != ma_device_state_started); - if (pDevice->pContext->callbacks.onDeviceDataLoopWakeup != nullptr) { + if (pDevice->pContext->callbacks.onDeviceDataLoopWakeup != NULL) { pDevice->pContext->callbacks.onDeviceDataLoopWakeup(pDevice); } @@ -44401,7 +44401,7 @@ MA_API ma_bool32 ma_device_is_started(const ma_device* pDevice) MA_API ma_device_state ma_device_get_state(const ma_device* pDevice) { - if (pDevice == nullptr) { + if (pDevice == NULL) { return ma_device_state_uninitialized; } @@ -44410,7 +44410,7 @@ MA_API ma_device_state ma_device_get_state(const ma_device* pDevice) MA_API ma_result ma_device_set_master_volume(ma_device* pDevice, float volume) { - if (pDevice == nullptr) { + if (pDevice == NULL) { return MA_INVALID_ARGS; } @@ -44425,11 +44425,11 @@ MA_API ma_result ma_device_set_master_volume(ma_device* pDevice, float volume) MA_API ma_result ma_device_get_master_volume(ma_device* pDevice, float* pVolume) { - if (pVolume == nullptr) { + if (pVolume == NULL) { return MA_INVALID_ARGS; } - if (pDevice == nullptr) { + if (pDevice == NULL) { *pVolume = 0; return MA_INVALID_ARGS; } @@ -44453,7 +44453,7 @@ MA_API ma_result ma_device_get_master_volume_db(ma_device* pDevice, float* pGain float factor; ma_result result; - if (pGainDB == nullptr) { + if (pGainDB == NULL) { return MA_INVALID_ARGS; } @@ -44471,11 +44471,11 @@ MA_API ma_result ma_device_get_master_volume_db(ma_device* pDevice, float* pGain MA_API ma_result ma_device_handle_backend_data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount) { - if (pDevice == nullptr) { + if (pDevice == NULL) { return MA_INVALID_ARGS; } - if (pOutput == nullptr && pInput == nullptr) { + if (pOutput == NULL && pInput == NULL) { return MA_INVALID_ARGS; } @@ -44489,16 +44489,16 @@ MA_API ma_result ma_device_handle_backend_data_callback(ma_device* pDevice, void } if (pDevice->type == ma_device_type_duplex) { - if (pInput != nullptr) { + if (pInput != NULL) { ma_device__handle_duplex_callback_capture(pDevice, frameCount, pInput, &pDevice->duplexRB.rb); } - if (pOutput != nullptr) { + if (pOutput != NULL) { ma_device__handle_duplex_callback_playback(pDevice, frameCount, pOutput, &pDevice->duplexRB.rb); } } else { if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_loopback) { - if (pInput == nullptr) { + if (pInput == NULL) { return MA_INVALID_ARGS; } @@ -44506,7 +44506,7 @@ MA_API ma_result ma_device_handle_backend_data_callback(ma_device* pDevice, void } if (pDevice->type == ma_device_type_playback) { - if (pOutput == nullptr) { + if (pOutput == NULL) { return MA_INVALID_ARGS; } @@ -44519,7 +44519,7 @@ MA_API ma_result ma_device_handle_backend_data_callback(ma_device* pDevice, void MA_API ma_uint32 ma_calculate_buffer_size_in_frames_from_descriptor(const ma_device_descriptor* pDescriptor, ma_uint32 nativeSampleRate, ma_performance_profile performanceProfile) { - if (pDescriptor == nullptr) { + if (pDescriptor == NULL) { return 0; } @@ -44612,8 +44612,8 @@ MA_API void ma_clip_samples_u8(ma_uint8* pDst, const ma_int16* pSrc, ma_uint64 c { ma_uint64 iSample; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); for (iSample = 0; iSample < count; iSample += 1) { pDst[iSample] = ma_clip_u8(pSrc[iSample]); @@ -44624,8 +44624,8 @@ MA_API void ma_clip_samples_s16(ma_int16* pDst, const ma_int32* pSrc, ma_uint64 { ma_uint64 iSample; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); for (iSample = 0; iSample < count; iSample += 1) { pDst[iSample] = ma_clip_s16(pSrc[iSample]); @@ -44636,8 +44636,8 @@ MA_API void ma_clip_samples_s24(ma_uint8* pDst, const ma_int64* pSrc, ma_uint64 { ma_uint64 iSample; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); for (iSample = 0; iSample < count; iSample += 1) { ma_int64 s = ma_clip_s24(pSrc[iSample]); @@ -44651,8 +44651,8 @@ MA_API void ma_clip_samples_s32(ma_int32* pDst, const ma_int64* pSrc, ma_uint64 { ma_uint64 iSample; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); for (iSample = 0; iSample < count; iSample += 1) { pDst[iSample] = ma_clip_s32(pSrc[iSample]); @@ -44663,8 +44663,8 @@ MA_API void ma_clip_samples_f32(float* pDst, const float* pSrc, ma_uint64 count) { ma_uint64 iSample; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); for (iSample = 0; iSample < count; iSample += 1) { pDst[iSample] = ma_clip_f32(pSrc[iSample]); @@ -44675,8 +44675,8 @@ MA_API void ma_clip_pcm_frames(void* pDst, const void* pSrc, ma_uint64 frameCoun { ma_uint64 sampleCount; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); sampleCount = frameCount * channels; @@ -44699,7 +44699,7 @@ MA_API void ma_copy_and_apply_volume_factor_u8(ma_uint8* pSamplesOut, const ma_u { ma_uint64 iSample; - if (pSamplesOut == nullptr || pSamplesIn == nullptr) { + if (pSamplesOut == NULL || pSamplesIn == NULL) { return; } @@ -44712,7 +44712,7 @@ MA_API void ma_copy_and_apply_volume_factor_s16(ma_int16* pSamplesOut, const ma_ { ma_uint64 iSample; - if (pSamplesOut == nullptr || pSamplesIn == nullptr) { + if (pSamplesOut == NULL || pSamplesIn == NULL) { return; } @@ -44727,7 +44727,7 @@ MA_API void ma_copy_and_apply_volume_factor_s24(void* pSamplesOut, const void* p ma_uint8* pSamplesOut8; ma_uint8* pSamplesIn8; - if (pSamplesOut == nullptr || pSamplesIn == nullptr) { + if (pSamplesOut == NULL || pSamplesIn == NULL) { return; } @@ -44750,7 +44750,7 @@ MA_API void ma_copy_and_apply_volume_factor_s32(ma_int32* pSamplesOut, const ma_ { ma_uint64 iSample; - if (pSamplesOut == nullptr || pSamplesIn == nullptr) { + if (pSamplesOut == NULL || pSamplesIn == NULL) { return; } @@ -44763,7 +44763,7 @@ MA_API void ma_copy_and_apply_volume_factor_f32(float* pSamplesOut, const float* { ma_uint64 iSample; - if (pSamplesOut == nullptr || pSamplesIn == nullptr) { + if (pSamplesOut == NULL || pSamplesIn == NULL) { return; } @@ -44926,8 +44926,8 @@ MA_API void ma_copy_and_apply_volume_and_clip_samples_u8(ma_uint8* pDst, const m ma_uint64 iSample; ma_int16 volumeFixed; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); volumeFixed = ma_float_to_fixed_16(volume); @@ -44941,8 +44941,8 @@ MA_API void ma_copy_and_apply_volume_and_clip_samples_s16(ma_int16* pDst, const ma_uint64 iSample; ma_int16 volumeFixed; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); volumeFixed = ma_float_to_fixed_16(volume); @@ -44956,8 +44956,8 @@ MA_API void ma_copy_and_apply_volume_and_clip_samples_s24(ma_uint8* pDst, const ma_uint64 iSample; ma_int16 volumeFixed; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); volumeFixed = ma_float_to_fixed_16(volume); @@ -44974,8 +44974,8 @@ MA_API void ma_copy_and_apply_volume_and_clip_samples_s32(ma_int32* pDst, const ma_uint64 iSample; ma_int16 volumeFixed; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); volumeFixed = ma_float_to_fixed_16(volume); @@ -44988,8 +44988,8 @@ MA_API void ma_copy_and_apply_volume_and_clip_samples_f32(float* pDst, const flo { ma_uint64 iSample; - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); /* For the f32 case we need to make sure this supports in-place processing where the input and output buffers are the same. */ @@ -45000,8 +45000,8 @@ MA_API void ma_copy_and_apply_volume_and_clip_samples_f32(float* pDst, const flo MA_API void ma_copy_and_apply_volume_and_clip_pcm_frames(void* pDst, const void* pSrc, ma_uint64 frameCount, ma_format format, ma_uint32 channels, float volume) { - MA_ASSERT(pDst != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(pDst != NULL); + MA_ASSERT(pSrc != NULL); if (volume == 1) { ma_clip_pcm_frames(pDst, pSrc, frameCount, format, channels); /* Optimized case for volume = 1. */ @@ -45043,7 +45043,7 @@ MA_API ma_result ma_mix_pcm_frames_f32(float* pDst, const float* pSrc, ma_uint64 ma_uint64 iSample; ma_uint64 sampleCount; - if (pDst == nullptr || pSrc == nullptr || channels == 0) { + if (pDst == NULL || pSrc == NULL || channels == 0) { return MA_INVALID_ARGS; } @@ -47035,7 +47035,7 @@ MA_API void ma_convert_pcm_frames_format(void* pOut, ma_format formatOut, const MA_API void ma_deinterleave_pcm_frames(ma_format format, ma_uint32 channels, ma_uint64 frameCount, const void* pInterleavedPCMFrames, void** ppDeinterleavedPCMFrames) { - if (pInterleavedPCMFrames == nullptr || ppDeinterleavedPCMFrames == nullptr) { + if (pInterleavedPCMFrames == NULL || ppDeinterleavedPCMFrames == NULL) { return; /* Invalid args. */ } @@ -47171,11 +47171,11 @@ typedef struct static ma_result ma_biquad_get_heap_layout(const ma_biquad_config* pConfig, ma_biquad_heap_layout* pHeapLayout) { - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -47204,7 +47204,7 @@ MA_API ma_result ma_biquad_get_heap_size(const ma_biquad_config* pConfig, size_t ma_result result; ma_biquad_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -47225,7 +47225,7 @@ MA_API ma_result ma_biquad_init_preallocated(const ma_biquad_config* pConfig, vo ma_result result; ma_biquad_heap_layout heapLayout; - if (pBQ == nullptr) { + if (pBQ == NULL) { return MA_INVALID_ARGS; } @@ -47258,11 +47258,11 @@ MA_API ma_result ma_biquad_init(const ma_biquad_config* pConfig, const ma_alloca if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_biquad_init_preallocated(pConfig, pHeap, pBQ); @@ -47277,7 +47277,7 @@ MA_API ma_result ma_biquad_init(const ma_biquad_config* pConfig, const ma_alloca MA_API void ma_biquad_uninit(ma_biquad* pBQ, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pBQ == nullptr) { + if (pBQ == NULL) { return; } @@ -47288,7 +47288,7 @@ MA_API void ma_biquad_uninit(ma_biquad* pBQ, const ma_allocation_callbacks* pAll MA_API ma_result ma_biquad_reinit(const ma_biquad_config* pConfig, ma_biquad* pBQ) { - if (pBQ == nullptr || pConfig == nullptr) { + if (pBQ == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -47335,7 +47335,7 @@ MA_API ma_result ma_biquad_reinit(const ma_biquad_config* pConfig, ma_biquad* pB MA_API ma_result ma_biquad_clear_cache(ma_biquad* pBQ) { - if (pBQ == nullptr) { + if (pBQ == NULL) { return MA_INVALID_ARGS; } @@ -47418,7 +47418,7 @@ MA_API ma_result ma_biquad_process_pcm_frames(ma_biquad* pBQ, void* pFramesOut, { ma_uint32 n; - if (pBQ == nullptr || pFramesOut == nullptr || pFramesIn == nullptr) { + if (pBQ == NULL || pFramesOut == NULL || pFramesIn == NULL) { return MA_INVALID_ARGS; } @@ -47452,7 +47452,7 @@ MA_API ma_result ma_biquad_process_pcm_frames(ma_biquad* pBQ, void* pFramesOut, MA_API ma_uint32 ma_biquad_get_latency(const ma_biquad* pBQ) { - if (pBQ == nullptr) { + if (pBQ == NULL) { return 0; } @@ -47507,11 +47507,11 @@ typedef struct static ma_result ma_lpf1_get_heap_layout(const ma_lpf1_config* pConfig, ma_lpf1_heap_layout* pHeapLayout) { - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -47536,7 +47536,7 @@ MA_API ma_result ma_lpf1_get_heap_size(const ma_lpf1_config* pConfig, size_t* pH ma_result result; ma_lpf1_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -47555,7 +47555,7 @@ MA_API ma_result ma_lpf1_init_preallocated(const ma_lpf1_config* pConfig, void* ma_result result; ma_lpf1_heap_layout heapLayout; - if (pLPF == nullptr) { + if (pLPF == NULL) { return MA_INVALID_ARGS; } @@ -47587,11 +47587,11 @@ MA_API ma_result ma_lpf1_init(const ma_lpf1_config* pConfig, const ma_allocation if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_lpf1_init_preallocated(pConfig, pHeap, pLPF); @@ -47606,7 +47606,7 @@ MA_API ma_result ma_lpf1_init(const ma_lpf1_config* pConfig, const ma_allocation MA_API void ma_lpf1_uninit(ma_lpf1* pLPF, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pLPF == nullptr) { + if (pLPF == NULL) { return; } @@ -47619,7 +47619,7 @@ MA_API ma_result ma_lpf1_reinit(const ma_lpf1_config* pConfig, ma_lpf1* pLPF) { double a; - if (pLPF == nullptr || pConfig == nullptr) { + if (pLPF == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -47653,7 +47653,7 @@ MA_API ma_result ma_lpf1_reinit(const ma_lpf1_config* pConfig, ma_lpf1* pLPF) MA_API ma_result ma_lpf1_clear_cache(ma_lpf1* pLPF) { - if (pLPF == nullptr) { + if (pLPF == NULL) { return MA_INVALID_ARGS; } @@ -47710,7 +47710,7 @@ MA_API ma_result ma_lpf1_process_pcm_frames(ma_lpf1* pLPF, void* pFramesOut, con { ma_uint32 n; - if (pLPF == nullptr || pFramesOut == nullptr || pFramesIn == nullptr) { + if (pLPF == NULL || pFramesOut == NULL || pFramesIn == NULL) { return MA_INVALID_ARGS; } @@ -47744,7 +47744,7 @@ MA_API ma_result ma_lpf1_process_pcm_frames(ma_lpf1* pLPF, void* pFramesOut, con MA_API ma_uint32 ma_lpf1_get_latency(const ma_lpf1* pLPF) { - if (pLPF == nullptr) { + if (pLPF == NULL) { return 0; } @@ -47761,7 +47761,7 @@ static MA_INLINE ma_biquad_config ma_lpf2__get_biquad_config(const ma_lpf2_confi double c; double a; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); q = pConfig->q; w = 2 * MA_PI_D * pConfig->cutoffFrequency / pConfig->sampleRate; @@ -47795,13 +47795,13 @@ MA_API ma_result ma_lpf2_init_preallocated(const ma_lpf2_config* pConfig, void* ma_result result; ma_biquad_config bqConfig; - if (pLPF == nullptr) { + if (pLPF == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pLPF); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -47827,11 +47827,11 @@ MA_API ma_result ma_lpf2_init(const ma_lpf2_config* pConfig, const ma_allocation if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_lpf2_init_preallocated(pConfig, pHeap, pLPF); @@ -47846,7 +47846,7 @@ MA_API ma_result ma_lpf2_init(const ma_lpf2_config* pConfig, const ma_allocation MA_API void ma_lpf2_uninit(ma_lpf2* pLPF, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pLPF == nullptr) { + if (pLPF == NULL) { return; } @@ -47858,7 +47858,7 @@ MA_API ma_result ma_lpf2_reinit(const ma_lpf2_config* pConfig, ma_lpf2* pLPF) ma_result result; ma_biquad_config bqConfig; - if (pLPF == nullptr || pConfig == nullptr) { + if (pLPF == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -47873,7 +47873,7 @@ MA_API ma_result ma_lpf2_reinit(const ma_lpf2_config* pConfig, ma_lpf2* pLPF) MA_API ma_result ma_lpf2_clear_cache(ma_lpf2* pLPF) { - if (pLPF == nullptr) { + if (pLPF == NULL) { return MA_INVALID_ARGS; } @@ -47894,7 +47894,7 @@ static MA_INLINE void ma_lpf2_process_pcm_frame_f32(ma_lpf2* pLPF, float* pFrame MA_API ma_result ma_lpf2_process_pcm_frames(ma_lpf2* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pLPF == nullptr) { + if (pLPF == NULL) { return MA_INVALID_ARGS; } @@ -47903,7 +47903,7 @@ MA_API ma_result ma_lpf2_process_pcm_frames(ma_lpf2* pLPF, void* pFramesOut, con MA_API ma_uint32 ma_lpf2_get_latency(const ma_lpf2* pLPF) { - if (pLPF == nullptr) { + if (pLPF == NULL) { return 0; } @@ -47935,8 +47935,8 @@ typedef struct static void ma_lpf_calculate_sub_lpf_counts(ma_uint32 order, ma_uint32* pLPF1Count, ma_uint32* pLPF2Count) { - MA_ASSERT(pLPF1Count != nullptr); - MA_ASSERT(pLPF2Count != nullptr); + MA_ASSERT(pLPF1Count != NULL); + MA_ASSERT(pLPF2Count != NULL); *pLPF1Count = order % 2; *pLPF2Count = order / 2; @@ -47950,11 +47950,11 @@ static ma_result ma_lpf_get_heap_layout(const ma_lpf_config* pConfig, ma_lpf_hea ma_uint32 ilpf1; ma_uint32 ilpf2; - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -48013,7 +48013,7 @@ static ma_result ma_lpf_reinit__internal(const ma_lpf_config* pConfig, void* pHe ma_uint32 ilpf2; ma_lpf_heap_layout heapLayout; /* Only used if isNew is true. */ - if (pLPF == nullptr || pConfig == nullptr) { + if (pLPF == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -48078,7 +48078,7 @@ static ma_result ma_lpf_reinit__internal(const ma_lpf_config* pConfig, void* pHe ma_uint32 jlpf1; for (jlpf1 = 0; jlpf1 < ilpf1; jlpf1 += 1) { - ma_lpf1_uninit(&pLPF->pLPF1[jlpf1], nullptr); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ + ma_lpf1_uninit(&pLPF->pLPF1[jlpf1], NULL); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ } return result; @@ -48116,11 +48116,11 @@ static ma_result ma_lpf_reinit__internal(const ma_lpf_config* pConfig, void* pHe ma_uint32 jlpf2; for (jlpf1 = 0; jlpf1 < lpf1Count; jlpf1 += 1) { - ma_lpf1_uninit(&pLPF->pLPF1[jlpf1], nullptr); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ + ma_lpf1_uninit(&pLPF->pLPF1[jlpf1], NULL); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ } for (jlpf2 = 0; jlpf2 < ilpf2; jlpf2 += 1) { - ma_lpf2_uninit(&pLPF->pLPF2[jlpf2], nullptr); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ + ma_lpf2_uninit(&pLPF->pLPF2[jlpf2], NULL); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ } return result; @@ -48141,7 +48141,7 @@ MA_API ma_result ma_lpf_get_heap_size(const ma_lpf_config* pConfig, size_t* pHea ma_result result; ma_lpf_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -48159,7 +48159,7 @@ MA_API ma_result ma_lpf_get_heap_size(const ma_lpf_config* pConfig, size_t* pHea MA_API ma_result ma_lpf_init_preallocated(const ma_lpf_config* pConfig, void* pHeap, ma_lpf* pLPF) { - if (pLPF == nullptr) { + if (pLPF == NULL) { return MA_INVALID_ARGS; } @@ -48181,11 +48181,11 @@ MA_API ma_result ma_lpf_init(const ma_lpf_config* pConfig, const ma_allocation_c if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_lpf_init_preallocated(pConfig, pHeap, pLPF); @@ -48203,7 +48203,7 @@ MA_API void ma_lpf_uninit(ma_lpf* pLPF, const ma_allocation_callbacks* pAllocati ma_uint32 ilpf1; ma_uint32 ilpf2; - if (pLPF == nullptr) { + if (pLPF == NULL) { return; } @@ -48222,7 +48222,7 @@ MA_API void ma_lpf_uninit(ma_lpf* pLPF, const ma_allocation_callbacks* pAllocati MA_API ma_result ma_lpf_reinit(const ma_lpf_config* pConfig, ma_lpf* pLPF) { - return ma_lpf_reinit__internal(pConfig, nullptr, pLPF, /*isNew*/MA_FALSE); + return ma_lpf_reinit__internal(pConfig, NULL, pLPF, /*isNew*/MA_FALSE); } MA_API ma_result ma_lpf_clear_cache(ma_lpf* pLPF) @@ -48230,7 +48230,7 @@ MA_API ma_result ma_lpf_clear_cache(ma_lpf* pLPF) ma_uint32 ilpf1; ma_uint32 ilpf2; - if (pLPF == nullptr) { + if (pLPF == NULL) { return MA_INVALID_ARGS; } @@ -48287,7 +48287,7 @@ MA_API ma_result ma_lpf_process_pcm_frames(ma_lpf* pLPF, void* pFramesOut, const ma_uint32 ilpf1; ma_uint32 ilpf2; - if (pLPF == nullptr) { + if (pLPF == NULL) { return MA_INVALID_ARGS; } @@ -48341,7 +48341,7 @@ MA_API ma_result ma_lpf_process_pcm_frames(ma_lpf* pLPF, void* pFramesOut, const MA_API ma_uint32 ma_lpf_get_latency(const ma_lpf* pLPF) { - if (pLPF == nullptr) { + if (pLPF == NULL) { return 0; } @@ -48395,11 +48395,11 @@ typedef struct static ma_result ma_hpf1_get_heap_layout(const ma_hpf1_config* pConfig, ma_hpf1_heap_layout* pHeapLayout) { - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -48424,7 +48424,7 @@ MA_API ma_result ma_hpf1_get_heap_size(const ma_hpf1_config* pConfig, size_t* pH ma_result result; ma_hpf1_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -48443,7 +48443,7 @@ MA_API ma_result ma_hpf1_init_preallocated(const ma_hpf1_config* pConfig, void* ma_result result; ma_hpf1_heap_layout heapLayout; - if (pLPF == nullptr) { + if (pLPF == NULL) { return MA_INVALID_ARGS; } @@ -48475,11 +48475,11 @@ MA_API ma_result ma_hpf1_init(const ma_hpf1_config* pConfig, const ma_allocation if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_hpf1_init_preallocated(pConfig, pHeap, pLPF); @@ -48494,7 +48494,7 @@ MA_API ma_result ma_hpf1_init(const ma_hpf1_config* pConfig, const ma_allocation MA_API void ma_hpf1_uninit(ma_hpf1* pHPF, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pHPF == nullptr) { + if (pHPF == NULL) { return; } @@ -48507,7 +48507,7 @@ MA_API ma_result ma_hpf1_reinit(const ma_hpf1_config* pConfig, ma_hpf1* pHPF) { double a; - if (pHPF == nullptr || pConfig == nullptr) { + if (pHPF == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -48583,7 +48583,7 @@ MA_API ma_result ma_hpf1_process_pcm_frames(ma_hpf1* pHPF, void* pFramesOut, con { ma_uint32 n; - if (pHPF == nullptr || pFramesOut == nullptr || pFramesIn == nullptr) { + if (pHPF == NULL || pFramesOut == NULL || pFramesIn == NULL) { return MA_INVALID_ARGS; } @@ -48617,7 +48617,7 @@ MA_API ma_result ma_hpf1_process_pcm_frames(ma_hpf1* pHPF, void* pFramesOut, con MA_API ma_uint32 ma_hpf1_get_latency(const ma_hpf1* pHPF) { - if (pHPF == nullptr) { + if (pHPF == NULL) { return 0; } @@ -48634,7 +48634,7 @@ static MA_INLINE ma_biquad_config ma_hpf2__get_biquad_config(const ma_hpf2_confi double c; double a; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); q = pConfig->q; w = 2 * MA_PI_D * pConfig->cutoffFrequency / pConfig->sampleRate; @@ -48668,13 +48668,13 @@ MA_API ma_result ma_hpf2_init_preallocated(const ma_hpf2_config* pConfig, void* ma_result result; ma_biquad_config bqConfig; - if (pHPF == nullptr) { + if (pHPF == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pHPF); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -48700,11 +48700,11 @@ MA_API ma_result ma_hpf2_init(const ma_hpf2_config* pConfig, const ma_allocation if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_hpf2_init_preallocated(pConfig, pHeap, pHPF); @@ -48719,7 +48719,7 @@ MA_API ma_result ma_hpf2_init(const ma_hpf2_config* pConfig, const ma_allocation MA_API void ma_hpf2_uninit(ma_hpf2* pHPF, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pHPF == nullptr) { + if (pHPF == NULL) { return; } @@ -48731,7 +48731,7 @@ MA_API ma_result ma_hpf2_reinit(const ma_hpf2_config* pConfig, ma_hpf2* pHPF) ma_result result; ma_biquad_config bqConfig; - if (pHPF == nullptr || pConfig == nullptr) { + if (pHPF == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -48756,7 +48756,7 @@ static MA_INLINE void ma_hpf2_process_pcm_frame_f32(ma_hpf2* pHPF, float* pFrame MA_API ma_result ma_hpf2_process_pcm_frames(ma_hpf2* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pHPF == nullptr) { + if (pHPF == NULL) { return MA_INVALID_ARGS; } @@ -48765,7 +48765,7 @@ MA_API ma_result ma_hpf2_process_pcm_frames(ma_hpf2* pHPF, void* pFramesOut, con MA_API ma_uint32 ma_hpf2_get_latency(const ma_hpf2* pHPF) { - if (pHPF == nullptr) { + if (pHPF == NULL) { return 0; } @@ -48797,8 +48797,8 @@ typedef struct static void ma_hpf_calculate_sub_hpf_counts(ma_uint32 order, ma_uint32* pHPF1Count, ma_uint32* pHPF2Count) { - MA_ASSERT(pHPF1Count != nullptr); - MA_ASSERT(pHPF2Count != nullptr); + MA_ASSERT(pHPF1Count != NULL); + MA_ASSERT(pHPF2Count != NULL); *pHPF1Count = order % 2; *pHPF2Count = order / 2; @@ -48812,11 +48812,11 @@ static ma_result ma_hpf_get_heap_layout(const ma_hpf_config* pConfig, ma_hpf_hea ma_uint32 ihpf1; ma_uint32 ihpf2; - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -48875,7 +48875,7 @@ static ma_result ma_hpf_reinit__internal(const ma_hpf_config* pConfig, void* pHe ma_uint32 ihpf2; ma_hpf_heap_layout heapLayout; /* Only used if isNew is true. */ - if (pHPF == nullptr || pConfig == nullptr) { + if (pHPF == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -48940,7 +48940,7 @@ static ma_result ma_hpf_reinit__internal(const ma_hpf_config* pConfig, void* pHe ma_uint32 jhpf1; for (jhpf1 = 0; jhpf1 < ihpf1; jhpf1 += 1) { - ma_hpf1_uninit(&pHPF->pHPF1[jhpf1], nullptr); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ + ma_hpf1_uninit(&pHPF->pHPF1[jhpf1], NULL); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ } return result; @@ -48978,11 +48978,11 @@ static ma_result ma_hpf_reinit__internal(const ma_hpf_config* pConfig, void* pHe ma_uint32 jhpf2; for (jhpf1 = 0; jhpf1 < hpf1Count; jhpf1 += 1) { - ma_hpf1_uninit(&pHPF->pHPF1[jhpf1], nullptr); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ + ma_hpf1_uninit(&pHPF->pHPF1[jhpf1], NULL); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ } for (jhpf2 = 0; jhpf2 < ihpf2; jhpf2 += 1) { - ma_hpf2_uninit(&pHPF->pHPF2[jhpf2], nullptr); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ + ma_hpf2_uninit(&pHPF->pHPF2[jhpf2], NULL); /* No need for allocation callbacks here since we used a preallocated heap allocation. */ } return result; @@ -49003,7 +49003,7 @@ MA_API ma_result ma_hpf_get_heap_size(const ma_hpf_config* pConfig, size_t* pHea ma_result result; ma_hpf_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -49021,7 +49021,7 @@ MA_API ma_result ma_hpf_get_heap_size(const ma_hpf_config* pConfig, size_t* pHea MA_API ma_result ma_hpf_init_preallocated(const ma_hpf_config* pConfig, void* pHeap, ma_hpf* pLPF) { - if (pLPF == nullptr) { + if (pLPF == NULL) { return MA_INVALID_ARGS; } @@ -49043,11 +49043,11 @@ MA_API ma_result ma_hpf_init(const ma_hpf_config* pConfig, const ma_allocation_c if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_hpf_init_preallocated(pConfig, pHeap, pHPF); @@ -49065,7 +49065,7 @@ MA_API void ma_hpf_uninit(ma_hpf* pHPF, const ma_allocation_callbacks* pAllocati ma_uint32 ihpf1; ma_uint32 ihpf2; - if (pHPF == nullptr) { + if (pHPF == NULL) { return; } @@ -49084,7 +49084,7 @@ MA_API void ma_hpf_uninit(ma_hpf* pHPF, const ma_allocation_callbacks* pAllocati MA_API ma_result ma_hpf_reinit(const ma_hpf_config* pConfig, ma_hpf* pHPF) { - return ma_hpf_reinit__internal(pConfig, nullptr, pHPF, /*isNew*/MA_FALSE); + return ma_hpf_reinit__internal(pConfig, NULL, pHPF, /*isNew*/MA_FALSE); } MA_API ma_result ma_hpf_process_pcm_frames(ma_hpf* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) @@ -49093,7 +49093,7 @@ MA_API ma_result ma_hpf_process_pcm_frames(ma_hpf* pHPF, void* pFramesOut, const ma_uint32 ihpf1; ma_uint32 ihpf2; - if (pHPF == nullptr) { + if (pHPF == NULL) { return MA_INVALID_ARGS; } @@ -49165,7 +49165,7 @@ MA_API ma_result ma_hpf_process_pcm_frames(ma_hpf* pHPF, void* pFramesOut, const MA_API ma_uint32 ma_hpf_get_latency(const ma_hpf* pHPF) { - if (pHPF == nullptr) { + if (pHPF == NULL) { return 0; } @@ -49207,7 +49207,7 @@ static MA_INLINE ma_biquad_config ma_bpf2__get_biquad_config(const ma_bpf2_confi double c; double a; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); q = pConfig->q; w = 2 * MA_PI_D * pConfig->cutoffFrequency / pConfig->sampleRate; @@ -49241,13 +49241,13 @@ MA_API ma_result ma_bpf2_init_preallocated(const ma_bpf2_config* pConfig, void* ma_result result; ma_biquad_config bqConfig; - if (pBPF == nullptr) { + if (pBPF == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pBPF); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -49273,11 +49273,11 @@ MA_API ma_result ma_bpf2_init(const ma_bpf2_config* pConfig, const ma_allocation if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_bpf2_init_preallocated(pConfig, pHeap, pBPF); @@ -49292,7 +49292,7 @@ MA_API ma_result ma_bpf2_init(const ma_bpf2_config* pConfig, const ma_allocation MA_API void ma_bpf2_uninit(ma_bpf2* pBPF, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pBPF == nullptr) { + if (pBPF == NULL) { return; } @@ -49304,7 +49304,7 @@ MA_API ma_result ma_bpf2_reinit(const ma_bpf2_config* pConfig, ma_bpf2* pBPF) ma_result result; ma_biquad_config bqConfig; - if (pBPF == nullptr || pConfig == nullptr) { + if (pBPF == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -49329,7 +49329,7 @@ static MA_INLINE void ma_bpf2_process_pcm_frame_f32(ma_bpf2* pBPF, float* pFrame MA_API ma_result ma_bpf2_process_pcm_frames(ma_bpf2* pBPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pBPF == nullptr) { + if (pBPF == NULL) { return MA_INVALID_ARGS; } @@ -49338,7 +49338,7 @@ MA_API ma_result ma_bpf2_process_pcm_frames(ma_bpf2* pBPF, void* pFramesOut, con MA_API ma_uint32 ma_bpf2_get_latency(const ma_bpf2* pBPF) { - if (pBPF == nullptr) { + if (pBPF == NULL) { return 0; } @@ -49373,11 +49373,11 @@ static ma_result ma_bpf_get_heap_layout(const ma_bpf_config* pConfig, ma_bpf_hea ma_uint32 bpf2Count; ma_uint32 ibpf2; - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -49421,7 +49421,7 @@ static ma_result ma_bpf_reinit__internal(const ma_bpf_config* pConfig, void* pHe ma_uint32 ibpf2; ma_bpf_heap_layout heapLayout; /* Only used if isNew is true. */ - if (pBPF == nullptr || pConfig == nullptr) { + if (pBPF == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -49510,7 +49510,7 @@ MA_API ma_result ma_bpf_get_heap_size(const ma_bpf_config* pConfig, size_t* pHea ma_result result; ma_bpf_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -49528,7 +49528,7 @@ MA_API ma_result ma_bpf_get_heap_size(const ma_bpf_config* pConfig, size_t* pHea MA_API ma_result ma_bpf_init_preallocated(const ma_bpf_config* pConfig, void* pHeap, ma_bpf* pBPF) { - if (pBPF == nullptr) { + if (pBPF == NULL) { return MA_INVALID_ARGS; } @@ -49550,11 +49550,11 @@ MA_API ma_result ma_bpf_init(const ma_bpf_config* pConfig, const ma_allocation_c if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_bpf_init_preallocated(pConfig, pHeap, pBPF); @@ -49571,7 +49571,7 @@ MA_API void ma_bpf_uninit(ma_bpf* pBPF, const ma_allocation_callbacks* pAllocati { ma_uint32 ibpf2; - if (pBPF == nullptr) { + if (pBPF == NULL) { return; } @@ -49586,7 +49586,7 @@ MA_API void ma_bpf_uninit(ma_bpf* pBPF, const ma_allocation_callbacks* pAllocati MA_API ma_result ma_bpf_reinit(const ma_bpf_config* pConfig, ma_bpf* pBPF) { - return ma_bpf_reinit__internal(pConfig, nullptr, pBPF, /*isNew*/MA_FALSE); + return ma_bpf_reinit__internal(pConfig, NULL, pBPF, /*isNew*/MA_FALSE); } MA_API ma_result ma_bpf_process_pcm_frames(ma_bpf* pBPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) @@ -49594,7 +49594,7 @@ MA_API ma_result ma_bpf_process_pcm_frames(ma_bpf* pBPF, void* pFramesOut, const ma_result result; ma_uint32 ibpf2; - if (pBPF == nullptr) { + if (pBPF == NULL) { return MA_INVALID_ARGS; } @@ -49651,7 +49651,7 @@ MA_API ma_result ma_bpf_process_pcm_frames(ma_bpf* pBPF, void* pFramesOut, const MA_API ma_uint32 ma_bpf_get_latency(const ma_bpf* pBPF) { - if (pBPF == nullptr) { + if (pBPF == NULL) { return 0; } @@ -49692,7 +49692,7 @@ static MA_INLINE ma_biquad_config ma_notch2__get_biquad_config(const ma_notch2_c double c; double a; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); q = pConfig->q; w = 2 * MA_PI_D * pConfig->frequency / pConfig->sampleRate; @@ -49726,13 +49726,13 @@ MA_API ma_result ma_notch2_init_preallocated(const ma_notch2_config* pConfig, vo ma_result result; ma_biquad_config bqConfig; - if (pFilter == nullptr) { + if (pFilter == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pFilter); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -49758,11 +49758,11 @@ MA_API ma_result ma_notch2_init(const ma_notch2_config* pConfig, const ma_alloca if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_notch2_init_preallocated(pConfig, pHeap, pFilter); @@ -49777,7 +49777,7 @@ MA_API ma_result ma_notch2_init(const ma_notch2_config* pConfig, const ma_alloca MA_API void ma_notch2_uninit(ma_notch2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return; } @@ -49789,7 +49789,7 @@ MA_API ma_result ma_notch2_reinit(const ma_notch2_config* pConfig, ma_notch2* pF ma_result result; ma_biquad_config bqConfig; - if (pFilter == nullptr || pConfig == nullptr) { + if (pFilter == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -49814,7 +49814,7 @@ static MA_INLINE void ma_notch2_process_pcm_frame_f32(ma_notch2* pFilter, float* MA_API ma_result ma_notch2_process_pcm_frames(ma_notch2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return MA_INVALID_ARGS; } @@ -49823,7 +49823,7 @@ MA_API ma_result ma_notch2_process_pcm_frames(ma_notch2* pFilter, void* pFramesO MA_API ma_uint32 ma_notch2_get_latency(const ma_notch2* pFilter) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return 0; } @@ -49867,7 +49867,7 @@ static MA_INLINE ma_biquad_config ma_peak2__get_biquad_config(const ma_peak2_con double a; double A; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); q = pConfig->q; w = 2 * MA_PI_D * pConfig->frequency / pConfig->sampleRate; @@ -49902,13 +49902,13 @@ MA_API ma_result ma_peak2_init_preallocated(const ma_peak2_config* pConfig, void ma_result result; ma_biquad_config bqConfig; - if (pFilter == nullptr) { + if (pFilter == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pFilter); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -49934,11 +49934,11 @@ MA_API ma_result ma_peak2_init(const ma_peak2_config* pConfig, const ma_allocati if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_peak2_init_preallocated(pConfig, pHeap, pFilter); @@ -49953,7 +49953,7 @@ MA_API ma_result ma_peak2_init(const ma_peak2_config* pConfig, const ma_allocati MA_API void ma_peak2_uninit(ma_peak2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return; } @@ -49965,7 +49965,7 @@ MA_API ma_result ma_peak2_reinit(const ma_peak2_config* pConfig, ma_peak2* pFilt ma_result result; ma_biquad_config bqConfig; - if (pFilter == nullptr || pConfig == nullptr) { + if (pFilter == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -49990,7 +49990,7 @@ static MA_INLINE void ma_peak2_process_pcm_frame_f32(ma_peak2* pFilter, float* p MA_API ma_result ma_peak2_process_pcm_frames(ma_peak2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return MA_INVALID_ARGS; } @@ -49999,7 +49999,7 @@ MA_API ma_result ma_peak2_process_pcm_frames(ma_peak2* pFilter, void* pFramesOut MA_API ma_uint32 ma_peak2_get_latency(const ma_peak2* pFilter) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return 0; } @@ -50039,7 +50039,7 @@ static MA_INLINE ma_biquad_config ma_loshelf2__get_biquad_config(const ma_loshel double a; double sqrtA; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); w = 2 * MA_PI_D * pConfig->frequency / pConfig->sampleRate; s = ma_sind(w); @@ -50075,13 +50075,13 @@ MA_API ma_result ma_loshelf2_init_preallocated(const ma_loshelf2_config* pConfig ma_result result; ma_biquad_config bqConfig; - if (pFilter == nullptr) { + if (pFilter == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pFilter); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -50107,11 +50107,11 @@ MA_API ma_result ma_loshelf2_init(const ma_loshelf2_config* pConfig, const ma_al if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_loshelf2_init_preallocated(pConfig, pHeap, pFilter); @@ -50126,7 +50126,7 @@ MA_API ma_result ma_loshelf2_init(const ma_loshelf2_config* pConfig, const ma_al MA_API void ma_loshelf2_uninit(ma_loshelf2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return; } @@ -50138,7 +50138,7 @@ MA_API ma_result ma_loshelf2_reinit(const ma_loshelf2_config* pConfig, ma_loshel ma_result result; ma_biquad_config bqConfig; - if (pFilter == nullptr || pConfig == nullptr) { + if (pFilter == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -50163,7 +50163,7 @@ static MA_INLINE void ma_loshelf2_process_pcm_frame_f32(ma_loshelf2* pFilter, fl MA_API ma_result ma_loshelf2_process_pcm_frames(ma_loshelf2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return MA_INVALID_ARGS; } @@ -50172,7 +50172,7 @@ MA_API ma_result ma_loshelf2_process_pcm_frames(ma_loshelf2* pFilter, void* pFra MA_API ma_uint32 ma_loshelf2_get_latency(const ma_loshelf2* pFilter) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return 0; } @@ -50212,7 +50212,7 @@ static MA_INLINE ma_biquad_config ma_hishelf2__get_biquad_config(const ma_hishel double a; double sqrtA; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); w = 2 * MA_PI_D * pConfig->frequency / pConfig->sampleRate; s = ma_sind(w); @@ -50248,13 +50248,13 @@ MA_API ma_result ma_hishelf2_init_preallocated(const ma_hishelf2_config* pConfig ma_result result; ma_biquad_config bqConfig; - if (pFilter == nullptr) { + if (pFilter == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pFilter); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -50280,11 +50280,11 @@ MA_API ma_result ma_hishelf2_init(const ma_hishelf2_config* pConfig, const ma_al if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_hishelf2_init_preallocated(pConfig, pHeap, pFilter); @@ -50299,7 +50299,7 @@ MA_API ma_result ma_hishelf2_init(const ma_hishelf2_config* pConfig, const ma_al MA_API void ma_hishelf2_uninit(ma_hishelf2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return; } @@ -50311,7 +50311,7 @@ MA_API ma_result ma_hishelf2_reinit(const ma_hishelf2_config* pConfig, ma_hishel ma_result result; ma_biquad_config bqConfig; - if (pFilter == nullptr || pConfig == nullptr) { + if (pFilter == NULL || pConfig == NULL) { return MA_INVALID_ARGS; } @@ -50336,7 +50336,7 @@ static MA_INLINE void ma_hishelf2_process_pcm_frame_f32(ma_hishelf2* pFilter, fl MA_API ma_result ma_hishelf2_process_pcm_frames(ma_hishelf2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return MA_INVALID_ARGS; } @@ -50345,7 +50345,7 @@ MA_API ma_result ma_hishelf2_process_pcm_frames(ma_hishelf2* pFilter, void* pFra MA_API ma_uint32 ma_hishelf2_get_latency(const ma_hishelf2* pFilter) { - if (pFilter == nullptr) { + if (pFilter == NULL) { return 0; } @@ -50376,13 +50376,13 @@ MA_API ma_delay_config ma_delay_config_init(ma_uint32 channels, ma_uint32 sample MA_API ma_result ma_delay_init(const ma_delay_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_delay* pDelay) { - if (pDelay == nullptr) { + if (pDelay == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pDelay); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -50395,7 +50395,7 @@ MA_API ma_result ma_delay_init(const ma_delay_config* pConfig, const ma_allocati pDelay->cursor = 0; pDelay->pBuffer = (float*)ma_malloc((size_t)(pDelay->bufferSizeInFrames * ma_get_bytes_per_frame(ma_format_f32, pConfig->channels)), pAllocationCallbacks); - if (pDelay->pBuffer == nullptr) { + if (pDelay->pBuffer == NULL) { return MA_OUT_OF_MEMORY; } @@ -50406,7 +50406,7 @@ MA_API ma_result ma_delay_init(const ma_delay_config* pConfig, const ma_allocati MA_API void ma_delay_uninit(ma_delay* pDelay, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pDelay == nullptr) { + if (pDelay == NULL) { return; } @@ -50420,7 +50420,7 @@ MA_API ma_result ma_delay_process_pcm_frames(ma_delay* pDelay, void* pFramesOut, float* pFramesOutF32 = (float*)pFramesOut; const float* pFramesInF32 = (const float*)pFramesIn; - if (pDelay == nullptr || pFramesOut == nullptr || pFramesIn == nullptr) { + if (pDelay == NULL || pFramesOut == NULL || pFramesIn == NULL) { return MA_INVALID_ARGS; } @@ -50458,7 +50458,7 @@ MA_API ma_result ma_delay_process_pcm_frames(ma_delay* pDelay, void* pFramesOut, MA_API void ma_delay_set_wet(ma_delay* pDelay, float value) { - if (pDelay == nullptr) { + if (pDelay == NULL) { return; } @@ -50467,7 +50467,7 @@ MA_API void ma_delay_set_wet(ma_delay* pDelay, float value) MA_API float ma_delay_get_wet(const ma_delay* pDelay) { - if (pDelay == nullptr) { + if (pDelay == NULL) { return 0; } @@ -50476,7 +50476,7 @@ MA_API float ma_delay_get_wet(const ma_delay* pDelay) MA_API void ma_delay_set_dry(ma_delay* pDelay, float value) { - if (pDelay == nullptr) { + if (pDelay == NULL) { return; } @@ -50485,7 +50485,7 @@ MA_API void ma_delay_set_dry(ma_delay* pDelay, float value) MA_API float ma_delay_get_dry(const ma_delay* pDelay) { - if (pDelay == nullptr) { + if (pDelay == NULL) { return 0; } @@ -50494,7 +50494,7 @@ MA_API float ma_delay_get_dry(const ma_delay* pDelay) MA_API void ma_delay_set_decay(ma_delay* pDelay, float value) { - if (pDelay == nullptr) { + if (pDelay == NULL) { return; } @@ -50503,7 +50503,7 @@ MA_API void ma_delay_set_decay(ma_delay* pDelay, float value) MA_API float ma_delay_get_decay(const ma_delay* pDelay) { - if (pDelay == nullptr) { + if (pDelay == NULL) { return 0; } @@ -50532,11 +50532,11 @@ typedef struct static ma_result ma_gainer_get_heap_layout(const ma_gainer_config* pConfig, ma_gainer_heap_layout* pHeapLayout) { - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -50566,7 +50566,7 @@ MA_API ma_result ma_gainer_get_heap_size(const ma_gainer_config* pConfig, size_t ma_result result; ma_gainer_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -50589,13 +50589,13 @@ MA_API ma_result ma_gainer_init_preallocated(const ma_gainer_config* pConfig, vo ma_gainer_heap_layout heapLayout; ma_uint32 iChannel; - if (pGainer == nullptr) { + if (pGainer == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pGainer); - if (pConfig == nullptr || pHeap == nullptr) { + if (pConfig == NULL || pHeap == NULL) { return MA_INVALID_ARGS; } @@ -50635,11 +50635,11 @@ MA_API ma_result ma_gainer_init(const ma_gainer_config* pConfig, const ma_alloca if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_gainer_init_preallocated(pConfig, pHeap, pGainer); @@ -50654,7 +50654,7 @@ MA_API ma_result ma_gainer_init(const ma_gainer_config* pConfig, const ma_alloca MA_API void ma_gainer_uninit(ma_gainer* pGainer, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pGainer == nullptr) { + if (pGainer == NULL) { return; } @@ -50675,7 +50675,7 @@ static /*__attribute__((noinline))*/ ma_result ma_gainer_process_pcm_frames_inte ma_uint32 iChannel; ma_uint64 interpolatedFrameCount; - MA_ASSERT(pGainer != nullptr); + MA_ASSERT(pGainer != NULL); /* We don't necessarily need to apply a linear interpolation for the entire frameCount frames. When @@ -50701,7 +50701,7 @@ static /*__attribute__((noinline))*/ ma_result ma_gainer_process_pcm_frames_inte */ if (interpolatedFrameCount > 0) { /* We can allow the input and output buffers to be null in which case we'll just update the internal timer. */ - if (pFramesOut != nullptr && pFramesIn != nullptr) { + if (pFramesOut != NULL && pFramesIn != NULL) { /* All we're really doing here is moving the old gains towards the new gains. We don't want to be modifying the gains inside the ma_gainer object because that will break things. Instead @@ -50891,7 +50891,7 @@ static /*__attribute__((noinline))*/ ma_result ma_gainer_process_pcm_frames_inte } /* All we need to do here is apply the new gains using an optimized path. */ - if (pFramesOut != nullptr && pFramesIn != nullptr) { + if (pFramesOut != NULL && pFramesIn != NULL) { if (pGainer->config.channels <= 32) { float gains[32]; for (iChannel = 0; iChannel < pGainer->config.channels; iChannel += 1) { @@ -50928,7 +50928,7 @@ static /*__attribute__((noinline))*/ ma_result ma_gainer_process_pcm_frames_inte /* Slow path. Need to interpolate the gain for each channel individually. */ /* We can allow the input and output buffers to be null in which case we'll just update the internal timer. */ - if (pFramesOut != nullptr && pFramesIn != nullptr) { + if (pFramesOut != NULL && pFramesIn != NULL) { float a = (float)pGainer->t / pGainer->config.smoothTimeInFrames; float d = 1.0f / pGainer->config.smoothTimeInFrames; ma_uint32 channelCount = pGainer->config.channels; @@ -50953,7 +50953,7 @@ static /*__attribute__((noinline))*/ ma_result ma_gainer_process_pcm_frames_inte #if 0 /* Reference implementation. */ for (iFrame = 0; iFrame < frameCount; iFrame += 1) { /* We can allow the input and output buffers to be null in which case we'll just update the internal timer. */ - if (pFramesOut != nullptr && pFramesIn != nullptr) { + if (pFramesOut != NULL && pFramesIn != NULL) { for (iChannel = 0; iChannel < pGainer->config.channels; iChannel += 1) { pFramesOutF32[iFrame * pGainer->config.channels + iChannel] = pFramesInF32[iFrame * pGainer->config.channels + iChannel] * ma_gainer_calculate_current_gain(pGainer, iChannel) * pGainer->masterVolume; } @@ -50971,7 +50971,7 @@ static /*__attribute__((noinline))*/ ma_result ma_gainer_process_pcm_frames_inte MA_API ma_result ma_gainer_process_pcm_frames(ma_gainer* pGainer, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pGainer == nullptr) { + if (pGainer == NULL) { return MA_INVALID_ARGS; } @@ -51001,7 +51001,7 @@ MA_API ma_result ma_gainer_set_gain(ma_gainer* pGainer, float newGain) { ma_uint32 iChannel; - if (pGainer == nullptr) { + if (pGainer == NULL) { return MA_INVALID_ARGS; } @@ -51019,7 +51019,7 @@ MA_API ma_result ma_gainer_set_gains(ma_gainer* pGainer, float* pNewGains) { ma_uint32 iChannel; - if (pGainer == nullptr || pNewGains == nullptr) { + if (pGainer == NULL || pNewGains == NULL) { return MA_INVALID_ARGS; } @@ -51035,7 +51035,7 @@ MA_API ma_result ma_gainer_set_gains(ma_gainer* pGainer, float* pNewGains) MA_API ma_result ma_gainer_set_master_volume(ma_gainer* pGainer, float volume) { - if (pGainer == nullptr) { + if (pGainer == NULL) { return MA_INVALID_ARGS; } @@ -51046,7 +51046,7 @@ MA_API ma_result ma_gainer_set_master_volume(ma_gainer* pGainer, float volume) MA_API ma_result ma_gainer_get_master_volume(const ma_gainer* pGainer, float* pVolume) { - if (pGainer == nullptr || pVolume == nullptr) { + if (pGainer == NULL || pVolume == NULL) { return MA_INVALID_ARGS; } @@ -51072,13 +51072,13 @@ MA_API ma_panner_config ma_panner_config_init(ma_format format, ma_uint32 channe MA_API ma_result ma_panner_init(const ma_panner_config* pConfig, ma_panner* pPanner) { - if (pPanner == nullptr) { + if (pPanner == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pPanner); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -51201,7 +51201,7 @@ static void ma_stereo_pan_pcm_frames(void* pFramesOut, const void* pFramesIn, ma MA_API ma_result ma_panner_process_pcm_frames(ma_panner* pPanner, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pPanner == nullptr || pFramesOut == nullptr || pFramesIn == nullptr) { + if (pPanner == NULL || pFramesOut == NULL || pFramesIn == NULL) { return MA_INVALID_ARGS; } @@ -51227,7 +51227,7 @@ MA_API ma_result ma_panner_process_pcm_frames(ma_panner* pPanner, void* pFramesO MA_API void ma_panner_set_mode(ma_panner* pPanner, ma_pan_mode mode) { - if (pPanner == nullptr) { + if (pPanner == NULL) { return; } @@ -51236,7 +51236,7 @@ MA_API void ma_panner_set_mode(ma_panner* pPanner, ma_pan_mode mode) MA_API ma_pan_mode ma_panner_get_mode(const ma_panner* pPanner) { - if (pPanner == nullptr) { + if (pPanner == NULL) { return ma_pan_mode_balance; } @@ -51245,7 +51245,7 @@ MA_API ma_pan_mode ma_panner_get_mode(const ma_panner* pPanner) MA_API void ma_panner_set_pan(ma_panner* pPanner, float pan) { - if (pPanner == nullptr) { + if (pPanner == NULL) { return; } @@ -51254,7 +51254,7 @@ MA_API void ma_panner_set_pan(ma_panner* pPanner, float pan) MA_API float ma_panner_get_pan(const ma_panner* pPanner) { - if (pPanner == nullptr) { + if (pPanner == NULL) { return 0; } @@ -51279,13 +51279,13 @@ MA_API ma_fader_config ma_fader_config_init(ma_format format, ma_uint32 channels MA_API ma_result ma_fader_init(const ma_fader_config* pConfig, ma_fader* pFader) { - if (pFader == nullptr) { + if (pFader == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pFader); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -51305,7 +51305,7 @@ MA_API ma_result ma_fader_init(const ma_fader_config* pConfig, ma_fader* pFader) MA_API ma_result ma_fader_process_pcm_frames(ma_fader* pFader, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pFader == nullptr) { + if (pFader == NULL) { return MA_INVALID_ARGS; } @@ -51379,19 +51379,19 @@ MA_API ma_result ma_fader_process_pcm_frames(ma_fader* pFader, void* pFramesOut, MA_API void ma_fader_get_data_format(const ma_fader* pFader, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate) { - if (pFader == nullptr) { + if (pFader == NULL) { return; } - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = pFader->config.format; } - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = pFader->config.channels; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = pFader->config.sampleRate; } } @@ -51403,7 +51403,7 @@ MA_API void ma_fader_set_fade(ma_fader* pFader, float volumeBeg, float volumeEnd MA_API void ma_fader_set_fade_ex(ma_fader* pFader, float volumeBeg, float volumeEnd, ma_uint64 lengthInFrames, ma_int64 startOffsetInFrames) { - if (pFader == nullptr) { + if (pFader == NULL) { return; } @@ -51433,7 +51433,7 @@ MA_API void ma_fader_set_fade_ex(ma_fader* pFader, float volumeBeg, float volume MA_API float ma_fader_get_current_volume(const ma_fader* pFader) { - if (pFader == nullptr) { + if (pFader == NULL) { return 0.0f; } @@ -51730,7 +51730,7 @@ MA_API ma_spatializer_listener_config ma_spatializer_listener_config_init(ma_uin MA_ZERO_OBJECT(&config); config.channelsOut = channelsOut; - config.pChannelMapOut = nullptr; + config.pChannelMapOut = NULL; config.handedness = ma_handedness_right; config.worldUp = ma_vec3f_init_3f(0, 1, 0); config.coneInnerAngleInRadians = 6.283185f; /* 360 degrees. */ @@ -51750,11 +51750,11 @@ typedef struct static ma_result ma_spatializer_listener_get_heap_layout(const ma_spatializer_listener_config* pConfig, ma_spatializer_listener_heap_layout* pHeapLayout) { - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -51777,7 +51777,7 @@ MA_API ma_result ma_spatializer_listener_get_heap_size(const ma_spatializer_list ma_result result; ma_spatializer_listener_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -51798,7 +51798,7 @@ MA_API ma_result ma_spatializer_listener_init_preallocated(const ma_spatializer_ ma_result result; ma_spatializer_listener_heap_layout heapLayout; - if (pListener == nullptr) { + if (pListener == NULL) { return MA_INVALID_ARGS; } @@ -51829,7 +51829,7 @@ MA_API ma_result ma_spatializer_listener_init_preallocated(const ma_spatializer_ pListener->config.pChannelMapOut = (ma_channel*)ma_offset_ptr(pHeap, heapLayout.channelMapOutOffset); /* Use a slightly different default channel map for stereo. */ - if (pConfig->pChannelMapOut == nullptr) { + if (pConfig->pChannelMapOut == NULL) { ma_get_default_channel_map_for_spatializer(pListener->config.pChannelMapOut, pConfig->channelsOut, pConfig->channelsOut); } else { ma_channel_map_copy_or_default(pListener->config.pChannelMapOut, pConfig->channelsOut, pConfig->pChannelMapOut, pConfig->channelsOut); @@ -51851,11 +51851,11 @@ MA_API ma_result ma_spatializer_listener_init(const ma_spatializer_listener_conf if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_spatializer_listener_init_preallocated(pConfig, pHeap, pListener); @@ -51870,7 +51870,7 @@ MA_API ma_result ma_spatializer_listener_init(const ma_spatializer_listener_conf MA_API void ma_spatializer_listener_uninit(ma_spatializer_listener* pListener, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pListener == nullptr) { + if (pListener == NULL) { return; } @@ -51881,8 +51881,8 @@ MA_API void ma_spatializer_listener_uninit(ma_spatializer_listener* pListener, c MA_API ma_channel* ma_spatializer_listener_get_channel_map(ma_spatializer_listener* pListener) { - if (pListener == nullptr) { - return nullptr; + if (pListener == NULL) { + return NULL; } return pListener->config.pChannelMapOut; @@ -51890,7 +51890,7 @@ MA_API ma_channel* ma_spatializer_listener_get_channel_map(ma_spatializer_listen MA_API void ma_spatializer_listener_set_cone(ma_spatializer_listener* pListener, float innerAngleInRadians, float outerAngleInRadians, float outerGain) { - if (pListener == nullptr) { + if (pListener == NULL) { return; } @@ -51901,26 +51901,26 @@ MA_API void ma_spatializer_listener_set_cone(ma_spatializer_listener* pListener, MA_API void ma_spatializer_listener_get_cone(const ma_spatializer_listener* pListener, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain) { - if (pListener == nullptr) { + if (pListener == NULL) { return; } - if (pInnerAngleInRadians != nullptr) { + if (pInnerAngleInRadians != NULL) { *pInnerAngleInRadians = pListener->config.coneInnerAngleInRadians; } - if (pOuterAngleInRadians != nullptr) { + if (pOuterAngleInRadians != NULL) { *pOuterAngleInRadians = pListener->config.coneOuterAngleInRadians; } - if (pOuterGain != nullptr) { + if (pOuterGain != NULL) { *pOuterGain = pListener->config.coneOuterGain; } } MA_API void ma_spatializer_listener_set_position(ma_spatializer_listener* pListener, float x, float y, float z) { - if (pListener == nullptr) { + if (pListener == NULL) { return; } @@ -51929,7 +51929,7 @@ MA_API void ma_spatializer_listener_set_position(ma_spatializer_listener* pListe MA_API ma_vec3f ma_spatializer_listener_get_position(const ma_spatializer_listener* pListener) { - if (pListener == nullptr) { + if (pListener == NULL) { return ma_vec3f_init_3f(0, 0, 0); } @@ -51938,7 +51938,7 @@ MA_API ma_vec3f ma_spatializer_listener_get_position(const ma_spatializer_listen MA_API void ma_spatializer_listener_set_direction(ma_spatializer_listener* pListener, float x, float y, float z) { - if (pListener == nullptr) { + if (pListener == NULL) { return; } @@ -51947,7 +51947,7 @@ MA_API void ma_spatializer_listener_set_direction(ma_spatializer_listener* pList MA_API ma_vec3f ma_spatializer_listener_get_direction(const ma_spatializer_listener* pListener) { - if (pListener == nullptr) { + if (pListener == NULL) { return ma_vec3f_init_3f(0, 0, -1); } @@ -51956,7 +51956,7 @@ MA_API ma_vec3f ma_spatializer_listener_get_direction(const ma_spatializer_liste MA_API void ma_spatializer_listener_set_velocity(ma_spatializer_listener* pListener, float x, float y, float z) { - if (pListener == nullptr) { + if (pListener == NULL) { return; } @@ -51965,7 +51965,7 @@ MA_API void ma_spatializer_listener_set_velocity(ma_spatializer_listener* pListe MA_API ma_vec3f ma_spatializer_listener_get_velocity(const ma_spatializer_listener* pListener) { - if (pListener == nullptr) { + if (pListener == NULL) { return ma_vec3f_init_3f(0, 0, 0); } @@ -51974,7 +51974,7 @@ MA_API ma_vec3f ma_spatializer_listener_get_velocity(const ma_spatializer_listen MA_API void ma_spatializer_listener_set_speed_of_sound(ma_spatializer_listener* pListener, float speedOfSound) { - if (pListener == nullptr) { + if (pListener == NULL) { return; } @@ -51983,7 +51983,7 @@ MA_API void ma_spatializer_listener_set_speed_of_sound(ma_spatializer_listener* MA_API float ma_spatializer_listener_get_speed_of_sound(const ma_spatializer_listener* pListener) { - if (pListener == nullptr) { + if (pListener == NULL) { return 0; } @@ -51992,7 +51992,7 @@ MA_API float ma_spatializer_listener_get_speed_of_sound(const ma_spatializer_lis MA_API void ma_spatializer_listener_set_world_up(ma_spatializer_listener* pListener, float x, float y, float z) { - if (pListener == nullptr) { + if (pListener == NULL) { return; } @@ -52001,7 +52001,7 @@ MA_API void ma_spatializer_listener_set_world_up(ma_spatializer_listener* pListe MA_API ma_vec3f ma_spatializer_listener_get_world_up(const ma_spatializer_listener* pListener) { - if (pListener == nullptr) { + if (pListener == NULL) { return ma_vec3f_init_3f(0, 1, 0); } @@ -52010,7 +52010,7 @@ MA_API ma_vec3f ma_spatializer_listener_get_world_up(const ma_spatializer_listen MA_API void ma_spatializer_listener_set_enabled(ma_spatializer_listener* pListener, ma_bool32 isEnabled) { - if (pListener == nullptr) { + if (pListener == NULL) { return; } @@ -52019,7 +52019,7 @@ MA_API void ma_spatializer_listener_set_enabled(ma_spatializer_listener* pListen MA_API ma_bool32 ma_spatializer_listener_is_enabled(const ma_spatializer_listener* pListener) { - if (pListener == nullptr) { + if (pListener == NULL) { return MA_FALSE; } @@ -52036,7 +52036,7 @@ MA_API ma_spatializer_config ma_spatializer_config_init(ma_uint32 channelsIn, ma MA_ZERO_OBJECT(&config); config.channelsIn = channelsIn; config.channelsOut = channelsOut; - config.pChannelMapIn = nullptr; + config.pChannelMapIn = NULL; config.attenuationModel = ma_attenuation_model_inverse; config.positioning = ma_positioning_absolute; config.handedness = ma_handedness_right; @@ -52059,13 +52059,13 @@ MA_API ma_spatializer_config ma_spatializer_config_init(ma_uint32 channelsIn, ma static ma_gainer_config ma_spatializer_gainer_config_init(const ma_spatializer_config* pConfig) { - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); return ma_gainer_config_init(pConfig->channelsOut, pConfig->gainSmoothTimeInFrames); } static ma_result ma_spatializer_validate_config(const ma_spatializer_config* pConfig) { - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); if (pConfig->channelsIn == 0 || pConfig->channelsOut == 0) { return MA_INVALID_ARGS; @@ -52086,11 +52086,11 @@ static ma_result ma_spatializer_get_heap_layout(const ma_spatializer_config* pCo { ma_result result; - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -52103,7 +52103,7 @@ static ma_result ma_spatializer_get_heap_layout(const ma_spatializer_config* pCo /* Channel map. */ pHeapLayout->channelMapInOffset = MA_SIZE_MAX; /* <-- MA_SIZE_MAX indicates no allocation necessary. */ - if (pConfig->pChannelMapIn != nullptr) { + if (pConfig->pChannelMapIn != NULL) { pHeapLayout->channelMapInOffset = pHeapLayout->sizeInBytes; pHeapLayout->sizeInBytes += ma_align_64(sizeof(*pConfig->pChannelMapIn) * pConfig->channelsIn); } @@ -52136,7 +52136,7 @@ MA_API ma_result ma_spatializer_get_heap_size(const ma_spatializer_config* pConf ma_result result; ma_spatializer_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -52159,13 +52159,13 @@ MA_API ma_result ma_spatializer_init_preallocated(const ma_spatializer_config* p ma_spatializer_heap_layout heapLayout; ma_gainer_config gainerConfig; - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pSpatializer); - if (pConfig == nullptr || pHeap == nullptr) { + if (pConfig == NULL || pHeap == NULL) { return MA_INVALID_ARGS; } @@ -52206,7 +52206,7 @@ MA_API ma_result ma_spatializer_init_preallocated(const ma_spatializer_config* p } /* Channel map. This will be on the heap. */ - if (pConfig->pChannelMapIn != nullptr) { + if (pConfig->pChannelMapIn != NULL) { pSpatializer->pChannelMapIn = (ma_channel*)ma_offset_ptr(pHeap, heapLayout.channelMapInOffset); ma_channel_map_copy_or_default(pSpatializer->pChannelMapIn, pSpatializer->channelsIn, pConfig->pChannelMapIn, pSpatializer->channelsIn); } @@ -52239,11 +52239,11 @@ MA_API ma_result ma_spatializer_init(const ma_spatializer_config* pConfig, const if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_spatializer_init_preallocated(pConfig, pHeap, pSpatializer); @@ -52258,7 +52258,7 @@ MA_API ma_result ma_spatializer_init(const ma_spatializer_config* pConfig, const MA_API void ma_spatializer_uninit(ma_spatializer* pSpatializer, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52318,7 +52318,7 @@ MA_API ma_result ma_spatializer_process_pcm_frames(ma_spatializer* pSpatializer, ma_channel* pChannelMapIn; ma_channel* pChannelMapOut; - if (pSpatializer == nullptr || pListener == nullptr) { + if (pSpatializer == NULL || pListener == NULL) { return MA_INVALID_ARGS; } @@ -52444,7 +52444,7 @@ MA_API ma_result ma_spatializer_process_pcm_frames(ma_spatializer* pSpatializer, We're supporting angular gain on the listener as well for those who want to reduce the volume of sounds that are positioned behind the listener. On default settings, this will have no effect. */ - if (pListener != nullptr && pListener->config.coneInnerAngleInRadians < 6.283185f) { + if (pListener != NULL && pListener->config.coneInnerAngleInRadians < 6.283185f) { ma_vec3f listenerDirection; float listenerInnerAngle; float listenerOuterAngle; @@ -52498,7 +52498,7 @@ MA_API ma_result ma_spatializer_process_pcm_frames(ma_spatializer* pSpatializer, /*printf("distance=%f; gain=%f\n", distance, gain);*/ /* We must have a valid channel map here to ensure we spatialize properly. */ - MA_ASSERT(pChannelMapOut != nullptr); + MA_ASSERT(pChannelMapOut != NULL); /* We're not converting to mono so we'll want to apply some panning. This is where the feeling of something being @@ -52621,7 +52621,7 @@ MA_API ma_result ma_spatializer_process_pcm_frames(ma_spatializer* pSpatializer, MA_API ma_result ma_spatializer_set_master_volume(ma_spatializer* pSpatializer, float volume) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return MA_INVALID_ARGS; } @@ -52630,7 +52630,7 @@ MA_API ma_result ma_spatializer_set_master_volume(ma_spatializer* pSpatializer, MA_API ma_result ma_spatializer_get_master_volume(const ma_spatializer* pSpatializer, float* pVolume) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return MA_INVALID_ARGS; } @@ -52639,7 +52639,7 @@ MA_API ma_result ma_spatializer_get_master_volume(const ma_spatializer* pSpatial MA_API ma_uint32 ma_spatializer_get_input_channels(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return 0; } @@ -52648,7 +52648,7 @@ MA_API ma_uint32 ma_spatializer_get_input_channels(const ma_spatializer* pSpatia MA_API ma_uint32 ma_spatializer_get_output_channels(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return 0; } @@ -52657,7 +52657,7 @@ MA_API ma_uint32 ma_spatializer_get_output_channels(const ma_spatializer* pSpati MA_API void ma_spatializer_set_attenuation_model(ma_spatializer* pSpatializer, ma_attenuation_model attenuationModel) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52666,7 +52666,7 @@ MA_API void ma_spatializer_set_attenuation_model(ma_spatializer* pSpatializer, m MA_API ma_attenuation_model ma_spatializer_get_attenuation_model(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return ma_attenuation_model_none; } @@ -52675,7 +52675,7 @@ MA_API ma_attenuation_model ma_spatializer_get_attenuation_model(const ma_spatia MA_API void ma_spatializer_set_positioning(ma_spatializer* pSpatializer, ma_positioning positioning) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52684,7 +52684,7 @@ MA_API void ma_spatializer_set_positioning(ma_spatializer* pSpatializer, ma_posi MA_API ma_positioning ma_spatializer_get_positioning(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return ma_positioning_absolute; } @@ -52693,7 +52693,7 @@ MA_API ma_positioning ma_spatializer_get_positioning(const ma_spatializer* pSpat MA_API void ma_spatializer_set_rolloff(ma_spatializer* pSpatializer, float rolloff) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52702,7 +52702,7 @@ MA_API void ma_spatializer_set_rolloff(ma_spatializer* pSpatializer, float rollo MA_API float ma_spatializer_get_rolloff(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return 0; } @@ -52711,7 +52711,7 @@ MA_API float ma_spatializer_get_rolloff(const ma_spatializer* pSpatializer) MA_API void ma_spatializer_set_min_gain(ma_spatializer* pSpatializer, float minGain) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52720,7 +52720,7 @@ MA_API void ma_spatializer_set_min_gain(ma_spatializer* pSpatializer, float minG MA_API float ma_spatializer_get_min_gain(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return 0; } @@ -52729,7 +52729,7 @@ MA_API float ma_spatializer_get_min_gain(const ma_spatializer* pSpatializer) MA_API void ma_spatializer_set_max_gain(ma_spatializer* pSpatializer, float maxGain) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52738,7 +52738,7 @@ MA_API void ma_spatializer_set_max_gain(ma_spatializer* pSpatializer, float maxG MA_API float ma_spatializer_get_max_gain(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return 0; } @@ -52747,7 +52747,7 @@ MA_API float ma_spatializer_get_max_gain(const ma_spatializer* pSpatializer) MA_API void ma_spatializer_set_min_distance(ma_spatializer* pSpatializer, float minDistance) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52756,7 +52756,7 @@ MA_API void ma_spatializer_set_min_distance(ma_spatializer* pSpatializer, float MA_API float ma_spatializer_get_min_distance(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return 0; } @@ -52765,7 +52765,7 @@ MA_API float ma_spatializer_get_min_distance(const ma_spatializer* pSpatializer) MA_API void ma_spatializer_set_max_distance(ma_spatializer* pSpatializer, float maxDistance) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52774,7 +52774,7 @@ MA_API void ma_spatializer_set_max_distance(ma_spatializer* pSpatializer, float MA_API float ma_spatializer_get_max_distance(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return 0; } @@ -52783,7 +52783,7 @@ MA_API float ma_spatializer_get_max_distance(const ma_spatializer* pSpatializer) MA_API void ma_spatializer_set_cone(ma_spatializer* pSpatializer, float innerAngleInRadians, float outerAngleInRadians, float outerGain) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52794,26 +52794,26 @@ MA_API void ma_spatializer_set_cone(ma_spatializer* pSpatializer, float innerAng MA_API void ma_spatializer_get_cone(const ma_spatializer* pSpatializer, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } - if (pInnerAngleInRadians != nullptr) { + if (pInnerAngleInRadians != NULL) { *pInnerAngleInRadians = ma_atomic_load_f32(&pSpatializer->coneInnerAngleInRadians); } - if (pOuterAngleInRadians != nullptr) { + if (pOuterAngleInRadians != NULL) { *pOuterAngleInRadians = ma_atomic_load_f32(&pSpatializer->coneOuterAngleInRadians); } - if (pOuterGain != nullptr) { + if (pOuterGain != NULL) { *pOuterGain = ma_atomic_load_f32(&pSpatializer->coneOuterGain); } } MA_API void ma_spatializer_set_doppler_factor(ma_spatializer* pSpatializer, float dopplerFactor) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52822,7 +52822,7 @@ MA_API void ma_spatializer_set_doppler_factor(ma_spatializer* pSpatializer, floa MA_API float ma_spatializer_get_doppler_factor(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return 1; } @@ -52831,7 +52831,7 @@ MA_API float ma_spatializer_get_doppler_factor(const ma_spatializer* pSpatialize MA_API void ma_spatializer_set_directional_attenuation_factor(ma_spatializer* pSpatializer, float directionalAttenuationFactor) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52840,7 +52840,7 @@ MA_API void ma_spatializer_set_directional_attenuation_factor(ma_spatializer* pS MA_API float ma_spatializer_get_directional_attenuation_factor(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return 1; } @@ -52849,7 +52849,7 @@ MA_API float ma_spatializer_get_directional_attenuation_factor(const ma_spatiali MA_API void ma_spatializer_set_position(ma_spatializer* pSpatializer, float x, float y, float z) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52858,7 +52858,7 @@ MA_API void ma_spatializer_set_position(ma_spatializer* pSpatializer, float x, f MA_API ma_vec3f ma_spatializer_get_position(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return ma_vec3f_init_3f(0, 0, 0); } @@ -52867,7 +52867,7 @@ MA_API ma_vec3f ma_spatializer_get_position(const ma_spatializer* pSpatializer) MA_API void ma_spatializer_set_direction(ma_spatializer* pSpatializer, float x, float y, float z) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52876,7 +52876,7 @@ MA_API void ma_spatializer_set_direction(ma_spatializer* pSpatializer, float x, MA_API ma_vec3f ma_spatializer_get_direction(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return ma_vec3f_init_3f(0, 0, -1); } @@ -52885,7 +52885,7 @@ MA_API ma_vec3f ma_spatializer_get_direction(const ma_spatializer* pSpatializer) MA_API void ma_spatializer_set_velocity(ma_spatializer* pSpatializer, float x, float y, float z) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } @@ -52894,7 +52894,7 @@ MA_API void ma_spatializer_set_velocity(ma_spatializer* pSpatializer, float x, f MA_API ma_vec3f ma_spatializer_get_velocity(const ma_spatializer* pSpatializer) { - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return ma_vec3f_init_3f(0, 0, 0); } @@ -52903,28 +52903,28 @@ MA_API ma_vec3f ma_spatializer_get_velocity(const ma_spatializer* pSpatializer) MA_API void ma_spatializer_get_relative_position_and_direction(const ma_spatializer* pSpatializer, const ma_spatializer_listener* pListener, ma_vec3f* pRelativePos, ma_vec3f* pRelativeDir) { - if (pRelativePos != nullptr) { + if (pRelativePos != NULL) { pRelativePos->x = 0; pRelativePos->y = 0; pRelativePos->z = 0; } - if (pRelativeDir != nullptr) { + if (pRelativeDir != NULL) { pRelativeDir->x = 0; pRelativeDir->y = 0; pRelativeDir->z = -1; } - if (pSpatializer == nullptr) { + if (pSpatializer == NULL) { return; } - if (pListener == nullptr || ma_spatializer_get_positioning(pSpatializer) == ma_positioning_relative) { + if (pListener == NULL || ma_spatializer_get_positioning(pSpatializer) == ma_positioning_relative) { /* There's no listener or we're using relative positioning. */ - if (pRelativePos != nullptr) { + if (pRelativePos != NULL) { *pRelativePos = ma_spatializer_get_position(pSpatializer); } - if (pRelativeDir != nullptr) { + if (pRelativeDir != NULL) { *pRelativeDir = ma_spatializer_get_direction(pSpatializer); } } else { @@ -52982,7 +52982,7 @@ MA_API void ma_spatializer_get_relative_position_and_direction(const ma_spatiali space. This allows calculations to work based on the sound being relative to the origin which makes things simpler. */ - if (pRelativePos != nullptr) { + if (pRelativePos != NULL) { v = spatializerPosition; pRelativePos->x = m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * 1; pRelativePos->y = m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * 1; @@ -52993,7 +52993,7 @@ MA_API void ma_spatializer_get_relative_position_and_direction(const ma_spatiali The direction of the sound needs to also be transformed so that it's relative to the rotation of the listener. */ - if (pRelativeDir != nullptr) { + if (pRelativeDir != NULL) { v = spatializerDirection; pRelativeDir->x = m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z; pRelativeDir->y = m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z; @@ -53061,7 +53061,7 @@ static ma_result ma_linear_resampler_set_rate_internal(ma_linear_resampler* pRes ma_lpf_config lpfConfig; ma_uint32 oldSampleRateOut; /* Required for adjusting time advance down the bottom. */ - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } @@ -53115,11 +53115,11 @@ static ma_result ma_linear_resampler_set_rate_internal(ma_linear_resampler* pRes static ma_result ma_linear_resampler_get_heap_layout(const ma_linear_resampler_config* pConfig, ma_linear_resampler_heap_layout* pHeapLayout) { - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -53175,7 +53175,7 @@ MA_API ma_result ma_linear_resampler_get_heap_size(const ma_linear_resampler_con ma_result result; ma_linear_resampler_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -53196,7 +53196,7 @@ MA_API ma_result ma_linear_resampler_init_preallocated(const ma_linear_resampler ma_result result; ma_linear_resampler_heap_layout heapLayout; - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } @@ -53245,11 +53245,11 @@ MA_API ma_result ma_linear_resampler_init(const ma_linear_resampler_config* pCon if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_linear_resampler_init_preallocated(pConfig, pHeap, pResampler); @@ -53264,7 +53264,7 @@ MA_API ma_result ma_linear_resampler_init(const ma_linear_resampler_config* pCon MA_API void ma_linear_resampler_uninit(ma_linear_resampler* pResampler, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pResampler == nullptr) { + if (pResampler == NULL) { return; } @@ -53297,8 +53297,8 @@ static void ma_linear_resampler_interpolate_frame_s16(ma_linear_resampler* pResa const ma_uint32 channels = pResampler->config.channels; const ma_uint32 shift = 12; - MA_ASSERT(pResampler != nullptr); - MA_ASSERT(pFrameOut != nullptr); + MA_ASSERT(pResampler != NULL); + MA_ASSERT(pFrameOut != NULL); a = (pResampler->inTimeFrac << shift) / pResampler->config.sampleRateOut; @@ -53316,8 +53316,8 @@ static void ma_linear_resampler_interpolate_frame_f32(ma_linear_resampler* pResa float a; const ma_uint32 channels = pResampler->config.channels; - MA_ASSERT(pResampler != nullptr); - MA_ASSERT(pFrameOut != nullptr); + MA_ASSERT(pResampler != NULL); + MA_ASSERT(pFrameOut != NULL); a = (float)pResampler->inTimeFrac / pResampler->config.sampleRateOut; @@ -53337,9 +53337,9 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_downsample(ma_linear ma_uint64 framesProcessedIn; ma_uint64 framesProcessedOut; - MA_ASSERT(pResampler != nullptr); - MA_ASSERT(pFrameCountIn != nullptr); - MA_ASSERT(pFrameCountOut != nullptr); + MA_ASSERT(pResampler != NULL); + MA_ASSERT(pFrameCountIn != NULL); + MA_ASSERT(pFrameCountOut != NULL); pFramesInS16 = (const ma_int16*)pFramesIn; pFramesOutS16 = ( ma_int16*)pFramesOut; @@ -53353,7 +53353,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_downsample(ma_linear while (pResampler->inTimeInt > 0 && frameCountIn > framesProcessedIn) { ma_uint32 iChannel; - if (pFramesInS16 != nullptr) { + if (pFramesInS16 != NULL) { for (iChannel = 0; iChannel < pResampler->config.channels; iChannel += 1) { pResampler->x0.s16[iChannel] = pResampler->x1.s16[iChannel]; pResampler->x1.s16[iChannel] = pFramesInS16[iChannel]; @@ -53380,7 +53380,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_downsample(ma_linear } /* Getting here means the frames have been loaded and filtered and we can generate the next output frame. */ - if (pFramesOutS16 != nullptr) { + if (pFramesOutS16 != NULL) { MA_ASSERT(pResampler->inTimeInt == 0); ma_linear_resampler_interpolate_frame_s16(pResampler, pFramesOutS16); @@ -53413,9 +53413,9 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_upsample(ma_linear_r ma_uint64 framesProcessedIn; ma_uint64 framesProcessedOut; - MA_ASSERT(pResampler != nullptr); - MA_ASSERT(pFrameCountIn != nullptr); - MA_ASSERT(pFrameCountOut != nullptr); + MA_ASSERT(pResampler != NULL); + MA_ASSERT(pFrameCountIn != NULL); + MA_ASSERT(pFrameCountOut != NULL); pFramesInS16 = (const ma_int16*)pFramesIn; pFramesOutS16 = ( ma_int16*)pFramesOut; @@ -53429,7 +53429,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_upsample(ma_linear_r while (pResampler->inTimeInt > 0 && frameCountIn > framesProcessedIn) { ma_uint32 iChannel; - if (pFramesInS16 != nullptr) { + if (pFramesInS16 != NULL) { for (iChannel = 0; iChannel < pResampler->config.channels; iChannel += 1) { pResampler->x0.s16[iChannel] = pResampler->x1.s16[iChannel]; pResampler->x1.s16[iChannel] = pFramesInS16[iChannel]; @@ -53451,7 +53451,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_upsample(ma_linear_r } /* Getting here means the frames have been loaded and we can generate the next output frame. */ - if (pFramesOutS16 != nullptr) { + if (pFramesOutS16 != NULL) { MA_ASSERT(pResampler->inTimeInt == 0); ma_linear_resampler_interpolate_frame_s16(pResampler, pFramesOutS16); @@ -53482,7 +53482,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_upsample(ma_linear_r static ma_result ma_linear_resampler_process_pcm_frames_s16(ma_linear_resampler* pResampler, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut) { - MA_ASSERT(pResampler != nullptr); + MA_ASSERT(pResampler != NULL); if (pResampler->config.sampleRateIn > pResampler->config.sampleRateOut) { return ma_linear_resampler_process_pcm_frames_s16_downsample(pResampler, pFramesIn, pFrameCountIn, pFramesOut, pFrameCountOut); @@ -53501,9 +53501,9 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_downsample(ma_linear ma_uint64 framesProcessedIn; ma_uint64 framesProcessedOut; - MA_ASSERT(pResampler != nullptr); - MA_ASSERT(pFrameCountIn != nullptr); - MA_ASSERT(pFrameCountOut != nullptr); + MA_ASSERT(pResampler != NULL); + MA_ASSERT(pFrameCountIn != NULL); + MA_ASSERT(pFrameCountOut != NULL); pFramesInF32 = (const float*)pFramesIn; pFramesOutF32 = ( float*)pFramesOut; @@ -53517,7 +53517,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_downsample(ma_linear while (pResampler->inTimeInt > 0 && frameCountIn > framesProcessedIn) { ma_uint32 iChannel; - if (pFramesInF32 != nullptr) { + if (pFramesInF32 != NULL) { for (iChannel = 0; iChannel < pResampler->config.channels; iChannel += 1) { pResampler->x0.f32[iChannel] = pResampler->x1.f32[iChannel]; pResampler->x1.f32[iChannel] = pFramesInF32[iChannel]; @@ -53544,7 +53544,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_downsample(ma_linear } /* Getting here means the frames have been loaded and filtered and we can generate the next output frame. */ - if (pFramesOutF32 != nullptr) { + if (pFramesOutF32 != NULL) { MA_ASSERT(pResampler->inTimeInt == 0); ma_linear_resampler_interpolate_frame_f32(pResampler, pFramesOutF32); @@ -53577,9 +53577,9 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_upsample(ma_linear_r ma_uint64 framesProcessedIn; ma_uint64 framesProcessedOut; - MA_ASSERT(pResampler != nullptr); - MA_ASSERT(pFrameCountIn != nullptr); - MA_ASSERT(pFrameCountOut != nullptr); + MA_ASSERT(pResampler != NULL); + MA_ASSERT(pFrameCountIn != NULL); + MA_ASSERT(pFrameCountOut != NULL); pFramesInF32 = (const float*)pFramesIn; pFramesOutF32 = ( float*)pFramesOut; @@ -53593,7 +53593,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_upsample(ma_linear_r while (pResampler->inTimeInt > 0 && frameCountIn > framesProcessedIn) { ma_uint32 iChannel; - if (pFramesInF32 != nullptr) { + if (pFramesInF32 != NULL) { for (iChannel = 0; iChannel < pResampler->config.channels; iChannel += 1) { pResampler->x0.f32[iChannel] = pResampler->x1.f32[iChannel]; pResampler->x1.f32[iChannel] = pFramesInF32[iChannel]; @@ -53615,7 +53615,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_upsample(ma_linear_r } /* Getting here means the frames have been loaded and we can generate the next output frame. */ - if (pFramesOutF32 != nullptr) { + if (pFramesOutF32 != NULL) { MA_ASSERT(pResampler->inTimeInt == 0); ma_linear_resampler_interpolate_frame_f32(pResampler, pFramesOutF32); @@ -53646,7 +53646,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_upsample(ma_linear_r static ma_result ma_linear_resampler_process_pcm_frames_f32(ma_linear_resampler* pResampler, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut) { - MA_ASSERT(pResampler != nullptr); + MA_ASSERT(pResampler != NULL); if (pResampler->config.sampleRateIn > pResampler->config.sampleRateOut) { return ma_linear_resampler_process_pcm_frames_f32_downsample(pResampler, pFramesIn, pFrameCountIn, pFramesOut, pFrameCountOut); @@ -53658,7 +53658,7 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32(ma_linear_resampler* MA_API ma_result ma_linear_resampler_process_pcm_frames(ma_linear_resampler* pResampler, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut) { - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } @@ -53676,7 +53676,7 @@ MA_API ma_result ma_linear_resampler_process_pcm_frames(ma_linear_resampler* pRe MA_API ma_result ma_linear_resampler_set_rate(ma_linear_resampler* pResampler, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut) { - return ma_linear_resampler_set_rate_internal(pResampler, nullptr, nullptr, sampleRateIn, sampleRateOut, /* isResamplerAlreadyInitialized = */ MA_TRUE); + return ma_linear_resampler_set_rate_internal(pResampler, NULL, NULL, sampleRateIn, sampleRateOut, /* isResamplerAlreadyInitialized = */ MA_TRUE); } MA_API ma_result ma_linear_resampler_set_rate_ratio(ma_linear_resampler* pResampler, float ratioInOut) @@ -53684,7 +53684,7 @@ MA_API ma_result ma_linear_resampler_set_rate_ratio(ma_linear_resampler* pResamp ma_uint32 n; ma_uint32 d; - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } @@ -53706,7 +53706,7 @@ MA_API ma_result ma_linear_resampler_set_rate_ratio(ma_linear_resampler* pResamp MA_API ma_uint64 ma_linear_resampler_get_input_latency(const ma_linear_resampler* pResampler) { - if (pResampler == nullptr) { + if (pResampler == NULL) { return 0; } @@ -53715,7 +53715,7 @@ MA_API ma_uint64 ma_linear_resampler_get_input_latency(const ma_linear_resampler MA_API ma_uint64 ma_linear_resampler_get_output_latency(const ma_linear_resampler* pResampler) { - if (pResampler == nullptr) { + if (pResampler == NULL) { return 0; } @@ -53726,13 +53726,13 @@ MA_API ma_result ma_linear_resampler_get_required_input_frame_count(const ma_lin { ma_uint64 inputFrameCount; - if (pInputFrameCount == nullptr) { + if (pInputFrameCount == NULL) { return MA_INVALID_ARGS; } *pInputFrameCount = 0; - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } @@ -53759,13 +53759,13 @@ MA_API ma_result ma_linear_resampler_get_expected_output_frame_count(const ma_li ma_uint64 preliminaryInputFrameCountFromFrac; ma_uint64 preliminaryInputFrameCount; - if (pOutputFrameCount == nullptr) { + if (pOutputFrameCount == NULL) { return MA_INVALID_ARGS; } *pOutputFrameCount = 0; - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } @@ -53802,7 +53802,7 @@ MA_API ma_result ma_linear_resampler_reset(ma_linear_resampler* pResampler) { ma_uint32 iChannel; - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } @@ -53964,13 +53964,13 @@ MA_API ma_resampler_config ma_resampler_config_init(ma_format format, ma_uint32 static ma_result ma_resampler_get_vtable(const ma_resampler_config* pConfig, ma_resampler* pResampler, ma_resampling_backend_vtable** ppVTable, void** ppUserData) { - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(ppVTable != nullptr); - MA_ASSERT(ppUserData != nullptr); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(ppVTable != NULL); + MA_ASSERT(ppUserData != NULL); /* Safety. */ - *ppVTable = nullptr; - *ppUserData = nullptr; + *ppVTable = NULL; + *ppUserData = NULL; switch (pConfig->algorithm) { @@ -53998,22 +53998,22 @@ MA_API ma_result ma_resampler_get_heap_size(const ma_resampler_config* pConfig, ma_resampling_backend_vtable* pVTable; void* pVTableUserData; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } *pHeapSizeInBytes = 0; - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } - result = ma_resampler_get_vtable(pConfig, nullptr, &pVTable, &pVTableUserData); + result = ma_resampler_get_vtable(pConfig, NULL, &pVTable, &pVTableUserData); if (result != MA_SUCCESS) { return result; } - if (pVTable == nullptr || pVTable->onGetHeapSize == nullptr) { + if (pVTable == NULL || pVTable->onGetHeapSize == NULL) { return MA_NOT_IMPLEMENTED; } @@ -54029,13 +54029,13 @@ MA_API ma_result ma_resampler_init_preallocated(const ma_resampler_config* pConf { ma_result result; - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pResampler); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -54050,7 +54050,7 @@ MA_API ma_result ma_resampler_init_preallocated(const ma_resampler_config* pConf return result; } - if (pResampler->pBackendVTable == nullptr || pResampler->pBackendVTable->onInit == nullptr) { + if (pResampler->pBackendVTable == NULL || pResampler->pBackendVTable->onInit == NULL) { return MA_NOT_IMPLEMENTED; /* onInit not implemented. */ } @@ -54075,11 +54075,11 @@ MA_API ma_result ma_resampler_init(const ma_resampler_config* pConfig, const ma_ if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_resampler_init_preallocated(pConfig, pHeap, pResampler); @@ -54094,11 +54094,11 @@ MA_API ma_result ma_resampler_init(const ma_resampler_config* pConfig, const ma_ MA_API void ma_resampler_uninit(ma_resampler* pResampler, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pResampler == nullptr) { + if (pResampler == NULL) { return; } - if (pResampler->pBackendVTable == nullptr || pResampler->pBackendVTable->onUninit == nullptr) { + if (pResampler->pBackendVTable == NULL || pResampler->pBackendVTable->onUninit == NULL) { return; } @@ -54111,15 +54111,15 @@ MA_API void ma_resampler_uninit(ma_resampler* pResampler, const ma_allocation_ca MA_API ma_result ma_resampler_process_pcm_frames(ma_resampler* pResampler, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut) { - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } - if (pFrameCountOut == nullptr && pFrameCountIn == nullptr) { + if (pFrameCountOut == NULL && pFrameCountIn == NULL) { return MA_INVALID_ARGS; } - if (pResampler->pBackendVTable == nullptr || pResampler->pBackendVTable->onProcess == nullptr) { + if (pResampler->pBackendVTable == NULL || pResampler->pBackendVTable->onProcess == NULL) { return MA_NOT_IMPLEMENTED; } @@ -54130,7 +54130,7 @@ MA_API ma_result ma_resampler_set_rate(ma_resampler* pResampler, ma_uint32 sampl { ma_result result; - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } @@ -54138,7 +54138,7 @@ MA_API ma_result ma_resampler_set_rate(ma_resampler* pResampler, ma_uint32 sampl return MA_INVALID_ARGS; } - if (pResampler->pBackendVTable == nullptr || pResampler->pBackendVTable->onSetRate == nullptr) { + if (pResampler->pBackendVTable == NULL || pResampler->pBackendVTable->onSetRate == NULL) { return MA_NOT_IMPLEMENTED; } @@ -54158,7 +54158,7 @@ MA_API ma_result ma_resampler_set_rate_ratio(ma_resampler* pResampler, float rat ma_uint32 n; ma_uint32 d; - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } @@ -54180,11 +54180,11 @@ MA_API ma_result ma_resampler_set_rate_ratio(ma_resampler* pResampler, float rat MA_API ma_uint64 ma_resampler_get_input_latency(const ma_resampler* pResampler) { - if (pResampler == nullptr) { + if (pResampler == NULL) { return 0; } - if (pResampler->pBackendVTable == nullptr || pResampler->pBackendVTable->onGetInputLatency == nullptr) { + if (pResampler->pBackendVTable == NULL || pResampler->pBackendVTable->onGetInputLatency == NULL) { return 0; } @@ -54193,11 +54193,11 @@ MA_API ma_uint64 ma_resampler_get_input_latency(const ma_resampler* pResampler) MA_API ma_uint64 ma_resampler_get_output_latency(const ma_resampler* pResampler) { - if (pResampler == nullptr) { + if (pResampler == NULL) { return 0; } - if (pResampler->pBackendVTable == nullptr || pResampler->pBackendVTable->onGetOutputLatency == nullptr) { + if (pResampler->pBackendVTable == NULL || pResampler->pBackendVTable->onGetOutputLatency == NULL) { return 0; } @@ -54206,17 +54206,17 @@ MA_API ma_uint64 ma_resampler_get_output_latency(const ma_resampler* pResampler) MA_API ma_result ma_resampler_get_required_input_frame_count(const ma_resampler* pResampler, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount) { - if (pInputFrameCount == nullptr) { + if (pInputFrameCount == NULL) { return MA_INVALID_ARGS; } *pInputFrameCount = 0; - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } - if (pResampler->pBackendVTable == nullptr || pResampler->pBackendVTable->onGetRequiredInputFrameCount == nullptr) { + if (pResampler->pBackendVTable == NULL || pResampler->pBackendVTable->onGetRequiredInputFrameCount == NULL) { return MA_NOT_IMPLEMENTED; } @@ -54225,17 +54225,17 @@ MA_API ma_result ma_resampler_get_required_input_frame_count(const ma_resampler* MA_API ma_result ma_resampler_get_expected_output_frame_count(const ma_resampler* pResampler, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount) { - if (pOutputFrameCount == nullptr) { + if (pOutputFrameCount == NULL) { return MA_INVALID_ARGS; } *pOutputFrameCount = 0; - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } - if (pResampler->pBackendVTable == nullptr || pResampler->pBackendVTable->onGetExpectedOutputFrameCount == nullptr) { + if (pResampler->pBackendVTable == NULL || pResampler->pBackendVTable->onGetExpectedOutputFrameCount == NULL) { return MA_NOT_IMPLEMENTED; } @@ -54244,11 +54244,11 @@ MA_API ma_result ma_resampler_get_expected_output_frame_count(const ma_resampler MA_API ma_result ma_resampler_reset(ma_resampler* pResampler) { - if (pResampler == nullptr) { + if (pResampler == NULL) { return MA_INVALID_ARGS; } - if (pResampler->pBackendVTable == nullptr || pResampler->pBackendVTable->onReset == nullptr) { + if (pResampler->pBackendVTable == NULL || pResampler->pBackendVTable->onReset == NULL) { return MA_NOT_IMPLEMENTED; } @@ -54394,7 +54394,7 @@ static ma_uint32 ma_channel_map_get_spatial_channel_count(const ma_channel* pCha ma_uint32 spatialChannelCount = 0; ma_uint32 iChannel; - MA_ASSERT(pChannelMap != nullptr); + MA_ASSERT(pChannelMap != NULL); MA_ASSERT(channels > 0); for (iChannel = 0; iChannel < channels; ++iChannel) { @@ -54443,11 +54443,11 @@ static ma_channel_conversion_path ma_channel_map_get_conversion_path(const ma_ch return ma_channel_conversion_path_passthrough; } - if (channelsOut == 1 && (pChannelMapOut == nullptr || pChannelMapOut[0] == MA_CHANNEL_MONO)) { + if (channelsOut == 1 && (pChannelMapOut == NULL || pChannelMapOut[0] == MA_CHANNEL_MONO)) { return ma_channel_conversion_path_mono_out; } - if (channelsIn == 1 && (pChannelMapIn == nullptr || pChannelMapIn[0] == MA_CHANNEL_MONO)) { + if (channelsIn == 1 && (pChannelMapIn == NULL || pChannelMapIn[0] == MA_CHANNEL_MONO)) { return ma_channel_conversion_path_mono_in; } @@ -54485,7 +54485,7 @@ static ma_result ma_channel_map_build_shuffle_table(const ma_channel* pChannelMa ma_uint32 iChannelIn; ma_uint32 iChannelOut; - if (pShuffleTable == nullptr || channelCountIn == 0 || channelCountOut == 0) { + if (pShuffleTable == NULL || channelCountIn == 0 || channelCountOut == 0) { return MA_INVALID_ARGS; } @@ -54658,7 +54658,7 @@ static void ma_channel_map_apply_shuffle_table_f32(float* pFramesOut, ma_uint32 static ma_result ma_channel_map_apply_shuffle_table(void* pFramesOut, ma_uint32 channelsOut, const void* pFramesIn, ma_uint32 channelsIn, ma_uint64 frameCount, const ma_uint8* pShuffleTable, ma_format format) { - if (pFramesOut == nullptr || pFramesIn == nullptr || channelsOut == 0 || pShuffleTable == nullptr) { + if (pFramesOut == NULL || pFramesIn == NULL || channelsOut == 0 || pShuffleTable == NULL) { return MA_INVALID_ARGS; } @@ -54701,7 +54701,7 @@ static ma_result ma_channel_map_apply_mono_out_f32(float* pFramesOut, const floa ma_uint32 iChannelIn; ma_uint32 accumulationCount; - if (pFramesOut == nullptr || pFramesIn == nullptr || channelsIn == 0) { + if (pFramesOut == NULL || pFramesIn == NULL || channelsIn == 0) { return MA_INVALID_ARGS; } @@ -54742,7 +54742,7 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut, ma_uint64 iFrame; ma_uint32 iChannelOut; - if (pFramesOut == nullptr || channelsOut == 0 || pFramesIn == nullptr) { + if (pFramesOut == NULL || channelsOut == 0 || pFramesIn == NULL) { return MA_INVALID_ARGS; } @@ -55167,9 +55167,9 @@ static ma_result ma_channel_converter_get_heap_layout(const ma_channel_converter { ma_channel_conversion_path conversionPath; - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -55189,13 +55189,13 @@ static ma_result ma_channel_converter_get_heap_layout(const ma_channel_converter /* Input channel map. Only need to allocate this if we have an input channel map (otherwise default channel map is assumed). */ pHeapLayout->channelMapInOffset = pHeapLayout->sizeInBytes; - if (pConfig->pChannelMapIn != nullptr) { + if (pConfig->pChannelMapIn != NULL) { pHeapLayout->sizeInBytes += sizeof(ma_channel) * pConfig->channelsIn; } /* Output channel map. Only need to allocate this if we have an output channel map (otherwise default channel map is assumed). */ pHeapLayout->channelMapOutOffset = pHeapLayout->sizeInBytes; - if (pConfig->pChannelMapOut != nullptr) { + if (pConfig->pChannelMapOut != NULL) { pHeapLayout->sizeInBytes += sizeof(ma_channel) * pConfig->channelsOut; } @@ -55229,7 +55229,7 @@ MA_API ma_result ma_channel_converter_get_heap_size(const ma_channel_converter_c ma_result result; ma_channel_converter_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -55250,7 +55250,7 @@ MA_API ma_result ma_channel_converter_init_preallocated(const ma_channel_convert ma_result result; ma_channel_converter_heap_layout heapLayout; - if (pConverter == nullptr) { + if (pConverter == NULL) { return MA_INVALID_ARGS; } @@ -55269,18 +55269,18 @@ MA_API ma_result ma_channel_converter_init_preallocated(const ma_channel_convert pConverter->channelsOut = pConfig->channelsOut; pConverter->mixingMode = pConfig->mixingMode; - if (pConfig->pChannelMapIn != nullptr) { + if (pConfig->pChannelMapIn != NULL) { pConverter->pChannelMapIn = (ma_channel*)ma_offset_ptr(pHeap, heapLayout.channelMapInOffset); ma_channel_map_copy_or_default(pConverter->pChannelMapIn, pConfig->channelsIn, pConfig->pChannelMapIn, pConfig->channelsIn); } else { - pConverter->pChannelMapIn = nullptr; /* Use default channel map. */ + pConverter->pChannelMapIn = NULL; /* Use default channel map. */ } - if (pConfig->pChannelMapOut != nullptr) { + if (pConfig->pChannelMapOut != NULL) { pConverter->pChannelMapOut = (ma_channel*)ma_offset_ptr(pHeap, heapLayout.channelMapOutOffset); ma_channel_map_copy_or_default(pConverter->pChannelMapOut, pConfig->channelsOut, pConfig->pChannelMapOut, pConfig->channelsOut); } else { - pConverter->pChannelMapOut = nullptr; /* Use default channel map. */ + pConverter->pChannelMapOut = NULL; /* Use default channel map. */ } pConverter->conversionPath = ma_channel_converter_config_get_conversion_path(pConfig); @@ -55344,7 +55344,7 @@ MA_API ma_result ma_channel_converter_init_preallocated(const ma_channel_convert { case ma_channel_mix_mode_custom_weights: { - if (pConfig->ppWeights == nullptr) { + if (pConfig->ppWeights == NULL) { return MA_INVALID_ARGS; /* Config specified a custom weights mixing mode, but no custom weights have been specified. */ } @@ -55479,11 +55479,11 @@ MA_API ma_result ma_channel_converter_init(const ma_channel_converter_config* pC if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_channel_converter_init_preallocated(pConfig, pHeap, pConverter); @@ -55498,7 +55498,7 @@ MA_API ma_result ma_channel_converter_init(const ma_channel_converter_config* pC MA_API void ma_channel_converter_uninit(ma_channel_converter* pConverter, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pConverter == nullptr) { + if (pConverter == NULL) { return; } @@ -55509,9 +55509,9 @@ MA_API void ma_channel_converter_uninit(ma_channel_converter* pConverter, const static ma_result ma_channel_converter_process_pcm_frames__passthrough(ma_channel_converter* pConverter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - MA_ASSERT(pConverter != nullptr); - MA_ASSERT(pFramesOut != nullptr); - MA_ASSERT(pFramesIn != nullptr); + MA_ASSERT(pConverter != NULL); + MA_ASSERT(pFramesOut != NULL); + MA_ASSERT(pFramesIn != NULL); ma_copy_memory_64(pFramesOut, pFramesIn, frameCount * ma_get_bytes_per_frame(pConverter->format, pConverter->channelsOut)); return MA_SUCCESS; @@ -55519,9 +55519,9 @@ static ma_result ma_channel_converter_process_pcm_frames__passthrough(ma_channel static ma_result ma_channel_converter_process_pcm_frames__shuffle(ma_channel_converter* pConverter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - MA_ASSERT(pConverter != nullptr); - MA_ASSERT(pFramesOut != nullptr); - MA_ASSERT(pFramesIn != nullptr); + MA_ASSERT(pConverter != NULL); + MA_ASSERT(pFramesOut != NULL); + MA_ASSERT(pFramesIn != NULL); MA_ASSERT(pConverter->channelsIn == pConverter->channelsOut); return ma_channel_map_apply_shuffle_table(pFramesOut, pConverter->channelsOut, pFramesIn, pConverter->channelsIn, frameCount, pConverter->pShuffleTable, pConverter->format); @@ -55531,9 +55531,9 @@ static ma_result ma_channel_converter_process_pcm_frames__mono_in(ma_channel_con { ma_uint64 iFrame; - MA_ASSERT(pConverter != nullptr); - MA_ASSERT(pFramesOut != nullptr); - MA_ASSERT(pFramesIn != nullptr); + MA_ASSERT(pConverter != NULL); + MA_ASSERT(pFramesOut != NULL); + MA_ASSERT(pFramesIn != NULL); MA_ASSERT(pConverter->channelsIn == 1); switch (pConverter->format) @@ -55632,9 +55632,9 @@ static ma_result ma_channel_converter_process_pcm_frames__mono_out(ma_channel_co ma_uint64 iFrame; ma_uint32 iChannel; - MA_ASSERT(pConverter != nullptr); - MA_ASSERT(pFramesOut != nullptr); - MA_ASSERT(pFramesIn != nullptr); + MA_ASSERT(pConverter != NULL); + MA_ASSERT(pFramesOut != NULL); + MA_ASSERT(pFramesIn != NULL); MA_ASSERT(pConverter->channelsOut == 1); switch (pConverter->format) @@ -55726,9 +55726,9 @@ static ma_result ma_channel_converter_process_pcm_frames__weights(ma_channel_con ma_uint32 iChannelIn; ma_uint32 iChannelOut; - MA_ASSERT(pConverter != nullptr); - MA_ASSERT(pFramesOut != nullptr); - MA_ASSERT(pFramesIn != nullptr); + MA_ASSERT(pConverter != NULL); + MA_ASSERT(pFramesOut != NULL); + MA_ASSERT(pFramesIn != NULL); /* This is the more complicated case. Each of the output channels is accumulated with 0 or more input channels. */ @@ -55828,15 +55828,15 @@ static ma_result ma_channel_converter_process_pcm_frames__weights(ma_channel_con MA_API ma_result ma_channel_converter_process_pcm_frames(ma_channel_converter* pConverter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount) { - if (pConverter == nullptr) { + if (pConverter == NULL) { return MA_INVALID_ARGS; } - if (pFramesOut == nullptr) { + if (pFramesOut == NULL) { return MA_INVALID_ARGS; } - if (pFramesIn == nullptr) { + if (pFramesIn == NULL) { ma_zero_memory_64(pFramesOut, frameCount * ma_get_bytes_per_frame(pConverter->format, pConverter->channelsOut)); return MA_SUCCESS; } @@ -55857,7 +55857,7 @@ MA_API ma_result ma_channel_converter_process_pcm_frames(ma_channel_converter* p MA_API ma_result ma_channel_converter_get_input_channel_map(const ma_channel_converter* pConverter, ma_channel* pChannelMap, size_t channelMapCap) { - if (pConverter == nullptr || pChannelMap == nullptr) { + if (pConverter == NULL || pChannelMap == NULL) { return MA_INVALID_ARGS; } @@ -55868,7 +55868,7 @@ MA_API ma_result ma_channel_converter_get_input_channel_map(const ma_channel_con MA_API ma_result ma_channel_converter_get_output_channel_map(const ma_channel_converter* pConverter, ma_channel* pChannelMap, size_t channelMapCap) { - if (pConverter == nullptr || pChannelMap == nullptr) { + if (pConverter == NULL || pChannelMap == NULL) { return MA_INVALID_ARGS; } @@ -55921,14 +55921,14 @@ typedef struct static ma_bool32 ma_data_converter_config_is_resampler_required(const ma_data_converter_config* pConfig) { - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); return pConfig->allowDynamicSampleRate || pConfig->sampleRateIn != pConfig->sampleRateOut; } static ma_format ma_data_converter_config_get_mid_format(const ma_data_converter_config* pConfig) { - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); /* We want to avoid as much data conversion as possible. The channel converter and linear @@ -55956,7 +55956,7 @@ static ma_channel_converter_config ma_channel_converter_config_init_from_data_co { ma_channel_converter_config channelConverterConfig; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); channelConverterConfig = ma_channel_converter_config_init(ma_data_converter_config_get_mid_format(pConfig), pConfig->channelsIn, pConfig->pChannelMapIn, pConfig->channelsOut, pConfig->pChannelMapOut, pConfig->channelMixMode); channelConverterConfig.ppWeights = pConfig->ppChannelWeights; @@ -55970,7 +55970,7 @@ static ma_resampler_config ma_resampler_config_init_from_data_converter_config(c ma_resampler_config resamplerConfig; ma_uint32 resamplerChannels; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); /* The resampler is the most expensive part of the conversion process, so we need to do it at the stage where the channel count is at it's lowest. */ if (pConfig->channelsIn < pConfig->channelsOut) { @@ -55991,11 +55991,11 @@ static ma_result ma_data_converter_get_heap_layout(const ma_data_converter_confi { ma_result result; - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -56044,7 +56044,7 @@ MA_API ma_result ma_data_converter_get_heap_size(const ma_data_converter_config* ma_result result; ma_data_converter_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -56067,7 +56067,7 @@ MA_API ma_result ma_data_converter_init_preallocated(const ma_data_converter_con ma_format midFormat; ma_bool32 isResamplingRequired; - if (pConverter == nullptr) { + if (pConverter == NULL) { return MA_INVALID_ARGS; } @@ -56206,11 +56206,11 @@ MA_API ma_result ma_data_converter_init(const ma_data_converter_config* pConfig, if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_data_converter_init_preallocated(pConfig, pHeap, pConverter); @@ -56225,7 +56225,7 @@ MA_API ma_result ma_data_converter_init(const ma_data_converter_config* pConfig, MA_API void ma_data_converter_uninit(ma_data_converter* pConverter, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pConverter == nullptr) { + if (pConverter == NULL) { return; } @@ -56246,32 +56246,32 @@ static ma_result ma_data_converter_process_pcm_frames__passthrough(ma_data_conve ma_uint64 frameCountOut; ma_uint64 frameCount; - MA_ASSERT(pConverter != nullptr); + MA_ASSERT(pConverter != NULL); frameCountIn = 0; - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { frameCountIn = *pFrameCountIn; } frameCountOut = 0; - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { frameCountOut = *pFrameCountOut; } frameCount = ma_min(frameCountIn, frameCountOut); - if (pFramesOut != nullptr) { - if (pFramesIn != nullptr) { + if (pFramesOut != NULL) { + if (pFramesIn != NULL) { ma_copy_memory_64(pFramesOut, pFramesIn, frameCount * ma_get_bytes_per_frame(pConverter->formatOut, pConverter->channelsOut)); } else { ma_zero_memory_64(pFramesOut, frameCount * ma_get_bytes_per_frame(pConverter->formatOut, pConverter->channelsOut)); } } - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { *pFrameCountIn = frameCount; } - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { *pFrameCountOut = frameCount; } @@ -56284,32 +56284,32 @@ static ma_result ma_data_converter_process_pcm_frames__format_only(ma_data_conve ma_uint64 frameCountOut; ma_uint64 frameCount; - MA_ASSERT(pConverter != nullptr); + MA_ASSERT(pConverter != NULL); frameCountIn = 0; - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { frameCountIn = *pFrameCountIn; } frameCountOut = 0; - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { frameCountOut = *pFrameCountOut; } frameCount = ma_min(frameCountIn, frameCountOut); - if (pFramesOut != nullptr) { - if (pFramesIn != nullptr) { + if (pFramesOut != NULL) { + if (pFramesIn != NULL) { ma_convert_pcm_frames_format(pFramesOut, pConverter->formatOut, pFramesIn, pConverter->formatIn, frameCount, pConverter->channelsIn, pConverter->ditherMode); } else { ma_zero_memory_64(pFramesOut, frameCount * ma_get_bytes_per_frame(pConverter->formatOut, pConverter->channelsOut)); } } - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { *pFrameCountIn = frameCount; } - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { *pFrameCountOut = frameCount; } @@ -56325,15 +56325,15 @@ static ma_result ma_data_converter_process_pcm_frames__resample_with_format_conv ma_uint64 framesProcessedIn; ma_uint64 framesProcessedOut; - MA_ASSERT(pConverter != nullptr); + MA_ASSERT(pConverter != NULL); frameCountIn = 0; - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { frameCountIn = *pFrameCountIn; } frameCountOut = 0; - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { frameCountOut = *pFrameCountOut; } @@ -56348,16 +56348,16 @@ static ma_result ma_data_converter_process_pcm_frames__resample_with_format_conv ma_uint64 frameCountInThisIteration; ma_uint64 frameCountOutThisIteration; - if (pFramesIn != nullptr) { + if (pFramesIn != NULL) { pFramesInThisIteration = ma_offset_ptr(pFramesIn, framesProcessedIn * ma_get_bytes_per_frame(pConverter->formatIn, pConverter->channelsIn)); } else { - pFramesInThisIteration = nullptr; + pFramesInThisIteration = NULL; } - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { pFramesOutThisIteration = ma_offset_ptr(pFramesOut, framesProcessedOut * ma_get_bytes_per_frame(pConverter->formatOut, pConverter->channelsOut)); } else { - pFramesOutThisIteration = nullptr; + pFramesOutThisIteration = NULL; } /* Do a pre format conversion if necessary. */ @@ -56376,7 +56376,7 @@ static ma_result ma_data_converter_process_pcm_frames__resample_with_format_conv } } - if (pFramesInThisIteration != nullptr) { + if (pFramesInThisIteration != NULL) { ma_convert_pcm_frames_format(pTempBufferIn, pConverter->resampler.format, pFramesInThisIteration, pConverter->formatIn, frameCountInThisIteration, pConverter->channelsIn, pConverter->ditherMode); } else { MA_ZERO_MEMORY(pTempBufferIn, sizeof(pTempBufferIn)); @@ -56417,7 +56417,7 @@ static ma_result ma_data_converter_process_pcm_frames__resample_with_format_conv /* If we are doing a post format conversion we need to do that now. */ if (pConverter->hasPostFormatConversion) { - if (pFramesOutThisIteration != nullptr) { + if (pFramesOutThisIteration != NULL) { ma_convert_pcm_frames_format(pFramesOutThisIteration, pConverter->formatOut, pTempBufferOut, pConverter->resampler.format, frameCountOutThisIteration, pConverter->resampler.channels, pConverter->ditherMode); } } @@ -56433,10 +56433,10 @@ static ma_result ma_data_converter_process_pcm_frames__resample_with_format_conv } } - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { *pFrameCountIn = framesProcessedIn; } - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { *pFrameCountOut = framesProcessedOut; } @@ -56445,7 +56445,7 @@ static ma_result ma_data_converter_process_pcm_frames__resample_with_format_conv static ma_result ma_data_converter_process_pcm_frames__resample_only(ma_data_converter* pConverter, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut) { - MA_ASSERT(pConverter != nullptr); + MA_ASSERT(pConverter != NULL); if (pConverter->hasPreFormatConversion == MA_FALSE && pConverter->hasPostFormatConversion == MA_FALSE) { /* Neither pre- nor post-format required. This is simple case where only resampling is required. */ @@ -56463,15 +56463,15 @@ static ma_result ma_data_converter_process_pcm_frames__channels_only(ma_data_con ma_uint64 frameCountOut; ma_uint64 frameCount; - MA_ASSERT(pConverter != nullptr); + MA_ASSERT(pConverter != NULL); frameCountIn = 0; - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { frameCountIn = *pFrameCountIn; } frameCountOut = 0; - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { frameCountOut = *pFrameCountOut; } @@ -56494,16 +56494,16 @@ static ma_result ma_data_converter_process_pcm_frames__channels_only(ma_data_con /* */ void* pFramesOutThisIteration; ma_uint64 frameCountThisIteration; - if (pFramesIn != nullptr) { + if (pFramesIn != NULL) { pFramesInThisIteration = ma_offset_ptr(pFramesIn, framesProcessed * ma_get_bytes_per_frame(pConverter->formatIn, pConverter->channelsIn)); } else { - pFramesInThisIteration = nullptr; + pFramesInThisIteration = NULL; } - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { pFramesOutThisIteration = ma_offset_ptr(pFramesOut, framesProcessed * ma_get_bytes_per_frame(pConverter->formatOut, pConverter->channelsOut)); } else { - pFramesOutThisIteration = nullptr; + pFramesOutThisIteration = NULL; } /* Do a pre format conversion if necessary. */ @@ -56522,7 +56522,7 @@ static ma_result ma_data_converter_process_pcm_frames__channels_only(ma_data_con } } - if (pFramesInThisIteration != nullptr) { + if (pFramesInThisIteration != NULL) { ma_convert_pcm_frames_format(pTempBufferIn, pConverter->channelConverter.format, pFramesInThisIteration, pConverter->formatIn, frameCountThisIteration, pConverter->channelsIn, pConverter->ditherMode); } else { MA_ZERO_MEMORY(pTempBufferIn, sizeof(pTempBufferIn)); @@ -56556,7 +56556,7 @@ static ma_result ma_data_converter_process_pcm_frames__channels_only(ma_data_con /* If we are doing a post format conversion we need to do that now. */ if (pConverter->hasPostFormatConversion) { - if (pFramesOutThisIteration != nullptr) { + if (pFramesOutThisIteration != NULL) { ma_convert_pcm_frames_format(pFramesOutThisIteration, pConverter->formatOut, pTempBufferOut, pConverter->channelConverter.format, frameCountThisIteration, pConverter->channelConverter.channelsOut, pConverter->ditherMode); } } @@ -56565,10 +56565,10 @@ static ma_result ma_data_converter_process_pcm_frames__channels_only(ma_data_con } } - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { *pFrameCountIn = frameCount; } - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { *pFrameCountOut = frameCount; } @@ -56589,18 +56589,18 @@ static ma_result ma_data_converter_process_pcm_frames__resample_first(ma_data_co ma_uint8 pTempBufferOut[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; /* In channel converter output format. */ ma_uint64 tempBufferOutCap; - MA_ASSERT(pConverter != nullptr); + MA_ASSERT(pConverter != NULL); MA_ASSERT(pConverter->resampler.format == pConverter->channelConverter.format); MA_ASSERT(pConverter->resampler.channels == pConverter->channelConverter.channelsIn); MA_ASSERT(pConverter->resampler.channels < pConverter->channelConverter.channelsOut); frameCountIn = 0; - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { frameCountIn = *pFrameCountIn; } frameCountOut = 0; - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { frameCountOut = *pFrameCountOut; } @@ -56614,15 +56614,15 @@ static ma_result ma_data_converter_process_pcm_frames__resample_first(ma_data_co while (framesProcessedOut < frameCountOut) { ma_uint64 frameCountInThisIteration; ma_uint64 frameCountOutThisIteration; - const void* pRunningFramesIn = nullptr; - void* pRunningFramesOut = nullptr; + const void* pRunningFramesIn = NULL; + void* pRunningFramesOut = NULL; const void* pResampleBufferIn; void* pChannelsBufferOut; - if (pFramesIn != nullptr) { + if (pFramesIn != NULL) { pRunningFramesIn = ma_offset_ptr(pFramesIn, framesProcessedIn * ma_get_bytes_per_frame(pConverter->formatIn, pConverter->channelsIn)); } - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { pRunningFramesOut = ma_offset_ptr(pFramesOut, framesProcessedOut * ma_get_bytes_per_frame(pConverter->formatOut, pConverter->channelsOut)); } @@ -56671,11 +56671,11 @@ static ma_result ma_data_converter_process_pcm_frames__resample_first(ma_data_co #endif if (pConverter->hasPreFormatConversion) { - if (pFramesIn != nullptr) { + if (pFramesIn != NULL) { ma_convert_pcm_frames_format(pTempBufferIn, pConverter->resampler.format, pRunningFramesIn, pConverter->formatIn, frameCountInThisIteration, pConverter->channelsIn, pConverter->ditherMode); pResampleBufferIn = pTempBufferIn; } else { - pResampleBufferIn = nullptr; + pResampleBufferIn = NULL; } } else { pResampleBufferIn = pRunningFramesIn; @@ -56691,7 +56691,7 @@ static ma_result ma_data_converter_process_pcm_frames__resample_first(ma_data_co The input data has been resampled so now we need to run it through the channel converter. The input data is always contained in pTempBufferMid. We only need to do this part if we have an output buffer. */ - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { if (pConverter->hasPostFormatConversion) { pChannelsBufferOut = pTempBufferOut; } else { @@ -56721,10 +56721,10 @@ static ma_result ma_data_converter_process_pcm_frames__resample_first(ma_data_co } } - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { *pFrameCountIn = framesProcessedIn; } - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { *pFrameCountOut = framesProcessedOut; } @@ -56745,18 +56745,18 @@ static ma_result ma_data_converter_process_pcm_frames__channels_first(ma_data_co ma_uint8 pTempBufferOut[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; /* In channel converter output format. */ ma_uint64 tempBufferOutCap; - MA_ASSERT(pConverter != nullptr); + MA_ASSERT(pConverter != NULL); MA_ASSERT(pConverter->resampler.format == pConverter->channelConverter.format); MA_ASSERT(pConverter->resampler.channels == pConverter->channelConverter.channelsOut); MA_ASSERT(pConverter->resampler.channels <= pConverter->channelConverter.channelsIn); frameCountIn = 0; - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { frameCountIn = *pFrameCountIn; } frameCountOut = 0; - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { frameCountOut = *pFrameCountOut; } @@ -56770,15 +56770,15 @@ static ma_result ma_data_converter_process_pcm_frames__channels_first(ma_data_co while (framesProcessedOut < frameCountOut) { ma_uint64 frameCountInThisIteration; ma_uint64 frameCountOutThisIteration; - const void* pRunningFramesIn = nullptr; - void* pRunningFramesOut = nullptr; + const void* pRunningFramesIn = NULL; + void* pRunningFramesOut = NULL; const void* pChannelsBufferIn; void* pResampleBufferOut; - if (pFramesIn != nullptr) { + if (pFramesIn != NULL) { pRunningFramesIn = ma_offset_ptr(pFramesIn, framesProcessedIn * ma_get_bytes_per_frame(pConverter->formatIn, pConverter->channelsIn)); } - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { pRunningFramesOut = ma_offset_ptr(pFramesOut, framesProcessedOut * ma_get_bytes_per_frame(pConverter->formatOut, pConverter->channelsOut)); } @@ -56835,11 +56835,11 @@ static ma_result ma_data_converter_process_pcm_frames__channels_first(ma_data_co /* Pre format conversion. */ if (pConverter->hasPreFormatConversion) { - if (pRunningFramesIn != nullptr) { + if (pRunningFramesIn != NULL) { ma_convert_pcm_frames_format(pTempBufferIn, pConverter->channelConverter.format, pRunningFramesIn, pConverter->formatIn, frameCountInThisIteration, pConverter->channelsIn, pConverter->ditherMode); pChannelsBufferIn = pTempBufferIn; } else { - pChannelsBufferIn = nullptr; + pChannelsBufferIn = NULL; } } else { pChannelsBufferIn = pRunningFramesIn; @@ -56868,7 +56868,7 @@ static ma_result ma_data_converter_process_pcm_frames__channels_first(ma_data_co /* Post format conversion. */ if (pConverter->hasPostFormatConversion) { - if (pRunningFramesOut != nullptr) { + if (pRunningFramesOut != NULL) { ma_convert_pcm_frames_format(pRunningFramesOut, pConverter->formatOut, pResampleBufferOut, pConverter->resampler.format, frameCountOutThisIteration, pConverter->channelsOut, pConverter->ditherMode); } } @@ -56885,10 +56885,10 @@ static ma_result ma_data_converter_process_pcm_frames__channels_first(ma_data_co } } - if (pFrameCountIn != nullptr) { + if (pFrameCountIn != NULL) { *pFrameCountIn = framesProcessedIn; } - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { *pFrameCountOut = framesProcessedOut; } @@ -56897,7 +56897,7 @@ static ma_result ma_data_converter_process_pcm_frames__channels_first(ma_data_co MA_API ma_result ma_data_converter_process_pcm_frames(ma_data_converter* pConverter, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut) { - if (pConverter == nullptr) { + if (pConverter == NULL) { return MA_INVALID_ARGS; } @@ -56915,7 +56915,7 @@ MA_API ma_result ma_data_converter_process_pcm_frames(ma_data_converter* pConver MA_API ma_result ma_data_converter_set_rate(ma_data_converter* pConverter, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut) { - if (pConverter == nullptr) { + if (pConverter == NULL) { return MA_INVALID_ARGS; } @@ -56928,7 +56928,7 @@ MA_API ma_result ma_data_converter_set_rate(ma_data_converter* pConverter, ma_ui MA_API ma_result ma_data_converter_set_rate_ratio(ma_data_converter* pConverter, float ratioInOut) { - if (pConverter == nullptr) { + if (pConverter == NULL) { return MA_INVALID_ARGS; } @@ -56941,7 +56941,7 @@ MA_API ma_result ma_data_converter_set_rate_ratio(ma_data_converter* pConverter, MA_API ma_uint64 ma_data_converter_get_input_latency(const ma_data_converter* pConverter) { - if (pConverter == nullptr) { + if (pConverter == NULL) { return 0; } @@ -56954,7 +56954,7 @@ MA_API ma_uint64 ma_data_converter_get_input_latency(const ma_data_converter* pC MA_API ma_uint64 ma_data_converter_get_output_latency(const ma_data_converter* pConverter) { - if (pConverter == nullptr) { + if (pConverter == NULL) { return 0; } @@ -56967,13 +56967,13 @@ MA_API ma_uint64 ma_data_converter_get_output_latency(const ma_data_converter* p MA_API ma_result ma_data_converter_get_required_input_frame_count(const ma_data_converter* pConverter, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount) { - if (pInputFrameCount == nullptr) { + if (pInputFrameCount == NULL) { return MA_INVALID_ARGS; } *pInputFrameCount = 0; - if (pConverter == nullptr) { + if (pConverter == NULL) { return MA_INVALID_ARGS; } @@ -56987,13 +56987,13 @@ MA_API ma_result ma_data_converter_get_required_input_frame_count(const ma_data_ MA_API ma_result ma_data_converter_get_expected_output_frame_count(const ma_data_converter* pConverter, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount) { - if (pOutputFrameCount == nullptr) { + if (pOutputFrameCount == NULL) { return MA_INVALID_ARGS; } *pOutputFrameCount = 0; - if (pConverter == nullptr) { + if (pConverter == NULL) { return MA_INVALID_ARGS; } @@ -57007,7 +57007,7 @@ MA_API ma_result ma_data_converter_get_expected_output_frame_count(const ma_data MA_API ma_result ma_data_converter_get_input_channel_map(const ma_data_converter* pConverter, ma_channel* pChannelMap, size_t channelMapCap) { - if (pConverter == nullptr || pChannelMap == nullptr) { + if (pConverter == NULL || pChannelMap == NULL) { return MA_INVALID_ARGS; } @@ -57022,7 +57022,7 @@ MA_API ma_result ma_data_converter_get_input_channel_map(const ma_data_converter MA_API ma_result ma_data_converter_get_output_channel_map(const ma_data_converter* pConverter, ma_channel* pChannelMap, size_t channelMapCap) { - if (pConverter == nullptr || pChannelMap == nullptr) { + if (pConverter == NULL || pChannelMap == NULL) { return MA_INVALID_ARGS; } @@ -57037,7 +57037,7 @@ MA_API ma_result ma_data_converter_get_output_channel_map(const ma_data_converte MA_API ma_result ma_data_converter_reset(ma_data_converter* pConverter) { - if (pConverter == nullptr) { + if (pConverter == NULL) { return MA_INVALID_ARGS; } @@ -57060,7 +57060,7 @@ static ma_channel ma_channel_map_init_standard_channel(ma_standard_channel_map s MA_API ma_channel ma_channel_map_get_channel(const ma_channel* pChannelMap, ma_uint32 channelCount, ma_uint32 channelIndex) { - if (pChannelMap == nullptr) { + if (pChannelMap == NULL) { return ma_channel_map_init_standard_channel(ma_standard_channel_map_default, channelCount, channelIndex); } else { if (channelIndex >= channelCount) { @@ -57073,7 +57073,7 @@ MA_API ma_channel ma_channel_map_get_channel(const ma_channel* pChannelMap, ma_u MA_API void ma_channel_map_init_blank(ma_channel* pChannelMap, ma_uint32 channels) { - if (pChannelMap == nullptr) { + if (pChannelMap == NULL) { return; } @@ -57793,7 +57793,7 @@ MA_API void ma_channel_map_init_standard(ma_standard_channel_map standardChannel { ma_uint32 iChannel; - if (pChannelMap == nullptr || channelMapCap == 0 || channels == 0) { + if (pChannelMap == NULL || channelMapCap == 0 || channels == 0) { return; } @@ -57810,18 +57810,18 @@ MA_API void ma_channel_map_init_standard(ma_standard_channel_map standardChannel MA_API void ma_channel_map_copy(ma_channel* pOut, const ma_channel* pIn, ma_uint32 channels) { - if (pOut != nullptr && pIn != nullptr && channels > 0) { + if (pOut != NULL && pIn != NULL && channels > 0) { MA_COPY_MEMORY(pOut, pIn, sizeof(*pOut) * channels); } } MA_API void ma_channel_map_copy_or_default(ma_channel* pOut, size_t channelMapCapOut, const ma_channel* pIn, ma_uint32 channels) { - if (pOut == nullptr || channels == 0) { + if (pOut == NULL || channels == 0) { return; } - if (pIn != nullptr) { + if (pIn != NULL) { ma_channel_map_copy(pOut, pIn, channels); } else { ma_channel_map_init_standard(ma_standard_channel_map_default, pOut, channelMapCapOut, channels); @@ -57870,7 +57870,7 @@ MA_API ma_bool32 ma_channel_map_is_blank(const ma_channel* pChannelMap, ma_uint3 ma_uint32 iChannel; /* A null channel map is equivalent to the default channel map. */ - if (pChannelMap == nullptr) { + if (pChannelMap == NULL) { return MA_FALSE; } @@ -57885,20 +57885,20 @@ MA_API ma_bool32 ma_channel_map_is_blank(const ma_channel* pChannelMap, ma_uint3 MA_API ma_bool32 ma_channel_map_contains_channel_position(ma_uint32 channels, const ma_channel* pChannelMap, ma_channel channelPosition) { - return ma_channel_map_find_channel_position(channels, pChannelMap, channelPosition, nullptr); + return ma_channel_map_find_channel_position(channels, pChannelMap, channelPosition, NULL); } MA_API ma_bool32 ma_channel_map_find_channel_position(ma_uint32 channels, const ma_channel* pChannelMap, ma_channel channelPosition, ma_uint32* pChannelIndex) { ma_uint32 iChannel; - if (pChannelIndex != nullptr) { + if (pChannelIndex != NULL) { *pChannelIndex = (ma_uint32)-1; } for (iChannel = 0; iChannel < channels; ++iChannel) { if (ma_channel_map_get_channel(pChannelMap, channels, iChannel) == channelPosition) { - if (pChannelIndex != nullptr) { + if (pChannelIndex != NULL) { *pChannelIndex = iChannel; } @@ -57922,14 +57922,14 @@ MA_API size_t ma_channel_map_to_string(const ma_channel* pChannelMap, ma_uint32 size_t channelStrLen = strlen(pChannelStr); /* Append the string if necessary. */ - if (pBufferOut != nullptr && bufferCap > len + channelStrLen) { + if (pBufferOut != NULL && bufferCap > len + channelStrLen) { MA_COPY_MEMORY(pBufferOut + len, pChannelStr, channelStrLen); } len += channelStrLen; /* Append a space if it's not the last item. */ if (iChannel+1 < channels) { - if (pBufferOut != nullptr && bufferCap > len + 1) { + if (pBufferOut != NULL && bufferCap > len + 1) { pBufferOut[len] = ' '; } len += 1; @@ -57937,7 +57937,7 @@ MA_API size_t ma_channel_map_to_string(const ma_channel* pChannelMap, ma_uint32 } /* Null terminate. Don't increment the length here. */ - if (pBufferOut != nullptr) { + if (pBufferOut != NULL) { if (bufferCap > len) { pBufferOut[len] = '\0'; } else if (bufferCap > 0) { @@ -58032,16 +58032,16 @@ MA_API ma_uint64 ma_convert_frames_ex(void* pOut, ma_uint64 frameCountOut, const ma_result result; ma_data_converter converter; - if (frameCountIn == 0 || pConfig == nullptr) { + if (frameCountIn == 0 || pConfig == NULL) { return 0; } - result = ma_data_converter_init(pConfig, nullptr, &converter); + result = ma_data_converter_init(pConfig, NULL, &converter); if (result != MA_SUCCESS) { return 0; /* Failed to initialize the data converter. */ } - if (pOut == nullptr) { + if (pOut == NULL) { result = ma_data_converter_get_expected_output_frame_count(&converter, frameCountIn, &frameCountOut); if (result != MA_SUCCESS) { if (result == MA_NOT_IMPLEMENTED) { @@ -58052,7 +58052,7 @@ MA_API ma_uint64 ma_convert_frames_ex(void* pOut, ma_uint64 frameCountOut, const ma_uint64 framesProcessedIn = frameCountIn; ma_uint64 framesProcessedOut = 0xFFFFFFFF; - result = ma_data_converter_process_pcm_frames(&converter, pIn, &framesProcessedIn, nullptr, &framesProcessedOut); + result = ma_data_converter_process_pcm_frames(&converter, pIn, &framesProcessedIn, NULL, &framesProcessedOut); if (result != MA_SUCCESS) { break; } @@ -58068,7 +58068,7 @@ MA_API ma_uint64 ma_convert_frames_ex(void* pOut, ma_uint64 frameCountOut, const } } - ma_data_converter_uninit(&converter, nullptr); + ma_data_converter_uninit(&converter, NULL); return frameCountOut; } @@ -58090,13 +58090,13 @@ static MA_INLINE ma_uint32 ma_rb__extract_offset_loop_flag(ma_uint32 encodedOffs static MA_INLINE void* ma_rb__get_read_ptr(ma_rb* pRB) { - MA_ASSERT(pRB != nullptr); + MA_ASSERT(pRB != NULL); return ma_offset_ptr(pRB->pBuffer, ma_rb__extract_offset_in_bytes(ma_atomic_load_32(&pRB->encodedReadOffset))); } static MA_INLINE void* ma_rb__get_write_ptr(ma_rb* pRB) { - MA_ASSERT(pRB != nullptr); + MA_ASSERT(pRB != NULL); return ma_offset_ptr(pRB->pBuffer, ma_rb__extract_offset_in_bytes(ma_atomic_load_32(&pRB->encodedWriteOffset))); } @@ -58107,8 +58107,8 @@ static MA_INLINE ma_uint32 ma_rb__construct_offset(ma_uint32 offsetInBytes, ma_u static MA_INLINE void ma_rb__deconstruct_offset(ma_uint32 encodedOffset, ma_uint32* pOffsetInBytes, ma_uint32* pOffsetLoopFlag) { - MA_ASSERT(pOffsetInBytes != nullptr); - MA_ASSERT(pOffsetLoopFlag != nullptr); + MA_ASSERT(pOffsetInBytes != NULL); + MA_ASSERT(pOffsetLoopFlag != NULL); *pOffsetInBytes = ma_rb__extract_offset_in_bytes(encodedOffset); *pOffsetLoopFlag = ma_rb__extract_offset_loop_flag(encodedOffset); @@ -58120,7 +58120,7 @@ MA_API ma_result ma_rb_init_ex(size_t subbufferSizeInBytes, size_t subbufferCoun ma_result result; const ma_uint32 maxSubBufferSize = 0x7FFFFFFF - (MA_SIMD_ALIGNMENT-1); - if (pRB == nullptr) { + if (pRB == NULL) { return MA_INVALID_ARGS; } @@ -58143,7 +58143,7 @@ MA_API ma_result ma_rb_init_ex(size_t subbufferSizeInBytes, size_t subbufferCoun pRB->subbufferSizeInBytes = (ma_uint32)subbufferSizeInBytes; pRB->subbufferCount = (ma_uint32)subbufferCount; - if (pOptionalPreallocatedBuffer != nullptr) { + if (pOptionalPreallocatedBuffer != NULL) { pRB->subbufferStrideInBytes = (ma_uint32)subbufferStrideInBytes; pRB->pBuffer = pOptionalPreallocatedBuffer; } else { @@ -58157,7 +58157,7 @@ MA_API ma_result ma_rb_init_ex(size_t subbufferSizeInBytes, size_t subbufferCoun bufferSizeInBytes = (size_t)pRB->subbufferCount*pRB->subbufferStrideInBytes; pRB->pBuffer = ma_aligned_malloc(bufferSizeInBytes, MA_SIMD_ALIGNMENT, &pRB->allocationCallbacks); - if (pRB->pBuffer == nullptr) { + if (pRB->pBuffer == NULL) { return MA_OUT_OF_MEMORY; } @@ -58175,7 +58175,7 @@ MA_API ma_result ma_rb_init(size_t bufferSizeInBytes, void* pOptionalPreallocate MA_API void ma_rb_uninit(ma_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return; } @@ -58186,7 +58186,7 @@ MA_API void ma_rb_uninit(ma_rb* pRB) MA_API void ma_rb_reset(ma_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return; } @@ -58205,7 +58205,7 @@ MA_API ma_result ma_rb_acquire_read(ma_rb* pRB, size_t* pSizeInBytes, void** ppB size_t bytesAvailable; size_t bytesRequested; - if (pRB == nullptr || pSizeInBytes == nullptr || ppBufferOut == nullptr) { + if (pRB == NULL || pSizeInBytes == NULL || ppBufferOut == NULL) { return MA_INVALID_ARGS; } @@ -58245,7 +58245,7 @@ MA_API ma_result ma_rb_commit_read(ma_rb* pRB, size_t sizeInBytes) ma_uint32 newReadOffsetInBytes; ma_uint32 newReadOffsetLoopFlag; - if (pRB == nullptr) { + if (pRB == NULL) { return MA_INVALID_ARGS; } @@ -58281,7 +58281,7 @@ MA_API ma_result ma_rb_acquire_write(ma_rb* pRB, size_t* pSizeInBytes, void** pp size_t bytesAvailable; size_t bytesRequested; - if (pRB == nullptr || pSizeInBytes == nullptr || ppBufferOut == nullptr) { + if (pRB == NULL || pSizeInBytes == NULL || ppBufferOut == NULL) { return MA_INVALID_ARGS; } @@ -58327,7 +58327,7 @@ MA_API ma_result ma_rb_commit_write(ma_rb* pRB, size_t sizeInBytes) ma_uint32 newWriteOffsetInBytes; ma_uint32 newWriteOffsetLoopFlag; - if (pRB == nullptr) { + if (pRB == NULL) { return MA_INVALID_ARGS; } @@ -58363,7 +58363,7 @@ MA_API ma_result ma_rb_seek_read(ma_rb* pRB, size_t offsetInBytes) ma_uint32 newReadOffsetInBytes; ma_uint32 newReadOffsetLoopFlag; - if (pRB == nullptr || offsetInBytes > pRB->subbufferSizeInBytes) { + if (pRB == NULL || offsetInBytes > pRB->subbufferSizeInBytes) { return MA_INVALID_ARGS; } @@ -58407,7 +58407,7 @@ MA_API ma_result ma_rb_seek_write(ma_rb* pRB, size_t offsetInBytes) ma_uint32 newWriteOffsetInBytes; ma_uint32 newWriteOffsetLoopFlag; - if (pRB == nullptr) { + if (pRB == NULL) { return MA_INVALID_ARGS; } @@ -58449,7 +58449,7 @@ MA_API ma_int32 ma_rb_pointer_distance(ma_rb* pRB) ma_uint32 writeOffsetInBytes; ma_uint32 writeOffsetLoopFlag; - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58470,7 +58470,7 @@ MA_API ma_uint32 ma_rb_available_read(ma_rb* pRB) { ma_int32 dist; - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58484,7 +58484,7 @@ MA_API ma_uint32 ma_rb_available_read(ma_rb* pRB) MA_API ma_uint32 ma_rb_available_write(ma_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58493,7 +58493,7 @@ MA_API ma_uint32 ma_rb_available_write(ma_rb* pRB) MA_API size_t ma_rb_get_subbuffer_size(ma_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58502,7 +58502,7 @@ MA_API size_t ma_rb_get_subbuffer_size(ma_rb* pRB) MA_API size_t ma_rb_get_subbuffer_stride(ma_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58515,7 +58515,7 @@ MA_API size_t ma_rb_get_subbuffer_stride(ma_rb* pRB) MA_API size_t ma_rb_get_subbuffer_offset(ma_rb* pRB, size_t subbufferIndex) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58524,8 +58524,8 @@ MA_API size_t ma_rb_get_subbuffer_offset(ma_rb* pRB, size_t subbufferIndex) MA_API void* ma_rb_get_subbuffer_ptr(ma_rb* pRB, size_t subbufferIndex, void* pBuffer) { - if (pRB == nullptr) { - return nullptr; + if (pRB == NULL) { + return NULL; } return ma_offset_ptr(pBuffer, ma_rb_get_subbuffer_offset(pRB, subbufferIndex)); @@ -58540,7 +58540,7 @@ static ma_result ma_pcm_rb_data_source__on_read(ma_data_source* pDataSource, voi ma_result result; ma_uint64 totalFramesRead; - MA_ASSERT(pRB != nullptr); + MA_ASSERT(pRB != NULL); /* We need to run this in a loop since the ring buffer itself may loop. */ totalFramesRead = 0; @@ -58589,22 +58589,22 @@ static ma_result ma_pcm_rb_data_source__on_read(ma_data_source* pDataSource, voi static ma_result ma_pcm_rb_data_source__on_get_data_format(ma_data_source* pDataSource, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap) { ma_pcm_rb* pRB = (ma_pcm_rb*)pDataSource; - MA_ASSERT(pRB != nullptr); + MA_ASSERT(pRB != NULL); - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = pRB->format; } - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = pRB->channels; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = pRB->sampleRate; } /* Just assume the default channel map. */ - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pRB->channels); } @@ -58614,17 +58614,17 @@ static ma_result ma_pcm_rb_data_source__on_get_data_format(ma_data_source* pData static ma_data_source_vtable ma_gRBDataSourceVTable = { ma_pcm_rb_data_source__on_read, - nullptr, /* onSeek */ + NULL, /* onSeek */ ma_pcm_rb_data_source__on_get_data_format, - nullptr, /* onGetCursor */ - nullptr, /* onGetLength */ - nullptr, /* onSetLooping */ + NULL, /* onGetCursor */ + NULL, /* onGetLength */ + NULL, /* onSetLooping */ 0 }; static MA_INLINE ma_uint32 ma_pcm_rb_get_bpf(ma_pcm_rb* pRB) { - MA_ASSERT(pRB != nullptr); + MA_ASSERT(pRB != NULL); return ma_get_bytes_per_frame(pRB->format, pRB->channels); } @@ -58634,7 +58634,7 @@ MA_API ma_result ma_pcm_rb_init_ex(ma_format format, ma_uint32 channels, ma_uint ma_uint32 bpf; ma_result result; - if (pRB == nullptr) { + if (pRB == NULL) { return MA_INVALID_ARGS; } @@ -58676,7 +58676,7 @@ MA_API ma_result ma_pcm_rb_init(ma_format format, ma_uint32 channels, ma_uint32 MA_API void ma_pcm_rb_uninit(ma_pcm_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return; } @@ -58686,7 +58686,7 @@ MA_API void ma_pcm_rb_uninit(ma_pcm_rb* pRB) MA_API void ma_pcm_rb_reset(ma_pcm_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return; } @@ -58698,7 +58698,7 @@ MA_API ma_result ma_pcm_rb_acquire_read(ma_pcm_rb* pRB, ma_uint32* pSizeInFrames size_t sizeInBytes; ma_result result; - if (pRB == nullptr || pSizeInFrames == nullptr) { + if (pRB == NULL || pSizeInFrames == NULL) { return MA_INVALID_ARGS; } @@ -58715,7 +58715,7 @@ MA_API ma_result ma_pcm_rb_acquire_read(ma_pcm_rb* pRB, ma_uint32* pSizeInFrames MA_API ma_result ma_pcm_rb_commit_read(ma_pcm_rb* pRB, ma_uint32 sizeInFrames) { - if (pRB == nullptr) { + if (pRB == NULL) { return MA_INVALID_ARGS; } @@ -58727,7 +58727,7 @@ MA_API ma_result ma_pcm_rb_acquire_write(ma_pcm_rb* pRB, ma_uint32* pSizeInFrame size_t sizeInBytes; ma_result result; - if (pRB == nullptr) { + if (pRB == NULL) { return MA_INVALID_ARGS; } @@ -58744,7 +58744,7 @@ MA_API ma_result ma_pcm_rb_acquire_write(ma_pcm_rb* pRB, ma_uint32* pSizeInFrame MA_API ma_result ma_pcm_rb_commit_write(ma_pcm_rb* pRB, ma_uint32 sizeInFrames) { - if (pRB == nullptr) { + if (pRB == NULL) { return MA_INVALID_ARGS; } @@ -58753,7 +58753,7 @@ MA_API ma_result ma_pcm_rb_commit_write(ma_pcm_rb* pRB, ma_uint32 sizeInFrames) MA_API ma_result ma_pcm_rb_seek_read(ma_pcm_rb* pRB, ma_uint32 offsetInFrames) { - if (pRB == nullptr) { + if (pRB == NULL) { return MA_INVALID_ARGS; } @@ -58762,7 +58762,7 @@ MA_API ma_result ma_pcm_rb_seek_read(ma_pcm_rb* pRB, ma_uint32 offsetInFrames) MA_API ma_result ma_pcm_rb_seek_write(ma_pcm_rb* pRB, ma_uint32 offsetInFrames) { - if (pRB == nullptr) { + if (pRB == NULL) { return MA_INVALID_ARGS; } @@ -58771,7 +58771,7 @@ MA_API ma_result ma_pcm_rb_seek_write(ma_pcm_rb* pRB, ma_uint32 offsetInFrames) MA_API ma_int32 ma_pcm_rb_pointer_distance(ma_pcm_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58780,7 +58780,7 @@ MA_API ma_int32 ma_pcm_rb_pointer_distance(ma_pcm_rb* pRB) MA_API ma_uint32 ma_pcm_rb_available_read(ma_pcm_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58789,7 +58789,7 @@ MA_API ma_uint32 ma_pcm_rb_available_read(ma_pcm_rb* pRB) MA_API ma_uint32 ma_pcm_rb_available_write(ma_pcm_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58798,7 +58798,7 @@ MA_API ma_uint32 ma_pcm_rb_available_write(ma_pcm_rb* pRB) MA_API ma_uint32 ma_pcm_rb_get_subbuffer_size(ma_pcm_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58807,7 +58807,7 @@ MA_API ma_uint32 ma_pcm_rb_get_subbuffer_size(ma_pcm_rb* pRB) MA_API ma_uint32 ma_pcm_rb_get_subbuffer_stride(ma_pcm_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58816,7 +58816,7 @@ MA_API ma_uint32 ma_pcm_rb_get_subbuffer_stride(ma_pcm_rb* pRB) MA_API ma_uint32 ma_pcm_rb_get_subbuffer_offset(ma_pcm_rb* pRB, ma_uint32 subbufferIndex) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58825,8 +58825,8 @@ MA_API ma_uint32 ma_pcm_rb_get_subbuffer_offset(ma_pcm_rb* pRB, ma_uint32 subbuf MA_API void* ma_pcm_rb_get_subbuffer_ptr(ma_pcm_rb* pRB, ma_uint32 subbufferIndex, void* pBuffer) { - if (pRB == nullptr) { - return nullptr; + if (pRB == NULL) { + return NULL; } return ma_rb_get_subbuffer_ptr(&pRB->rb, subbufferIndex, pBuffer); @@ -58834,7 +58834,7 @@ MA_API void* ma_pcm_rb_get_subbuffer_ptr(ma_pcm_rb* pRB, ma_uint32 subbufferInde MA_API ma_format ma_pcm_rb_get_format(const ma_pcm_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return ma_format_unknown; } @@ -58843,7 +58843,7 @@ MA_API ma_format ma_pcm_rb_get_format(const ma_pcm_rb* pRB) MA_API ma_uint32 ma_pcm_rb_get_channels(const ma_pcm_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58852,7 +58852,7 @@ MA_API ma_uint32 ma_pcm_rb_get_channels(const ma_pcm_rb* pRB) MA_API ma_uint32 ma_pcm_rb_get_sample_rate(const ma_pcm_rb* pRB) { - if (pRB == nullptr) { + if (pRB == NULL) { return 0; } @@ -58861,7 +58861,7 @@ MA_API ma_uint32 ma_pcm_rb_get_sample_rate(const ma_pcm_rb* pRB) MA_API void ma_pcm_rb_set_sample_rate(ma_pcm_rb* pRB, ma_uint32 sampleRate) { - if (pRB == nullptr) { + if (pRB == NULL) { return; } @@ -58880,7 +58880,7 @@ MA_API ma_result ma_duplex_rb_init(ma_format captureFormat, ma_uint32 captureCha return MA_INVALID_ARGS; } - result = ma_pcm_rb_init(captureFormat, captureChannels, sizeInFrames, nullptr, pAllocationCallbacks, &pRB->rb); + result = ma_pcm_rb_init(captureFormat, captureChannels, sizeInFrames, NULL, pAllocationCallbacks, &pRB->rb); if (result != MA_SUCCESS) { return result; } @@ -58984,21 +58984,21 @@ MA_API const char* ma_result_description(ma_result result) MA_API void* ma_malloc(size_t sz, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks != nullptr) { - if (pAllocationCallbacks->onMalloc != nullptr) { + if (pAllocationCallbacks != NULL) { + if (pAllocationCallbacks->onMalloc != NULL) { return pAllocationCallbacks->onMalloc(sz, pAllocationCallbacks->pUserData); } else { - return nullptr; /* Do not fall back to the default implementation. */ + return NULL; /* Do not fall back to the default implementation. */ } } else { - return ma__malloc_default(sz, nullptr); + return ma__malloc_default(sz, NULL); } } MA_API void* ma_calloc(size_t sz, const ma_allocation_callbacks* pAllocationCallbacks) { void* p = ma_malloc(sz, pAllocationCallbacks); - if (p != nullptr) { + if (p != NULL) { MA_ZERO_MEMORY(p, sz); } @@ -59007,31 +59007,31 @@ MA_API void* ma_calloc(size_t sz, const ma_allocation_callbacks* pAllocationCall MA_API void* ma_realloc(void* p, size_t sz, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks != nullptr) { - if (pAllocationCallbacks->onRealloc != nullptr) { + if (pAllocationCallbacks != NULL) { + if (pAllocationCallbacks->onRealloc != NULL) { return pAllocationCallbacks->onRealloc(p, sz, pAllocationCallbacks->pUserData); } else { - return nullptr; /* Do not fall back to the default implementation. */ + return NULL; /* Do not fall back to the default implementation. */ } } else { - return ma__realloc_default(p, sz, nullptr); + return ma__realloc_default(p, sz, NULL); } } MA_API void ma_free(void* p, const ma_allocation_callbacks* pAllocationCallbacks) { - if (p == nullptr) { + if (p == NULL) { return; } - if (pAllocationCallbacks != nullptr) { - if (pAllocationCallbacks->onFree != nullptr) { + if (pAllocationCallbacks != NULL) { + if (pAllocationCallbacks->onFree != NULL) { pAllocationCallbacks->onFree(p, pAllocationCallbacks->pUserData); } else { return; /* Do no fall back to the default implementation. */ } } else { - ma__free_default(p, nullptr); + ma__free_default(p, NULL); } } @@ -59048,8 +59048,8 @@ MA_API void* ma_aligned_malloc(size_t sz, size_t alignment, const ma_allocation_ extraBytes = alignment-1 + sizeof(void*); pUnaligned = ma_malloc(sz + extraBytes, pAllocationCallbacks); - if (pUnaligned == nullptr) { - return nullptr; + if (pUnaligned == NULL) { + return NULL; } pAligned = (void*)(((ma_uintptr)pUnaligned + extraBytes) & ~((ma_uintptr)(alignment-1))); @@ -59120,17 +59120,17 @@ MA_API ma_result ma_data_source_init(const ma_data_source_config* pConfig, ma_da { ma_data_source_base* pDataSourceBase = (ma_data_source_base*)pDataSource; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pDataSourceBase); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } - if (pConfig->vtable == nullptr) { + if (pConfig->vtable == NULL) { return MA_INVALID_ARGS; } @@ -59140,15 +59140,15 @@ MA_API ma_result ma_data_source_init(const ma_data_source_config* pConfig, ma_da pDataSourceBase->loopBegInFrames = MA_DATA_SOURCE_DEFAULT_LOOP_POINT_BEG; pDataSourceBase->loopEndInFrames = MA_DATA_SOURCE_DEFAULT_LOOP_POINT_END; pDataSourceBase->pCurrent = pDataSource; /* Always read from ourself by default. */ - pDataSourceBase->pNext = nullptr; - pDataSourceBase->onGetNext = nullptr; + pDataSourceBase->pNext = NULL; + pDataSourceBase->onGetNext = NULL; return MA_SUCCESS; } MA_API void ma_data_source_uninit(ma_data_source* pDataSource) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return; } @@ -59162,16 +59162,16 @@ static ma_result ma_data_source_resolve_current(ma_data_source* pDataSource, ma_ { ma_data_source_base* pCurrentDataSource = (ma_data_source_base*)pDataSource; - MA_ASSERT(pDataSource != nullptr); - MA_ASSERT(ppCurrentDataSource != nullptr); + MA_ASSERT(pDataSource != NULL); + MA_ASSERT(ppCurrentDataSource != NULL); - if (pCurrentDataSource->pCurrent == nullptr) { + if (pCurrentDataSource->pCurrent == NULL) { /* - The current data source is nullptr. If we're using this in the context of a chain we need to return nullptr + The current data source is NULL. If we're using this in the context of a chain we need to return NULL here so that we don't end up looping. Otherwise we just return the data source itself. */ - if (pCurrentDataSource->pNext != nullptr || pCurrentDataSource->onGetNext != nullptr) { - pCurrentDataSource = nullptr; + if (pCurrentDataSource->pNext != NULL || pCurrentDataSource->onGetNext != NULL) { + pCurrentDataSource = NULL; } else { pCurrentDataSource = (ma_data_source_base*)pDataSource; /* Not being used in a chain. Make sure we just always read from the data source itself at all times. */ } @@ -59188,12 +59188,12 @@ static ma_result ma_data_source_read_pcm_frames_from_backend(ma_data_source* pDa { ma_data_source_base* pDataSourceBase = (ma_data_source_base*)pDataSource; - MA_ASSERT(pDataSourceBase != nullptr); - MA_ASSERT(pDataSourceBase->vtable != nullptr); - MA_ASSERT(pDataSourceBase->vtable->onRead != nullptr); - MA_ASSERT(pFramesRead != nullptr); + MA_ASSERT(pDataSourceBase != NULL); + MA_ASSERT(pDataSourceBase->vtable != NULL); + MA_ASSERT(pDataSourceBase->vtable->onRead != NULL); + MA_ASSERT(pFramesRead != NULL); - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { return pDataSourceBase->vtable->onRead(pDataSourceBase, pFramesOut, frameCount, pFramesRead); } else { /* @@ -59207,7 +59207,7 @@ static ma_result ma_data_source_read_pcm_frames_from_backend(ma_data_source* pDa ma_uint64 discardBufferCapInFrames; ma_uint8 pDiscardBuffer[4096]; - result = ma_data_source_get_data_format(pDataSource, &format, &channels, nullptr, nullptr, 0); + result = ma_data_source_get_data_format(pDataSource, &format, &channels, NULL, NULL, 0); if (result != MA_SUCCESS) { return result; } @@ -59243,7 +59243,7 @@ static ma_result ma_data_source_read_pcm_frames_within_range(ma_data_source* pDa ma_uint64 framesRead = 0; ma_bool32 loop = ma_data_source_is_looping(pDataSource); - if (pDataSourceBase == nullptr) { + if (pDataSourceBase == NULL) { return MA_AT_END; } @@ -59251,7 +59251,7 @@ static ma_result ma_data_source_read_pcm_frames_within_range(ma_data_source* pDa return MA_INVALID_ARGS; } - MA_ASSERT(pDataSourceBase->vtable != nullptr); + MA_ASSERT(pDataSourceBase->vtable != NULL); if ((pDataSourceBase->vtable->flags & MA_DATA_SOURCE_SELF_MANAGED_RANGE_AND_LOOP_POINT) != 0 || (pDataSourceBase->rangeEndInFrames == ~((ma_uint64)0) && (pDataSourceBase->loopEndInFrames == ~((ma_uint64)0) || loop == MA_FALSE))) { /* Either the data source is self-managing the range, or no range is set - just read like normal. The data source itself will tell us when the end is reached. */ @@ -59299,7 +59299,7 @@ static ma_result ma_data_source_read_pcm_frames_within_range(ma_data_source* pDa } } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = framesRead; } @@ -59323,7 +59323,7 @@ MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, voi ma_uint32 emptyLoopCounter = 0; /* Keeps track of how many times 0 frames have been read. For infinite loop detection of sounds with no audio data. */ ma_bool32 loop; - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -59331,7 +59331,7 @@ MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, voi return MA_INVALID_ARGS; } - if (pDataSourceBase == nullptr) { + if (pDataSourceBase == NULL) { return MA_INVALID_ARGS; } @@ -59341,7 +59341,7 @@ MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, voi We need to know the data format so we can advance the output buffer as we read frames. If this fails, chaining will not work and we'll just read as much as we can from the current source. */ - if (ma_data_source_get_data_format(pDataSource, &format, &channels, nullptr, nullptr, 0) != MA_SUCCESS) { + if (ma_data_source_get_data_format(pDataSource, &format, &channels, NULL, NULL, 0) != MA_SUCCESS) { result = ma_data_source_resolve_current(pDataSource, (ma_data_source**)&pCurrentDataSource); if (result != MA_SUCCESS) { return result; @@ -59366,7 +59366,7 @@ MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, voi break; } - if (pCurrentDataSource == nullptr) { + if (pCurrentDataSource == NULL) { break; } @@ -59417,11 +59417,11 @@ MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, voi /* Don't return MA_AT_END for looping sounds. */ result = MA_SUCCESS; } else { - if (pCurrentDataSource->pNext != nullptr) { + if (pCurrentDataSource->pNext != NULL) { pDataSourceBase->pCurrent = pCurrentDataSource->pNext; - } else if (pCurrentDataSource->onGetNext != nullptr) { + } else if (pCurrentDataSource->onGetNext != NULL) { pDataSourceBase->pCurrent = pCurrentDataSource->onGetNext(pCurrentDataSource); - if (pDataSourceBase->pCurrent == nullptr) { + if (pDataSourceBase->pCurrent == NULL) { break; /* Our callback did not return a next data source. We're done. */ } } else { @@ -59437,12 +59437,12 @@ MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, voi } } - if (pRunningFramesOut != nullptr) { + if (pRunningFramesOut != NULL) { pRunningFramesOut = ma_offset_ptr(pRunningFramesOut, framesProcessed * ma_get_bytes_per_frame(format, channels)); } } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesProcessed; } @@ -59457,18 +59457,18 @@ MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, voi MA_API ma_result ma_data_source_seek_pcm_frames(ma_data_source* pDataSource, ma_uint64 frameCount, ma_uint64* pFramesSeeked) { - return ma_data_source_read_pcm_frames(pDataSource, nullptr, frameCount, pFramesSeeked); + return ma_data_source_read_pcm_frames(pDataSource, NULL, frameCount, pFramesSeeked); } MA_API ma_result ma_data_source_seek_to_pcm_frame(ma_data_source* pDataSource, ma_uint64 frameIndex) { ma_data_source_base* pDataSourceBase = (ma_data_source_base*)pDataSource; - if (pDataSourceBase == nullptr) { + if (pDataSourceBase == NULL) { return MA_INVALID_ARGS; } - if (pDataSourceBase->vtable->onSeek == nullptr) { + if (pDataSourceBase->vtable->onSeek == NULL) { return MA_NOT_IMPLEMENTED; } @@ -59476,7 +59476,7 @@ MA_API ma_result ma_data_source_seek_to_pcm_frame(ma_data_source* pDataSource, m return MA_INVALID_OPERATION; /* Trying to seek too far forward. */ } - MA_ASSERT(pDataSourceBase->vtable != nullptr); + MA_ASSERT(pDataSourceBase->vtable != NULL); return pDataSourceBase->vtable->onSeek(pDataSource, pDataSourceBase->rangeBegInFrames + frameIndex); } @@ -59488,11 +59488,11 @@ MA_API ma_result ma_data_source_seek_seconds(ma_data_source* pDataSource, float ma_uint32 sampleRate; ma_result result; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } - result = ma_data_source_get_data_format(pDataSource, nullptr, nullptr, &sampleRate, nullptr, 0); + result = ma_data_source_get_data_format(pDataSource, NULL, NULL, &sampleRate, NULL, 0); if (result != MA_SUCCESS) { return result; } @@ -59513,11 +59513,11 @@ MA_API ma_result ma_data_source_seek_to_second(ma_data_source* pDataSource, floa ma_uint32 sampleRate; ma_result result; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } - result = ma_data_source_get_data_format(pDataSource, nullptr, nullptr, &sampleRate, nullptr, 0); + result = ma_data_source_get_data_format(pDataSource, NULL, NULL, &sampleRate, NULL, 0); if (result != MA_SUCCESS) { return result; } @@ -59537,26 +59537,26 @@ MA_API ma_result ma_data_source_get_data_format(ma_data_source* pDataSource, ma_ ma_uint32 sampleRate; /* Initialize to defaults for safety just in case the data source does not implement this callback. */ - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = ma_format_unknown; } - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = 0; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = 0; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { MA_ZERO_MEMORY(pChannelMap, sizeof(*pChannelMap) * channelMapCap); } - if (pDataSourceBase == nullptr) { + if (pDataSourceBase == NULL) { return MA_INVALID_ARGS; } - MA_ASSERT(pDataSourceBase->vtable != nullptr); + MA_ASSERT(pDataSourceBase->vtable != NULL); - if (pDataSourceBase->vtable->onGetDataFormat == nullptr) { + if (pDataSourceBase->vtable->onGetDataFormat == NULL) { return MA_NOT_IMPLEMENTED; } @@ -59565,13 +59565,13 @@ MA_API ma_result ma_data_source_get_data_format(ma_data_source* pDataSource, ma_ return result; } - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = format; } - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = channels; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = sampleRate; } @@ -59586,19 +59586,19 @@ MA_API ma_result ma_data_source_get_cursor_in_pcm_frames(ma_data_source* pDataSo ma_result result; ma_uint64 cursor; - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; - if (pDataSourceBase == nullptr) { + if (pDataSourceBase == NULL) { return MA_SUCCESS; } - MA_ASSERT(pDataSourceBase->vtable != nullptr); + MA_ASSERT(pDataSourceBase->vtable != NULL); - if (pDataSourceBase->vtable->onGetCursor == nullptr) { + if (pDataSourceBase->vtable->onGetCursor == NULL) { return MA_NOT_IMPLEMENTED; } @@ -59621,17 +59621,17 @@ MA_API ma_result ma_data_source_get_length_in_pcm_frames(ma_data_source* pDataSo { ma_data_source_base* pDataSourceBase = (ma_data_source_base*)pDataSource; - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } *pLength = 0; - if (pDataSourceBase == nullptr) { + if (pDataSourceBase == NULL) { return MA_INVALID_ARGS; } - MA_ASSERT(pDataSourceBase->vtable != nullptr); + MA_ASSERT(pDataSourceBase->vtable != NULL); /* If we have a range defined we'll use that to determine the length. This is one of rare times @@ -59647,7 +59647,7 @@ MA_API ma_result ma_data_source_get_length_in_pcm_frames(ma_data_source* pDataSo Getting here means a range is not defined so we'll need to get the data source itself to tell us the length. */ - if (pDataSourceBase->vtable->onGetLength == nullptr) { + if (pDataSourceBase->vtable->onGetLength == NULL) { return MA_NOT_IMPLEMENTED; } @@ -59660,7 +59660,7 @@ MA_API ma_result ma_data_source_get_cursor_in_seconds(ma_data_source* pDataSourc ma_uint64 cursorInPCMFrames; ma_uint32 sampleRate; - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } @@ -59671,7 +59671,7 @@ MA_API ma_result ma_data_source_get_cursor_in_seconds(ma_data_source* pDataSourc return result; } - result = ma_data_source_get_data_format(pDataSource, nullptr, nullptr, &sampleRate, nullptr, 0); + result = ma_data_source_get_data_format(pDataSource, NULL, NULL, &sampleRate, NULL, 0); if (result != MA_SUCCESS) { return result; } @@ -59688,7 +59688,7 @@ MA_API ma_result ma_data_source_get_length_in_seconds(ma_data_source* pDataSourc ma_uint64 lengthInPCMFrames; ma_uint32 sampleRate; - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } @@ -59699,7 +59699,7 @@ MA_API ma_result ma_data_source_get_length_in_seconds(ma_data_source* pDataSourc return result; } - result = ma_data_source_get_data_format(pDataSource, nullptr, nullptr, &sampleRate, nullptr, 0); + result = ma_data_source_get_data_format(pDataSource, NULL, NULL, &sampleRate, NULL, 0); if (result != MA_SUCCESS) { return result; } @@ -59714,16 +59714,16 @@ MA_API ma_result ma_data_source_set_looping(ma_data_source* pDataSource, ma_bool { ma_data_source_base* pDataSourceBase = (ma_data_source_base*)pDataSource; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } ma_atomic_exchange_32(&pDataSourceBase->isLooping, isLooping); - MA_ASSERT(pDataSourceBase->vtable != nullptr); + MA_ASSERT(pDataSourceBase->vtable != NULL); /* If there's no callback for this just treat it as a successful no-op. */ - if (pDataSourceBase->vtable->onSetLooping == nullptr) { + if (pDataSourceBase->vtable->onSetLooping == NULL) { return MA_SUCCESS; } @@ -59734,7 +59734,7 @@ MA_API ma_bool32 ma_data_source_is_looping(const ma_data_source* pDataSource) { const ma_data_source_base* pDataSourceBase = (const ma_data_source_base*)pDataSource; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_FALSE; } @@ -59749,7 +59749,7 @@ MA_API ma_result ma_data_source_set_range_in_pcm_frames(ma_data_source* pDataSou ma_uint64 absoluteCursor; ma_bool32 doSeekAdjustment = MA_FALSE; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -59812,22 +59812,22 @@ MA_API void ma_data_source_get_range_in_pcm_frames(const ma_data_source* pDataSo { const ma_data_source_base* pDataSourceBase = (const ma_data_source_base*)pDataSource; - if (pRangeBegInFrames != nullptr) { + if (pRangeBegInFrames != NULL) { *pRangeBegInFrames = 0; } - if (pRangeEndInFrames != nullptr) { + if (pRangeEndInFrames != NULL) { *pRangeEndInFrames = 0; } - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return; } - if (pRangeBegInFrames != nullptr) { + if (pRangeBegInFrames != NULL) { *pRangeBegInFrames = pDataSourceBase->rangeBegInFrames; } - if (pRangeEndInFrames != nullptr) { + if (pRangeEndInFrames != NULL) { *pRangeEndInFrames = pDataSourceBase->rangeEndInFrames; } } @@ -59836,7 +59836,7 @@ MA_API ma_result ma_data_source_set_loop_point_in_pcm_frames(ma_data_source* pDa { ma_data_source_base* pDataSourceBase = (ma_data_source_base*)pDataSource; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -59863,22 +59863,22 @@ MA_API void ma_data_source_get_loop_point_in_pcm_frames(const ma_data_source* pD { const ma_data_source_base* pDataSourceBase = (const ma_data_source_base*)pDataSource; - if (pLoopBegInFrames != nullptr) { + if (pLoopBegInFrames != NULL) { *pLoopBegInFrames = 0; } - if (pLoopEndInFrames != nullptr) { + if (pLoopEndInFrames != NULL) { *pLoopEndInFrames = 0; } - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return; } - if (pLoopBegInFrames != nullptr) { + if (pLoopBegInFrames != NULL) { *pLoopBegInFrames = pDataSourceBase->loopBegInFrames; } - if (pLoopEndInFrames != nullptr) { + if (pLoopEndInFrames != NULL) { *pLoopEndInFrames = pDataSourceBase->loopEndInFrames; } } @@ -59887,7 +59887,7 @@ MA_API ma_result ma_data_source_set_current(ma_data_source* pDataSource, ma_data { ma_data_source_base* pDataSourceBase = (ma_data_source_base*)pDataSource; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -59900,8 +59900,8 @@ MA_API ma_data_source* ma_data_source_get_current(const ma_data_source* pDataSou { const ma_data_source_base* pDataSourceBase = (const ma_data_source_base*)pDataSource; - if (pDataSource == nullptr) { - return nullptr; + if (pDataSource == NULL) { + return NULL; } return pDataSourceBase->pCurrent; @@ -59911,7 +59911,7 @@ MA_API ma_result ma_data_source_set_next(ma_data_source* pDataSource, ma_data_so { ma_data_source_base* pDataSourceBase = (ma_data_source_base*)pDataSource; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -59924,8 +59924,8 @@ MA_API ma_data_source* ma_data_source_get_next(const ma_data_source* pDataSource { const ma_data_source_base* pDataSourceBase = (const ma_data_source_base*)pDataSource; - if (pDataSource == nullptr) { - return nullptr; + if (pDataSource == NULL) { + return NULL; } return pDataSourceBase->pNext; @@ -59935,7 +59935,7 @@ MA_API ma_result ma_data_source_set_next_callback(ma_data_source* pDataSource, m { ma_data_source_base* pDataSourceBase = (ma_data_source_base*)pDataSource; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -59948,8 +59948,8 @@ MA_API ma_data_source_get_next_proc ma_data_source_get_next_callback(const ma_da { const ma_data_source_base* pDataSourceBase = (const ma_data_source_base*)pDataSource; - if (pDataSource == nullptr) { - return nullptr; + if (pDataSource == NULL) { + return NULL; } return pDataSourceBase->onGetNext; @@ -59961,7 +59961,7 @@ static ma_result ma_audio_buffer_ref__data_source_on_read(ma_data_source* pDataS ma_audio_buffer_ref* pAudioBufferRef = (ma_audio_buffer_ref*)pDataSource; ma_uint64 framesRead = ma_audio_buffer_ref_read_pcm_frames(pAudioBufferRef, pFramesOut, frameCount, MA_FALSE); - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = framesRead; } @@ -60014,7 +60014,7 @@ static ma_data_source_vtable g_ma_audio_buffer_ref_data_source_vtable = ma_audio_buffer_ref__data_source_on_get_data_format, ma_audio_buffer_ref__data_source_on_get_cursor, ma_audio_buffer_ref__data_source_on_get_length, - nullptr, /* onSetLooping */ + NULL, /* onSetLooping */ 0 }; @@ -60023,7 +60023,7 @@ MA_API ma_result ma_audio_buffer_ref_init(ma_format format, ma_uint32 channels, ma_result result; ma_data_source_config dataSourceConfig; - if (pAudioBufferRef == nullptr) { + if (pAudioBufferRef == NULL) { return MA_INVALID_ARGS; } @@ -60049,7 +60049,7 @@ MA_API ma_result ma_audio_buffer_ref_init(ma_format format, ma_uint32 channels, MA_API void ma_audio_buffer_ref_uninit(ma_audio_buffer_ref* pAudioBufferRef) { - if (pAudioBufferRef == nullptr) { + if (pAudioBufferRef == NULL) { return; } @@ -60058,7 +60058,7 @@ MA_API void ma_audio_buffer_ref_uninit(ma_audio_buffer_ref* pAudioBufferRef) MA_API ma_result ma_audio_buffer_ref_set_data(ma_audio_buffer_ref* pAudioBufferRef, const void* pData, ma_uint64 sizeInFrames) { - if (pAudioBufferRef == nullptr) { + if (pAudioBufferRef == NULL) { return MA_INVALID_ARGS; } @@ -60073,7 +60073,7 @@ MA_API ma_uint64 ma_audio_buffer_ref_read_pcm_frames(ma_audio_buffer_ref* pAudio { ma_uint64 totalFramesRead = 0; - if (pAudioBufferRef == nullptr) { + if (pAudioBufferRef == NULL) { return 0; } @@ -60091,7 +60091,7 @@ MA_API ma_uint64 ma_audio_buffer_ref_read_pcm_frames(ma_audio_buffer_ref* pAudio framesToRead = framesAvailable; } - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { ma_copy_pcm_frames(ma_offset_ptr(pFramesOut, totalFramesRead * ma_get_bytes_per_frame(pAudioBufferRef->format, pAudioBufferRef->channels)), ma_offset_ptr(pAudioBufferRef->pData, pAudioBufferRef->cursor * ma_get_bytes_per_frame(pAudioBufferRef->format, pAudioBufferRef->channels)), framesToRead, pAudioBufferRef->format, pAudioBufferRef->channels); } @@ -60114,7 +60114,7 @@ MA_API ma_uint64 ma_audio_buffer_ref_read_pcm_frames(ma_audio_buffer_ref* pAudio MA_API ma_result ma_audio_buffer_ref_seek_to_pcm_frame(ma_audio_buffer_ref* pAudioBufferRef, ma_uint64 frameIndex) { - if (pAudioBufferRef == nullptr) { + if (pAudioBufferRef == NULL) { return MA_INVALID_ARGS; } @@ -60132,16 +60132,16 @@ MA_API ma_result ma_audio_buffer_ref_map(ma_audio_buffer_ref* pAudioBufferRef, v ma_uint64 framesAvailable; ma_uint64 frameCount = 0; - if (ppFramesOut != nullptr) { - *ppFramesOut = nullptr; /* Safety. */ + if (ppFramesOut != NULL) { + *ppFramesOut = NULL; /* Safety. */ } - if (pFrameCount != nullptr) { + if (pFrameCount != NULL) { frameCount = *pFrameCount; *pFrameCount = 0; /* Safety. */ } - if (pAudioBufferRef == nullptr || ppFramesOut == nullptr || pFrameCount == nullptr) { + if (pAudioBufferRef == NULL || ppFramesOut == NULL || pFrameCount == NULL) { return MA_INVALID_ARGS; } @@ -60160,7 +60160,7 @@ MA_API ma_result ma_audio_buffer_ref_unmap(ma_audio_buffer_ref* pAudioBufferRef, { ma_uint64 framesAvailable; - if (pAudioBufferRef == nullptr) { + if (pAudioBufferRef == NULL) { return MA_INVALID_ARGS; } @@ -60180,7 +60180,7 @@ MA_API ma_result ma_audio_buffer_ref_unmap(ma_audio_buffer_ref* pAudioBufferRef, MA_API ma_bool32 ma_audio_buffer_ref_at_end(const ma_audio_buffer_ref* pAudioBufferRef) { - if (pAudioBufferRef == nullptr) { + if (pAudioBufferRef == NULL) { return MA_FALSE; } @@ -60189,13 +60189,13 @@ MA_API ma_bool32 ma_audio_buffer_ref_at_end(const ma_audio_buffer_ref* pAudioBuf MA_API ma_result ma_audio_buffer_ref_get_cursor_in_pcm_frames(const ma_audio_buffer_ref* pAudioBufferRef, ma_uint64* pCursor) { - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; - if (pAudioBufferRef == nullptr) { + if (pAudioBufferRef == NULL) { return MA_INVALID_ARGS; } @@ -60206,13 +60206,13 @@ MA_API ma_result ma_audio_buffer_ref_get_cursor_in_pcm_frames(const ma_audio_buf MA_API ma_result ma_audio_buffer_ref_get_length_in_pcm_frames(const ma_audio_buffer_ref* pAudioBufferRef, ma_uint64* pLength) { - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } *pLength = 0; - if (pAudioBufferRef == nullptr) { + if (pAudioBufferRef == NULL) { return MA_INVALID_ARGS; } @@ -60223,13 +60223,13 @@ MA_API ma_result ma_audio_buffer_ref_get_length_in_pcm_frames(const ma_audio_buf MA_API ma_result ma_audio_buffer_ref_get_available_frames(const ma_audio_buffer_ref* pAudioBufferRef, ma_uint64* pAvailableFrames) { - if (pAvailableFrames == nullptr) { + if (pAvailableFrames == NULL) { return MA_INVALID_ARGS; } *pAvailableFrames = 0; - if (pAudioBufferRef == nullptr) { + if (pAudioBufferRef == NULL) { return MA_INVALID_ARGS; } @@ -60264,13 +60264,13 @@ static ma_result ma_audio_buffer_init_ex(const ma_audio_buffer_config* pConfig, { ma_result result; - if (pAudioBuffer == nullptr) { + if (pAudioBuffer == NULL) { return MA_INVALID_ARGS; } MA_ZERO_MEMORY(pAudioBuffer, sizeof(*pAudioBuffer) - sizeof(pAudioBuffer->_pExtraData)); /* Safety. Don't overwrite the extra data. */ - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -60278,7 +60278,7 @@ static ma_result ma_audio_buffer_init_ex(const ma_audio_buffer_config* pConfig, return MA_INVALID_ARGS; /* Not allowing buffer sizes of 0 frames. */ } - result = ma_audio_buffer_ref_init(pConfig->format, pConfig->channels, nullptr, 0, &pAudioBuffer->ref); + result = ma_audio_buffer_ref_init(pConfig->format, pConfig->channels, NULL, 0, &pAudioBuffer->ref); if (result != MA_SUCCESS) { return result; } @@ -60298,11 +60298,11 @@ static ma_result ma_audio_buffer_init_ex(const ma_audio_buffer_config* pConfig, } pData = ma_malloc((size_t)allocationSizeInBytes, &pAudioBuffer->allocationCallbacks); /* Safe cast to size_t. */ - if (pData == nullptr) { + if (pData == NULL) { return MA_OUT_OF_MEMORY; } - if (pConfig->pData != nullptr) { + if (pConfig->pData != NULL) { ma_copy_pcm_frames(pData, pConfig->pData, pConfig->sizeInFrames, pConfig->format, pConfig->channels); } else { ma_silence_pcm_frames(pData, pConfig->sizeInFrames, pConfig->format, pConfig->channels); @@ -60320,7 +60320,7 @@ static ma_result ma_audio_buffer_init_ex(const ma_audio_buffer_config* pConfig, static void ma_audio_buffer_uninit_ex(ma_audio_buffer* pAudioBuffer, ma_bool32 doFree) { - if (pAudioBuffer == nullptr) { + if (pAudioBuffer == NULL) { return; } @@ -60352,13 +60352,13 @@ MA_API ma_result ma_audio_buffer_alloc_and_init(const ma_audio_buffer_config* pC ma_audio_buffer_config innerConfig; /* We'll be making some changes to the config, so need to make a copy. */ ma_uint64 allocationSizeInBytes; - if (ppAudioBuffer == nullptr) { + if (ppAudioBuffer == NULL) { return MA_INVALID_ARGS; } - *ppAudioBuffer = nullptr; /* Safety. */ + *ppAudioBuffer = NULL; /* Safety. */ - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -60371,11 +60371,11 @@ MA_API ma_result ma_audio_buffer_alloc_and_init(const ma_audio_buffer_config* pC } pAudioBuffer = (ma_audio_buffer*)ma_malloc((size_t)allocationSizeInBytes, &innerConfig.allocationCallbacks); /* Safe cast to size_t. */ - if (pAudioBuffer == nullptr) { + if (pAudioBuffer == NULL) { return MA_OUT_OF_MEMORY; } - if (pConfig->pData != nullptr) { + if (pConfig->pData != NULL) { ma_copy_pcm_frames(&pAudioBuffer->_pExtraData[0], pConfig->pData, pConfig->sizeInFrames, pConfig->format, pConfig->channels); } else { ma_silence_pcm_frames(&pAudioBuffer->_pExtraData[0], pConfig->sizeInFrames, pConfig->format, pConfig->channels); @@ -60406,7 +60406,7 @@ MA_API void ma_audio_buffer_uninit_and_free(ma_audio_buffer* pAudioBuffer) MA_API ma_uint64 ma_audio_buffer_read_pcm_frames(ma_audio_buffer* pAudioBuffer, void* pFramesOut, ma_uint64 frameCount, ma_bool32 loop) { - if (pAudioBuffer == nullptr) { + if (pAudioBuffer == NULL) { return 0; } @@ -60415,7 +60415,7 @@ MA_API ma_uint64 ma_audio_buffer_read_pcm_frames(ma_audio_buffer* pAudioBuffer, MA_API ma_result ma_audio_buffer_seek_to_pcm_frame(ma_audio_buffer* pAudioBuffer, ma_uint64 frameIndex) { - if (pAudioBuffer == nullptr) { + if (pAudioBuffer == NULL) { return MA_INVALID_ARGS; } @@ -60424,12 +60424,12 @@ MA_API ma_result ma_audio_buffer_seek_to_pcm_frame(ma_audio_buffer* pAudioBuffer MA_API ma_result ma_audio_buffer_map(ma_audio_buffer* pAudioBuffer, void** ppFramesOut, ma_uint64* pFrameCount) { - if (ppFramesOut != nullptr) { - *ppFramesOut = nullptr; /* Safety. */ + if (ppFramesOut != NULL) { + *ppFramesOut = NULL; /* Safety. */ } - if (pAudioBuffer == nullptr) { - if (pFrameCount != nullptr) { + if (pAudioBuffer == NULL) { + if (pFrameCount != NULL) { *pFrameCount = 0; } @@ -60441,7 +60441,7 @@ MA_API ma_result ma_audio_buffer_map(ma_audio_buffer* pAudioBuffer, void** ppFra MA_API ma_result ma_audio_buffer_unmap(ma_audio_buffer* pAudioBuffer, ma_uint64 frameCount) { - if (pAudioBuffer == nullptr) { + if (pAudioBuffer == NULL) { return MA_INVALID_ARGS; } @@ -60450,7 +60450,7 @@ MA_API ma_result ma_audio_buffer_unmap(ma_audio_buffer* pAudioBuffer, ma_uint64 MA_API ma_bool32 ma_audio_buffer_at_end(const ma_audio_buffer* pAudioBuffer) { - if (pAudioBuffer == nullptr) { + if (pAudioBuffer == NULL) { return MA_FALSE; } @@ -60459,7 +60459,7 @@ MA_API ma_bool32 ma_audio_buffer_at_end(const ma_audio_buffer* pAudioBuffer) MA_API ma_result ma_audio_buffer_get_cursor_in_pcm_frames(const ma_audio_buffer* pAudioBuffer, ma_uint64* pCursor) { - if (pAudioBuffer == nullptr) { + if (pAudioBuffer == NULL) { return MA_INVALID_ARGS; } @@ -60468,7 +60468,7 @@ MA_API ma_result ma_audio_buffer_get_cursor_in_pcm_frames(const ma_audio_buffer* MA_API ma_result ma_audio_buffer_get_length_in_pcm_frames(const ma_audio_buffer* pAudioBuffer, ma_uint64* pLength) { - if (pAudioBuffer == nullptr) { + if (pAudioBuffer == NULL) { return MA_INVALID_ARGS; } @@ -60477,13 +60477,13 @@ MA_API ma_result ma_audio_buffer_get_length_in_pcm_frames(const ma_audio_buffer* MA_API ma_result ma_audio_buffer_get_available_frames(const ma_audio_buffer* pAudioBuffer, ma_uint64* pAvailableFrames) { - if (pAvailableFrames == nullptr) { + if (pAvailableFrames == NULL) { return MA_INVALID_ARGS; } *pAvailableFrames = 0; - if (pAudioBuffer == nullptr) { + if (pAudioBuffer == NULL) { return MA_INVALID_ARGS; } @@ -60496,7 +60496,7 @@ MA_API ma_result ma_audio_buffer_get_available_frames(const ma_audio_buffer* pAu MA_API ma_result ma_paged_audio_buffer_data_init(ma_format format, ma_uint32 channels, ma_paged_audio_buffer_data* pData) { - if (pData == nullptr) { + if (pData == NULL) { return MA_INVALID_ARGS; } @@ -60513,13 +60513,13 @@ MA_API void ma_paged_audio_buffer_data_uninit(ma_paged_audio_buffer_data* pData, { ma_paged_audio_buffer_page* pPage; - if (pData == nullptr) { + if (pData == NULL) { return; } /* All pages need to be freed. */ pPage = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&pData->head.pNext); - while (pPage != nullptr) { + while (pPage != NULL) { ma_paged_audio_buffer_page* pNext = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&pPage->pNext); ma_free(pPage, pAllocationCallbacks); @@ -60529,8 +60529,8 @@ MA_API void ma_paged_audio_buffer_data_uninit(ma_paged_audio_buffer_data* pData, MA_API ma_paged_audio_buffer_page* ma_paged_audio_buffer_data_get_head(ma_paged_audio_buffer_data* pData) { - if (pData == nullptr) { - return nullptr; + if (pData == NULL) { + return NULL; } return &pData->head; @@ -60538,8 +60538,8 @@ MA_API ma_paged_audio_buffer_page* ma_paged_audio_buffer_data_get_head(ma_paged_ MA_API ma_paged_audio_buffer_page* ma_paged_audio_buffer_data_get_tail(ma_paged_audio_buffer_data* pData) { - if (pData == nullptr) { - return nullptr; + if (pData == NULL) { + return NULL; } return pData->pTail; @@ -60549,18 +60549,18 @@ MA_API ma_result ma_paged_audio_buffer_data_get_length_in_pcm_frames(ma_paged_au { ma_paged_audio_buffer_page* pPage; - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } *pLength = 0; - if (pData == nullptr) { + if (pData == NULL) { return MA_INVALID_ARGS; } /* Calculate the length from the linked list. */ - for (pPage = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&pData->head.pNext); pPage != nullptr; pPage = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&pPage->pNext)) { + for (pPage = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&pData->head.pNext); pPage != NULL; pPage = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&pPage->pNext)) { *pLength += pPage->sizeInFrames; } @@ -60572,13 +60572,13 @@ MA_API ma_result ma_paged_audio_buffer_data_allocate_page(ma_paged_audio_buffer_ ma_paged_audio_buffer_page* pPage; ma_uint64 allocationSize; - if (ppPage == nullptr) { + if (ppPage == NULL) { return MA_INVALID_ARGS; } - *ppPage = nullptr; + *ppPage = NULL; - if (pData == nullptr) { + if (pData == NULL) { return MA_INVALID_ARGS; } @@ -60588,14 +60588,14 @@ MA_API ma_result ma_paged_audio_buffer_data_allocate_page(ma_paged_audio_buffer_ } pPage = (ma_paged_audio_buffer_page*)ma_malloc((size_t)allocationSize, pAllocationCallbacks); /* Safe cast to size_t. */ - if (pPage == nullptr) { + if (pPage == NULL) { return MA_OUT_OF_MEMORY; } - pPage->pNext = nullptr; + pPage->pNext = NULL; pPage->sizeInFrames = pageSizeInFrames; - if (pInitialData != nullptr) { + if (pInitialData != NULL) { ma_copy_pcm_frames(pPage->pAudioData, pInitialData, pageSizeInFrames, pData->format, pData->channels); } @@ -60606,7 +60606,7 @@ MA_API ma_result ma_paged_audio_buffer_data_allocate_page(ma_paged_audio_buffer_ MA_API ma_result ma_paged_audio_buffer_data_free_page(ma_paged_audio_buffer_data* pData, ma_paged_audio_buffer_page* pPage, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pData == nullptr || pPage == nullptr) { + if (pData == NULL || pPage == NULL) { return MA_INVALID_ARGS; } @@ -60618,7 +60618,7 @@ MA_API ma_result ma_paged_audio_buffer_data_free_page(ma_paged_audio_buffer_data MA_API ma_result ma_paged_audio_buffer_data_append_page(ma_paged_audio_buffer_data* pData, ma_paged_audio_buffer_page* pPage) { - if (pData == nullptr || pPage == nullptr) { + if (pData == NULL || pPage == NULL) { return MA_INVALID_ARGS; } @@ -60703,7 +60703,7 @@ static ma_data_source_vtable g_ma_paged_audio_buffer_data_source_vtable = ma_paged_audio_buffer__data_source_on_get_data_format, ma_paged_audio_buffer__data_source_on_get_cursor, ma_paged_audio_buffer__data_source_on_get_length, - nullptr, /* onSetLooping */ + NULL, /* onSetLooping */ 0 }; @@ -60712,18 +60712,18 @@ MA_API ma_result ma_paged_audio_buffer_init(const ma_paged_audio_buffer_config* ma_result result; ma_data_source_config dataSourceConfig; - if (pPagedAudioBuffer == nullptr) { + if (pPagedAudioBuffer == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pPagedAudioBuffer); /* A config is required for the format and channel count. */ - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } - if (pConfig->pData == nullptr) { + if (pConfig->pData == NULL) { return MA_INVALID_ARGS; /* No underlying data specified. */ } @@ -60745,7 +60745,7 @@ MA_API ma_result ma_paged_audio_buffer_init(const ma_paged_audio_buffer_config* MA_API void ma_paged_audio_buffer_uninit(ma_paged_audio_buffer* pPagedAudioBuffer) { - if (pPagedAudioBuffer == nullptr) { + if (pPagedAudioBuffer == NULL) { return; } @@ -60759,7 +60759,7 @@ MA_API ma_result ma_paged_audio_buffer_read_pcm_frames(ma_paged_audio_buffer* pP ma_format format; ma_uint32 channels; - if (pPagedAudioBuffer == nullptr) { + if (pPagedAudioBuffer == NULL) { return MA_INVALID_ARGS; } @@ -60767,12 +60767,12 @@ MA_API ma_result ma_paged_audio_buffer_read_pcm_frames(ma_paged_audio_buffer* pP channels = pPagedAudioBuffer->pData->channels; while (totalFramesRead < frameCount) { - /* Read from the current page. The buffer should never be in a state where this is nullptr. */ + /* Read from the current page. The buffer should never be in a state where this is NULL. */ ma_uint64 framesRemainingInCurrentPage; ma_uint64 framesRemainingToRead = frameCount - totalFramesRead; ma_uint64 framesToReadThisIteration; - MA_ASSERT(pPagedAudioBuffer->pCurrent != nullptr); + MA_ASSERT(pPagedAudioBuffer->pCurrent != NULL); framesRemainingInCurrentPage = pPagedAudioBuffer->pCurrent->sizeInFrames - pPagedAudioBuffer->relativeCursor; @@ -60789,7 +60789,7 @@ MA_API ma_result ma_paged_audio_buffer_read_pcm_frames(ma_paged_audio_buffer* pP if (pPagedAudioBuffer->relativeCursor == pPagedAudioBuffer->pCurrent->sizeInFrames) { /* We reached the end of the page. Need to move to the next. If there's no more pages, we're done. */ ma_paged_audio_buffer_page* pNext = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&pPagedAudioBuffer->pCurrent->pNext); - if (pNext == nullptr) { + if (pNext == NULL) { result = MA_AT_END; break; /* We've reached the end. */ } else { @@ -60799,7 +60799,7 @@ MA_API ma_result ma_paged_audio_buffer_read_pcm_frames(ma_paged_audio_buffer* pP } } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesRead; } @@ -60808,7 +60808,7 @@ MA_API ma_result ma_paged_audio_buffer_read_pcm_frames(ma_paged_audio_buffer* pP MA_API ma_result ma_paged_audio_buffer_seek_to_pcm_frame(ma_paged_audio_buffer* pPagedAudioBuffer, ma_uint64 frameIndex) { - if (pPagedAudioBuffer == nullptr) { + if (pPagedAudioBuffer == NULL) { return MA_INVALID_ARGS; } @@ -60830,7 +60830,7 @@ MA_API ma_result ma_paged_audio_buffer_seek_to_pcm_frame(ma_paged_audio_buffer* ma_paged_audio_buffer_page* pPage; ma_uint64 runningCursor = 0; - for (pPage = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&ma_paged_audio_buffer_data_get_head(pPagedAudioBuffer->pData)->pNext); pPage != nullptr; pPage = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&pPage->pNext)) { + for (pPage = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&ma_paged_audio_buffer_data_get_head(pPagedAudioBuffer->pData)->pNext); pPage != NULL; pPage = (ma_paged_audio_buffer_page*)ma_atomic_load_ptr(&pPage->pNext)) { ma_uint64 pageRangeBeg = runningCursor; ma_uint64 pageRangeEnd = pageRangeBeg + pPage->sizeInFrames; @@ -60856,13 +60856,13 @@ MA_API ma_result ma_paged_audio_buffer_seek_to_pcm_frame(ma_paged_audio_buffer* MA_API ma_result ma_paged_audio_buffer_get_cursor_in_pcm_frames(ma_paged_audio_buffer* pPagedAudioBuffer, ma_uint64* pCursor) { - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; /* Safety. */ - if (pPagedAudioBuffer == nullptr) { + if (pPagedAudioBuffer == NULL) { return MA_INVALID_ARGS; } @@ -60887,17 +60887,17 @@ MA_API ma_result ma_vfs_open(ma_vfs* pVFS, const char* pFilePath, ma_uint32 open { ma_vfs_callbacks* pCallbacks = (ma_vfs_callbacks*)pVFS; - if (pFile == nullptr) { + if (pFile == NULL) { return MA_INVALID_ARGS; } - *pFile = nullptr; + *pFile = NULL; - if (pVFS == nullptr || pFilePath == nullptr || openMode == 0) { + if (pVFS == NULL || pFilePath == NULL || openMode == 0) { return MA_INVALID_ARGS; } - if (pCallbacks->onOpen == nullptr) { + if (pCallbacks->onOpen == NULL) { return MA_NOT_IMPLEMENTED; } @@ -60908,17 +60908,17 @@ MA_API ma_result ma_vfs_open_w(ma_vfs* pVFS, const wchar_t* pFilePath, ma_uint32 { ma_vfs_callbacks* pCallbacks = (ma_vfs_callbacks*)pVFS; - if (pFile == nullptr) { + if (pFile == NULL) { return MA_INVALID_ARGS; } - *pFile = nullptr; + *pFile = NULL; - if (pVFS == nullptr || pFilePath == nullptr || openMode == 0) { + if (pVFS == NULL || pFilePath == NULL || openMode == 0) { return MA_INVALID_ARGS; } - if (pCallbacks->onOpenW == nullptr) { + if (pCallbacks->onOpenW == NULL) { return MA_NOT_IMPLEMENTED; } @@ -60929,11 +60929,11 @@ MA_API ma_result ma_vfs_close(ma_vfs* pVFS, ma_vfs_file file) { ma_vfs_callbacks* pCallbacks = (ma_vfs_callbacks*)pVFS; - if (pVFS == nullptr || file == nullptr) { + if (pVFS == NULL || file == NULL) { return MA_INVALID_ARGS; } - if (pCallbacks->onClose == nullptr) { + if (pCallbacks->onClose == NULL) { return MA_NOT_IMPLEMENTED; } @@ -60946,21 +60946,21 @@ MA_API ma_result ma_vfs_read(ma_vfs* pVFS, ma_vfs_file file, void* pDst, size_t ma_result result; size_t bytesRead = 0; - if (pBytesRead != nullptr) { + if (pBytesRead != NULL) { *pBytesRead = 0; } - if (pVFS == nullptr || file == nullptr || pDst == nullptr) { + if (pVFS == NULL || file == NULL || pDst == NULL) { return MA_INVALID_ARGS; } - if (pCallbacks->onRead == nullptr) { + if (pCallbacks->onRead == NULL) { return MA_NOT_IMPLEMENTED; } result = pCallbacks->onRead(pVFS, file, pDst, sizeInBytes, &bytesRead); - if (pBytesRead != nullptr) { + if (pBytesRead != NULL) { *pBytesRead = bytesRead; } @@ -60975,15 +60975,15 @@ MA_API ma_result ma_vfs_write(ma_vfs* pVFS, ma_vfs_file file, const void* pSrc, { ma_vfs_callbacks* pCallbacks = (ma_vfs_callbacks*)pVFS; - if (pBytesWritten != nullptr) { + if (pBytesWritten != NULL) { *pBytesWritten = 0; } - if (pVFS == nullptr || file == nullptr || pSrc == nullptr) { + if (pVFS == NULL || file == NULL || pSrc == NULL) { return MA_INVALID_ARGS; } - if (pCallbacks->onWrite == nullptr) { + if (pCallbacks->onWrite == NULL) { return MA_NOT_IMPLEMENTED; } @@ -60994,11 +60994,11 @@ MA_API ma_result ma_vfs_seek(ma_vfs* pVFS, ma_vfs_file file, ma_int64 offset, ma { ma_vfs_callbacks* pCallbacks = (ma_vfs_callbacks*)pVFS; - if (pVFS == nullptr || file == nullptr) { + if (pVFS == NULL || file == NULL) { return MA_INVALID_ARGS; } - if (pCallbacks->onSeek == nullptr) { + if (pCallbacks->onSeek == NULL) { return MA_NOT_IMPLEMENTED; } @@ -61009,17 +61009,17 @@ MA_API ma_result ma_vfs_tell(ma_vfs* pVFS, ma_vfs_file file, ma_int64* pCursor) { ma_vfs_callbacks* pCallbacks = (ma_vfs_callbacks*)pVFS; - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; - if (pVFS == nullptr || file == nullptr) { + if (pVFS == NULL || file == NULL) { return MA_INVALID_ARGS; } - if (pCallbacks->onTell == nullptr) { + if (pCallbacks->onTell == NULL) { return MA_NOT_IMPLEMENTED; } @@ -61030,17 +61030,17 @@ MA_API ma_result ma_vfs_info(ma_vfs* pVFS, ma_vfs_file file, ma_file_info* pInfo { ma_vfs_callbacks* pCallbacks = (ma_vfs_callbacks*)pVFS; - if (pInfo == nullptr) { + if (pInfo == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pInfo); - if (pVFS == nullptr || file == nullptr) { + if (pVFS == NULL || file == NULL) { return MA_INVALID_ARGS; } - if (pCallbacks->onInfo == nullptr) { + if (pCallbacks->onInfo == NULL) { return MA_NOT_IMPLEMENTED; } @@ -61063,17 +61063,17 @@ program and is left to the OS to uninitialize when the program terminates. typedef DWORD (__stdcall * ma_SetFilePointer_proc)(HANDLE hFile, LONG lDistanceToMove, LONG* lpDistanceToMoveHigh, DWORD dwMoveMethod); typedef BOOL (__stdcall * ma_SetFilePointerEx_proc)(HANDLE hFile, LARGE_INTEGER liDistanceToMove, LARGE_INTEGER* lpNewFilePointer, DWORD dwMoveMethod); -static ma_handle hKernel32DLL = nullptr; -static ma_SetFilePointer_proc ma_SetFilePointer = nullptr; -static ma_SetFilePointerEx_proc ma_SetFilePointerEx = nullptr; +static ma_handle hKernel32DLL = NULL; +static ma_SetFilePointer_proc ma_SetFilePointer = NULL; +static ma_SetFilePointerEx_proc ma_SetFilePointerEx = NULL; static void ma_win32_fileio_init(void) { - if (hKernel32DLL == nullptr) { - hKernel32DLL = ma_dlopen(nullptr, "kernel32.dll"); - if (hKernel32DLL != nullptr) { - ma_SetFilePointer = (ma_SetFilePointer_proc) ma_dlsym(nullptr, hKernel32DLL, "SetFilePointer"); - ma_SetFilePointerEx = (ma_SetFilePointerEx_proc)ma_dlsym(nullptr, hKernel32DLL, "SetFilePointerEx"); + if (hKernel32DLL == NULL) { + hKernel32DLL = ma_dlopen(NULL, "kernel32.dll"); + if (hKernel32DLL != NULL) { + ma_SetFilePointer = (ma_SetFilePointer_proc) ma_dlsym(NULL, hKernel32DLL, "SetFilePointer"); + ma_SetFilePointerEx = (ma_SetFilePointerEx_proc)ma_dlsym(NULL, hKernel32DLL, "SetFilePointerEx"); } } } @@ -61114,7 +61114,7 @@ static ma_result ma_default_vfs_open__win32(ma_vfs* pVFS, const char* pFilePath, ma_default_vfs__get_open_settings_win32(openMode, &dwDesiredAccess, &dwShareMode, &dwCreationDisposition); - hFile = CreateFileA(pFilePath, dwDesiredAccess, dwShareMode, nullptr, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, nullptr); + hFile = CreateFileA(pFilePath, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { return ma_result_from_GetLastError(GetLastError()); } @@ -61139,7 +61139,7 @@ static ma_result ma_default_vfs_open_w__win32(ma_vfs* pVFS, const wchar_t* pFile ma_default_vfs__get_open_settings_win32(openMode, &dwDesiredAccess, &dwShareMode, &dwCreationDisposition); - hFile = CreateFileW(pFilePath, dwDesiredAccess, dwShareMode, nullptr, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, nullptr); + hFile = CreateFileW(pFilePath, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { return ma_result_from_GetLastError(GetLastError()); } @@ -61188,7 +61188,7 @@ static ma_result ma_default_vfs_read__win32(ma_vfs* pVFS, ma_vfs_file file, void bytesToRead = (DWORD)bytesRemaining; } - readResult = ReadFile((HANDLE)file, ma_offset_ptr(pDst, totalBytesRead), bytesToRead, &bytesRead, nullptr); + readResult = ReadFile((HANDLE)file, ma_offset_ptr(pDst, totalBytesRead), bytesToRead, &bytesRead, NULL); if (readResult == 1 && bytesRead == 0) { result = MA_AT_END; break; /* EOF */ @@ -61206,7 +61206,7 @@ static ma_result ma_default_vfs_read__win32(ma_vfs* pVFS, ma_vfs_file file, void } } - if (pBytesRead != nullptr) { + if (pBytesRead != NULL) { *pBytesRead = totalBytesRead; } @@ -61234,7 +61234,7 @@ static ma_result ma_default_vfs_write__win32(ma_vfs* pVFS, ma_vfs_file file, con bytesToWrite = (DWORD)bytesRemaining; } - writeResult = WriteFile((HANDLE)file, ma_offset_ptr(pSrc, totalBytesWritten), bytesToWrite, &bytesWritten, nullptr); + writeResult = WriteFile((HANDLE)file, ma_offset_ptr(pSrc, totalBytesWritten), bytesToWrite, &bytesWritten, NULL); totalBytesWritten += bytesWritten; if (writeResult == 0) { @@ -61243,7 +61243,7 @@ static ma_result ma_default_vfs_write__win32(ma_vfs* pVFS, ma_vfs_file file, con } } - if (pBytesWritten != nullptr) { + if (pBytesWritten != NULL) { *pBytesWritten = totalBytesWritten; } @@ -61269,15 +61269,15 @@ static ma_result ma_default_vfs_seek__win32(ma_vfs* pVFS, ma_vfs_file file, ma_i dwMoveMethod = FILE_BEGIN; } - if (ma_SetFilePointerEx != nullptr) { - result = ma_SetFilePointerEx((HANDLE)file, liDistanceToMove, nullptr, dwMoveMethod); - } else if (ma_SetFilePointer != nullptr) { + if (ma_SetFilePointerEx != NULL) { + result = ma_SetFilePointerEx((HANDLE)file, liDistanceToMove, NULL, dwMoveMethod); + } else if (ma_SetFilePointer != NULL) { /* No SetFilePointerEx() so restrict to 31 bits. */ if (offset > 0x7FFFFFFF) { return MA_OUT_OF_RANGE; } - result = ma_SetFilePointer((HANDLE)file, (LONG)liDistanceToMove.QuadPart, nullptr, dwMoveMethod); + result = ma_SetFilePointer((HANDLE)file, (LONG)liDistanceToMove.QuadPart, NULL, dwMoveMethod); } else { return MA_NOT_IMPLEMENTED; } @@ -61299,9 +61299,9 @@ static ma_result ma_default_vfs_tell__win32(ma_vfs* pVFS, ma_vfs_file file, ma_i liZero.QuadPart = 0; - if (ma_SetFilePointerEx != nullptr) { + if (ma_SetFilePointerEx != NULL) { result = ma_SetFilePointerEx((HANDLE)file, liZero, &liTell, FILE_CURRENT); - } else if (ma_SetFilePointer != nullptr) { + } else if (ma_SetFilePointer != NULL) { LONG tell; result = ma_SetFilePointer((HANDLE)file, (LONG)liZero.QuadPart, &tell, FILE_CURRENT); @@ -61314,7 +61314,7 @@ static ma_result ma_default_vfs_tell__win32(ma_vfs* pVFS, ma_vfs_file file, ma_i return ma_result_from_GetLastError(GetLastError()); } - if (pCursor != nullptr) { + if (pCursor != NULL) { *pCursor = liTell.QuadPart; } @@ -61353,9 +61353,9 @@ static ma_result ma_default_vfs_open__stdio(ma_vfs* pVFS, const char* pFilePath, FILE* pFileStd; const char* pOpenModeStr; - MA_ASSERT(pFilePath != nullptr); + MA_ASSERT(pFilePath != NULL); MA_ASSERT(openMode != 0); - MA_ASSERT(pFile != nullptr); + MA_ASSERT(pFile != NULL); (void)pVFS; @@ -61385,9 +61385,9 @@ static ma_result ma_default_vfs_open_w__stdio(ma_vfs* pVFS, const wchar_t* pFile FILE* pFileStd; const wchar_t* pOpenModeStr; - MA_ASSERT(pFilePath != nullptr); + MA_ASSERT(pFilePath != NULL); MA_ASSERT(openMode != 0); - MA_ASSERT(pFile != nullptr); + MA_ASSERT(pFile != NULL); (void)pVFS; @@ -61401,7 +61401,7 @@ static ma_result ma_default_vfs_open_w__stdio(ma_vfs* pVFS, const wchar_t* pFile pOpenModeStr = L"wb"; } - result = ma_wfopen(&pFileStd, pFilePath, pOpenModeStr, (pVFS != nullptr) ? &((ma_default_vfs*)pVFS)->allocationCallbacks : nullptr); + result = ma_wfopen(&pFileStd, pFilePath, pOpenModeStr, (pVFS != NULL) ? &((ma_default_vfs*)pVFS)->allocationCallbacks : NULL); if (result != MA_SUCCESS) { return result; } @@ -61413,7 +61413,7 @@ static ma_result ma_default_vfs_open_w__stdio(ma_vfs* pVFS, const wchar_t* pFile static ma_result ma_default_vfs_close__stdio(ma_vfs* pVFS, ma_vfs_file file) { - MA_ASSERT(file != nullptr); + MA_ASSERT(file != NULL); (void)pVFS; @@ -61426,14 +61426,14 @@ static ma_result ma_default_vfs_read__stdio(ma_vfs* pVFS, ma_vfs_file file, void { size_t result; - MA_ASSERT(file != nullptr); - MA_ASSERT(pDst != nullptr); + MA_ASSERT(file != NULL); + MA_ASSERT(pDst != NULL); (void)pVFS; result = fread(pDst, 1, sizeInBytes, (FILE*)file); - if (pBytesRead != nullptr) { + if (pBytesRead != NULL) { *pBytesRead = result; } @@ -61452,14 +61452,14 @@ static ma_result ma_default_vfs_write__stdio(ma_vfs* pVFS, ma_vfs_file file, con { size_t result; - MA_ASSERT(file != nullptr); - MA_ASSERT(pSrc != nullptr); + MA_ASSERT(file != NULL); + MA_ASSERT(pSrc != NULL); (void)pVFS; result = fwrite(pSrc, 1, sizeInBytes, (FILE*)file); - if (pBytesWritten != nullptr) { + if (pBytesWritten != NULL) { *pBytesWritten = result; } @@ -61475,7 +61475,7 @@ static ma_result ma_default_vfs_seek__stdio(ma_vfs* pVFS, ma_vfs_file file, ma_i int result; int whence; - MA_ASSERT(file != nullptr); + MA_ASSERT(file != NULL); (void)pVFS; @@ -61512,8 +61512,8 @@ static ma_result ma_default_vfs_tell__stdio(ma_vfs* pVFS, ma_vfs_file file, ma_i { ma_int64 result; - MA_ASSERT(file != nullptr); - MA_ASSERT(pCursor != nullptr); + MA_ASSERT(file != NULL); + MA_ASSERT(pCursor != NULL); (void)pVFS; @@ -61541,8 +61541,8 @@ static ma_result ma_default_vfs_info__stdio(ma_vfs* pVFS, ma_vfs_file file, ma_f int fd; struct stat info; - MA_ASSERT(file != nullptr); - MA_ASSERT(pInfo != nullptr); + MA_ASSERT(file != NULL); + MA_ASSERT(pInfo != NULL); (void)pVFS; @@ -61565,13 +61565,13 @@ static ma_result ma_default_vfs_info__stdio(ma_vfs* pVFS, ma_vfs_file file, ma_f static ma_result ma_default_vfs_open(ma_vfs* pVFS, const char* pFilePath, ma_uint32 openMode, ma_vfs_file* pFile) { - if (pFile == nullptr) { + if (pFile == NULL) { return MA_INVALID_ARGS; } - *pFile = nullptr; + *pFile = NULL; - if (pFilePath == nullptr || openMode == 0) { + if (pFilePath == NULL || openMode == 0) { return MA_INVALID_ARGS; } @@ -61584,13 +61584,13 @@ static ma_result ma_default_vfs_open(ma_vfs* pVFS, const char* pFilePath, ma_uin static ma_result ma_default_vfs_open_w(ma_vfs* pVFS, const wchar_t* pFilePath, ma_uint32 openMode, ma_vfs_file* pFile) { - if (pFile == nullptr) { + if (pFile == NULL) { return MA_INVALID_ARGS; } - *pFile = nullptr; + *pFile = NULL; - if (pFilePath == nullptr || openMode == 0) { + if (pFilePath == NULL || openMode == 0) { return MA_INVALID_ARGS; } @@ -61603,7 +61603,7 @@ static ma_result ma_default_vfs_open_w(ma_vfs* pVFS, const wchar_t* pFilePath, m static ma_result ma_default_vfs_close(ma_vfs* pVFS, ma_vfs_file file) { - if (file == nullptr) { + if (file == NULL) { return MA_INVALID_ARGS; } @@ -61616,11 +61616,11 @@ static ma_result ma_default_vfs_close(ma_vfs* pVFS, ma_vfs_file file) static ma_result ma_default_vfs_read(ma_vfs* pVFS, ma_vfs_file file, void* pDst, size_t sizeInBytes, size_t* pBytesRead) { - if (pBytesRead != nullptr) { + if (pBytesRead != NULL) { *pBytesRead = 0; } - if (file == nullptr || pDst == nullptr) { + if (file == NULL || pDst == NULL) { return MA_INVALID_ARGS; } @@ -61633,11 +61633,11 @@ static ma_result ma_default_vfs_read(ma_vfs* pVFS, ma_vfs_file file, void* pDst, static ma_result ma_default_vfs_write(ma_vfs* pVFS, ma_vfs_file file, const void* pSrc, size_t sizeInBytes, size_t* pBytesWritten) { - if (pBytesWritten != nullptr) { + if (pBytesWritten != NULL) { *pBytesWritten = 0; } - if (file == nullptr || pSrc == nullptr) { + if (file == NULL || pSrc == NULL) { return MA_INVALID_ARGS; } @@ -61650,7 +61650,7 @@ static ma_result ma_default_vfs_write(ma_vfs* pVFS, ma_vfs_file file, const void static ma_result ma_default_vfs_seek(ma_vfs* pVFS, ma_vfs_file file, ma_int64 offset, ma_seek_origin origin) { - if (file == nullptr) { + if (file == NULL) { return MA_INVALID_ARGS; } @@ -61663,13 +61663,13 @@ static ma_result ma_default_vfs_seek(ma_vfs* pVFS, ma_vfs_file file, ma_int64 of static ma_result ma_default_vfs_tell(ma_vfs* pVFS, ma_vfs_file file, ma_int64* pCursor) { - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; - if (file == nullptr) { + if (file == NULL) { return MA_INVALID_ARGS; } @@ -61684,13 +61684,13 @@ static ma_result ma_default_vfs_info(ma_vfs* pVFS, ma_vfs_file file, ma_file_inf { ma_result result; - if (pInfo == nullptr) { + if (pInfo == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pInfo); - if (file == nullptr) { + if (file == NULL) { return MA_INVALID_ARGS; } @@ -61736,7 +61736,7 @@ static ma_result ma_default_vfs_info(ma_vfs* pVFS, ma_vfs_file file, ma_file_inf MA_API ma_result ma_default_vfs_init(ma_default_vfs* pVFS, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pVFS == nullptr) { + if (pVFS == NULL) { return MA_INVALID_ARGS; } @@ -61756,7 +61756,7 @@ MA_API ma_result ma_default_vfs_init(ma_default_vfs* pVFS, const ma_allocation_c MA_API ma_result ma_vfs_or_default_open(ma_vfs* pVFS, const char* pFilePath, ma_uint32 openMode, ma_vfs_file* pFile) { - if (pVFS != nullptr) { + if (pVFS != NULL) { return ma_vfs_open(pVFS, pFilePath, openMode, pFile); } else { return ma_default_vfs_open(pVFS, pFilePath, openMode, pFile); @@ -61765,7 +61765,7 @@ MA_API ma_result ma_vfs_or_default_open(ma_vfs* pVFS, const char* pFilePath, ma_ MA_API ma_result ma_vfs_or_default_open_w(ma_vfs* pVFS, const wchar_t* pFilePath, ma_uint32 openMode, ma_vfs_file* pFile) { - if (pVFS != nullptr) { + if (pVFS != NULL) { return ma_vfs_open_w(pVFS, pFilePath, openMode, pFile); } else { return ma_default_vfs_open_w(pVFS, pFilePath, openMode, pFile); @@ -61774,7 +61774,7 @@ MA_API ma_result ma_vfs_or_default_open_w(ma_vfs* pVFS, const wchar_t* pFilePath MA_API ma_result ma_vfs_or_default_close(ma_vfs* pVFS, ma_vfs_file file) { - if (pVFS != nullptr) { + if (pVFS != NULL) { return ma_vfs_close(pVFS, file); } else { return ma_default_vfs_close(pVFS, file); @@ -61783,7 +61783,7 @@ MA_API ma_result ma_vfs_or_default_close(ma_vfs* pVFS, ma_vfs_file file) MA_API ma_result ma_vfs_or_default_read(ma_vfs* pVFS, ma_vfs_file file, void* pDst, size_t sizeInBytes, size_t* pBytesRead) { - if (pVFS != nullptr) { + if (pVFS != NULL) { return ma_vfs_read(pVFS, file, pDst, sizeInBytes, pBytesRead); } else { return ma_default_vfs_read(pVFS, file, pDst, sizeInBytes, pBytesRead); @@ -61792,7 +61792,7 @@ MA_API ma_result ma_vfs_or_default_read(ma_vfs* pVFS, ma_vfs_file file, void* pD MA_API ma_result ma_vfs_or_default_write(ma_vfs* pVFS, ma_vfs_file file, const void* pSrc, size_t sizeInBytes, size_t* pBytesWritten) { - if (pVFS != nullptr) { + if (pVFS != NULL) { return ma_vfs_write(pVFS, file, pSrc, sizeInBytes, pBytesWritten); } else { return ma_default_vfs_write(pVFS, file, pSrc, sizeInBytes, pBytesWritten); @@ -61801,7 +61801,7 @@ MA_API ma_result ma_vfs_or_default_write(ma_vfs* pVFS, ma_vfs_file file, const v MA_API ma_result ma_vfs_or_default_seek(ma_vfs* pVFS, ma_vfs_file file, ma_int64 offset, ma_seek_origin origin) { - if (pVFS != nullptr) { + if (pVFS != NULL) { return ma_vfs_seek(pVFS, file, offset, origin); } else { return ma_default_vfs_seek(pVFS, file, offset, origin); @@ -61810,7 +61810,7 @@ MA_API ma_result ma_vfs_or_default_seek(ma_vfs* pVFS, ma_vfs_file file, ma_int64 MA_API ma_result ma_vfs_or_default_tell(ma_vfs* pVFS, ma_vfs_file file, ma_int64* pCursor) { - if (pVFS != nullptr) { + if (pVFS != NULL) { return ma_vfs_tell(pVFS, file, pCursor); } else { return ma_default_vfs_tell(pVFS, file, pCursor); @@ -61819,7 +61819,7 @@ MA_API ma_result ma_vfs_or_default_tell(ma_vfs* pVFS, ma_vfs_file file, ma_int64 MA_API ma_result ma_vfs_or_default_info(ma_vfs* pVFS, ma_vfs_file file, ma_file_info* pInfo) { - if (pVFS != nullptr) { + if (pVFS != NULL) { return ma_vfs_info(pVFS, file, pInfo); } else { return ma_default_vfs_info(pVFS, file, pInfo); @@ -61836,18 +61836,18 @@ static ma_result ma_vfs_open_and_read_file_ex(ma_vfs* pVFS, const char* pFilePat void* pData; size_t bytesRead; - if (ppData != nullptr) { - *ppData = nullptr; + if (ppData != NULL) { + *ppData = NULL; } - if (pSize != nullptr) { + if (pSize != NULL) { *pSize = 0; } - if (ppData == nullptr) { + if (ppData == NULL) { return MA_INVALID_ARGS; } - if (pFilePath != nullptr) { + if (pFilePath != NULL) { result = ma_vfs_or_default_open(pVFS, pFilePath, MA_OPEN_MODE_READ, &file); } else { result = ma_vfs_or_default_open_w(pVFS, pFilePathW, MA_OPEN_MODE_READ, &file); @@ -61868,7 +61868,7 @@ static ma_result ma_vfs_open_and_read_file_ex(ma_vfs* pVFS, const char* pFilePat } pData = ma_malloc((size_t)info.sizeInBytes, pAllocationCallbacks); /* Safe cast. */ - if (pData == nullptr) { + if (pData == NULL) { ma_vfs_or_default_close(pVFS, file); return result; } @@ -61881,11 +61881,11 @@ static ma_result ma_vfs_open_and_read_file_ex(ma_vfs* pVFS, const char* pFilePat return result; } - if (pSize != nullptr) { + if (pSize != NULL) { *pSize = bytesRead; } - MA_ASSERT(ppData != nullptr); + MA_ASSERT(ppData != NULL); *ppData = pData; return MA_SUCCESS; @@ -61893,12 +61893,12 @@ static ma_result ma_vfs_open_and_read_file_ex(ma_vfs* pVFS, const char* pFilePat MA_API ma_result ma_vfs_open_and_read_file(ma_vfs* pVFS, const char* pFilePath, void** ppData, size_t* pSize, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_vfs_open_and_read_file_ex(pVFS, pFilePath, nullptr, ppData, pSize, pAllocationCallbacks); + return ma_vfs_open_and_read_file_ex(pVFS, pFilePath, NULL, ppData, pSize, pAllocationCallbacks); } MA_API ma_result ma_vfs_open_and_read_file_w(ma_vfs* pVFS, const wchar_t* pFilePath, void** ppData, size_t* pSize, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_vfs_open_and_read_file_ex(pVFS, nullptr, pFilePath, ppData, pSize, pAllocationCallbacks); + return ma_vfs_open_and_read_file_ex(pVFS, NULL, pFilePath, ppData, pSize, pAllocationCallbacks); } @@ -62821,23 +62821,23 @@ Decoding static ma_result ma_decoder_read_bytes(ma_decoder* pDecoder, void* pBufferOut, size_t bytesToRead, size_t* pBytesRead) { - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pDecoder != NULL); return pDecoder->onRead(pDecoder, pBufferOut, bytesToRead, pBytesRead); } static ma_result ma_decoder_seek_bytes(ma_decoder* pDecoder, ma_int64 byteOffset, ma_seek_origin origin) { - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pDecoder != NULL); return pDecoder->onSeek(pDecoder, byteOffset, origin); } static ma_result ma_decoder_tell_bytes(ma_decoder* pDecoder, ma_int64* pCursor) { - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pDecoder != NULL); - if (pDecoder->onTell == nullptr) { + if (pDecoder->onTell == NULL) { return MA_NOT_IMPLEMENTED; } @@ -62880,7 +62880,7 @@ MA_API ma_decoder_config ma_decoder_config_init_default(void) MA_API ma_decoder_config ma_decoder_config_init_copy(const ma_decoder_config* pConfig) { ma_decoder_config config; - if (pConfig != nullptr) { + if (pConfig != NULL) { config = *pConfig; } else { MA_ZERO_OBJECT(&config); @@ -62898,8 +62898,8 @@ static ma_result ma_decoder__init_data_converter(ma_decoder* pDecoder, const ma_ ma_uint32 internalSampleRate; ma_channel internalChannelMap[MA_MAX_CHANNELS]; - MA_ASSERT(pDecoder != nullptr); - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pDecoder != NULL); + MA_ASSERT(pConfig != NULL); result = ma_data_source_get_data_format(pDecoder->pBackend, &internalFormat, &internalChannels, &internalSampleRate, internalChannelMap, ma_countof(internalChannelMap)); if (result != MA_SUCCESS) { @@ -62980,7 +62980,7 @@ static ma_result ma_decoder__init_data_converter(ma_decoder* pDecoder, const ma_ } pDecoder->pInputCache = ma_malloc((size_t)inputCacheCapSizeInBytes, &pDecoder->allocationCallbacks); /* Safe cast to size_t. */ - if (pDecoder->pInputCache == nullptr) { + if (pDecoder->pInputCache == NULL) { ma_data_converter_uninit(&pDecoder->converter, &pDecoder->allocationCallbacks); return MA_OUT_OF_MEMORY; } @@ -62995,7 +62995,7 @@ static ma_result ma_decoder__init_data_converter(ma_decoder* pDecoder, const ma_ static ma_result ma_decoder_internal_on_read__custom(void* pUserData, void* pBufferOut, size_t bytesToRead, size_t* pBytesRead) { ma_decoder* pDecoder = (ma_decoder*)pUserData; - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pDecoder != NULL); return ma_decoder_read_bytes(pDecoder, pBufferOut, bytesToRead, pBytesRead); } @@ -63003,7 +63003,7 @@ static ma_result ma_decoder_internal_on_read__custom(void* pUserData, void* pBuf static ma_result ma_decoder_internal_on_seek__custom(void* pUserData, ma_int64 offset, ma_seek_origin origin) { ma_decoder* pDecoder = (ma_decoder*)pUserData; - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pDecoder != NULL); return ma_decoder_seek_bytes(pDecoder, offset, origin); } @@ -63011,7 +63011,7 @@ static ma_result ma_decoder_internal_on_seek__custom(void* pUserData, ma_int64 o static ma_result ma_decoder_internal_on_tell__custom(void* pUserData, ma_int64* pCursor) { ma_decoder* pDecoder = (ma_decoder*)pUserData; - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pDecoder != NULL); return ma_decoder_tell_bytes(pDecoder, pCursor); } @@ -63023,11 +63023,11 @@ static ma_result ma_decoder_init_from_vtable__internal(const ma_decoding_backend ma_decoding_backend_config backendConfig; ma_data_source* pBackend; - MA_ASSERT(pVTable != nullptr); - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pVTable != NULL); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDecoder != NULL); - if (pVTable->onInit == nullptr) { + if (pVTable->onInit == NULL) { return MA_NOT_IMPLEMENTED; } @@ -63052,11 +63052,11 @@ static ma_result ma_decoder_init_from_file__internal(const ma_decoding_backend_v ma_decoding_backend_config backendConfig; ma_data_source* pBackend; - MA_ASSERT(pVTable != nullptr); - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pVTable != NULL); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDecoder != NULL); - if (pVTable->onInitFile == nullptr) { + if (pVTable->onInitFile == NULL) { return MA_NOT_IMPLEMENTED; } @@ -63081,11 +63081,11 @@ static ma_result ma_decoder_init_from_file_w__internal(const ma_decoding_backend ma_decoding_backend_config backendConfig; ma_data_source* pBackend; - MA_ASSERT(pVTable != nullptr); - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pVTable != NULL); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDecoder != NULL); - if (pVTable->onInitFileW == nullptr) { + if (pVTable->onInitFileW == NULL) { return MA_NOT_IMPLEMENTED; } @@ -63110,11 +63110,11 @@ static ma_result ma_decoder_init_from_memory__internal(const ma_decoding_backend ma_decoding_backend_config backendConfig; ma_data_source* pBackend; - MA_ASSERT(pVTable != nullptr); - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pVTable != NULL); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDecoder != NULL); - if (pVTable->onInitMemory == nullptr) { + if (pVTable->onInitMemory == NULL) { return MA_NOT_IMPLEMENTED; } @@ -63140,17 +63140,17 @@ static ma_result ma_decoder_init_custom__internal(const ma_decoder_config* pConf ma_result result = MA_NO_BACKEND; size_t ivtable; - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDecoder != NULL); - if (pConfig->ppCustomBackendVTables == nullptr) { + if (pConfig->ppCustomBackendVTables == NULL) { return MA_NO_BACKEND; } /* The order each backend is listed is what defines the priority. */ for (ivtable = 0; ivtable < pConfig->customBackendCount; ivtable += 1) { const ma_decoding_backend_vtable* pVTable = pConfig->ppCustomBackendVTables[ivtable]; - if (pVTable != nullptr) { + if (pVTable != NULL) { result = ma_decoder_init_from_vtable__internal(pVTable, pConfig->pCustomBackendUserData, pConfig, pDecoder); if (result == MA_SUCCESS) { return MA_SUCCESS; @@ -63175,17 +63175,17 @@ static ma_result ma_decoder_init_custom_from_file__internal(const char* pFilePat ma_result result = MA_NO_BACKEND; size_t ivtable; - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDecoder != NULL); - if (pConfig->ppCustomBackendVTables == nullptr) { + if (pConfig->ppCustomBackendVTables == NULL) { return MA_NO_BACKEND; } /* The order each backend is listed is what defines the priority. */ for (ivtable = 0; ivtable < pConfig->customBackendCount; ivtable += 1) { const ma_decoding_backend_vtable* pVTable = pConfig->ppCustomBackendVTables[ivtable]; - if (pVTable != nullptr) { + if (pVTable != NULL) { result = ma_decoder_init_from_file__internal(pVTable, pConfig->pCustomBackendUserData, pFilePath, pConfig, pDecoder); if (result == MA_SUCCESS) { return MA_SUCCESS; @@ -63204,17 +63204,17 @@ static ma_result ma_decoder_init_custom_from_file_w__internal(const wchar_t* pFi ma_result result = MA_NO_BACKEND; size_t ivtable; - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDecoder != NULL); - if (pConfig->ppCustomBackendVTables == nullptr) { + if (pConfig->ppCustomBackendVTables == NULL) { return MA_NO_BACKEND; } /* The order each backend is listed is what defines the priority. */ for (ivtable = 0; ivtable < pConfig->customBackendCount; ivtable += 1) { const ma_decoding_backend_vtable* pVTable = pConfig->ppCustomBackendVTables[ivtable]; - if (pVTable != nullptr) { + if (pVTable != NULL) { result = ma_decoder_init_from_file_w__internal(pVTable, pConfig->pCustomBackendUserData, pFilePath, pConfig, pDecoder); if (result == MA_SUCCESS) { return MA_SUCCESS; @@ -63233,17 +63233,17 @@ static ma_result ma_decoder_init_custom_from_memory__internal(const void* pData, ma_result result = MA_NO_BACKEND; size_t ivtable; - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDecoder != NULL); - if (pConfig->ppCustomBackendVTables == nullptr) { + if (pConfig->ppCustomBackendVTables == NULL) { return MA_NO_BACKEND; } /* The order each backend is listed is what defines the priority. */ for (ivtable = 0; ivtable < pConfig->customBackendCount; ivtable += 1) { const ma_decoding_backend_vtable* pVTable = pConfig->ppCustomBackendVTables[ivtable]; - if (pVTable != nullptr) { + if (pVTable != NULL) { result = ma_decoder_init_from_memory__internal(pVTable, pConfig->pCustomBackendUserData, pData, dataSize, pConfig, pDecoder); if (result == MA_SUCCESS) { return MA_SUCCESS; @@ -63318,7 +63318,7 @@ static ma_data_source_vtable g_ma_wav_ds_vtable = ma_wav_ds_get_data_format, ma_wav_ds_get_cursor, ma_wav_ds_get_length, - nullptr, /* onSetLooping */ + NULL, /* onSetLooping */ 0 }; @@ -63330,7 +63330,7 @@ static size_t ma_wav_dr_callback__read(void* pUserData, void* pBufferOut, size_t ma_result result; size_t bytesRead; - MA_ASSERT(pWav != nullptr); + MA_ASSERT(pWav != NULL); result = pWav->onRead(pWav->pReadSeekTellUserData, pBufferOut, bytesToRead, &bytesRead); (void)result; @@ -63344,7 +63344,7 @@ static ma_bool32 ma_wav_dr_callback__seek(void* pUserData, int offset, ma_dr_wav ma_result result; ma_seek_origin maSeekOrigin; - MA_ASSERT(pWav != nullptr); + MA_ASSERT(pWav != NULL); maSeekOrigin = ma_seek_origin_start; if (origin == MA_DR_WAV_SEEK_CUR) { @@ -63366,10 +63366,10 @@ static ma_bool32 ma_wav_dr_callback__tell(void* pUserData, ma_int64* pCursor) ma_wav* pWav = (ma_wav*)pUserData; ma_result result; - MA_ASSERT(pWav != nullptr); - MA_ASSERT(pCursor != nullptr); + MA_ASSERT(pWav != NULL); + MA_ASSERT(pCursor != NULL); - if (pWav->onTell == nullptr) { + if (pWav->onTell == NULL) { return MA_FALSE; /* Not implemented. */ } @@ -63387,14 +63387,14 @@ static ma_result ma_wav_init_internal(const ma_decoding_backend_config* pConfig, ma_result result; ma_data_source_config dataSourceConfig; - if (pWav == nullptr) { + if (pWav == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pWav); pWav->format = ma_format_unknown; /* Use closest match to source file by default. */ - if (pConfig != nullptr && (pConfig->preferredFormat == ma_format_f32 || pConfig->preferredFormat == ma_format_s16 || pConfig->preferredFormat == ma_format_s32)) { + if (pConfig != NULL && (pConfig->preferredFormat == ma_format_f32 || pConfig->preferredFormat == ma_format_s16 || pConfig->preferredFormat == ma_format_s32)) { pWav->format = pConfig->preferredFormat; } else { /* Getting here means something other than f32 and s16 was specified. Just leave this unset to use the default format. */ @@ -63461,7 +63461,7 @@ MA_API ma_result ma_wav_init(ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_p return result; } - if (onRead == nullptr || onSeek == nullptr) { + if (onRead == NULL || onSeek == NULL) { return MA_INVALID_ARGS; /* onRead and onSeek are mandatory. */ } @@ -63591,7 +63591,7 @@ MA_API ma_result ma_wav_init_memory(const void* pData, size_t dataSize, const ma MA_API void ma_wav_uninit(ma_wav* pWav, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pWav == nullptr) { + if (pWav == NULL) { return; } @@ -63613,7 +63613,7 @@ MA_API void ma_wav_uninit(ma_wav* pWav, const ma_allocation_callbacks* pAllocati MA_API ma_result ma_wav_read_pcm_frames(ma_wav* pWav, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead) { - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -63621,7 +63621,7 @@ MA_API ma_result ma_wav_read_pcm_frames(ma_wav* pWav, void* pFramesOut, ma_uint6 return MA_INVALID_ARGS; } - if (pWav == nullptr) { + if (pWav == NULL) { return MA_INVALID_ARGS; } @@ -63632,7 +63632,7 @@ MA_API ma_result ma_wav_read_pcm_frames(ma_wav* pWav, void* pFramesOut, ma_uint6 ma_uint64 totalFramesRead = 0; ma_format format; - ma_wav_get_data_format(pWav, &format, nullptr, nullptr, nullptr, 0); + ma_wav_get_data_format(pWav, &format, NULL, NULL, NULL, 0); switch (format) { @@ -63664,7 +63664,7 @@ MA_API ma_result ma_wav_read_pcm_frames(ma_wav* pWav, void* pFramesOut, ma_uint6 result = MA_AT_END; } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesRead; } @@ -63690,7 +63690,7 @@ MA_API ma_result ma_wav_read_pcm_frames(ma_wav* pWav, void* pFramesOut, ma_uint6 MA_API ma_result ma_wav_seek_to_pcm_frame(ma_wav* pWav, ma_uint64 frameIndex) { - if (pWav == nullptr) { + if (pWav == NULL) { return MA_INVALID_ARGS; } @@ -63720,38 +63720,38 @@ MA_API ma_result ma_wav_seek_to_pcm_frame(ma_wav* pWav, ma_uint64 frameIndex) MA_API ma_result ma_wav_get_data_format(ma_wav* pWav, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap) { /* Defaults for safety. */ - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = ma_format_unknown; } - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = 0; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = 0; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { MA_ZERO_MEMORY(pChannelMap, sizeof(*pChannelMap) * channelMapCap); } - if (pWav == nullptr) { + if (pWav == NULL) { return MA_INVALID_OPERATION; } - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = pWav->format; } #if !defined(MA_NO_WAV) { - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = pWav->dr.channels; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = pWav->dr.sampleRate; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { ma_channel_map_init_standard(ma_standard_channel_map_microsoft, pChannelMap, channelMapCap, pWav->dr.channels); } @@ -63768,13 +63768,13 @@ MA_API ma_result ma_wav_get_data_format(ma_wav* pWav, ma_format* pFormat, ma_uin MA_API ma_result ma_wav_get_cursor_in_pcm_frames(ma_wav* pWav, ma_uint64* pCursor) { - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; /* Safety. */ - if (pWav == nullptr) { + if (pWav == NULL) { return MA_INVALID_ARGS; } @@ -63798,13 +63798,13 @@ MA_API ma_result ma_wav_get_cursor_in_pcm_frames(ma_wav* pWav, ma_uint64* pCurso MA_API ma_result ma_wav_get_length_in_pcm_frames(ma_wav* pWav, ma_uint64* pLength) { - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } *pLength = 0; /* Safety. */ - if (pWav == nullptr) { + if (pWav == NULL) { return MA_INVALID_ARGS; } @@ -63836,7 +63836,7 @@ static ma_result ma_decoding_backend_init__wav(void* pUserData, ma_read_proc onR /* For now we're just allocating the decoder backend on the heap. */ pWav = (ma_wav*)ma_malloc(sizeof(*pWav), pAllocationCallbacks); - if (pWav == nullptr) { + if (pWav == NULL) { return MA_OUT_OF_MEMORY; } @@ -63860,7 +63860,7 @@ static ma_result ma_decoding_backend_init_file__wav(void* pUserData, const char* /* For now we're just allocating the decoder backend on the heap. */ pWav = (ma_wav*)ma_malloc(sizeof(*pWav), pAllocationCallbacks); - if (pWav == nullptr) { + if (pWav == NULL) { return MA_OUT_OF_MEMORY; } @@ -63884,7 +63884,7 @@ static ma_result ma_decoding_backend_init_file_w__wav(void* pUserData, const wch /* For now we're just allocating the decoder backend on the heap. */ pWav = (ma_wav*)ma_malloc(sizeof(*pWav), pAllocationCallbacks); - if (pWav == nullptr) { + if (pWav == NULL) { return MA_OUT_OF_MEMORY; } @@ -63908,7 +63908,7 @@ static ma_result ma_decoding_backend_init_memory__wav(void* pUserData, const voi /* For now we're just allocating the decoder backend on the heap. */ pWav = (ma_wav*)ma_malloc(sizeof(*pWav), pAllocationCallbacks); - if (pWav == nullptr) { + if (pWav == NULL) { return MA_OUT_OF_MEMORY; } @@ -63944,22 +63944,22 @@ static ma_decoding_backend_vtable g_ma_decoding_backend_vtable_wav = static ma_result ma_decoder_init_wav__internal(const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_vtable__internal(&g_ma_decoding_backend_vtable_wav, nullptr, pConfig, pDecoder); + return ma_decoder_init_from_vtable__internal(&g_ma_decoding_backend_vtable_wav, NULL, pConfig, pDecoder); } static ma_result ma_decoder_init_wav_from_file__internal(const char* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_file__internal(&g_ma_decoding_backend_vtable_wav, nullptr, pFilePath, pConfig, pDecoder); + return ma_decoder_init_from_file__internal(&g_ma_decoding_backend_vtable_wav, NULL, pFilePath, pConfig, pDecoder); } static ma_result ma_decoder_init_wav_from_file_w__internal(const wchar_t* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_file_w__internal(&g_ma_decoding_backend_vtable_wav, nullptr, pFilePath, pConfig, pDecoder); + return ma_decoder_init_from_file_w__internal(&g_ma_decoding_backend_vtable_wav, NULL, pFilePath, pConfig, pDecoder); } static ma_result ma_decoder_init_wav_from_memory__internal(const void* pData, size_t dataSize, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_memory__internal(&g_ma_decoding_backend_vtable_wav, nullptr, pData, dataSize, pConfig, pDecoder); + return ma_decoder_init_from_memory__internal(&g_ma_decoding_backend_vtable_wav, NULL, pData, dataSize, pConfig, pDecoder); } #endif /* ma_dr_wav_h */ @@ -64023,7 +64023,7 @@ static ma_data_source_vtable g_ma_flac_ds_vtable = ma_flac_ds_get_data_format, ma_flac_ds_get_cursor, ma_flac_ds_get_length, - nullptr, /* onSetLooping */ + NULL, /* onSetLooping */ 0 }; @@ -64035,7 +64035,7 @@ static size_t ma_flac_dr_callback__read(void* pUserData, void* pBufferOut, size_ ma_result result; size_t bytesRead; - MA_ASSERT(pFlac != nullptr); + MA_ASSERT(pFlac != NULL); result = pFlac->onRead(pFlac->pReadSeekTellUserData, pBufferOut, bytesToRead, &bytesRead); (void)result; @@ -64049,7 +64049,7 @@ static ma_bool32 ma_flac_dr_callback__seek(void* pUserData, int offset, ma_dr_fl ma_result result; ma_seek_origin maSeekOrigin; - MA_ASSERT(pFlac != nullptr); + MA_ASSERT(pFlac != NULL); maSeekOrigin = ma_seek_origin_start; if (origin == MA_DR_FLAC_SEEK_CUR) { @@ -64071,10 +64071,10 @@ static ma_bool32 ma_flac_dr_callback__tell(void* pUserData, ma_int64* pCursor) ma_flac* pFlac = (ma_flac*)pUserData; ma_result result; - MA_ASSERT(pFlac != nullptr); - MA_ASSERT(pCursor != nullptr); + MA_ASSERT(pFlac != NULL); + MA_ASSERT(pCursor != NULL); - if (pFlac->onTell == nullptr) { + if (pFlac->onTell == NULL) { return MA_FALSE; /* Not implemented. */ } @@ -64092,14 +64092,14 @@ static ma_result ma_flac_init_internal(const ma_decoding_backend_config* pConfig ma_result result; ma_data_source_config dataSourceConfig; - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pFlac); pFlac->format = ma_format_f32; /* f32 by default. */ - if (pConfig != nullptr && (pConfig->preferredFormat == ma_format_f32 || pConfig->preferredFormat == ma_format_s16 || pConfig->preferredFormat == ma_format_s32)) { + if (pConfig != NULL && (pConfig->preferredFormat == ma_format_f32 || pConfig->preferredFormat == ma_format_s16 || pConfig->preferredFormat == ma_format_s32)) { pFlac->format = pConfig->preferredFormat; } else { /* Getting here means something other than f32 and s16 was specified. Just leave this unset to use the default format. */ @@ -64125,7 +64125,7 @@ MA_API ma_result ma_flac_init(ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_ return result; } - if (onRead == nullptr || onSeek == nullptr) { + if (onRead == NULL || onSeek == NULL) { return MA_INVALID_ARGS; /* onRead and onSeek are mandatory. */ } @@ -64137,7 +64137,7 @@ MA_API ma_result ma_flac_init(ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_ #if !defined(MA_NO_FLAC) { pFlac->dr = ma_dr_flac_open(ma_flac_dr_callback__read, ma_flac_dr_callback__seek, ma_flac_dr_callback__tell, pFlac, pAllocationCallbacks); - if (pFlac->dr == nullptr) { + if (pFlac->dr == NULL) { return MA_INVALID_FILE; } @@ -64164,7 +64164,7 @@ MA_API ma_result ma_flac_init_file(const char* pFilePath, const ma_decoding_back #if !defined(MA_NO_FLAC) { pFlac->dr = ma_dr_flac_open_file(pFilePath, pAllocationCallbacks); - if (pFlac->dr == nullptr) { + if (pFlac->dr == NULL) { return MA_INVALID_FILE; } @@ -64192,7 +64192,7 @@ MA_API ma_result ma_flac_init_file_w(const wchar_t* pFilePath, const ma_decoding #if !defined(MA_NO_FLAC) { pFlac->dr = ma_dr_flac_open_file_w(pFilePath, pAllocationCallbacks); - if (pFlac->dr == nullptr) { + if (pFlac->dr == NULL) { return MA_INVALID_FILE; } @@ -64220,7 +64220,7 @@ MA_API ma_result ma_flac_init_memory(const void* pData, size_t dataSize, const m #if !defined(MA_NO_FLAC) { pFlac->dr = ma_dr_flac_open_memory(pData, dataSize, pAllocationCallbacks); - if (pFlac->dr == nullptr) { + if (pFlac->dr == NULL) { return MA_INVALID_FILE; } @@ -64239,7 +64239,7 @@ MA_API ma_result ma_flac_init_memory(const void* pData, size_t dataSize, const m MA_API void ma_flac_uninit(ma_flac* pFlac, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pFlac == nullptr) { + if (pFlac == NULL) { return; } @@ -64261,7 +64261,7 @@ MA_API void ma_flac_uninit(ma_flac* pFlac, const ma_allocation_callbacks* pAlloc MA_API ma_result ma_flac_read_pcm_frames(ma_flac* pFlac, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead) { - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -64269,7 +64269,7 @@ MA_API ma_result ma_flac_read_pcm_frames(ma_flac* pFlac, void* pFramesOut, ma_ui return MA_INVALID_ARGS; } - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_INVALID_ARGS; } @@ -64280,7 +64280,7 @@ MA_API ma_result ma_flac_read_pcm_frames(ma_flac* pFlac, void* pFramesOut, ma_ui ma_uint64 totalFramesRead = 0; ma_format format; - ma_flac_get_data_format(pFlac, &format, nullptr, nullptr, nullptr, 0); + ma_flac_get_data_format(pFlac, &format, NULL, NULL, NULL, 0); switch (format) { @@ -64313,7 +64313,7 @@ MA_API ma_result ma_flac_read_pcm_frames(ma_flac* pFlac, void* pFramesOut, ma_ui result = MA_AT_END; } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesRead; } @@ -64339,7 +64339,7 @@ MA_API ma_result ma_flac_read_pcm_frames(ma_flac* pFlac, void* pFramesOut, ma_ui MA_API ma_result ma_flac_seek_to_pcm_frame(ma_flac* pFlac, ma_uint64 frameIndex) { - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_INVALID_ARGS; } @@ -64369,38 +64369,38 @@ MA_API ma_result ma_flac_seek_to_pcm_frame(ma_flac* pFlac, ma_uint64 frameIndex) MA_API ma_result ma_flac_get_data_format(ma_flac* pFlac, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap) { /* Defaults for safety. */ - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = ma_format_unknown; } - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = 0; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = 0; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { MA_ZERO_MEMORY(pChannelMap, sizeof(*pChannelMap) * channelMapCap); } - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_INVALID_OPERATION; } - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = pFlac->format; } #if !defined(MA_NO_FLAC) { - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = pFlac->dr->channels; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = pFlac->dr->sampleRate; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { ma_channel_map_init_standard(ma_standard_channel_map_microsoft, pChannelMap, channelMapCap, pFlac->dr->channels); } @@ -64417,13 +64417,13 @@ MA_API ma_result ma_flac_get_data_format(ma_flac* pFlac, ma_format* pFormat, ma_ MA_API ma_result ma_flac_get_cursor_in_pcm_frames(ma_flac* pFlac, ma_uint64* pCursor) { - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; /* Safety. */ - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_INVALID_ARGS; } @@ -64444,13 +64444,13 @@ MA_API ma_result ma_flac_get_cursor_in_pcm_frames(ma_flac* pFlac, ma_uint64* pCu MA_API ma_result ma_flac_get_length_in_pcm_frames(ma_flac* pFlac, ma_uint64* pLength) { - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } *pLength = 0; /* Safety. */ - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_INVALID_ARGS; } @@ -64479,7 +64479,7 @@ static ma_result ma_decoding_backend_init__flac(void* pUserData, ma_read_proc on /* For now we're just allocating the decoder backend on the heap. */ pFlac = (ma_flac*)ma_malloc(sizeof(*pFlac), pAllocationCallbacks); - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_OUT_OF_MEMORY; } @@ -64503,7 +64503,7 @@ static ma_result ma_decoding_backend_init_file__flac(void* pUserData, const char /* For now we're just allocating the decoder backend on the heap. */ pFlac = (ma_flac*)ma_malloc(sizeof(*pFlac), pAllocationCallbacks); - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_OUT_OF_MEMORY; } @@ -64527,7 +64527,7 @@ static ma_result ma_decoding_backend_init_file_w__flac(void* pUserData, const wc /* For now we're just allocating the decoder backend on the heap. */ pFlac = (ma_flac*)ma_malloc(sizeof(*pFlac), pAllocationCallbacks); - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_OUT_OF_MEMORY; } @@ -64551,7 +64551,7 @@ static ma_result ma_decoding_backend_init_memory__flac(void* pUserData, const vo /* For now we're just allocating the decoder backend on the heap. */ pFlac = (ma_flac*)ma_malloc(sizeof(*pFlac), pAllocationCallbacks); - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_OUT_OF_MEMORY; } @@ -64587,22 +64587,22 @@ static ma_decoding_backend_vtable g_ma_decoding_backend_vtable_flac = static ma_result ma_decoder_init_flac__internal(const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_vtable__internal(&g_ma_decoding_backend_vtable_flac, nullptr, pConfig, pDecoder); + return ma_decoder_init_from_vtable__internal(&g_ma_decoding_backend_vtable_flac, NULL, pConfig, pDecoder); } static ma_result ma_decoder_init_flac_from_file__internal(const char* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_file__internal(&g_ma_decoding_backend_vtable_flac, nullptr, pFilePath, pConfig, pDecoder); + return ma_decoder_init_from_file__internal(&g_ma_decoding_backend_vtable_flac, NULL, pFilePath, pConfig, pDecoder); } static ma_result ma_decoder_init_flac_from_file_w__internal(const wchar_t* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_file_w__internal(&g_ma_decoding_backend_vtable_flac, nullptr, pFilePath, pConfig, pDecoder); + return ma_decoder_init_from_file_w__internal(&g_ma_decoding_backend_vtable_flac, NULL, pFilePath, pConfig, pDecoder); } static ma_result ma_decoder_init_flac_from_memory__internal(const void* pData, size_t dataSize, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_memory__internal(&g_ma_decoding_backend_vtable_flac, nullptr, pData, dataSize, pConfig, pDecoder); + return ma_decoder_init_from_memory__internal(&g_ma_decoding_backend_vtable_flac, NULL, pData, dataSize, pConfig, pDecoder); } #endif /* ma_dr_flac_h */ @@ -64668,7 +64668,7 @@ static ma_data_source_vtable g_ma_mp3_ds_vtable = ma_mp3_ds_get_data_format, ma_mp3_ds_get_cursor, ma_mp3_ds_get_length, - nullptr, /* onSetLooping */ + NULL, /* onSetLooping */ 0 }; @@ -64680,7 +64680,7 @@ static size_t ma_mp3_dr_callback__read(void* pUserData, void* pBufferOut, size_t ma_result result; size_t bytesRead; - MA_ASSERT(pMP3 != nullptr); + MA_ASSERT(pMP3 != NULL); result = pMP3->onRead(pMP3->pReadSeekTellUserData, pBufferOut, bytesToRead, &bytesRead); (void)result; @@ -64694,7 +64694,7 @@ static ma_bool32 ma_mp3_dr_callback__seek(void* pUserData, int offset, ma_dr_mp3 ma_result result; ma_seek_origin maSeekOrigin; - MA_ASSERT(pMP3 != nullptr); + MA_ASSERT(pMP3 != NULL); if (origin == MA_DR_MP3_SEEK_SET) { maSeekOrigin = ma_seek_origin_start; @@ -64717,7 +64717,7 @@ static ma_bool32 ma_mp3_dr_callback__tell(void* pUserData, ma_int64* pCursor) ma_mp3* pMP3 = (ma_mp3*)pUserData; ma_result result; - MA_ASSERT(pMP3 != nullptr); + MA_ASSERT(pMP3 != NULL); result = pMP3->onTell(pMP3->pReadSeekTellUserData, pCursor); if (result != MA_SUCCESS) { @@ -64733,14 +64733,14 @@ static ma_result ma_mp3_init_internal(const ma_decoding_backend_config* pConfig, ma_result result; ma_data_source_config dataSourceConfig; - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pMP3); pMP3->format = ma_format_f32; /* f32 by default. */ - if (pConfig != nullptr && (pConfig->preferredFormat == ma_format_f32 || pConfig->preferredFormat == ma_format_s16)) { + if (pConfig != NULL && (pConfig->preferredFormat == ma_format_f32 || pConfig->preferredFormat == ma_format_s16)) { pMP3->format = pConfig->preferredFormat; } else { /* Getting here means something other than f32 and s16 was specified. Just leave this unset to use the default format. */ @@ -64761,15 +64761,15 @@ static ma_result ma_mp3_generate_seek_table(ma_mp3* pMP3, const ma_decoding_back { ma_bool32 mp3Result; ma_uint32 seekPointCount = 0; - ma_dr_mp3_seek_point* pSeekPoints = nullptr; + ma_dr_mp3_seek_point* pSeekPoints = NULL; - MA_ASSERT(pMP3 != nullptr); - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pMP3 != NULL); + MA_ASSERT(pConfig != NULL); seekPointCount = pConfig->seekPointCount; if (seekPointCount > 0) { pSeekPoints = (ma_dr_mp3_seek_point*)ma_malloc(sizeof(*pMP3->pSeekPoints) * seekPointCount, pAllocationCallbacks); - if (pSeekPoints == nullptr) { + if (pSeekPoints == NULL) { return MA_OUT_OF_MEMORY; } } @@ -64813,7 +64813,7 @@ MA_API ma_result ma_mp3_init(ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_p return result; } - if (onRead == nullptr || onSeek == nullptr) { + if (onRead == NULL || onSeek == NULL) { return MA_INVALID_ARGS; /* onRead and onSeek are mandatory. */ } @@ -64826,7 +64826,7 @@ MA_API ma_result ma_mp3_init(ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_p { ma_bool32 mp3Result; - mp3Result = ma_dr_mp3_init(&pMP3->dr, ma_mp3_dr_callback__read, ma_mp3_dr_callback__seek, ma_mp3_dr_callback__tell, nullptr, pMP3, pAllocationCallbacks); + mp3Result = ma_dr_mp3_init(&pMP3->dr, ma_mp3_dr_callback__read, ma_mp3_dr_callback__seek, ma_mp3_dr_callback__tell, NULL, pMP3, pAllocationCallbacks); if (mp3Result != MA_TRUE) { return MA_INVALID_FILE; } @@ -64943,7 +64943,7 @@ MA_API ma_result ma_mp3_init_memory(const void* pData, size_t dataSize, const ma MA_API void ma_mp3_uninit(ma_mp3* pMP3, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return; } @@ -64966,7 +64966,7 @@ MA_API void ma_mp3_uninit(ma_mp3* pMP3, const ma_allocation_callbacks* pAllocati MA_API ma_result ma_mp3_read_pcm_frames(ma_mp3* pMP3, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead) { - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -64974,7 +64974,7 @@ MA_API ma_result ma_mp3_read_pcm_frames(ma_mp3* pMP3, void* pFramesOut, ma_uint6 return MA_INVALID_ARGS; } - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_INVALID_ARGS; } @@ -64985,7 +64985,7 @@ MA_API ma_result ma_mp3_read_pcm_frames(ma_mp3* pMP3, void* pFramesOut, ma_uint6 ma_uint64 totalFramesRead = 0; ma_format format; - ma_mp3_get_data_format(pMP3, &format, nullptr, nullptr, nullptr, 0); + ma_mp3_get_data_format(pMP3, &format, NULL, NULL, NULL, 0); switch (format) { @@ -65014,7 +65014,7 @@ MA_API ma_result ma_mp3_read_pcm_frames(ma_mp3* pMP3, void* pFramesOut, ma_uint6 result = MA_AT_END; } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesRead; } @@ -65036,7 +65036,7 @@ MA_API ma_result ma_mp3_read_pcm_frames(ma_mp3* pMP3, void* pFramesOut, ma_uint6 MA_API ma_result ma_mp3_seek_to_pcm_frame(ma_mp3* pMP3, ma_uint64 frameIndex) { - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_INVALID_ARGS; } @@ -65066,38 +65066,38 @@ MA_API ma_result ma_mp3_seek_to_pcm_frame(ma_mp3* pMP3, ma_uint64 frameIndex) MA_API ma_result ma_mp3_get_data_format(ma_mp3* pMP3, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap) { /* Defaults for safety. */ - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = ma_format_unknown; } - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = 0; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = 0; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { MA_ZERO_MEMORY(pChannelMap, sizeof(*pChannelMap) * channelMapCap); } - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_INVALID_OPERATION; } - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = pMP3->format; } #if !defined(MA_NO_MP3) { - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = pMP3->dr.channels; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = pMP3->dr.sampleRate; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pMP3->dr.channels); } @@ -65114,13 +65114,13 @@ MA_API ma_result ma_mp3_get_data_format(ma_mp3* pMP3, ma_format* pFormat, ma_uin MA_API ma_result ma_mp3_get_cursor_in_pcm_frames(ma_mp3* pMP3, ma_uint64* pCursor) { - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; /* Safety. */ - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_INVALID_ARGS; } @@ -65141,13 +65141,13 @@ MA_API ma_result ma_mp3_get_cursor_in_pcm_frames(ma_mp3* pMP3, ma_uint64* pCurso MA_API ma_result ma_mp3_get_length_in_pcm_frames(ma_mp3* pMP3, ma_uint64* pLength) { - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } *pLength = 0; /* Safety. */ - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_INVALID_ARGS; } @@ -65176,7 +65176,7 @@ static ma_result ma_decoding_backend_init__mp3(void* pUserData, ma_read_proc onR /* For now we're just allocating the decoder backend on the heap. */ pMP3 = (ma_mp3*)ma_malloc(sizeof(*pMP3), pAllocationCallbacks); - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_OUT_OF_MEMORY; } @@ -65200,7 +65200,7 @@ static ma_result ma_decoding_backend_init_file__mp3(void* pUserData, const char* /* For now we're just allocating the decoder backend on the heap. */ pMP3 = (ma_mp3*)ma_malloc(sizeof(*pMP3), pAllocationCallbacks); - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_OUT_OF_MEMORY; } @@ -65224,7 +65224,7 @@ static ma_result ma_decoding_backend_init_file_w__mp3(void* pUserData, const wch /* For now we're just allocating the decoder backend on the heap. */ pMP3 = (ma_mp3*)ma_malloc(sizeof(*pMP3), pAllocationCallbacks); - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_OUT_OF_MEMORY; } @@ -65248,7 +65248,7 @@ static ma_result ma_decoding_backend_init_memory__mp3(void* pUserData, const voi /* For now we're just allocating the decoder backend on the heap. */ pMP3 = (ma_mp3*)ma_malloc(sizeof(*pMP3), pAllocationCallbacks); - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_OUT_OF_MEMORY; } @@ -65284,22 +65284,22 @@ static ma_decoding_backend_vtable g_ma_decoding_backend_vtable_mp3 = static ma_result ma_decoder_init_mp3__internal(const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_vtable__internal(&g_ma_decoding_backend_vtable_mp3, nullptr, pConfig, pDecoder); + return ma_decoder_init_from_vtable__internal(&g_ma_decoding_backend_vtable_mp3, NULL, pConfig, pDecoder); } static ma_result ma_decoder_init_mp3_from_file__internal(const char* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_file__internal(&g_ma_decoding_backend_vtable_mp3, nullptr, pFilePath, pConfig, pDecoder); + return ma_decoder_init_from_file__internal(&g_ma_decoding_backend_vtable_mp3, NULL, pFilePath, pConfig, pDecoder); } static ma_result ma_decoder_init_mp3_from_file_w__internal(const wchar_t* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_file_w__internal(&g_ma_decoding_backend_vtable_mp3, nullptr, pFilePath, pConfig, pDecoder); + return ma_decoder_init_from_file_w__internal(&g_ma_decoding_backend_vtable_mp3, NULL, pFilePath, pConfig, pDecoder); } static ma_result ma_decoder_init_mp3_from_memory__internal(const void* pData, size_t dataSize, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_memory__internal(&g_ma_decoding_backend_vtable_mp3, nullptr, pData, dataSize, pConfig, pDecoder); + return ma_decoder_init_from_memory__internal(&g_ma_decoding_backend_vtable_mp3, NULL, pData, dataSize, pConfig, pDecoder); } #endif /* ma_dr_mp3_h */ @@ -65381,7 +65381,7 @@ static ma_data_source_vtable g_ma_stbvorbis_ds_vtable = ma_stbvorbis_ds_get_data_format, ma_stbvorbis_ds_get_cursor, ma_stbvorbis_ds_get_length, - nullptr, /* onSetLooping */ + NULL, /* onSetLooping */ 0 }; @@ -65393,7 +65393,7 @@ static ma_result ma_stbvorbis_init_internal(const ma_decoding_backend_config* pC (void)pConfig; - if (pVorbis == nullptr) { + if (pVorbis == NULL) { return MA_INVALID_ARGS; } @@ -65416,7 +65416,7 @@ static ma_result ma_stbvorbis_post_init(ma_stbvorbis* pVorbis) { stb_vorbis_info info; - MA_ASSERT(pVorbis != nullptr); + MA_ASSERT(pVorbis != NULL); info = stb_vorbis_get_info(pVorbis->stb); @@ -65432,7 +65432,7 @@ static ma_result ma_stbvorbis_init_internal_decoder_push(ma_stbvorbis* pVorbis) stb_vorbis* stb; size_t dataSize = 0; size_t dataCapacity = 0; - ma_uint8* pData = nullptr; /* <-- Must be initialized to nullptr. */ + ma_uint8* pData = NULL; /* <-- Must be initialized to NULL. */ for (;;) { int vorbisError; @@ -65443,7 +65443,7 @@ static ma_result ma_stbvorbis_init_internal_decoder_push(ma_stbvorbis* pVorbis) /* Allocate memory for the new chunk. */ dataCapacity += MA_VORBIS_DATA_CHUNK_SIZE; pNewData = (ma_uint8*)ma_realloc(pData, dataCapacity, &pVorbis->allocationCallbacks); - if (pNewData == nullptr) { + if (pNewData == NULL) { ma_free(pData, &pVorbis->allocationCallbacks); return MA_OUT_OF_MEMORY; } @@ -65465,8 +65465,8 @@ static ma_result ma_stbvorbis_init_internal_decoder_push(ma_stbvorbis* pVorbis) return MA_TOO_BIG; } - stb = stb_vorbis_open_pushdata(pData, (int)dataSize, &consumedDataSize, &vorbisError, nullptr); - if (stb != nullptr) { + stb = stb_vorbis_open_pushdata(pData, (int)dataSize, &consumedDataSize, &vorbisError, NULL); + if (stb != NULL) { /* Successfully opened the Vorbis decoder. We might have some leftover unprocessed data so we'll need to move that down to the front. @@ -65492,7 +65492,7 @@ static ma_result ma_stbvorbis_init_internal_decoder_push(ma_stbvorbis* pVorbis) } } - MA_ASSERT(stb != nullptr); + MA_ASSERT(stb != NULL); pVorbis->stb = stb; pVorbis->push.pData = pData; pVorbis->push.dataSize = dataSize; @@ -65511,7 +65511,7 @@ MA_API ma_result ma_stbvorbis_init(ma_read_proc onRead, ma_seek_proc onSeek, ma_ return result; } - if (onRead == nullptr || onSeek == nullptr) { + if (onRead == NULL || onSeek == NULL) { return MA_INVALID_ARGS; /* onRead and onSeek are mandatory. */ } @@ -65567,8 +65567,8 @@ MA_API ma_result ma_stbvorbis_init_file(const char* pFilePath, const ma_decoding (void)pAllocationCallbacks; /* Don't know how to make use of this with stb_vorbis. */ /* We can use stb_vorbis' pull mode for file based streams. */ - pVorbis->stb = stb_vorbis_open_filename(pFilePath, nullptr, nullptr); - if (pVorbis->stb == nullptr) { + pVorbis->stb = stb_vorbis_open_filename(pFilePath, NULL, NULL); + if (pVorbis->stb == NULL) { return MA_INVALID_FILE; } @@ -65610,8 +65610,8 @@ MA_API ma_result ma_stbvorbis_init_memory(const void* pData, size_t dataSize, co return MA_TOO_BIG; } - pVorbis->stb = stb_vorbis_open_memory((const unsigned char*)pData, (int)dataSize, nullptr, nullptr); - if (pVorbis->stb == nullptr) { + pVorbis->stb = stb_vorbis_open_memory((const unsigned char*)pData, (int)dataSize, NULL, NULL); + if (pVorbis->stb == NULL) { return MA_INVALID_FILE; } @@ -65638,7 +65638,7 @@ MA_API ma_result ma_stbvorbis_init_memory(const void* pData, size_t dataSize, co MA_API void ma_stbvorbis_uninit(ma_stbvorbis* pVorbis, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pVorbis == nullptr) { + if (pVorbis == NULL) { return; } @@ -65663,7 +65663,7 @@ MA_API void ma_stbvorbis_uninit(ma_stbvorbis* pVorbis, const ma_allocation_callb MA_API ma_result ma_stbvorbis_read_pcm_frames(ma_stbvorbis* pVorbis, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead) { - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -65671,7 +65671,7 @@ MA_API ma_result ma_stbvorbis_read_pcm_frames(ma_stbvorbis* pVorbis, void* pFram return MA_INVALID_ARGS; } - if (pVorbis == nullptr) { + if (pVorbis == NULL) { return MA_INVALID_ARGS; } @@ -65683,7 +65683,7 @@ MA_API ma_result ma_stbvorbis_read_pcm_frames(ma_stbvorbis* pVorbis, void* pFram ma_format format; ma_uint32 channels; - ma_stbvorbis_get_data_format(pVorbis, &format, &channels, nullptr, nullptr, 0); + ma_stbvorbis_get_data_format(pVorbis, &format, &channels, NULL, NULL, 0); if (format == ma_format_f32) { /* We read differently depending on whether or not we're using push mode. */ @@ -65696,7 +65696,7 @@ MA_API ma_result ma_stbvorbis_read_pcm_frames(ma_stbvorbis* pVorbis, void* pFram ma_uint32 framesToReadFromCache = (ma_uint32)ma_min(pVorbis->push.framesRemaining, (frameCount - totalFramesRead)); /* Safe cast because pVorbis->framesRemaining is 32-bit. */ /* The output pointer can be null in which case we just treat it as a seek. */ - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { ma_uint64 iFrame; for (iFrame = 0; iFrame < framesToReadFromCache; iFrame += 1) { ma_uint32 iChannel; @@ -65730,7 +65730,7 @@ MA_API ma_result ma_stbvorbis_read_pcm_frames(ma_stbvorbis* pVorbis, void* pFram break; /* Too big. */ } - consumedDataSize = stb_vorbis_decode_frame_pushdata(pVorbis->stb, pVorbis->push.pData, (int)pVorbis->push.dataSize, nullptr, &pVorbis->push.ppPacketData, &samplesRead); + consumedDataSize = stb_vorbis_decode_frame_pushdata(pVorbis->stb, pVorbis->push.pData, (int)pVorbis->push.dataSize, NULL, &pVorbis->push.ppPacketData, &samplesRead); if (consumedDataSize != 0) { /* Successfully decoded a Vorbis frame. Consume the data. */ pVorbis->push.dataSize -= (size_t)consumedDataSize; @@ -65750,7 +65750,7 @@ MA_API ma_result ma_stbvorbis_read_pcm_frames(ma_stbvorbis* pVorbis, void* pFram ma_uint8* pNewData; pNewData = (ma_uint8*)ma_realloc(pVorbis->push.pData, newCap, &pVorbis->allocationCallbacks); - if (pNewData == nullptr) { + if (pNewData == NULL) { result = MA_OUT_OF_MEMORY; break; } @@ -65802,7 +65802,7 @@ MA_API ma_result ma_stbvorbis_read_pcm_frames(ma_stbvorbis* pVorbis, void* pFram result = MA_AT_END; } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesRead; } @@ -65828,7 +65828,7 @@ MA_API ma_result ma_stbvorbis_read_pcm_frames(ma_stbvorbis* pVorbis, void* pFram MA_API ma_result ma_stbvorbis_seek_to_pcm_frame(ma_stbvorbis* pVorbis, ma_uint64 frameIndex) { - if (pVorbis == nullptr) { + if (pVorbis == NULL) { return MA_INVALID_ARGS; } @@ -65918,38 +65918,38 @@ MA_API ma_result ma_stbvorbis_seek_to_pcm_frame(ma_stbvorbis* pVorbis, ma_uint64 MA_API ma_result ma_stbvorbis_get_data_format(ma_stbvorbis* pVorbis, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap) { /* Defaults for safety. */ - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = ma_format_unknown; } - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = 0; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = 0; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { MA_ZERO_MEMORY(pChannelMap, sizeof(*pChannelMap) * channelMapCap); } - if (pVorbis == nullptr) { + if (pVorbis == NULL) { return MA_INVALID_OPERATION; } - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = pVorbis->format; } #if !defined(MA_NO_VORBIS) { - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = pVorbis->channels; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = pVorbis->sampleRate; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { ma_channel_map_init_standard(ma_standard_channel_map_vorbis, pChannelMap, channelMapCap, pVorbis->channels); } @@ -65966,13 +65966,13 @@ MA_API ma_result ma_stbvorbis_get_data_format(ma_stbvorbis* pVorbis, ma_format* MA_API ma_result ma_stbvorbis_get_cursor_in_pcm_frames(ma_stbvorbis* pVorbis, ma_uint64* pCursor) { - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; /* Safety. */ - if (pVorbis == nullptr) { + if (pVorbis == NULL) { return MA_INVALID_ARGS; } @@ -65993,13 +65993,13 @@ MA_API ma_result ma_stbvorbis_get_cursor_in_pcm_frames(ma_stbvorbis* pVorbis, ma MA_API ma_result ma_stbvorbis_get_length_in_pcm_frames(ma_stbvorbis* pVorbis, ma_uint64* pLength) { - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } *pLength = 0; /* Safety. */ - if (pVorbis == nullptr) { + if (pVorbis == NULL) { return MA_INVALID_ARGS; } @@ -66032,7 +66032,7 @@ static ma_result ma_decoding_backend_init__stbvorbis(void* pUserData, ma_read_pr /* For now we're just allocating the decoder backend on the heap. */ pVorbis = (ma_stbvorbis*)ma_malloc(sizeof(*pVorbis), pAllocationCallbacks); - if (pVorbis == nullptr) { + if (pVorbis == NULL) { return MA_OUT_OF_MEMORY; } @@ -66056,7 +66056,7 @@ static ma_result ma_decoding_backend_init_file__stbvorbis(void* pUserData, const /* For now we're just allocating the decoder backend on the heap. */ pVorbis = (ma_stbvorbis*)ma_malloc(sizeof(*pVorbis), pAllocationCallbacks); - if (pVorbis == nullptr) { + if (pVorbis == NULL) { return MA_OUT_OF_MEMORY; } @@ -66080,7 +66080,7 @@ static ma_result ma_decoding_backend_init_memory__stbvorbis(void* pUserData, con /* For now we're just allocating the decoder backend on the heap. */ pVorbis = (ma_stbvorbis*)ma_malloc(sizeof(*pVorbis), pAllocationCallbacks); - if (pVorbis == nullptr) { + if (pVorbis == NULL) { return MA_OUT_OF_MEMORY; } @@ -66109,29 +66109,29 @@ static ma_decoding_backend_vtable g_ma_decoding_backend_vtable_stbvorbis = { ma_decoding_backend_init__stbvorbis, ma_decoding_backend_init_file__stbvorbis, - nullptr, /* onInitFileW() */ + NULL, /* onInitFileW() */ ma_decoding_backend_init_memory__stbvorbis, ma_decoding_backend_uninit__stbvorbis }; static ma_result ma_decoder_init_vorbis__internal(const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_vtable__internal(&g_ma_decoding_backend_vtable_stbvorbis, nullptr, pConfig, pDecoder); + return ma_decoder_init_from_vtable__internal(&g_ma_decoding_backend_vtable_stbvorbis, NULL, pConfig, pDecoder); } static ma_result ma_decoder_init_vorbis_from_file__internal(const char* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_file__internal(&g_ma_decoding_backend_vtable_stbvorbis, nullptr, pFilePath, pConfig, pDecoder); + return ma_decoder_init_from_file__internal(&g_ma_decoding_backend_vtable_stbvorbis, NULL, pFilePath, pConfig, pDecoder); } static ma_result ma_decoder_init_vorbis_from_file_w__internal(const wchar_t* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_file_w__internal(&g_ma_decoding_backend_vtable_stbvorbis, nullptr, pFilePath, pConfig, pDecoder); + return ma_decoder_init_from_file_w__internal(&g_ma_decoding_backend_vtable_stbvorbis, NULL, pFilePath, pConfig, pDecoder); } static ma_result ma_decoder_init_vorbis_from_memory__internal(const void* pData, size_t dataSize, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - return ma_decoder_init_from_memory__internal(&g_ma_decoding_backend_vtable_stbvorbis, nullptr, pData, dataSize, pConfig, pDecoder); + return ma_decoder_init_from_memory__internal(&g_ma_decoding_backend_vtable_stbvorbis, NULL, pData, dataSize, pConfig, pDecoder); } #endif /* STB_VORBIS_INCLUDE_STB_VORBIS_H */ @@ -66139,9 +66139,9 @@ static ma_result ma_decoder_init_vorbis_from_memory__internal(const void* pData, static ma_result ma_decoder__init_allocation_callbacks(const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pDecoder != NULL); - if (pConfig != nullptr) { + if (pConfig != NULL) { return ma_allocation_callbacks_init_copy(&pDecoder->allocationCallbacks, &pConfig->allocationCallbacks); } else { pDecoder->allocationCallbacks = ma_allocation_callbacks_init_default(); @@ -66181,7 +66181,7 @@ static ma_data_source_vtable g_ma_decoder_data_source_vtable = ma_decoder__data_source_on_get_data_format, ma_decoder__data_source_on_get_cursor, ma_decoder__data_source_on_get_length, - nullptr, /* onSetLooping */ + NULL, /* onSetLooping */ 0 }; @@ -66190,9 +66190,9 @@ static ma_result ma_decoder__preinit(ma_decoder_read_proc onRead, ma_decoder_see ma_result result; ma_data_source_config dataSourceConfig; - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pConfig != NULL); - if (pDecoder == nullptr) { + if (pDecoder == NULL) { return MA_INVALID_ARGS; } @@ -66240,8 +66240,8 @@ static ma_result ma_decoder_init__internal(ma_decoder_read_proc onRead, ma_decod { ma_result result = MA_NO_BACKEND; - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDecoder != NULL); /* Silence some warnings in the case that we don't have any decoder backends enabled. */ (void)onRead; @@ -66346,7 +66346,7 @@ MA_API ma_result ma_decoder_init(ma_decoder_read_proc onRead, ma_decoder_seek_pr config = ma_decoder_config_init_copy(pConfig); - result = ma_decoder__preinit(onRead, onSeek, nullptr, pUserData, &config, pDecoder); + result = ma_decoder__preinit(onRead, onSeek, NULL, pUserData, &config, pDecoder); if (result != MA_SUCCESS) { return result; } @@ -66361,7 +66361,7 @@ static ma_result ma_decoder__on_read_memory(ma_decoder* pDecoder, void* pBufferO MA_ASSERT(pDecoder->data.memory.dataSize >= pDecoder->data.memory.currentReadPos); - if (pBytesRead != nullptr) { + if (pBytesRead != NULL) { *pBytesRead = 0; } @@ -66379,7 +66379,7 @@ static ma_result ma_decoder__on_read_memory(ma_decoder* pDecoder, void* pBufferO pDecoder->data.memory.currentReadPos += bytesToRead; } - if (pBytesRead != nullptr) { + if (pBytesRead != NULL) { *pBytesRead = bytesToRead; } @@ -66431,8 +66431,8 @@ static ma_result ma_decoder__on_seek_memory(ma_decoder* pDecoder, ma_int64 byteO static ma_result ma_decoder__on_tell_memory(ma_decoder* pDecoder, ma_int64* pCursor) { - MA_ASSERT(pDecoder != nullptr); - MA_ASSERT(pCursor != nullptr); + MA_ASSERT(pDecoder != NULL); + MA_ASSERT(pCursor != NULL); *pCursor = (ma_int64)pDecoder->data.memory.currentReadPos; @@ -66441,12 +66441,12 @@ static ma_result ma_decoder__on_tell_memory(ma_decoder* pDecoder, ma_int64* pCur static ma_result ma_decoder__preinit_memory_wrapper(const void* pData, size_t dataSize, const ma_decoder_config* pConfig, ma_decoder* pDecoder) { - ma_result result = ma_decoder__preinit(ma_decoder__on_read_memory, ma_decoder__on_seek_memory, ma_decoder__on_tell_memory, nullptr, pConfig, pDecoder); + ma_result result = ma_decoder__preinit(ma_decoder__on_read_memory, ma_decoder__on_seek_memory, ma_decoder__on_tell_memory, NULL, pConfig, pDecoder); if (result != MA_SUCCESS) { return result; } - if (pData == nullptr || dataSize == 0) { + if (pData == NULL || dataSize == 0) { return MA_INVALID_ARGS; } @@ -66465,12 +66465,12 @@ MA_API ma_result ma_decoder_init_memory(const void* pData, size_t dataSize, cons config = ma_decoder_config_init_copy(pConfig); - result = ma_decoder__preinit(nullptr, nullptr, nullptr, nullptr, &config, pDecoder); + result = ma_decoder__preinit(NULL, NULL, NULL, NULL, &config, pDecoder); if (result != MA_SUCCESS) { return result; } - if (pData == nullptr || dataSize == 0) { + if (pData == NULL || dataSize == 0) { return MA_INVALID_ARGS; } @@ -66560,7 +66560,7 @@ MA_API ma_result ma_decoder_init_memory(const void* pData, size_t dataSize, cons return result; } - result = ma_decoder_init__internal(ma_decoder__on_read_memory, ma_decoder__on_seek_memory, nullptr, &config, pDecoder); + result = ma_decoder_init__internal(ma_decoder__on_read_memory, ma_decoder__on_seek_memory, NULL, &config, pDecoder); if (result != MA_SUCCESS) { return result; } @@ -66582,8 +66582,8 @@ static const char* ma_path_file_name(const char* path) { const char* fileName; - if (path == nullptr) { - return nullptr; + if (path == NULL) { + return NULL; } fileName = path; @@ -66609,8 +66609,8 @@ static const wchar_t* ma_path_file_name_w(const wchar_t* path) { const wchar_t* fileName; - if (path == nullptr) { - return nullptr; + if (path == NULL) { + return NULL; } fileName = path; @@ -66638,12 +66638,12 @@ static const char* ma_path_extension(const char* path) const char* extension; const char* lastOccurance; - if (path == nullptr) { + if (path == NULL) { path = ""; } extension = ma_path_file_name(path); - lastOccurance = nullptr; + lastOccurance = NULL; /* Just find the last '.' and return. */ while (extension[0] != '\0') { @@ -66655,7 +66655,7 @@ static const char* ma_path_extension(const char* path) extension += 1; } - return (lastOccurance != nullptr) ? lastOccurance : extension; + return (lastOccurance != NULL) ? lastOccurance : extension; } static const wchar_t* ma_path_extension_w(const wchar_t* path) @@ -66663,12 +66663,12 @@ static const wchar_t* ma_path_extension_w(const wchar_t* path) const wchar_t* extension; const wchar_t* lastOccurance; - if (path == nullptr) { + if (path == NULL) { path = L""; } extension = ma_path_file_name_w(path); - lastOccurance = nullptr; + lastOccurance = NULL; /* Just find the last '.' and return. */ while (extension[0] != '\0') { @@ -66680,7 +66680,7 @@ static const wchar_t* ma_path_extension_w(const wchar_t* path) extension += 1; } - return (lastOccurance != nullptr) ? lastOccurance : extension; + return (lastOccurance != NULL) ? lastOccurance : extension; } @@ -66689,7 +66689,7 @@ static ma_bool32 ma_path_extension_equal(const char* path, const char* extension const char* ext1; const char* ext2; - if (path == nullptr || extension == nullptr) { + if (path == NULL || extension == NULL) { return MA_FALSE; } @@ -66708,7 +66708,7 @@ static ma_bool32 ma_path_extension_equal_w(const wchar_t* path, const wchar_t* e const wchar_t* ext1; const wchar_t* ext2; - if (path == nullptr || extension == nullptr) { + if (path == NULL || extension == NULL) { return MA_FALSE; } @@ -66758,22 +66758,22 @@ static ma_bool32 ma_path_extension_equal_w(const wchar_t* path, const wchar_t* e static ma_result ma_decoder__on_read_vfs(ma_decoder* pDecoder, void* pBufferOut, size_t bytesToRead, size_t* pBytesRead) { - MA_ASSERT(pDecoder != nullptr); - MA_ASSERT(pBufferOut != nullptr); + MA_ASSERT(pDecoder != NULL); + MA_ASSERT(pBufferOut != NULL); return ma_vfs_or_default_read(pDecoder->data.vfs.pVFS, pDecoder->data.vfs.file, pBufferOut, bytesToRead, pBytesRead); } static ma_result ma_decoder__on_seek_vfs(ma_decoder* pDecoder, ma_int64 offset, ma_seek_origin origin) { - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pDecoder != NULL); return ma_vfs_or_default_seek(pDecoder->data.vfs.pVFS, pDecoder->data.vfs.file, offset, origin); } static ma_result ma_decoder__on_tell_vfs(ma_decoder* pDecoder, ma_int64* pCursor) { - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pDecoder != NULL); return ma_vfs_or_default_tell(pDecoder->data.vfs.pVFS, pDecoder->data.vfs.file, pCursor); } @@ -66783,12 +66783,12 @@ static ma_result ma_decoder__preinit_vfs(ma_vfs* pVFS, const char* pFilePath, co ma_result result; ma_vfs_file file; - result = ma_decoder__preinit(ma_decoder__on_read_vfs, ma_decoder__on_seek_vfs, ma_decoder__on_tell_vfs, nullptr, pConfig, pDecoder); + result = ma_decoder__preinit(ma_decoder__on_read_vfs, ma_decoder__on_seek_vfs, ma_decoder__on_tell_vfs, NULL, pConfig, pDecoder); if (result != MA_SUCCESS) { return result; } - if (pFilePath == nullptr || pFilePath[0] == '\0') { + if (pFilePath == NULL || pFilePath[0] == '\0') { return MA_INVALID_ARGS; } @@ -66892,13 +66892,13 @@ MA_API ma_result ma_decoder_init_vfs(ma_vfs* pVFS, const char* pFilePath, const /* If we still haven't got a result just use trial and error. Otherwise we can finish up. */ if (result != MA_SUCCESS) { - result = ma_decoder_init__internal(ma_decoder__on_read_vfs, ma_decoder__on_seek_vfs, nullptr, &config, pDecoder); + result = ma_decoder_init__internal(ma_decoder__on_read_vfs, ma_decoder__on_seek_vfs, NULL, &config, pDecoder); } else { result = ma_decoder__postinit(&config, pDecoder); } if (result != MA_SUCCESS) { - if (pDecoder->data.vfs.file != nullptr) { /* <-- Will be reset to nullptr if ma_decoder_uninit() is called in one of the steps above which allows us to avoid a double close of the file. */ + if (pDecoder->data.vfs.file != NULL) { /* <-- Will be reset to NULL if ma_decoder_uninit() is called in one of the steps above which allows us to avoid a double close of the file. */ ma_vfs_or_default_close(pVFS, pDecoder->data.vfs.file); } @@ -66914,12 +66914,12 @@ static ma_result ma_decoder__preinit_vfs_w(ma_vfs* pVFS, const wchar_t* pFilePat ma_result result; ma_vfs_file file; - result = ma_decoder__preinit(ma_decoder__on_read_vfs, ma_decoder__on_seek_vfs, ma_decoder__on_tell_vfs, nullptr, pConfig, pDecoder); + result = ma_decoder__preinit(ma_decoder__on_read_vfs, ma_decoder__on_seek_vfs, ma_decoder__on_tell_vfs, NULL, pConfig, pDecoder); if (result != MA_SUCCESS) { return result; } - if (pFilePath == nullptr || pFilePath[0] == '\0') { + if (pFilePath == NULL || pFilePath[0] == '\0') { return MA_INVALID_ARGS; } @@ -67023,7 +67023,7 @@ MA_API ma_result ma_decoder_init_vfs_w(ma_vfs* pVFS, const wchar_t* pFilePath, c /* If we still haven't got a result just use trial and error. Otherwise we can finish up. */ if (result != MA_SUCCESS) { - result = ma_decoder_init__internal(ma_decoder__on_read_vfs, ma_decoder__on_seek_vfs, nullptr, &config, pDecoder); + result = ma_decoder_init__internal(ma_decoder__on_read_vfs, ma_decoder__on_seek_vfs, NULL, &config, pDecoder); } else { result = ma_decoder__postinit(&config, pDecoder); } @@ -67041,12 +67041,12 @@ static ma_result ma_decoder__preinit_file(const char* pFilePath, const ma_decode { ma_result result; - result = ma_decoder__preinit(nullptr, nullptr, nullptr, nullptr, pConfig, pDecoder); + result = ma_decoder__preinit(NULL, NULL, NULL, NULL, pConfig, pDecoder); if (result != MA_SUCCESS) { return result; } - if (pFilePath == nullptr || pFilePath[0] == '\0') { + if (pFilePath == NULL || pFilePath[0] == '\0') { return MA_INVALID_ARGS; } @@ -67170,7 +67170,7 @@ MA_API ma_result ma_decoder_init_file(const char* pFilePath, const ma_decoder_co } } else { /* Probably no implementation for loading from a file path. Use miniaudio's file IO instead. */ - result = ma_decoder_init_vfs(nullptr, pFilePath, pConfig, pDecoder); + result = ma_decoder_init_vfs(NULL, pFilePath, pConfig, pDecoder); if (result != MA_SUCCESS) { return result; } @@ -67183,12 +67183,12 @@ static ma_result ma_decoder__preinit_file_w(const wchar_t* pFilePath, const ma_d { ma_result result; - result = ma_decoder__preinit(nullptr, nullptr, nullptr, nullptr, pConfig, pDecoder); + result = ma_decoder__preinit(NULL, NULL, NULL, NULL, pConfig, pDecoder); if (result != MA_SUCCESS) { return result; } - if (pFilePath == nullptr || pFilePath[0] == '\0') { + if (pFilePath == NULL || pFilePath[0] == '\0') { return MA_INVALID_ARGS; } @@ -67312,7 +67312,7 @@ MA_API ma_result ma_decoder_init_file_w(const wchar_t* pFilePath, const ma_decod } } else { /* Probably no implementation for loading from a file path. Use miniaudio's file IO instead. */ - result = ma_decoder_init_vfs_w(nullptr, pFilePath, pConfig, pDecoder); + result = ma_decoder_init_vfs_w(NULL, pFilePath, pConfig, pDecoder); if (result != MA_SUCCESS) { return result; } @@ -67323,25 +67323,25 @@ MA_API ma_result ma_decoder_init_file_w(const wchar_t* pFilePath, const ma_decod MA_API ma_result ma_decoder_uninit(ma_decoder* pDecoder) { - if (pDecoder == nullptr) { + if (pDecoder == NULL) { return MA_INVALID_ARGS; } - if (pDecoder->pBackend != nullptr) { - if (pDecoder->pBackendVTable != nullptr && pDecoder->pBackendVTable->onUninit != nullptr) { + if (pDecoder->pBackend != NULL) { + if (pDecoder->pBackendVTable != NULL && pDecoder->pBackendVTable->onUninit != NULL) { pDecoder->pBackendVTable->onUninit(pDecoder->pBackendUserData, pDecoder->pBackend, &pDecoder->allocationCallbacks); } } if (pDecoder->onRead == ma_decoder__on_read_vfs) { ma_vfs_or_default_close(pDecoder->data.vfs.pVFS, pDecoder->data.vfs.file); - pDecoder->data.vfs.file = nullptr; + pDecoder->data.vfs.file = NULL; } ma_data_converter_uninit(&pDecoder->converter, &pDecoder->allocationCallbacks); ma_data_source_uninit(&pDecoder->ds); - if (pDecoder->pInputCache != nullptr) { + if (pDecoder->pInputCache != NULL) { ma_free(pDecoder->pInputCache, &pDecoder->allocationCallbacks); } @@ -67354,7 +67354,7 @@ MA_API ma_result ma_decoder_read_pcm_frames(ma_decoder* pDecoder, void* pFramesO ma_uint64 totalFramesReadOut; void* pRunningFramesOut; - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; /* Safety. */ } @@ -67362,11 +67362,11 @@ MA_API ma_result ma_decoder_read_pcm_frames(ma_decoder* pDecoder, void* pFramesO return MA_INVALID_ARGS; } - if (pDecoder == nullptr) { + if (pDecoder == NULL) { return MA_INVALID_ARGS; } - if (pDecoder->pBackend == nullptr) { + if (pDecoder->pBackend == NULL) { return MA_INVALID_OPERATION; } @@ -67378,8 +67378,8 @@ MA_API ma_result ma_decoder_read_pcm_frames(ma_decoder* pDecoder, void* pFramesO Getting here means we need to do data conversion. If we're seeking forward and are _not_ doing resampling we can run this in a fast path. If we're doing resampling we need to run through each sample because we need to ensure its internal cache is updated. */ - if (pFramesOut == nullptr && pDecoder->converter.hasResampler == MA_FALSE) { - result = ma_data_source_read_pcm_frames(pDecoder->pBackend, nullptr, frameCount, &totalFramesReadOut); + if (pFramesOut == NULL && pDecoder->converter.hasResampler == MA_FALSE) { + result = ma_data_source_read_pcm_frames(pDecoder->pBackend, NULL, frameCount, &totalFramesReadOut); } else { /* Slow path. Need to run everything through the data converter. */ ma_format internalFormat; @@ -67388,7 +67388,7 @@ MA_API ma_result ma_decoder_read_pcm_frames(ma_decoder* pDecoder, void* pFramesO totalFramesReadOut = 0; pRunningFramesOut = pFramesOut; - result = ma_data_source_get_data_format(pDecoder->pBackend, &internalFormat, &internalChannels, nullptr, nullptr, 0); + result = ma_data_source_get_data_format(pDecoder->pBackend, &internalFormat, &internalChannels, NULL, NULL, 0); if (result != MA_SUCCESS) { return result; /* Failed to retrieve the internal format and channel count. */ } @@ -67399,7 +67399,7 @@ MA_API ma_result ma_decoder_read_pcm_frames(ma_decoder* pDecoder, void* pFramesO the required number of input frames, we'll use the heap-allocated path. Otherwise we'll use the stack-allocated path. */ - if (pDecoder->pInputCache != nullptr) { + if (pDecoder->pInputCache != NULL) { /* We don't have a way of determining the required number of input frames, so need to persistently store input data in a cache. */ while (totalFramesReadOut < frameCount) { ma_uint64 framesToReadThisIterationIn; @@ -67423,7 +67423,7 @@ MA_API ma_result ma_decoder_read_pcm_frames(ma_decoder* pDecoder, void* pFramesO totalFramesReadOut += framesToReadThisIterationOut; - if (pRunningFramesOut != nullptr) { + if (pRunningFramesOut != NULL) { pRunningFramesOut = ma_offset_ptr(pRunningFramesOut, framesToReadThisIterationOut * ma_get_bytes_per_frame(pDecoder->outputFormat, pDecoder->outputChannels)); } @@ -67491,7 +67491,7 @@ MA_API ma_result ma_decoder_read_pcm_frames(ma_decoder* pDecoder, void* pFramesO totalFramesReadOut += framesReadThisIterationOut; - if (pRunningFramesOut != nullptr) { + if (pRunningFramesOut != NULL) { pRunningFramesOut = ma_offset_ptr(pRunningFramesOut, framesReadThisIterationOut * ma_get_bytes_per_frame(pDecoder->outputFormat, pDecoder->outputChannels)); } @@ -67505,7 +67505,7 @@ MA_API ma_result ma_decoder_read_pcm_frames(ma_decoder* pDecoder, void* pFramesO pDecoder->readPointerInPCMFrames += totalFramesReadOut; - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesReadOut; } @@ -67518,17 +67518,17 @@ MA_API ma_result ma_decoder_read_pcm_frames(ma_decoder* pDecoder, void* pFramesO MA_API ma_result ma_decoder_seek_to_pcm_frame(ma_decoder* pDecoder, ma_uint64 frameIndex) { - if (pDecoder == nullptr) { + if (pDecoder == NULL) { return MA_INVALID_ARGS; } - if (pDecoder->pBackend != nullptr) { + if (pDecoder->pBackend != NULL) { ma_result result; ma_uint64 internalFrameIndex; ma_uint32 internalSampleRate; ma_uint64 currentFrameIndex; - result = ma_data_source_get_data_format(pDecoder->pBackend, nullptr, nullptr, &internalSampleRate, nullptr, 0); + result = ma_data_source_get_data_format(pDecoder->pBackend, NULL, NULL, &internalSampleRate, NULL, 0); if (result != MA_SUCCESS) { return result; /* Failed to retrieve the internal sample rate. */ } @@ -67560,23 +67560,23 @@ MA_API ma_result ma_decoder_seek_to_pcm_frame(ma_decoder* pDecoder, ma_uint64 fr MA_API ma_result ma_decoder_get_data_format(ma_decoder* pDecoder, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap) { - if (pDecoder == nullptr) { + if (pDecoder == NULL) { return MA_INVALID_ARGS; } - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = pDecoder->outputFormat; } - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = pDecoder->outputChannels; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = pDecoder->outputSampleRate; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { ma_data_converter_get_output_channel_map(&pDecoder->converter, pChannelMap, channelMapCap); } @@ -67585,13 +67585,13 @@ MA_API ma_result ma_decoder_get_data_format(ma_decoder* pDecoder, ma_format* pFo MA_API ma_result ma_decoder_get_cursor_in_pcm_frames(ma_decoder* pDecoder, ma_uint64* pCursor) { - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; - if (pDecoder == nullptr) { + if (pDecoder == NULL) { return MA_INVALID_ARGS; } @@ -67602,17 +67602,17 @@ MA_API ma_result ma_decoder_get_cursor_in_pcm_frames(ma_decoder* pDecoder, ma_ui MA_API ma_result ma_decoder_get_length_in_pcm_frames(ma_decoder* pDecoder, ma_uint64* pLength) { - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } *pLength = 0; - if (pDecoder == nullptr) { + if (pDecoder == NULL) { return MA_INVALID_ARGS; } - if (pDecoder->pBackend != nullptr) { + if (pDecoder->pBackend != NULL) { ma_result result; ma_uint64 internalLengthInPCMFrames; ma_uint32 internalSampleRate; @@ -67622,7 +67622,7 @@ MA_API ma_result ma_decoder_get_length_in_pcm_frames(ma_decoder* pDecoder, ma_ui return result; /* Failed to retrieve the internal length. */ } - result = ma_data_source_get_data_format(pDecoder->pBackend, nullptr, nullptr, &internalSampleRate, nullptr, 0); + result = ma_data_source_get_data_format(pDecoder->pBackend, NULL, NULL, &internalSampleRate, NULL, 0); if (result != MA_SUCCESS) { return result; /* Failed to retrieve the internal sample rate. */ } @@ -67644,13 +67644,13 @@ MA_API ma_result ma_decoder_get_available_frames(ma_decoder* pDecoder, ma_uint64 ma_result result; ma_uint64 totalFrameCount; - if (pAvailableFrames == nullptr) { + if (pAvailableFrames == NULL) { return MA_INVALID_ARGS; } *pAvailableFrames = 0; - if (pDecoder == nullptr) { + if (pDecoder == NULL) { return MA_INVALID_ARGS; } @@ -67677,14 +67677,14 @@ static ma_result ma_decoder__full_decode_and_uninit(ma_decoder* pDecoder, ma_dec ma_uint64 dataCapInFrames; void* pPCMFramesOut; - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pDecoder != NULL); totalFrameCount = 0; bpf = ma_get_bytes_per_frame(pDecoder->outputFormat, pDecoder->outputChannels); /* The frame count is unknown until we try reading. Thus, we just run in a loop. */ dataCapInFrames = 0; - pPCMFramesOut = nullptr; + pPCMFramesOut = NULL; for (;;) { ma_uint64 frameCountToTryReading; ma_uint64 framesJustRead; @@ -67703,7 +67703,7 @@ static ma_result ma_decoder__full_decode_and_uninit(ma_decoder* pDecoder, ma_dec } pNewPCMFramesOut = (void*)ma_realloc(pPCMFramesOut, (size_t)(newDataCapInFrames * bpf), &pDecoder->allocationCallbacks); - if (pNewPCMFramesOut == nullptr) { + if (pNewPCMFramesOut == NULL) { ma_free(pPCMFramesOut, &pDecoder->allocationCallbacks); return MA_OUT_OF_MEMORY; } @@ -67728,19 +67728,19 @@ static ma_result ma_decoder__full_decode_and_uninit(ma_decoder* pDecoder, ma_dec } - if (pConfigOut != nullptr) { + if (pConfigOut != NULL) { pConfigOut->format = pDecoder->outputFormat; pConfigOut->channels = pDecoder->outputChannels; pConfigOut->sampleRate = pDecoder->outputSampleRate; } - if (ppPCMFramesOut != nullptr) { + if (ppPCMFramesOut != NULL) { *ppPCMFramesOut = pPCMFramesOut; } else { ma_free(pPCMFramesOut, &pDecoder->allocationCallbacks); } - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { *pFrameCountOut = totalFrameCount; } @@ -67754,11 +67754,11 @@ MA_API ma_result ma_decode_from_vfs(ma_vfs* pVFS, const char* pFilePath, ma_deco ma_decoder_config config; ma_decoder decoder; - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { *pFrameCountOut = 0; } - if (ppPCMFramesOut != nullptr) { - *ppPCMFramesOut = nullptr; + if (ppPCMFramesOut != NULL) { + *ppPCMFramesOut = NULL; } config = ma_decoder_config_init_copy(pConfig); @@ -67775,7 +67775,7 @@ MA_API ma_result ma_decode_from_vfs(ma_vfs* pVFS, const char* pFilePath, ma_deco MA_API ma_result ma_decode_file(const char* pFilePath, ma_decoder_config* pConfig, ma_uint64* pFrameCountOut, void** ppPCMFramesOut) { - return ma_decode_from_vfs(nullptr, pFilePath, pConfig, pFrameCountOut, ppPCMFramesOut); + return ma_decode_from_vfs(NULL, pFilePath, pConfig, pFrameCountOut, ppPCMFramesOut); } MA_API ma_result ma_decode_memory(const void* pData, size_t dataSize, ma_decoder_config* pConfig, ma_uint64* pFrameCountOut, void** ppPCMFramesOut) @@ -67784,14 +67784,14 @@ MA_API ma_result ma_decode_memory(const void* pData, size_t dataSize, ma_decoder ma_decoder decoder; ma_result result; - if (pFrameCountOut != nullptr) { + if (pFrameCountOut != NULL) { *pFrameCountOut = 0; } - if (ppPCMFramesOut != nullptr) { - *ppPCMFramesOut = nullptr; + if (ppPCMFramesOut != NULL) { + *ppPCMFramesOut = NULL; } - if (pData == nullptr || dataSize == 0) { + if (pData == NULL || dataSize == 0) { return MA_INVALID_ARGS; } @@ -67815,7 +67815,7 @@ static size_t ma_encoder__internal_on_write_wav(void* pUserData, const void* pDa ma_encoder* pEncoder = (ma_encoder*)pUserData; size_t bytesWritten = 0; - MA_ASSERT(pEncoder != nullptr); + MA_ASSERT(pEncoder != NULL); pEncoder->onWrite(pEncoder, pData, bytesToWrite, &bytesWritten); return bytesWritten; @@ -67827,7 +67827,7 @@ static ma_bool32 ma_encoder__internal_on_seek_wav(void* pUserData, int offset, m ma_result result; ma_seek_origin maSeekOrigin; - MA_ASSERT(pEncoder != nullptr); + MA_ASSERT(pEncoder != NULL); maSeekOrigin = ma_seek_origin_start; if (origin == MA_DR_WAV_SEEK_CUR) { @@ -67850,10 +67850,10 @@ static ma_result ma_encoder__on_init_wav(ma_encoder* pEncoder) ma_allocation_callbacks allocationCallbacks; ma_dr_wav* pWav; - MA_ASSERT(pEncoder != nullptr); + MA_ASSERT(pEncoder != NULL); pWav = (ma_dr_wav*)ma_malloc(sizeof(*pWav), &pEncoder->config.allocationCallbacks); - if (pWav == nullptr) { + if (pWav == NULL) { return MA_OUT_OF_MEMORY; } @@ -67885,10 +67885,10 @@ static void ma_encoder__on_uninit_wav(ma_encoder* pEncoder) { ma_dr_wav* pWav; - MA_ASSERT(pEncoder != nullptr); + MA_ASSERT(pEncoder != NULL); pWav = (ma_dr_wav*)pEncoder->pInternalEncoder; - MA_ASSERT(pWav != nullptr); + MA_ASSERT(pWav != NULL); ma_dr_wav_uninit(pWav); ma_free(pWav, &pEncoder->config.allocationCallbacks); @@ -67899,14 +67899,14 @@ static ma_result ma_encoder__on_write_pcm_frames_wav(ma_encoder* pEncoder, const ma_dr_wav* pWav; ma_uint64 framesWritten; - MA_ASSERT(pEncoder != nullptr); + MA_ASSERT(pEncoder != NULL); pWav = (ma_dr_wav*)pEncoder->pInternalEncoder; - MA_ASSERT(pWav != nullptr); + MA_ASSERT(pWav != NULL); framesWritten = ma_dr_wav_write_pcm_frames(pWav, frameCount, pFramesIn); - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = framesWritten; } @@ -67931,13 +67931,13 @@ MA_API ma_result ma_encoder_preinit(const ma_encoder_config* pConfig, ma_encoder { ma_result result; - if (pEncoder == nullptr) { + if (pEncoder == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pEncoder); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -67960,9 +67960,9 @@ MA_API ma_result ma_encoder_init__internal(ma_encoder_write_proc onWrite, ma_enc ma_result result = MA_SUCCESS; /* This assumes ma_encoder_preinit() has been called prior. */ - MA_ASSERT(pEncoder != nullptr); + MA_ASSERT(pEncoder != NULL); - if (onWrite == nullptr || onSeek == nullptr) { + if (onWrite == NULL || onSeek == NULL) { return MA_INVALID_ARGS; } @@ -68026,7 +68026,7 @@ MA_API ma_result ma_encoder_init_vfs(ma_vfs* pVFS, const char* pFilePath, const pEncoder->data.vfs.pVFS = pVFS; pEncoder->data.vfs.file = file; - result = ma_encoder_init__internal(ma_encoder__on_write_vfs, ma_encoder__on_seek_vfs, nullptr, pEncoder); + result = ma_encoder_init__internal(ma_encoder__on_write_vfs, ma_encoder__on_seek_vfs, NULL, pEncoder); if (result != MA_SUCCESS) { ma_vfs_or_default_close(pVFS, file); return result; @@ -68054,7 +68054,7 @@ MA_API ma_result ma_encoder_init_vfs_w(ma_vfs* pVFS, const wchar_t* pFilePath, c pEncoder->data.vfs.pVFS = pVFS; pEncoder->data.vfs.file = file; - result = ma_encoder_init__internal(ma_encoder__on_write_vfs, ma_encoder__on_seek_vfs, nullptr, pEncoder); + result = ma_encoder_init__internal(ma_encoder__on_write_vfs, ma_encoder__on_seek_vfs, NULL, pEncoder); if (result != MA_SUCCESS) { ma_vfs_or_default_close(pVFS, file); return result; @@ -68065,12 +68065,12 @@ MA_API ma_result ma_encoder_init_vfs_w(ma_vfs* pVFS, const wchar_t* pFilePath, c MA_API ma_result ma_encoder_init_file(const char* pFilePath, const ma_encoder_config* pConfig, ma_encoder* pEncoder) { - return ma_encoder_init_vfs(nullptr, pFilePath, pConfig, pEncoder); + return ma_encoder_init_vfs(NULL, pFilePath, pConfig, pEncoder); } MA_API ma_result ma_encoder_init_file_w(const wchar_t* pFilePath, const ma_encoder_config* pConfig, ma_encoder* pEncoder) { - return ma_encoder_init_vfs_w(nullptr, pFilePath, pConfig, pEncoder); + return ma_encoder_init_vfs_w(NULL, pFilePath, pConfig, pEncoder); } MA_API ma_result ma_encoder_init(ma_encoder_write_proc onWrite, ma_encoder_seek_proc onSeek, void* pUserData, const ma_encoder_config* pConfig, ma_encoder* pEncoder) @@ -68088,7 +68088,7 @@ MA_API ma_result ma_encoder_init(ma_encoder_write_proc onWrite, ma_encoder_seek_ MA_API void ma_encoder_uninit(ma_encoder* pEncoder) { - if (pEncoder == nullptr) { + if (pEncoder == NULL) { return; } @@ -68099,18 +68099,18 @@ MA_API void ma_encoder_uninit(ma_encoder* pEncoder) /* If we have a file handle, close it. */ if (pEncoder->onWrite == ma_encoder__on_write_vfs) { ma_vfs_or_default_close(pEncoder->data.vfs.pVFS, pEncoder->data.vfs.file); - pEncoder->data.vfs.file = nullptr; + pEncoder->data.vfs.file = NULL; } } MA_API ma_result ma_encoder_write_pcm_frames(ma_encoder* pEncoder, const void* pFramesIn, ma_uint64 frameCount, ma_uint64* pFramesWritten) { - if (pFramesWritten != nullptr) { + if (pFramesWritten != NULL) { *pFramesWritten = 0; } - if (pEncoder == nullptr || pFramesIn == nullptr) { + if (pEncoder == NULL || pFramesIn == NULL) { return MA_INVALID_ARGS; } @@ -68188,8 +68188,8 @@ static ma_data_source_vtable g_ma_waveform_data_source_vtable = ma_waveform__data_source_on_seek, ma_waveform__data_source_on_get_data_format, ma_waveform__data_source_on_get_cursor, - nullptr, /* onGetLength. There's no notion of a length in waveforms. */ - nullptr, /* onSetLooping */ + NULL, /* onGetLength. There's no notion of a length in waveforms. */ + NULL, /* onSetLooping */ 0 }; @@ -68198,7 +68198,7 @@ MA_API ma_result ma_waveform_init(const ma_waveform_config* pConfig, ma_waveform ma_result result; ma_data_source_config dataSourceConfig; - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68221,7 +68221,7 @@ MA_API ma_result ma_waveform_init(const ma_waveform_config* pConfig, ma_waveform MA_API void ma_waveform_uninit(ma_waveform* pWaveform) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return; } @@ -68230,7 +68230,7 @@ MA_API void ma_waveform_uninit(ma_waveform* pWaveform) MA_API ma_result ma_waveform_set_amplitude(ma_waveform* pWaveform, double amplitude) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68240,7 +68240,7 @@ MA_API ma_result ma_waveform_set_amplitude(ma_waveform* pWaveform, double amplit MA_API ma_result ma_waveform_set_frequency(ma_waveform* pWaveform, double frequency) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68252,7 +68252,7 @@ MA_API ma_result ma_waveform_set_frequency(ma_waveform* pWaveform, double freque MA_API ma_result ma_waveform_set_type(ma_waveform* pWaveform, ma_waveform_type type) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68262,7 +68262,7 @@ MA_API ma_result ma_waveform_set_type(ma_waveform* pWaveform, ma_waveform_type t MA_API ma_result ma_waveform_set_sample_rate(ma_waveform* pWaveform, ma_uint32 sampleRate) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68338,8 +68338,8 @@ static void ma_waveform_read_pcm_frames__sine(ma_waveform* pWaveform, void* pFra ma_uint32 bps = ma_get_bytes_per_sample(pWaveform->config.format); ma_uint32 bpf = bps * pWaveform->config.channels; - MA_ASSERT(pWaveform != nullptr); - MA_ASSERT(pFramesOut != nullptr); + MA_ASSERT(pWaveform != NULL); + MA_ASSERT(pFramesOut != NULL); if (pWaveform->config.format == ma_format_f32) { float* pFramesOutF32 = (float*)pFramesOut; @@ -68380,8 +68380,8 @@ static void ma_waveform_read_pcm_frames__square(ma_waveform* pWaveform, double d ma_uint32 bps = ma_get_bytes_per_sample(pWaveform->config.format); ma_uint32 bpf = bps * pWaveform->config.channels; - MA_ASSERT(pWaveform != nullptr); - MA_ASSERT(pFramesOut != nullptr); + MA_ASSERT(pWaveform != NULL); + MA_ASSERT(pFramesOut != NULL); if (pWaveform->config.format == ma_format_f32) { float* pFramesOutF32 = (float*)pFramesOut; @@ -68422,8 +68422,8 @@ static void ma_waveform_read_pcm_frames__triangle(ma_waveform* pWaveform, void* ma_uint32 bps = ma_get_bytes_per_sample(pWaveform->config.format); ma_uint32 bpf = bps * pWaveform->config.channels; - MA_ASSERT(pWaveform != nullptr); - MA_ASSERT(pFramesOut != nullptr); + MA_ASSERT(pWaveform != NULL); + MA_ASSERT(pFramesOut != NULL); if (pWaveform->config.format == ma_format_f32) { float* pFramesOutF32 = (float*)pFramesOut; @@ -68464,8 +68464,8 @@ static void ma_waveform_read_pcm_frames__sawtooth(ma_waveform* pWaveform, void* ma_uint32 bps = ma_get_bytes_per_sample(pWaveform->config.format); ma_uint32 bpf = bps * pWaveform->config.channels; - MA_ASSERT(pWaveform != nullptr); - MA_ASSERT(pFramesOut != nullptr); + MA_ASSERT(pWaveform != NULL); + MA_ASSERT(pFramesOut != NULL); if (pWaveform->config.format == ma_format_f32) { float* pFramesOutF32 = (float*)pFramesOut; @@ -68501,7 +68501,7 @@ static void ma_waveform_read_pcm_frames__sawtooth(ma_waveform* pWaveform, void* MA_API ma_result ma_waveform_read_pcm_frames(ma_waveform* pWaveform, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead) { - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -68509,11 +68509,11 @@ MA_API ma_result ma_waveform_read_pcm_frames(ma_waveform* pWaveform, void* pFram return MA_INVALID_ARGS; } - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { switch (pWaveform->config.type) { case ma_waveform_type_sine: @@ -68542,7 +68542,7 @@ MA_API ma_result ma_waveform_read_pcm_frames(ma_waveform* pWaveform, void* pFram pWaveform->time += pWaveform->advance * (ma_int64)frameCount; /* Cast to int64 required for VC6. Won't affect anything in practice. */ } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = frameCount; } @@ -68551,7 +68551,7 @@ MA_API ma_result ma_waveform_read_pcm_frames(ma_waveform* pWaveform, void* pFram MA_API ma_result ma_waveform_seek_to_pcm_frame(ma_waveform* pWaveform, ma_uint64 frameIndex) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68580,7 +68580,7 @@ MA_API ma_result ma_pulsewave_init(const ma_pulsewave_config* pConfig, ma_pulsew ma_result result; ma_waveform_config config; - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68603,7 +68603,7 @@ MA_API ma_result ma_pulsewave_init(const ma_pulsewave_config* pConfig, ma_pulsew MA_API void ma_pulsewave_uninit(ma_pulsewave* pWaveform) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return; } @@ -68612,7 +68612,7 @@ MA_API void ma_pulsewave_uninit(ma_pulsewave* pWaveform) MA_API ma_result ma_pulsewave_read_pcm_frames(ma_pulsewave* pWaveform, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead) { - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -68620,17 +68620,17 @@ MA_API ma_result ma_pulsewave_read_pcm_frames(ma_pulsewave* pWaveform, void* pFr return MA_INVALID_ARGS; } - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { ma_waveform_read_pcm_frames__square(&pWaveform->waveform, pWaveform->config.dutyCycle, pFramesOut, frameCount); } else { pWaveform->waveform.time += pWaveform->waveform.advance * (ma_int64)frameCount; /* Cast to int64 required for VC6. Won't affect anything in practice. */ } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = frameCount; } @@ -68639,7 +68639,7 @@ MA_API ma_result ma_pulsewave_read_pcm_frames(ma_pulsewave* pWaveform, void* pFr MA_API ma_result ma_pulsewave_seek_to_pcm_frame(ma_pulsewave* pWaveform, ma_uint64 frameIndex) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68650,7 +68650,7 @@ MA_API ma_result ma_pulsewave_seek_to_pcm_frame(ma_pulsewave* pWaveform, ma_uint MA_API ma_result ma_pulsewave_set_amplitude(ma_pulsewave* pWaveform, double amplitude) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68662,7 +68662,7 @@ MA_API ma_result ma_pulsewave_set_amplitude(ma_pulsewave* pWaveform, double ampl MA_API ma_result ma_pulsewave_set_frequency(ma_pulsewave* pWaveform, double frequency) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68674,7 +68674,7 @@ MA_API ma_result ma_pulsewave_set_frequency(ma_pulsewave* pWaveform, double freq MA_API ma_result ma_pulsewave_set_sample_rate(ma_pulsewave* pWaveform, ma_uint32 sampleRate) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68686,7 +68686,7 @@ MA_API ma_result ma_pulsewave_set_sample_rate(ma_pulsewave* pWaveform, ma_uint32 MA_API ma_result ma_pulsewave_set_duty_cycle(ma_pulsewave* pWaveform, double dutyCycle) { - if (pWaveform == nullptr) { + if (pWaveform == NULL) { return MA_INVALID_ARGS; } @@ -68746,9 +68746,9 @@ static ma_data_source_vtable g_ma_noise_data_source_vtable = ma_noise__data_source_on_read, ma_noise__data_source_on_seek, /* No-op for noise. */ ma_noise__data_source_on_get_data_format, - nullptr, /* onGetCursor. No notion of a cursor for noise. */ - nullptr, /* onGetLength. No notion of a length for noise. */ - nullptr, /* onSetLooping */ + NULL, /* onGetCursor. No notion of a cursor for noise. */ + NULL, /* onGetLength. No notion of a length for noise. */ + NULL, /* onSetLooping */ 0 }; @@ -68774,11 +68774,11 @@ typedef struct static ma_result ma_noise_get_heap_layout(const ma_noise_config* pConfig, ma_noise_heap_layout* pHeapLayout) { - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -68822,7 +68822,7 @@ MA_API ma_result ma_noise_get_heap_size(const ma_noise_config* pConfig, size_t* ma_result result; ma_noise_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -68845,7 +68845,7 @@ MA_API ma_result ma_noise_init_preallocated(const ma_noise_config* pConfig, void ma_data_source_config dataSourceConfig; ma_uint32 iChannel; - if (pNoise == nullptr) { + if (pNoise == NULL) { return MA_INVALID_ARGS; } @@ -68906,11 +68906,11 @@ MA_API ma_result ma_noise_init(const ma_noise_config* pConfig, const ma_allocati if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_noise_init_preallocated(pConfig, pHeap, pNoise); @@ -68925,7 +68925,7 @@ MA_API ma_result ma_noise_init(const ma_noise_config* pConfig, const ma_allocati MA_API void ma_noise_uninit(ma_noise* pNoise, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pNoise == nullptr) { + if (pNoise == NULL) { return; } @@ -68938,7 +68938,7 @@ MA_API void ma_noise_uninit(ma_noise* pNoise, const ma_allocation_callbacks* pAl MA_API ma_result ma_noise_set_amplitude(ma_noise* pNoise, double amplitude) { - if (pNoise == nullptr) { + if (pNoise == NULL) { return MA_INVALID_ARGS; } @@ -68948,7 +68948,7 @@ MA_API ma_result ma_noise_set_amplitude(ma_noise* pNoise, double amplitude) MA_API ma_result ma_noise_set_seed(ma_noise* pNoise, ma_int32 seed) { - if (pNoise == nullptr) { + if (pNoise == NULL) { return MA_INVALID_ARGS; } @@ -68959,7 +68959,7 @@ MA_API ma_result ma_noise_set_seed(ma_noise* pNoise, ma_int32 seed) MA_API ma_result ma_noise_set_type(ma_noise* pNoise, ma_noise_type type) { - if (pNoise == nullptr) { + if (pNoise == NULL) { return MA_INVALID_ARGS; } @@ -69252,7 +69252,7 @@ MA_API ma_result ma_noise_read_pcm_frames(ma_noise* pNoise, void* pFramesOut, ma { ma_uint64 framesRead = 0; - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -69260,12 +69260,12 @@ MA_API ma_result ma_noise_read_pcm_frames(ma_noise* pNoise, void* pFramesOut, ma return MA_INVALID_ARGS; } - if (pNoise == nullptr) { + if (pNoise == NULL) { return MA_INVALID_ARGS; } - /* The output buffer is allowed to be nullptr. Since we aren't tracking cursors or anything we can just do nothing and pretend to be successful. */ - if (pFramesOut == nullptr) { + /* The output buffer is allowed to be NULL. Since we aren't tracking cursors or anything we can just do nothing and pretend to be successful. */ + if (pFramesOut == NULL) { framesRead = frameCount; } else { switch (pNoise->config.type) { @@ -69276,7 +69276,7 @@ MA_API ma_result ma_noise_read_pcm_frames(ma_noise* pNoise, void* pFramesOut, ma } } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = framesRead; } @@ -69306,7 +69306,7 @@ MA_API ma_resource_manager_pipeline_notifications ma_resource_manager_pipeline_n static void ma_resource_manager_pipeline_notifications_signal_all_notifications(const ma_resource_manager_pipeline_notifications* pPipelineNotifications) { - if (pPipelineNotifications == nullptr) { + if (pPipelineNotifications == NULL) { return; } @@ -69316,22 +69316,22 @@ static void ma_resource_manager_pipeline_notifications_signal_all_notifications( static void ma_resource_manager_pipeline_notifications_acquire_all_fences(const ma_resource_manager_pipeline_notifications* pPipelineNotifications) { - if (pPipelineNotifications == nullptr) { + if (pPipelineNotifications == NULL) { return; } - if (pPipelineNotifications->init.pFence != nullptr) { ma_fence_acquire(pPipelineNotifications->init.pFence); } - if (pPipelineNotifications->done.pFence != nullptr) { ma_fence_acquire(pPipelineNotifications->done.pFence); } + if (pPipelineNotifications->init.pFence != NULL) { ma_fence_acquire(pPipelineNotifications->init.pFence); } + if (pPipelineNotifications->done.pFence != NULL) { ma_fence_acquire(pPipelineNotifications->done.pFence); } } static void ma_resource_manager_pipeline_notifications_release_all_fences(const ma_resource_manager_pipeline_notifications* pPipelineNotifications) { - if (pPipelineNotifications == nullptr) { + if (pPipelineNotifications == NULL) { return; } - if (pPipelineNotifications->init.pFence != nullptr) { ma_fence_release(pPipelineNotifications->init.pFence); } - if (pPipelineNotifications->done.pFence != nullptr) { ma_fence_release(pPipelineNotifications->done.pFence); } + if (pPipelineNotifications->init.pFence != NULL) { ma_fence_release(pPipelineNotifications->init.pFence); } + if (pPipelineNotifications->done.pFence != NULL) { ma_fence_release(pPipelineNotifications->done.pFence); } } @@ -69447,11 +69447,11 @@ static ma_result ma_resource_manager_data_buffer_node_search(ma_resource_manager { ma_resource_manager_data_buffer_node* pCurrentNode; - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(ppDataBufferNode != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(ppDataBufferNode != NULL); pCurrentNode = pResourceManager->pRootDataBufferNode; - while (pCurrentNode != nullptr) { + while (pCurrentNode != NULL) { if (hashedName32 == pCurrentNode->hashedName32) { break; /* Found. */ } else if (hashedName32 < pCurrentNode->hashedName32) { @@ -69463,7 +69463,7 @@ static ma_result ma_resource_manager_data_buffer_node_search(ma_resource_manager *ppDataBufferNode = pCurrentNode; - if (pCurrentNode == nullptr) { + if (pCurrentNode == NULL) { return MA_DOES_NOT_EXIST; } else { return MA_SUCCESS; @@ -69475,31 +69475,31 @@ static ma_result ma_resource_manager_data_buffer_node_insert_point(ma_resource_m ma_result result = MA_SUCCESS; ma_resource_manager_data_buffer_node* pCurrentNode; - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(ppInsertPoint != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(ppInsertPoint != NULL); - *ppInsertPoint = nullptr; + *ppInsertPoint = NULL; - if (pResourceManager->pRootDataBufferNode == nullptr) { + if (pResourceManager->pRootDataBufferNode == NULL) { return MA_SUCCESS; /* No items. */ } /* We need to find the node that will become the parent of the new node. If a node is found that already has the same hashed name we need to return MA_ALREADY_EXISTS. */ pCurrentNode = pResourceManager->pRootDataBufferNode; - while (pCurrentNode != nullptr) { + while (pCurrentNode != NULL) { if (hashedName32 == pCurrentNode->hashedName32) { result = MA_ALREADY_EXISTS; break; } else { if (hashedName32 < pCurrentNode->hashedName32) { - if (pCurrentNode->pChildLo == nullptr) { + if (pCurrentNode->pChildLo == NULL) { result = MA_SUCCESS; break; } else { pCurrentNode = pCurrentNode->pChildLo; } } else { - if (pCurrentNode->pChildHi == nullptr) { + if (pCurrentNode->pChildHi == NULL) { result = MA_SUCCESS; break; } else { @@ -69515,22 +69515,22 @@ static ma_result ma_resource_manager_data_buffer_node_insert_point(ma_resource_m static ma_result ma_resource_manager_data_buffer_node_insert_at(ma_resource_manager* pResourceManager, ma_resource_manager_data_buffer_node* pDataBufferNode, ma_resource_manager_data_buffer_node* pInsertPoint) { - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pDataBufferNode != NULL); /* The key must have been set before calling this function. */ MA_ASSERT(pDataBufferNode->hashedName32 != 0); - if (pInsertPoint == nullptr) { + if (pInsertPoint == NULL) { /* It's the first node. */ pResourceManager->pRootDataBufferNode = pDataBufferNode; } else { /* It's not the first node. It needs to be inserted. */ if (pDataBufferNode->hashedName32 < pInsertPoint->hashedName32) { - MA_ASSERT(pInsertPoint->pChildLo == nullptr); + MA_ASSERT(pInsertPoint->pChildLo == NULL); pInsertPoint->pChildLo = pDataBufferNode; } else { - MA_ASSERT(pInsertPoint->pChildHi == nullptr); + MA_ASSERT(pInsertPoint->pChildHi == NULL); pInsertPoint->pChildHi = pDataBufferNode; } } @@ -69546,8 +69546,8 @@ static ma_result ma_resource_manager_data_buffer_node_insert(ma_resource_manager ma_result result; ma_resource_manager_data_buffer_node* pInsertPoint; - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pDataBufferNode != NULL); result = ma_resource_manager_data_buffer_node_insert_point(pResourceManager, pDataBufferNode->hashedName32, &pInsertPoint); if (result != MA_SUCCESS) { @@ -69562,10 +69562,10 @@ static MA_INLINE ma_resource_manager_data_buffer_node* ma_resource_manager_data_ { ma_resource_manager_data_buffer_node* pCurrentNode; - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pDataBufferNode != NULL); pCurrentNode = pDataBufferNode; - while (pCurrentNode->pChildLo != nullptr) { + while (pCurrentNode->pChildLo != NULL) { pCurrentNode = pCurrentNode->pChildLo; } @@ -69576,10 +69576,10 @@ static MA_INLINE ma_resource_manager_data_buffer_node* ma_resource_manager_data_ { ma_resource_manager_data_buffer_node* pCurrentNode; - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pDataBufferNode != NULL); pCurrentNode = pDataBufferNode; - while (pCurrentNode->pChildHi != nullptr) { + while (pCurrentNode->pChildHi != NULL) { pCurrentNode = pCurrentNode->pChildHi; } @@ -69588,8 +69588,8 @@ static MA_INLINE ma_resource_manager_data_buffer_node* ma_resource_manager_data_ static MA_INLINE ma_resource_manager_data_buffer_node* ma_resource_manager_data_buffer_node_find_inorder_successor(ma_resource_manager_data_buffer_node* pDataBufferNode) { - MA_ASSERT(pDataBufferNode != nullptr); - MA_ASSERT(pDataBufferNode->pChildHi != nullptr); + MA_ASSERT(pDataBufferNode != NULL); + MA_ASSERT(pDataBufferNode->pChildHi != NULL); return ma_resource_manager_data_buffer_node_find_min(pDataBufferNode->pChildHi); } @@ -69597,8 +69597,8 @@ static MA_INLINE ma_resource_manager_data_buffer_node* ma_resource_manager_data_ #if 0 /* Currently unused, but might make use of this later. */ static MA_INLINE ma_resource_manager_data_buffer_node* ma_resource_manager_data_buffer_node_find_inorder_predecessor(ma_resource_manager_data_buffer_node* pDataBufferNode) { - MA_ASSERT(pDataBufferNode != nullptr); - MA_ASSERT(pDataBufferNode->pChildLo != nullptr); + MA_ASSERT(pDataBufferNode != NULL); + MA_ASSERT(pDataBufferNode->pChildLo != NULL); return ma_resource_manager_data_buffer_node_find_max(pDataBufferNode->pChildLo); } @@ -69606,27 +69606,27 @@ static MA_INLINE ma_resource_manager_data_buffer_node* ma_resource_manager_data_ static ma_result ma_resource_manager_data_buffer_node_remove(ma_resource_manager* pResourceManager, ma_resource_manager_data_buffer_node* pDataBufferNode) { - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pDataBufferNode != NULL); - if (pDataBufferNode->pChildLo == nullptr) { - if (pDataBufferNode->pChildHi == nullptr) { + if (pDataBufferNode->pChildLo == NULL) { + if (pDataBufferNode->pChildHi == NULL) { /* Simple case - deleting a buffer with no children. */ - if (pDataBufferNode->pParent == nullptr) { + if (pDataBufferNode->pParent == NULL) { MA_ASSERT(pResourceManager->pRootDataBufferNode == pDataBufferNode); /* There is only a single buffer in the tree which should be equal to the root node. */ - pResourceManager->pRootDataBufferNode = nullptr; + pResourceManager->pRootDataBufferNode = NULL; } else { if (pDataBufferNode->pParent->pChildLo == pDataBufferNode) { - pDataBufferNode->pParent->pChildLo = nullptr; + pDataBufferNode->pParent->pChildLo = NULL; } else { - pDataBufferNode->pParent->pChildHi = nullptr; + pDataBufferNode->pParent->pChildHi = NULL; } } } else { - /* Node has one child - pChildHi != nullptr. */ + /* Node has one child - pChildHi != NULL. */ pDataBufferNode->pChildHi->pParent = pDataBufferNode->pParent; - if (pDataBufferNode->pParent == nullptr) { + if (pDataBufferNode->pParent == NULL) { MA_ASSERT(pResourceManager->pRootDataBufferNode == pDataBufferNode); pResourceManager->pRootDataBufferNode = pDataBufferNode->pChildHi; } else { @@ -69638,11 +69638,11 @@ static ma_result ma_resource_manager_data_buffer_node_remove(ma_resource_manager } } } else { - if (pDataBufferNode->pChildHi == nullptr) { - /* Node has one child - pChildLo != nullptr. */ + if (pDataBufferNode->pChildHi == NULL) { + /* Node has one child - pChildLo != NULL. */ pDataBufferNode->pChildLo->pParent = pDataBufferNode->pParent; - if (pDataBufferNode->pParent == nullptr) { + if (pDataBufferNode->pParent == NULL) { MA_ASSERT(pResourceManager->pRootDataBufferNode == pDataBufferNode); pResourceManager->pRootDataBufferNode = pDataBufferNode->pChildLo; } else { @@ -69658,7 +69658,7 @@ static ma_result ma_resource_manager_data_buffer_node_remove(ma_resource_manager /* For now we are just going to use the in-order successor as the replacement, but we may want to try to keep this balanced by switching between the two. */ pReplacementDataBufferNode = ma_resource_manager_data_buffer_node_find_inorder_successor(pDataBufferNode); - MA_ASSERT(pReplacementDataBufferNode != nullptr); + MA_ASSERT(pReplacementDataBufferNode != NULL); /* Now that we have our replacement node we can make the change. The simple way to do this would be to just exchange the values, and then remove the replacement @@ -69666,14 +69666,14 @@ static ma_result ma_resource_manager_data_buffer_node_remove(ma_resource_manager replacement node should have at most 1 child. Therefore, we can detach it in terms of our simpler cases above. What we're essentially doing is detaching the replacement node and reinserting it into the same position as the deleted node. */ - MA_ASSERT(pReplacementDataBufferNode->pParent != nullptr); /* The replacement node should never be the root which means it should always have a parent. */ - MA_ASSERT(pReplacementDataBufferNode->pChildLo == nullptr); /* Because we used in-order successor. This would be pChildHi == nullptr if we used in-order predecessor. */ + MA_ASSERT(pReplacementDataBufferNode->pParent != NULL); /* The replacement node should never be the root which means it should always have a parent. */ + MA_ASSERT(pReplacementDataBufferNode->pChildLo == NULL); /* Because we used in-order successor. This would be pChildHi == NULL if we used in-order predecessor. */ - if (pReplacementDataBufferNode->pChildHi == nullptr) { + if (pReplacementDataBufferNode->pChildHi == NULL) { if (pReplacementDataBufferNode->pParent->pChildLo == pReplacementDataBufferNode) { - pReplacementDataBufferNode->pParent->pChildLo = nullptr; + pReplacementDataBufferNode->pParent->pChildLo = NULL; } else { - pReplacementDataBufferNode->pParent->pChildHi = nullptr; + pReplacementDataBufferNode->pParent->pChildHi = NULL; } } else { pReplacementDataBufferNode->pChildHi->pParent = pReplacementDataBufferNode->pParent; @@ -69686,7 +69686,7 @@ static ma_result ma_resource_manager_data_buffer_node_remove(ma_resource_manager /* The replacement node has essentially been detached from the binary tree, so now we need to replace the old data buffer with it. The first thing to update is the parent */ - if (pDataBufferNode->pParent != nullptr) { + if (pDataBufferNode->pParent != NULL) { if (pDataBufferNode->pParent->pChildLo == pDataBufferNode) { pDataBufferNode->pParent->pChildLo = pReplacementDataBufferNode; } else { @@ -69700,10 +69700,10 @@ static ma_result ma_resource_manager_data_buffer_node_remove(ma_resource_manager pReplacementDataBufferNode->pChildHi = pDataBufferNode->pChildHi; /* Now the children of the replacement node need to have their parent pointers updated. */ - if (pReplacementDataBufferNode->pChildLo != nullptr) { + if (pReplacementDataBufferNode->pChildLo != NULL) { pReplacementDataBufferNode->pChildLo->pParent = pReplacementDataBufferNode; } - if (pReplacementDataBufferNode->pChildHi != nullptr) { + if (pReplacementDataBufferNode->pChildHi != NULL) { pReplacementDataBufferNode->pChildHi->pParent = pReplacementDataBufferNode; } @@ -69746,14 +69746,14 @@ static ma_result ma_resource_manager_data_buffer_node_increment_ref(ma_resource_ { ma_uint32 refCount; - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pDataBufferNode != NULL); (void)pResourceManager; refCount = ma_atomic_fetch_add_32(&pDataBufferNode->refCount, 1) + 1; - if (pNewRefCount != nullptr) { + if (pNewRefCount != NULL) { *pNewRefCount = refCount; } @@ -69764,14 +69764,14 @@ static ma_result ma_resource_manager_data_buffer_node_decrement_ref(ma_resource_ { ma_uint32 refCount; - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pDataBufferNode != NULL); (void)pResourceManager; refCount = ma_atomic_fetch_sub_32(&pDataBufferNode->refCount, 1) - 1; - if (pNewRefCount != nullptr) { + if (pNewRefCount != NULL) { *pNewRefCount = refCount; } @@ -69780,17 +69780,17 @@ static ma_result ma_resource_manager_data_buffer_node_decrement_ref(ma_resource_ static void ma_resource_manager_data_buffer_node_free(ma_resource_manager* pResourceManager, ma_resource_manager_data_buffer_node* pDataBufferNode) { - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pDataBufferNode != NULL); if (pDataBufferNode->isDataOwnedByResourceManager) { if (ma_resource_manager_data_buffer_node_get_data_supply_type(pDataBufferNode) == ma_resource_manager_data_supply_type_encoded) { ma_free((void*)pDataBufferNode->data.backend.encoded.pData, &pResourceManager->config.allocationCallbacks); - pDataBufferNode->data.backend.encoded.pData = nullptr; + pDataBufferNode->data.backend.encoded.pData = NULL; pDataBufferNode->data.backend.encoded.sizeInBytes = 0; } else if (ma_resource_manager_data_buffer_node_get_data_supply_type(pDataBufferNode) == ma_resource_manager_data_supply_type_decoded) { ma_free((void*)pDataBufferNode->data.backend.decoded.pData, &pResourceManager->config.allocationCallbacks); - pDataBufferNode->data.backend.decoded.pData = nullptr; + pDataBufferNode->data.backend.decoded.pData = NULL; pDataBufferNode->data.backend.decoded.totalFrameCount = 0; } else if (ma_resource_manager_data_buffer_node_get_data_supply_type(pDataBufferNode) == ma_resource_manager_data_supply_type_decoded_paged) { ma_paged_audio_buffer_data_uninit(&pDataBufferNode->data.backend.decodedPaged.data, &pResourceManager->config.allocationCallbacks); @@ -69806,7 +69806,7 @@ static void ma_resource_manager_data_buffer_node_free(ma_resource_manager* pReso static ma_result ma_resource_manager_data_buffer_node_result(const ma_resource_manager_data_buffer_node* pDataBufferNode) { - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pDataBufferNode != NULL); return (ma_result)ma_atomic_load_i32((ma_result*)&pDataBufferNode->result); /* Need a naughty const-cast here. */ } @@ -69814,7 +69814,7 @@ static ma_result ma_resource_manager_data_buffer_node_result(const ma_resource_m static ma_bool32 ma_resource_manager_is_threading_enabled(const ma_resource_manager* pResourceManager) { - MA_ASSERT(pResourceManager != nullptr); + MA_ASSERT(pResourceManager != NULL); return (pResourceManager->config.flags & MA_RESOURCE_MANAGER_FLAG_NO_THREADING) == 0; } @@ -69832,8 +69832,8 @@ typedef struct static ma_result ma_resource_manager_inline_notification_init(ma_resource_manager* pResourceManager, ma_resource_manager_inline_notification* pNotification) { - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pNotification != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pNotification != NULL); pNotification->pResourceManager = pResourceManager; @@ -69846,7 +69846,7 @@ static ma_result ma_resource_manager_inline_notification_init(ma_resource_manage static void ma_resource_manager_inline_notification_uninit(ma_resource_manager_inline_notification* pNotification) { - MA_ASSERT(pNotification != nullptr); + MA_ASSERT(pNotification != NULL); if (ma_resource_manager_is_threading_enabled(pNotification->pResourceManager)) { ma_async_notification_event_uninit(&pNotification->backend.e); @@ -69857,7 +69857,7 @@ static void ma_resource_manager_inline_notification_uninit(ma_resource_manager_i static void ma_resource_manager_inline_notification_wait(ma_resource_manager_inline_notification* pNotification) { - MA_ASSERT(pNotification != nullptr); + MA_ASSERT(pNotification != NULL); if (ma_resource_manager_is_threading_enabled(pNotification->pResourceManager)) { ma_async_notification_event_wait(&pNotification->backend.e); @@ -69880,7 +69880,7 @@ static void ma_resource_manager_inline_notification_wait_and_uninit(ma_resource_ static void ma_resource_manager_data_buffer_bst_lock(ma_resource_manager* pResourceManager) { - MA_ASSERT(pResourceManager != nullptr); + MA_ASSERT(pResourceManager != NULL); if (ma_resource_manager_is_threading_enabled(pResourceManager)) { #ifndef MA_NO_THREADING @@ -69899,7 +69899,7 @@ static void ma_resource_manager_data_buffer_bst_lock(ma_resource_manager* pResou static void ma_resource_manager_data_buffer_bst_unlock(ma_resource_manager* pResourceManager) { - MA_ASSERT(pResourceManager != nullptr); + MA_ASSERT(pResourceManager != NULL); if (ma_resource_manager_is_threading_enabled(pResourceManager)) { #ifndef MA_NO_THREADING @@ -69920,7 +69920,7 @@ static void ma_resource_manager_data_buffer_bst_unlock(ma_resource_manager* pRes static ma_thread_result MA_THREADCALL ma_resource_manager_job_thread(void* pUserData) { ma_resource_manager* pResourceManager = (ma_resource_manager*)pUserData; - MA_ASSERT(pResourceManager != nullptr); + MA_ASSERT(pResourceManager != NULL); for (;;) { ma_result result; @@ -69974,13 +69974,13 @@ MA_API ma_result ma_resource_manager_init(const ma_resource_manager_config* pCon ma_result result; ma_job_queue_config jobQueueConfig; - if (pResourceManager == nullptr) { + if (pResourceManager == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pResourceManager); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -69996,16 +69996,16 @@ MA_API ma_result ma_resource_manager_init(const ma_resource_manager_config* pCon ma_allocation_callbacks_init_copy(&pResourceManager->config.allocationCallbacks, &pConfig->allocationCallbacks); /* Get the log set up early so we can start using it as soon as possible. */ - if (pResourceManager->config.pLog == nullptr) { + if (pResourceManager->config.pLog == NULL) { result = ma_log_init(&pResourceManager->config.allocationCallbacks, &pResourceManager->log); if (result == MA_SUCCESS) { pResourceManager->config.pLog = &pResourceManager->log; } else { - pResourceManager->config.pLog = nullptr; /* Logging is unavailable. */ + pResourceManager->config.pLog = NULL; /* Logging is unavailable. */ } } - if (pResourceManager->config.pVFS == nullptr) { + if (pResourceManager->config.pVFS == NULL) { result = ma_default_vfs_init(&pResourceManager->defaultVFS, &pResourceManager->config.allocationCallbacks); if (result != MA_SUCCESS) { return result; /* Failed to initialize the default file system. */ @@ -70049,12 +70049,12 @@ MA_API ma_result ma_resource_manager_init(const ma_resource_manager_config* pCon /* Custom decoding backends. */ - if (pConfig->ppCustomDecodingBackendVTables != nullptr && pConfig->customDecodingBackendCount > 0) { + if (pConfig->ppCustomDecodingBackendVTables != NULL && pConfig->customDecodingBackendCount > 0) { size_t sizeInBytes = sizeof(*pResourceManager->config.ppCustomDecodingBackendVTables) * pConfig->customDecodingBackendCount; ma_decoding_backend_vtable** ppCustomDecodingBackendVTables; ppCustomDecodingBackendVTables = (ma_decoding_backend_vtable**)ma_malloc(sizeInBytes, &pResourceManager->config.allocationCallbacks); - if (pResourceManager->config.ppCustomDecodingBackendVTables == nullptr) { + if (pResourceManager->config.ppCustomDecodingBackendVTables == NULL) { ma_job_queue_uninit(&pResourceManager->jobQueue, &pResourceManager->config.allocationCallbacks); return MA_OUT_OF_MEMORY; } @@ -70108,7 +70108,7 @@ static void ma_resource_manager_delete_all_data_buffer_nodes(ma_resource_manager MA_ASSERT(pResourceManager); /* If everything was done properly, there shouldn't be any active data buffers. */ - while (pResourceManager->pRootDataBufferNode != nullptr) { + while (pResourceManager->pRootDataBufferNode != NULL) { ma_resource_manager_data_buffer_node* pDataBufferNode = pResourceManager->pRootDataBufferNode; ma_resource_manager_data_buffer_node_remove(pResourceManager, pDataBufferNode); @@ -70119,7 +70119,7 @@ static void ma_resource_manager_delete_all_data_buffer_nodes(ma_resource_manager MA_API void ma_resource_manager_uninit(ma_resource_manager* pResourceManager) { - if (pResourceManager == nullptr) { + if (pResourceManager == NULL) { return; } @@ -70174,8 +70174,8 @@ MA_API void ma_resource_manager_uninit(ma_resource_manager* pResourceManager) MA_API ma_log* ma_resource_manager_get_log(ma_resource_manager* pResourceManager) { - if (pResourceManager == nullptr) { - return nullptr; + if (pResourceManager == NULL) { + return NULL; } return pResourceManager->config.pLog; @@ -70217,13 +70217,13 @@ static ma_result ma_resource_manager__init_decoder(ma_resource_manager* pResourc ma_result result; ma_decoder_config config; - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pFilePath != nullptr || pFilePathW != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pFilePath != NULL || pFilePathW != NULL); + MA_ASSERT(pDecoder != NULL); config = ma_resource_manager__init_decoder_config(pResourceManager); - if (pFilePath != nullptr) { + if (pFilePath != NULL) { result = ma_decoder_init_vfs(pResourceManager->config.pVFS, pFilePath, &config, pDecoder); if (result != MA_SUCCESS) { ma_log_postf(ma_resource_manager_get_log(pResourceManager), MA_LOG_LEVEL_WARNING, "Failed to load file \"%s\". %s.\n", pFilePath, ma_result_description(result)); @@ -70250,7 +70250,7 @@ static ma_bool32 ma_resource_manager_data_buffer_has_connector(ma_resource_manag static ma_data_source* ma_resource_manager_data_buffer_get_connector(ma_resource_manager_data_buffer* pDataBuffer) { if (ma_resource_manager_data_buffer_has_connector(pDataBuffer) == MA_FALSE) { - return nullptr; /* Connector not yet initialized. */ + return NULL; /* Connector not yet initialized. */ } switch (pDataBuffer->pNode->data.type) @@ -70263,7 +70263,7 @@ static ma_data_source* ma_resource_manager_data_buffer_get_connector(ma_resource default: { ma_log_postf(ma_resource_manager_get_log(pDataBuffer->pResourceManager), MA_LOG_LEVEL_ERROR, "Failed to retrieve data buffer connector. Unknown data supply type.\n"); - return nullptr; + return NULL; }; }; } @@ -70272,8 +70272,8 @@ static ma_result ma_resource_manager_data_buffer_init_connector(ma_resource_mana { ma_result result; - MA_ASSERT(pDataBuffer != nullptr); - MA_ASSERT(pConfig != nullptr); + MA_ASSERT(pDataBuffer != NULL); + MA_ASSERT(pConfig != NULL); MA_ASSERT(ma_resource_manager_data_buffer_has_connector(pDataBuffer) == MA_FALSE); /* The underlying data buffer must be initialized before we'll be able to know how to initialize the backend. */ @@ -70299,7 +70299,7 @@ static ma_result ma_resource_manager_data_buffer_init_connector(ma_resource_mana case ma_resource_manager_data_supply_type_decoded: /* Connector is an audio buffer. */ { ma_audio_buffer_config config; - config = ma_audio_buffer_config_init(pDataBuffer->pNode->data.backend.decoded.format, pDataBuffer->pNode->data.backend.decoded.channels, pDataBuffer->pNode->data.backend.decoded.totalFrameCount, pDataBuffer->pNode->data.backend.decoded.pData, nullptr); + config = ma_audio_buffer_config_init(pDataBuffer->pNode->data.backend.decoded.format, pDataBuffer->pNode->data.backend.decoded.channels, pDataBuffer->pNode->data.backend.decoded.totalFrameCount, pDataBuffer->pNode->data.backend.decoded.pData, NULL); result = ma_audio_buffer_init(&config, &pDataBuffer->connector.buffer); } break; @@ -70349,11 +70349,11 @@ static ma_result ma_resource_manager_data_buffer_init_connector(ma_resource_mana ma_atomic_bool32_set(&pDataBuffer->isConnectorInitialized, MA_TRUE); - if (pInitNotification != nullptr) { + if (pInitNotification != NULL) { ma_async_notification_signal(pInitNotification); } - if (pInitFence != nullptr) { + if (pInitFence != NULL) { ma_fence_release(pInitFence); } } @@ -70364,8 +70364,8 @@ static ma_result ma_resource_manager_data_buffer_init_connector(ma_resource_mana static ma_result ma_resource_manager_data_buffer_uninit_connector(ma_resource_manager* pResourceManager, ma_resource_manager_data_buffer* pDataBuffer) { - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pDataBuffer != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pDataBuffer != NULL); (void)pResourceManager; @@ -70399,7 +70399,7 @@ static ma_result ma_resource_manager_data_buffer_uninit_connector(ma_resource_ma static ma_uint32 ma_resource_manager_data_buffer_node_next_execution_order(ma_resource_manager_data_buffer_node* pDataBufferNode) { - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pDataBufferNode != NULL); return ma_atomic_fetch_add_32(&pDataBufferNode->executionCounter, 1); } @@ -70409,13 +70409,13 @@ static ma_result ma_resource_manager_data_buffer_node_init_supply_encoded(ma_res size_t dataSizeInBytes; void* pData; - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pDataBufferNode != nullptr); - MA_ASSERT(pFilePath != nullptr || pFilePathW != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pDataBufferNode != NULL); + MA_ASSERT(pFilePath != NULL || pFilePathW != NULL); result = ma_vfs_open_and_read_file_ex(pResourceManager->config.pVFS, pFilePath, pFilePathW, &pData, &dataSizeInBytes, &pResourceManager->config.allocationCallbacks); if (result != MA_SUCCESS) { - if (pFilePath != nullptr) { + if (pFilePath != NULL) { ma_log_postf(ma_resource_manager_get_log(pResourceManager), MA_LOG_LEVEL_WARNING, "Failed to load file \"%s\". %s.\n", pFilePath, ma_result_description(result)); } else { #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(_MSC_VER) @@ -70439,15 +70439,15 @@ static ma_result ma_resource_manager_data_buffer_node_init_supply_decoded(ma_res ma_decoder* pDecoder; ma_uint64 totalFrameCount; - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pDataBufferNode != nullptr); - MA_ASSERT(ppDecoder != nullptr); - MA_ASSERT(pFilePath != nullptr || pFilePathW != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pDataBufferNode != NULL); + MA_ASSERT(ppDecoder != NULL); + MA_ASSERT(pFilePath != NULL || pFilePathW != NULL); - *ppDecoder = nullptr; /* For safety. */ + *ppDecoder = NULL; /* For safety. */ pDecoder = (ma_decoder*)ma_malloc(sizeof(*pDecoder), &pResourceManager->config.allocationCallbacks); - if (pDecoder == nullptr) { + if (pDecoder == NULL) { return MA_OUT_OF_MEMORY; } @@ -70485,7 +70485,7 @@ static ma_result ma_resource_manager_data_buffer_node_init_supply_decoded(ma_res } pData = ma_malloc((size_t)dataSizeInBytes, &pResourceManager->config.allocationCallbacks); - if (pData == nullptr) { + if (pData == NULL) { ma_decoder_uninit(pDecoder); ma_free(pDecoder, &pResourceManager->config.allocationCallbacks); return MA_OUT_OF_MEMORY; @@ -70532,9 +70532,9 @@ static ma_result ma_resource_manager_data_buffer_node_decode_next_page(ma_resour ma_uint64 framesToTryReading; ma_uint64 framesRead; - MA_ASSERT(pResourceManager != nullptr); - MA_ASSERT(pDataBufferNode != nullptr); - MA_ASSERT(pDecoder != nullptr); + MA_ASSERT(pResourceManager != NULL); + MA_ASSERT(pDataBufferNode != NULL); + MA_ASSERT(pDecoder != NULL); /* We need to know the size of a page in frames to know how many frames to decode. */ pageSizeInFrames = MA_RESOURCE_MANAGER_PAGE_SIZE_IN_MILLISECONDS * (pDecoder->outputSampleRate/1000); @@ -70562,7 +70562,7 @@ static ma_result ma_resource_manager_data_buffer_node_decode_next_page(ma_resour pDataBufferNode->data.backend.decoded.pData, pDataBufferNode->data.backend.decoded.decodedFrameCount * ma_get_bytes_per_frame(pDataBufferNode->data.backend.decoded.format, pDataBufferNode->data.backend.decoded.channels) ); - MA_ASSERT(pDst != nullptr); + MA_ASSERT(pDst != NULL); result = ma_decoder_read_pcm_frames(pDecoder, pDst, framesToTryReading, &framesRead); if (framesRead > 0) { @@ -70578,7 +70578,7 @@ static ma_result ma_resource_manager_data_buffer_node_decode_next_page(ma_resour /* The destination buffer is a freshly allocated page. */ ma_paged_audio_buffer_page* pPage; - result = ma_paged_audio_buffer_data_allocate_page(&pDataBufferNode->data.backend.decodedPaged.data, framesToTryReading, nullptr, &pResourceManager->config.allocationCallbacks, &pPage); + result = ma_paged_audio_buffer_data_allocate_page(&pDataBufferNode->data.backend.decodedPaged.data, framesToTryReading, NULL, &pResourceManager->config.allocationCallbacks, &pPage); if (result != MA_SUCCESS) { return result; } @@ -70622,11 +70622,11 @@ static ma_result ma_resource_manager_data_buffer_node_decode_next_page(ma_resour static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(ma_resource_manager* pResourceManager, const char* pFilePath, const wchar_t* pFilePathW, ma_uint32 hashedName32, ma_uint32 flags, const ma_resource_manager_data_supply* pExistingData, ma_fence* pInitFence, ma_fence* pDoneFence, ma_resource_manager_inline_notification* pInitNotification, ma_resource_manager_data_buffer_node** ppDataBufferNode) { ma_result result = MA_SUCCESS; - ma_resource_manager_data_buffer_node* pDataBufferNode = nullptr; + ma_resource_manager_data_buffer_node* pDataBufferNode = NULL; ma_resource_manager_data_buffer_node* pInsertPoint; - if (ppDataBufferNode != nullptr) { - *ppDataBufferNode = nullptr; + if (ppDataBufferNode != NULL) { + *ppDataBufferNode = NULL; } result = ma_resource_manager_data_buffer_node_insert_point(pResourceManager, hashedName32, &pInsertPoint); @@ -70634,7 +70634,7 @@ static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(m /* The node already exists. We just need to increment the reference count. */ pDataBufferNode = pInsertPoint; - result = ma_resource_manager_data_buffer_node_increment_ref(pResourceManager, pDataBufferNode, nullptr); + result = ma_resource_manager_data_buffer_node_increment_ref(pResourceManager, pDataBufferNode, NULL); if (result != MA_SUCCESS) { return result; /* Should never happen. Failed to increment the reference count. */ } @@ -70648,7 +70648,7 @@ static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(m does not occur before initialization on another thread. */ pDataBufferNode = (ma_resource_manager_data_buffer_node*)ma_malloc(sizeof(*pDataBufferNode), &pResourceManager->config.allocationCallbacks); - if (pDataBufferNode == nullptr) { + if (pDataBufferNode == NULL) { return MA_OUT_OF_MEMORY; } @@ -70656,7 +70656,7 @@ static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(m pDataBufferNode->hashedName32 = hashedName32; pDataBufferNode->refCount = 1; /* Always set to 1 by default (this is our first reference). */ - if (pExistingData == nullptr) { + if (pExistingData == NULL) { pDataBufferNode->data.type = ma_resource_manager_data_supply_type_unknown; /* <-- We won't know this until we start decoding. */ pDataBufferNode->result = MA_BUSY; /* Must be set to MA_BUSY before we leave the critical section, so might as well do it now. */ pDataBufferNode->isDataOwnedByResourceManager = MA_TRUE; @@ -70680,17 +70680,17 @@ static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(m if (pDataBufferNode->isDataOwnedByResourceManager && (flags & MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_ASYNC) != 0) { /* Loading asynchronously. Post the job. */ ma_job job; - char* pFilePathCopy = nullptr; - wchar_t* pFilePathWCopy = nullptr; + char* pFilePathCopy = NULL; + wchar_t* pFilePathWCopy = NULL; /* We need a copy of the file path. We should probably make this more efficient, but for now we'll do a transient memory allocation. */ - if (pFilePath != nullptr) { + if (pFilePath != NULL) { pFilePathCopy = ma_copy_string(pFilePath, &pResourceManager->config.allocationCallbacks); } else { pFilePathWCopy = ma_copy_string_w(pFilePathW, &pResourceManager->config.allocationCallbacks); } - if (pFilePathCopy == nullptr && pFilePathWCopy == nullptr) { + if (pFilePathCopy == NULL && pFilePathWCopy == NULL) { ma_resource_manager_data_buffer_node_remove(pResourceManager, pDataBufferNode); ma_free(pDataBufferNode, &pResourceManager->config.allocationCallbacks); return MA_OUT_OF_MEMORY; @@ -70701,8 +70701,8 @@ static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(m } /* Acquire init and done fences before posting the job. These will be unacquired by the job thread. */ - if (pInitFence != nullptr) { ma_fence_acquire(pInitFence); } - if (pDoneFence != nullptr) { ma_fence_acquire(pDoneFence); } + if (pInitFence != NULL) { ma_fence_acquire(pInitFence); } + if (pDoneFence != NULL) { ma_fence_acquire(pDoneFence); } /* We now have everything we need to post the job to the job thread. */ job = ma_job_init(MA_JOB_TYPE_RESOURCE_MANAGER_LOAD_DATA_BUFFER_NODE); @@ -70712,8 +70712,8 @@ static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(m job.data.resourceManager.loadDataBufferNode.pFilePath = pFilePathCopy; job.data.resourceManager.loadDataBufferNode.pFilePathW = pFilePathWCopy; job.data.resourceManager.loadDataBufferNode.flags = flags; - job.data.resourceManager.loadDataBufferNode.pInitNotification = ((flags & MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_WAIT_INIT) != 0) ? pInitNotification : nullptr; - job.data.resourceManager.loadDataBufferNode.pDoneNotification = nullptr; + job.data.resourceManager.loadDataBufferNode.pInitNotification = ((flags & MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_WAIT_INIT) != 0) ? pInitNotification : NULL; + job.data.resourceManager.loadDataBufferNode.pDoneNotification = NULL; job.data.resourceManager.loadDataBufferNode.pInitFence = pInitFence; job.data.resourceManager.loadDataBufferNode.pDoneFence = pDoneFence; @@ -70737,8 +70737,8 @@ static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(m In the WAIT_INIT case, these will have already been released in ma_job_process() so we should only release fences in this branch. */ - if (pInitFence != nullptr) { ma_fence_release(pInitFence); } - if (pDoneFence != nullptr) { ma_fence_release(pDoneFence); } + if (pInitFence != NULL) { ma_fence_release(pInitFence); } + if (pDoneFence != NULL) { ma_fence_release(pDoneFence); } /* These will have been freed by the job thread, but with WAIT_INIT they will already have happened since the job has already been handled. */ ma_free(pFilePathCopy, &pResourceManager->config.allocationCallbacks); @@ -70754,7 +70754,7 @@ static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(m } done: - if (ppDataBufferNode != nullptr) { + if (ppDataBufferNode != NULL) { *ppDataBufferNode = pDataBufferNode; } @@ -70765,19 +70765,19 @@ static ma_result ma_resource_manager_data_buffer_node_acquire(ma_resource_manage { ma_result result = MA_SUCCESS; ma_bool32 nodeAlreadyExists = MA_FALSE; - ma_resource_manager_data_buffer_node* pDataBufferNode = nullptr; + ma_resource_manager_data_buffer_node* pDataBufferNode = NULL; ma_resource_manager_inline_notification initNotification; /* Used when the WAIT_INIT flag is set. */ - if (ppDataBufferNode != nullptr) { - *ppDataBufferNode = nullptr; /* Safety. */ + if (ppDataBufferNode != NULL) { + *ppDataBufferNode = NULL; /* Safety. */ } - if (pResourceManager == nullptr || (pFilePath == nullptr && pFilePathW == nullptr && hashedName32 == 0)) { + if (pResourceManager == NULL || (pFilePath == NULL && pFilePathW == NULL && hashedName32 == 0)) { return MA_INVALID_ARGS; } /* If we're specifying existing data, it must be valid. */ - if (pExistingData != nullptr && pExistingData->type == ma_resource_manager_data_supply_type_unknown) { + if (pExistingData != NULL && pExistingData->type == ma_resource_manager_data_supply_type_unknown) { return MA_INVALID_ARGS; } @@ -70787,7 +70787,7 @@ static ma_result ma_resource_manager_data_buffer_node_acquire(ma_resource_manage } if (hashedName32 == 0) { - if (pFilePath != nullptr) { + if (pFilePath != NULL) { hashedName32 = ma_hash_string_32(pFilePath); } else { hashedName32 = ma_hash_string_w_32(pFilePathW); @@ -70823,7 +70823,7 @@ static ma_result ma_resource_manager_data_buffer_node_acquire(ma_resource_manage the node is initialized by the decoding thread(s). */ if (nodeAlreadyExists == MA_FALSE) { /* Don't need to try loading anything if the node already exists. */ - if (pFilePath == nullptr && pFilePathW == nullptr) { + if (pFilePath == NULL && pFilePathW == NULL) { /* If this path is hit, it means a buffer is being copied (i.e. initialized from only the hashed name), but that node has been freed in the meantime, probably from some other @@ -70883,7 +70883,7 @@ static ma_result ma_resource_manager_data_buffer_node_acquire(ma_resource_manage } } else { /* The data is not managed by the resource manager so there's nothing else to do. */ - MA_ASSERT(pExistingData != nullptr); + MA_ASSERT(pExistingData != NULL); } } @@ -70906,7 +70906,7 @@ done: } } - if (ppDataBufferNode != nullptr) { + if (ppDataBufferNode != NULL) { *ppDataBufferNode = pDataBufferNode; } @@ -70919,16 +70919,16 @@ static ma_result ma_resource_manager_data_buffer_node_unacquire(ma_resource_mana ma_uint32 refCount = 0xFFFFFFFF; /* The new reference count of the node after decrementing. Initialize to non-0 to be safe we don't fall into the freeing path. */ ma_uint32 hashedName32 = 0; - if (pResourceManager == nullptr) { + if (pResourceManager == NULL) { return MA_INVALID_ARGS; } - if (pDataBufferNode == nullptr) { - if (pName == nullptr && pNameW == nullptr) { + if (pDataBufferNode == NULL) { + if (pName == NULL && pNameW == NULL) { return MA_INVALID_ARGS; } - if (pName != nullptr) { + if (pName != NULL) { hashedName32 = ma_hash_string_32(pName); } else { hashedName32 = ma_hash_string_w_32(pNameW); @@ -70943,7 +70943,7 @@ static ma_result ma_resource_manager_data_buffer_node_unacquire(ma_resource_mana ma_resource_manager_data_buffer_bst_lock(pResourceManager); { /* Might need to find the node. Must be done inside the critical section. */ - if (pDataBufferNode == nullptr) { + if (pDataBufferNode == NULL) { result = ma_resource_manager_data_buffer_node_search(pResourceManager, hashedName32, &pDataBufferNode); if (result != MA_SUCCESS) { goto stage2; /* Couldn't find the node. */ @@ -71017,7 +71017,7 @@ stage2: static ma_uint32 ma_resource_manager_data_buffer_next_execution_order(ma_resource_manager_data_buffer* pDataBuffer) { - MA_ASSERT(pDataBuffer != nullptr); + MA_ASSERT(pDataBuffer != NULL); return ma_atomic_fetch_add_32(&pDataBuffer->executionCounter, 1); } @@ -71049,7 +71049,7 @@ static ma_result ma_resource_manager_data_buffer_cb__get_length_in_pcm_frames(ma static ma_result ma_resource_manager_data_buffer_cb__set_looping(ma_data_source* pDataSource, ma_bool32 isLooping) { ma_resource_manager_data_buffer* pDataBuffer = (ma_resource_manager_data_buffer*)pDataSource; - MA_ASSERT(pDataBuffer != nullptr); + MA_ASSERT(pDataBuffer != NULL); ma_atomic_exchange_32(&pDataBuffer->isLooping, isLooping); @@ -71079,8 +71079,8 @@ static ma_result ma_resource_manager_data_buffer_init_ex_internal(ma_resource_ma ma_uint32 flags; ma_resource_manager_pipeline_notifications notifications; - if (pDataBuffer == nullptr) { - if (pConfig != nullptr && pConfig->pNotifications != nullptr) { + if (pDataBuffer == NULL) { + if (pConfig != NULL && pConfig->pNotifications != NULL) { ma_resource_manager_pipeline_notifications_signal_all_notifications(pConfig->pNotifications); } @@ -71089,12 +71089,12 @@ static ma_result ma_resource_manager_data_buffer_init_ex_internal(ma_resource_ma MA_ZERO_OBJECT(pDataBuffer); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } - if (pConfig->pNotifications != nullptr) { - notifications = *pConfig->pNotifications; /* From here on out we should be referencing `notifications` instead of `pNotifications`. Set this to nullptr to catch errors at testing time. */ + if (pConfig->pNotifications != NULL) { + notifications = *pConfig->pNotifications; /* From here on out we should be referencing `notifications` instead of `pNotifications`. Set this to NULL to catch errors at testing time. */ } else { MA_ZERO_OBJECT(¬ifications); } @@ -71126,7 +71126,7 @@ static ma_result ma_resource_manager_data_buffer_init_ex_internal(ma_resource_ma ma_resource_manager_pipeline_notifications_acquire_all_fences(¬ifications); { /* We first need to acquire a node. If ASYNC is not set, this will not return until the entire sound has been loaded. */ - result = ma_resource_manager_data_buffer_node_acquire(pResourceManager, pConfig->pFilePath, pConfig->pFilePathW, hashedName32, flags, nullptr, notifications.init.pFence, notifications.done.pFence, &pDataBufferNode); + result = ma_resource_manager_data_buffer_node_acquire(pResourceManager, pConfig->pFilePath, pConfig->pFilePathW, hashedName32, flags, NULL, notifications.init.pFence, notifications.done.pFence, &pDataBufferNode); if (result != MA_SUCCESS) { ma_resource_manager_pipeline_notifications_signal_all_notifications(¬ifications); goto done; @@ -71137,7 +71137,7 @@ static ma_result ma_resource_manager_data_buffer_init_ex_internal(ma_resource_ma result = ma_data_source_init(&dataSourceConfig, &pDataBuffer->ds); if (result != MA_SUCCESS) { - ma_resource_manager_data_buffer_node_unacquire(pResourceManager, pDataBufferNode, nullptr, nullptr); + ma_resource_manager_data_buffer_node_unacquire(pResourceManager, pDataBufferNode, NULL, NULL); ma_resource_manager_pipeline_notifications_signal_all_notifications(¬ifications); goto done; } @@ -71150,7 +71150,7 @@ static ma_result ma_resource_manager_data_buffer_init_ex_internal(ma_resource_ma /* If we're loading asynchronously we need to post a job to the job queue to initialize the connector. */ if (async == MA_FALSE || ma_resource_manager_data_buffer_node_result(pDataBufferNode) == MA_SUCCESS) { /* Loading synchronously or the data has already been fully loaded. We can just initialize the connector from here without a job. */ - result = ma_resource_manager_data_buffer_init_connector(pDataBuffer, pConfig, nullptr, nullptr); + result = ma_resource_manager_data_buffer_init_connector(pDataBuffer, pConfig, NULL, NULL); ma_atomic_exchange_i32(&pDataBuffer->result, result); ma_resource_manager_pipeline_notifications_signal_all_notifications(¬ifications); @@ -71205,7 +71205,7 @@ static ma_result ma_resource_manager_data_buffer_init_ex_internal(ma_resource_ma if ((flags & MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_WAIT_INIT) != 0) { ma_resource_manager_inline_notification_wait(&initNotification); - if (notifications.init.pNotification != nullptr) { + if (notifications.init.pNotification != NULL) { ma_async_notification_signal(notifications.init.pNotification); } @@ -71225,7 +71225,7 @@ static ma_result ma_resource_manager_data_buffer_init_ex_internal(ma_resource_ma } if (result != MA_SUCCESS) { - ma_resource_manager_data_buffer_node_unacquire(pResourceManager, pDataBufferNode, nullptr, nullptr); + ma_resource_manager_data_buffer_node_unacquire(pResourceManager, pDataBufferNode, NULL, NULL); goto done; } } @@ -71274,11 +71274,11 @@ MA_API ma_result ma_resource_manager_data_buffer_init_copy(ma_resource_manager* { ma_resource_manager_data_source_config config; - if (pExistingDataBuffer == nullptr) { + if (pExistingDataBuffer == NULL) { return MA_INVALID_ARGS; } - MA_ASSERT(pExistingDataBuffer->pNode != nullptr); /* <-- If you've triggered this, you've passed in an invalid existing data buffer. */ + MA_ASSERT(pExistingDataBuffer->pNode != NULL); /* <-- If you've triggered this, you've passed in an invalid existing data buffer. */ config = ma_resource_manager_data_source_config_init(); config.flags = pExistingDataBuffer->flags; @@ -71288,13 +71288,13 @@ MA_API ma_result ma_resource_manager_data_buffer_init_copy(ma_resource_manager* static ma_result ma_resource_manager_data_buffer_uninit_internal(ma_resource_manager_data_buffer* pDataBuffer) { - MA_ASSERT(pDataBuffer != nullptr); + MA_ASSERT(pDataBuffer != NULL); /* The connector should be uninitialized first. */ ma_resource_manager_data_buffer_uninit_connector(pDataBuffer->pResourceManager, pDataBuffer); /* With the connector uninitialized we can unacquire the node. */ - ma_resource_manager_data_buffer_node_unacquire(pDataBuffer->pResourceManager, pDataBuffer->pNode, nullptr, nullptr); + ma_resource_manager_data_buffer_node_unacquire(pDataBuffer->pResourceManager, pDataBuffer->pNode, NULL, NULL); /* The base data source needs to be uninitialized as well. */ ma_data_source_uninit(&pDataBuffer->ds); @@ -71306,7 +71306,7 @@ MA_API ma_result ma_resource_manager_data_buffer_uninit(ma_resource_manager_data { ma_result result; - if (pDataBuffer == nullptr) { + if (pDataBuffer == NULL) { return MA_INVALID_ARGS; } @@ -71337,7 +71337,7 @@ MA_API ma_result ma_resource_manager_data_buffer_uninit(ma_resource_manager_data job.order = ma_resource_manager_data_buffer_next_execution_order(pDataBuffer); job.data.resourceManager.freeDataBuffer.pDataBuffer = pDataBuffer; job.data.resourceManager.freeDataBuffer.pDoneNotification = ¬ification; - job.data.resourceManager.freeDataBuffer.pDoneFence = nullptr; + job.data.resourceManager.freeDataBuffer.pDoneFence = NULL; result = ma_resource_manager_post_job(pDataBuffer->pResourceManager, &job); if (result != MA_SUCCESS) { @@ -71358,7 +71358,7 @@ MA_API ma_result ma_resource_manager_data_buffer_read_pcm_frames(ma_resource_man ma_bool32 isDecodedBufferBusy = MA_FALSE; /* Safety. */ - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -71452,7 +71452,7 @@ MA_API ma_result ma_resource_manager_data_buffer_read_pcm_frames(ma_resource_man result = MA_BUSY; } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = framesRead; } @@ -71533,7 +71533,7 @@ MA_API ma_result ma_resource_manager_data_buffer_get_data_format(ma_resource_man MA_API ma_result ma_resource_manager_data_buffer_get_cursor_in_pcm_frames(ma_resource_manager_data_buffer* pDataBuffer, ma_uint64* pCursor) { - if (pDataBuffer == nullptr || pCursor == nullptr) { + if (pDataBuffer == NULL || pCursor == NULL) { return MA_INVALID_ARGS; } @@ -71573,7 +71573,7 @@ MA_API ma_result ma_resource_manager_data_buffer_get_cursor_in_pcm_frames(ma_res MA_API ma_result ma_resource_manager_data_buffer_get_length_in_pcm_frames(ma_resource_manager_data_buffer* pDataBuffer, ma_uint64* pLength) { - if (pDataBuffer == nullptr || pLength == nullptr) { + if (pDataBuffer == NULL || pLength == NULL) { return MA_INVALID_ARGS; } @@ -71589,7 +71589,7 @@ MA_API ma_result ma_resource_manager_data_buffer_get_length_in_pcm_frames(ma_res MA_API ma_result ma_resource_manager_data_buffer_result(const ma_resource_manager_data_buffer* pDataBuffer) { - if (pDataBuffer == nullptr) { + if (pDataBuffer == NULL) { return MA_INVALID_ARGS; } @@ -71608,13 +71608,13 @@ MA_API ma_bool32 ma_resource_manager_data_buffer_is_looping(const ma_resource_ma MA_API ma_result ma_resource_manager_data_buffer_get_available_frames(ma_resource_manager_data_buffer* pDataBuffer, ma_uint64* pAvailableFrames) { - if (pAvailableFrames == nullptr) { + if (pAvailableFrames == NULL) { return MA_INVALID_ARGS; } *pAvailableFrames = 0; - if (pDataBuffer == nullptr) { + if (pDataBuffer == NULL) { return MA_INVALID_ARGS; } @@ -71663,18 +71663,18 @@ MA_API ma_result ma_resource_manager_data_buffer_get_available_frames(ma_resourc MA_API ma_result ma_resource_manager_register_file(ma_resource_manager* pResourceManager, const char* pFilePath, ma_uint32 flags) { - return ma_resource_manager_data_buffer_node_acquire(pResourceManager, pFilePath, nullptr, 0, flags, nullptr, nullptr, nullptr, nullptr); + return ma_resource_manager_data_buffer_node_acquire(pResourceManager, pFilePath, NULL, 0, flags, NULL, NULL, NULL, NULL); } MA_API ma_result ma_resource_manager_register_file_w(ma_resource_manager* pResourceManager, const wchar_t* pFilePath, ma_uint32 flags) { - return ma_resource_manager_data_buffer_node_acquire(pResourceManager, nullptr, pFilePath, 0, flags, nullptr, nullptr, nullptr, nullptr); + return ma_resource_manager_data_buffer_node_acquire(pResourceManager, NULL, pFilePath, 0, flags, NULL, NULL, NULL, NULL); } static ma_result ma_resource_manager_register_data(ma_resource_manager* pResourceManager, const char* pName, const wchar_t* pNameW, ma_resource_manager_data_supply* pExistingData) { - return ma_resource_manager_data_buffer_node_acquire(pResourceManager, pName, pNameW, 0, 0, pExistingData, nullptr, nullptr, nullptr); + return ma_resource_manager_data_buffer_node_acquire(pResourceManager, pName, pNameW, 0, 0, pExistingData, NULL, NULL, NULL); } static ma_result ma_resource_manager_register_decoded_data_internal(ma_resource_manager* pResourceManager, const char* pName, const wchar_t* pNameW, const void* pData, ma_uint64 frameCount, ma_format format, ma_uint32 channels, ma_uint32 sampleRate) @@ -71692,12 +71692,12 @@ static ma_result ma_resource_manager_register_decoded_data_internal(ma_resource_ MA_API ma_result ma_resource_manager_register_decoded_data(ma_resource_manager* pResourceManager, const char* pName, const void* pData, ma_uint64 frameCount, ma_format format, ma_uint32 channels, ma_uint32 sampleRate) { - return ma_resource_manager_register_decoded_data_internal(pResourceManager, pName, nullptr, pData, frameCount, format, channels, sampleRate); + return ma_resource_manager_register_decoded_data_internal(pResourceManager, pName, NULL, pData, frameCount, format, channels, sampleRate); } MA_API ma_result ma_resource_manager_register_decoded_data_w(ma_resource_manager* pResourceManager, const wchar_t* pName, const void* pData, ma_uint64 frameCount, ma_format format, ma_uint32 channels, ma_uint32 sampleRate) { - return ma_resource_manager_register_decoded_data_internal(pResourceManager, nullptr, pName, pData, frameCount, format, channels, sampleRate); + return ma_resource_manager_register_decoded_data_internal(pResourceManager, NULL, pName, pData, frameCount, format, channels, sampleRate); } @@ -71713,12 +71713,12 @@ static ma_result ma_resource_manager_register_encoded_data_internal(ma_resource_ MA_API ma_result ma_resource_manager_register_encoded_data(ma_resource_manager* pResourceManager, const char* pName, const void* pData, size_t sizeInBytes) { - return ma_resource_manager_register_encoded_data_internal(pResourceManager, pName, nullptr, pData, sizeInBytes); + return ma_resource_manager_register_encoded_data_internal(pResourceManager, pName, NULL, pData, sizeInBytes); } MA_API ma_result ma_resource_manager_register_encoded_data_w(ma_resource_manager* pResourceManager, const wchar_t* pName, const void* pData, size_t sizeInBytes) { - return ma_resource_manager_register_encoded_data_internal(pResourceManager, nullptr, pName, pData, sizeInBytes); + return ma_resource_manager_register_encoded_data_internal(pResourceManager, NULL, pName, pData, sizeInBytes); } @@ -71734,30 +71734,30 @@ MA_API ma_result ma_resource_manager_unregister_file_w(ma_resource_manager* pRes MA_API ma_result ma_resource_manager_unregister_data(ma_resource_manager* pResourceManager, const char* pName) { - return ma_resource_manager_data_buffer_node_unacquire(pResourceManager, nullptr, pName, nullptr); + return ma_resource_manager_data_buffer_node_unacquire(pResourceManager, NULL, pName, NULL); } MA_API ma_result ma_resource_manager_unregister_data_w(ma_resource_manager* pResourceManager, const wchar_t* pName) { - return ma_resource_manager_data_buffer_node_unacquire(pResourceManager, nullptr, nullptr, pName); + return ma_resource_manager_data_buffer_node_unacquire(pResourceManager, NULL, NULL, pName); } static ma_uint32 ma_resource_manager_data_stream_next_execution_order(ma_resource_manager_data_stream* pDataStream) { - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); return ma_atomic_fetch_add_32(&pDataStream->executionCounter, 1); } static ma_bool32 ma_resource_manager_data_stream_is_decoder_at_end(const ma_resource_manager_data_stream* pDataStream) { - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); return ma_atomic_load_32((ma_bool32*)&pDataStream->isDecoderAtEnd); } static ma_uint32 ma_resource_manager_data_stream_seek_counter(const ma_resource_manager_data_stream* pDataStream) { - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); return ma_atomic_load_32((ma_uint32*)&pDataStream->seekCounter); } @@ -71790,7 +71790,7 @@ static ma_result ma_resource_manager_data_stream_cb__get_length_in_pcm_frames(ma static ma_result ma_resource_manager_data_stream_cb__set_looping(ma_data_source* pDataSource, ma_bool32 isLooping) { ma_resource_manager_data_stream* pDataStream = (ma_resource_manager_data_stream*)pDataSource; - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); ma_atomic_exchange_32(&pDataStream->isLooping, isLooping); @@ -71822,16 +71822,16 @@ MA_API ma_result ma_resource_manager_data_stream_init_ex(ma_resource_manager* pR { ma_result result; ma_data_source_config dataSourceConfig; - char* pFilePathCopy = nullptr; - wchar_t* pFilePathWCopy = nullptr; + char* pFilePathCopy = NULL; + wchar_t* pFilePathWCopy = NULL; ma_job job; ma_bool32 waitBeforeReturning = MA_FALSE; ma_resource_manager_inline_notification waitNotification; ma_resource_manager_pipeline_notifications notifications; ma_uint32 flags; - if (pDataStream == nullptr) { - if (pConfig != nullptr && pConfig->pNotifications != nullptr) { + if (pDataStream == NULL) { + if (pConfig != NULL && pConfig->pNotifications != NULL) { ma_resource_manager_pipeline_notifications_signal_all_notifications(pConfig->pNotifications); } @@ -71840,12 +71840,12 @@ MA_API ma_result ma_resource_manager_data_stream_init_ex(ma_resource_manager* pR MA_ZERO_OBJECT(pDataStream); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } - if (pConfig->pNotifications != nullptr) { - notifications = *pConfig->pNotifications; /* From here on out, `notifications` should be used instead of `pNotifications`. Setting this to nullptr to catch any errors at testing time. */ + if (pConfig->pNotifications != NULL) { + notifications = *pConfig->pNotifications; /* From here on out, `notifications` should be used instead of `pNotifications`. Setting this to NULL to catch any errors at testing time. */ } else { MA_ZERO_OBJECT(¬ifications); } @@ -71872,7 +71872,7 @@ MA_API ma_result ma_resource_manager_data_stream_init_ex(ma_resource_manager* pR ma_data_source_set_loop_point_in_pcm_frames(pDataStream, pConfig->loopPointBegInPCMFrames, pConfig->loopPointEndInPCMFrames); ma_data_source_set_looping(pDataStream, (flags & MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_LOOPING) != 0); - if (pResourceManager == nullptr || (pConfig->pFilePath == nullptr && pConfig->pFilePathW == nullptr)) { + if (pResourceManager == NULL || (pConfig->pFilePath == NULL && pConfig->pFilePathW == NULL)) { ma_resource_manager_pipeline_notifications_signal_all_notifications(¬ifications); return MA_INVALID_ARGS; } @@ -71880,13 +71880,13 @@ MA_API ma_result ma_resource_manager_data_stream_init_ex(ma_resource_manager* pR /* We want all access to the VFS and the internal decoder to happen on the job thread just to keep things easier to manage for the VFS. */ /* We need a copy of the file path. We should probably make this more efficient, but for now we'll do a transient memory allocation. */ - if (pConfig->pFilePath != nullptr) { + if (pConfig->pFilePath != NULL) { pFilePathCopy = ma_copy_string(pConfig->pFilePath, &pResourceManager->config.allocationCallbacks); } else { pFilePathWCopy = ma_copy_string_w(pConfig->pFilePathW, &pResourceManager->config.allocationCallbacks); } - if (pFilePathCopy == nullptr && pFilePathWCopy == nullptr) { + if (pFilePathCopy == NULL && pFilePathWCopy == NULL) { ma_resource_manager_pipeline_notifications_signal_all_notifications(¬ifications); return MA_OUT_OF_MEMORY; } @@ -71932,7 +71932,7 @@ MA_API ma_result ma_resource_manager_data_stream_init_ex(ma_resource_manager* pR if (waitBeforeReturning) { ma_resource_manager_inline_notification_wait_and_uninit(&waitNotification); - if (notifications.init.pNotification != nullptr) { + if (notifications.init.pNotification != NULL) { ma_async_notification_signal(notifications.init.pNotification); } @@ -71979,7 +71979,7 @@ MA_API ma_result ma_resource_manager_data_stream_uninit(ma_resource_manager_data ma_resource_manager_inline_notification freeEvent; ma_job job; - if (pDataStream == nullptr) { + if (pDataStream == NULL) { return MA_INVALID_ARGS; } @@ -71996,7 +71996,7 @@ MA_API ma_result ma_resource_manager_data_stream_uninit(ma_resource_manager_data job.order = ma_resource_manager_data_stream_next_execution_order(pDataStream); job.data.resourceManager.freeDataStream.pDataStream = pDataStream; job.data.resourceManager.freeDataStream.pDoneNotification = &freeEvent; - job.data.resourceManager.freeDataStream.pDoneFence = nullptr; + job.data.resourceManager.freeDataStream.pDoneFence = NULL; ma_resource_manager_post_job(pDataStream->pResourceManager, &job); /* We need to wait for the job to finish processing before we return. */ @@ -72008,7 +72008,7 @@ MA_API ma_result ma_resource_manager_data_stream_uninit(ma_resource_manager_data static ma_uint32 ma_resource_manager_data_stream_get_page_size_in_frames(ma_resource_manager_data_stream* pDataStream) { - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); MA_ASSERT(pDataStream->isDecoderInitialized == MA_TRUE); return MA_RESOURCE_MANAGER_PAGE_SIZE_IN_MILLISECONDS * (pDataStream->decoder.outputSampleRate/1000); @@ -72016,7 +72016,7 @@ static ma_uint32 ma_resource_manager_data_stream_get_page_size_in_frames(ma_reso static void* ma_resource_manager_data_stream_get_page_data_pointer(ma_resource_manager_data_stream* pDataStream, ma_uint32 pageIndex, ma_uint32 relativeCursor) { - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); MA_ASSERT(pDataStream->isDecoderInitialized == MA_TRUE); MA_ASSERT(pageIndex == 0 || pageIndex == 1); @@ -72062,7 +72062,7 @@ static void ma_resource_manager_data_stream_fill_pages(ma_resource_manager_data_ { ma_uint32 iPage; - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); for (iPage = 0; iPage < 2; iPage += 1) { ma_resource_manager_data_stream_fill_page(pDataStream, iPage); @@ -72078,15 +72078,15 @@ static ma_result ma_resource_manager_data_stream_map(ma_resource_manager_data_st /* We cannot be using the data source after it's been uninitialized. */ MA_ASSERT(ma_resource_manager_data_stream_result(pDataStream) != MA_UNAVAILABLE); - if (pFrameCount != nullptr) { + if (pFrameCount != NULL) { frameCount = *pFrameCount; *pFrameCount = 0; } - if (ppFramesOut != nullptr) { - *ppFramesOut = nullptr; + if (ppFramesOut != NULL) { + *ppFramesOut = NULL; } - if (pDataStream == nullptr || ppFramesOut == nullptr || pFrameCount == nullptr) { + if (pDataStream == NULL || ppFramesOut == NULL || pFrameCount == NULL) { return MA_INVALID_ARGS; } @@ -72143,7 +72143,7 @@ static ma_result ma_resource_manager_data_stream_unmap(ma_resource_manager_data_ /* We cannot be using the data source after it's been uninitialized. */ MA_ASSERT(ma_resource_manager_data_stream_result(pDataStream) != MA_UNAVAILABLE); - if (pDataStream == nullptr) { + if (pDataStream == NULL) { return MA_INVALID_ARGS; } @@ -72197,7 +72197,7 @@ MA_API ma_result ma_resource_manager_data_stream_read_pcm_frames(ma_resource_man ma_uint32 channels; /* Safety. */ - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -72208,7 +72208,7 @@ MA_API ma_result ma_resource_manager_data_stream_read_pcm_frames(ma_resource_man /* We cannot be using the data source after it's been uninitialized. */ MA_ASSERT(ma_resource_manager_data_stream_result(pDataStream) != MA_UNAVAILABLE); - if (pDataStream == nullptr) { + if (pDataStream == NULL) { return MA_INVALID_ARGS; } @@ -72221,7 +72221,7 @@ MA_API ma_result ma_resource_manager_data_stream_read_pcm_frames(ma_resource_man return MA_BUSY; } - ma_resource_manager_data_stream_get_data_format(pDataStream, &format, &channels, nullptr, nullptr, 0); + ma_resource_manager_data_stream_get_data_format(pDataStream, &format, &channels, NULL, NULL, 0); /* Reading is implemented in terms of map/unmap. We need to run this in a loop because mapping is clamped against page boundaries. */ totalFramesProcessed = 0; @@ -72235,8 +72235,8 @@ MA_API ma_result ma_resource_manager_data_stream_read_pcm_frames(ma_resource_man break; } - /* Copy the mapped data to the output buffer if we have one. It's allowed for pFramesOut to be nullptr in which case a relative forward seek is performed. */ - if (pFramesOut != nullptr) { + /* Copy the mapped data to the output buffer if we have one. It's allowed for pFramesOut to be NULL in which case a relative forward seek is performed. */ + if (pFramesOut != NULL) { ma_copy_pcm_frames(ma_offset_pcm_frames_ptr(pFramesOut, totalFramesProcessed, format, channels), pMappedFrames, mappedFrameCount, format, channels); } @@ -72248,7 +72248,7 @@ MA_API ma_result ma_resource_manager_data_stream_read_pcm_frames(ma_resource_man } } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesProcessed; } @@ -72269,7 +72269,7 @@ MA_API ma_result ma_resource_manager_data_stream_seek_to_pcm_frame(ma_resource_m /* We cannot be using the data source after it's been uninitialized. */ MA_ASSERT(streamResult != MA_UNAVAILABLE); - if (pDataStream == nullptr) { + if (pDataStream == NULL) { return MA_INVALID_ARGS; } @@ -72320,23 +72320,23 @@ MA_API ma_result ma_resource_manager_data_stream_get_data_format(ma_resource_man /* We cannot be using the data source after it's been uninitialized. */ MA_ASSERT(ma_resource_manager_data_stream_result(pDataStream) != MA_UNAVAILABLE); - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = ma_format_unknown; } - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = 0; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = 0; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { MA_ZERO_MEMORY(pChannelMap, sizeof(*pChannelMap) * channelMapCap); } - if (pDataStream == nullptr) { + if (pDataStream == NULL) { return MA_INVALID_ARGS; } @@ -72355,7 +72355,7 @@ MA_API ma_result ma_resource_manager_data_stream_get_cursor_in_pcm_frames(ma_res { ma_result result; - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } @@ -72364,7 +72364,7 @@ MA_API ma_result ma_resource_manager_data_stream_get_cursor_in_pcm_frames(ma_res /* We cannot be using the data source after it's been uninitialized. */ MA_ASSERT(ma_resource_manager_data_stream_result(pDataStream) != MA_UNAVAILABLE); - if (pDataStream == nullptr) { + if (pDataStream == NULL) { return MA_INVALID_ARGS; } @@ -72387,7 +72387,7 @@ MA_API ma_result ma_resource_manager_data_stream_get_length_in_pcm_frames(ma_res { ma_result streamResult; - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } @@ -72398,7 +72398,7 @@ MA_API ma_result ma_resource_manager_data_stream_get_length_in_pcm_frames(ma_res /* We cannot be using the data source after it's been uninitialized. */ MA_ASSERT(streamResult != MA_UNAVAILABLE); - if (pDataStream == nullptr) { + if (pDataStream == NULL) { return MA_INVALID_ARGS; } @@ -72420,7 +72420,7 @@ MA_API ma_result ma_resource_manager_data_stream_get_length_in_pcm_frames(ma_res MA_API ma_result ma_resource_manager_data_stream_result(const ma_resource_manager_data_stream* pDataStream) { - if (pDataStream == nullptr) { + if (pDataStream == NULL) { return MA_INVALID_ARGS; } @@ -72434,7 +72434,7 @@ MA_API ma_result ma_resource_manager_data_stream_set_looping(ma_resource_manager MA_API ma_bool32 ma_resource_manager_data_stream_is_looping(const ma_resource_manager_data_stream* pDataStream) { - if (pDataStream == nullptr) { + if (pDataStream == NULL) { return MA_FALSE; } @@ -72448,13 +72448,13 @@ MA_API ma_result ma_resource_manager_data_stream_get_available_frames(ma_resourc ma_uint32 relativeCursor; ma_uint64 availableFrames; - if (pAvailableFrames == nullptr) { + if (pAvailableFrames == NULL) { return MA_INVALID_ARGS; } *pAvailableFrames = 0; - if (pDataStream == nullptr) { + if (pDataStream == NULL) { return MA_INVALID_ARGS; } @@ -72477,17 +72477,17 @@ MA_API ma_result ma_resource_manager_data_stream_get_available_frames(ma_resourc static ma_result ma_resource_manager_data_source_preinit(ma_resource_manager* pResourceManager, const ma_resource_manager_data_source_config* pConfig, ma_resource_manager_data_source* pDataSource) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pDataSource); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } - if (pResourceManager == nullptr) { + if (pResourceManager == NULL) { return MA_INVALID_ARGS; } @@ -72545,7 +72545,7 @@ MA_API ma_result ma_resource_manager_data_source_init_copy(ma_resource_manager* ma_result result; ma_resource_manager_data_source_config config; - if (pExistingDataSource == nullptr) { + if (pExistingDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72567,7 +72567,7 @@ MA_API ma_result ma_resource_manager_data_source_init_copy(ma_resource_manager* MA_API ma_result ma_resource_manager_data_source_uninit(ma_resource_manager_data_source* pDataSource) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72582,11 +72582,11 @@ MA_API ma_result ma_resource_manager_data_source_uninit(ma_resource_manager_data MA_API ma_result ma_resource_manager_data_source_read_pcm_frames(ma_resource_manager_data_source* pDataSource, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead) { /* Safety. */ - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72599,7 +72599,7 @@ MA_API ma_result ma_resource_manager_data_source_read_pcm_frames(ma_resource_man MA_API ma_result ma_resource_manager_data_source_seek_to_pcm_frame(ma_resource_manager_data_source* pDataSource, ma_uint64 frameIndex) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72612,7 +72612,7 @@ MA_API ma_result ma_resource_manager_data_source_seek_to_pcm_frame(ma_resource_m MA_API ma_result ma_resource_manager_data_source_map(ma_resource_manager_data_source* pDataSource, void** ppFramesOut, ma_uint64* pFrameCount) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72625,7 +72625,7 @@ MA_API ma_result ma_resource_manager_data_source_map(ma_resource_manager_data_so MA_API ma_result ma_resource_manager_data_source_unmap(ma_resource_manager_data_source* pDataSource, ma_uint64 frameCount) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72638,7 +72638,7 @@ MA_API ma_result ma_resource_manager_data_source_unmap(ma_resource_manager_data_ MA_API ma_result ma_resource_manager_data_source_get_data_format(ma_resource_manager_data_source* pDataSource, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72651,7 +72651,7 @@ MA_API ma_result ma_resource_manager_data_source_get_data_format(ma_resource_man MA_API ma_result ma_resource_manager_data_source_get_cursor_in_pcm_frames(ma_resource_manager_data_source* pDataSource, ma_uint64* pCursor) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72664,7 +72664,7 @@ MA_API ma_result ma_resource_manager_data_source_get_cursor_in_pcm_frames(ma_res MA_API ma_result ma_resource_manager_data_source_get_length_in_pcm_frames(ma_resource_manager_data_source* pDataSource, ma_uint64* pLength) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72677,7 +72677,7 @@ MA_API ma_result ma_resource_manager_data_source_get_length_in_pcm_frames(ma_res MA_API ma_result ma_resource_manager_data_source_result(const ma_resource_manager_data_source* pDataSource) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72690,7 +72690,7 @@ MA_API ma_result ma_resource_manager_data_source_result(const ma_resource_manage MA_API ma_result ma_resource_manager_data_source_set_looping(ma_resource_manager_data_source* pDataSource, ma_bool32 isLooping) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72703,7 +72703,7 @@ MA_API ma_result ma_resource_manager_data_source_set_looping(ma_resource_manager MA_API ma_bool32 ma_resource_manager_data_source_is_looping(const ma_resource_manager_data_source* pDataSource) { - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_FALSE; } @@ -72716,13 +72716,13 @@ MA_API ma_bool32 ma_resource_manager_data_source_is_looping(const ma_resource_ma MA_API ma_result ma_resource_manager_data_source_get_available_frames(ma_resource_manager_data_source* pDataSource, ma_uint64* pAvailableFrames) { - if (pAvailableFrames == nullptr) { + if (pAvailableFrames == NULL) { return MA_INVALID_ARGS; } *pAvailableFrames = 0; - if (pDataSource == nullptr) { + if (pDataSource == NULL) { return MA_INVALID_ARGS; } @@ -72736,7 +72736,7 @@ MA_API ma_result ma_resource_manager_data_source_get_available_frames(ma_resourc MA_API ma_result ma_resource_manager_post_job(ma_resource_manager* pResourceManager, const ma_job* pJob) { - if (pResourceManager == nullptr) { + if (pResourceManager == NULL) { return MA_INVALID_ARGS; } @@ -72751,7 +72751,7 @@ MA_API ma_result ma_resource_manager_post_job_quit(ma_resource_manager* pResourc MA_API ma_result ma_resource_manager_next_job(ma_resource_manager* pResourceManager, ma_job* pJob) { - if (pResourceManager == nullptr) { + if (pResourceManager == NULL) { return MA_INVALID_ARGS; } @@ -72765,13 +72765,13 @@ static ma_result ma_job_process__resource_manager__load_data_buffer_node(ma_job* ma_resource_manager* pResourceManager; ma_resource_manager_data_buffer_node* pDataBufferNode; - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); pResourceManager = (ma_resource_manager*)pJob->data.resourceManager.loadDataBufferNode.pResourceManager; - MA_ASSERT(pResourceManager != nullptr); + MA_ASSERT(pResourceManager != NULL); pDataBufferNode = (ma_resource_manager_data_buffer_node*)pJob->data.resourceManager.loadDataBufferNode.pDataBufferNode; - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pDataBufferNode != NULL); MA_ASSERT(pDataBufferNode->isDataOwnedByResourceManager == MA_TRUE); /* The data should always be owned by the resource manager. */ /* The data buffer is not getting deleted, but we may be getting executed out of order. If so, we need to push the job back onto the queue and return. */ @@ -72825,7 +72825,7 @@ static ma_result ma_job_process__resource_manager__load_data_buffer_node(ma_job* } if (result != MA_SUCCESS) { - if (pJob->data.resourceManager.loadDataBufferNode.pFilePath != nullptr) { + if (pJob->data.resourceManager.loadDataBufferNode.pFilePath != NULL) { ma_log_postf(ma_resource_manager_get_log(pResourceManager), MA_LOG_LEVEL_WARNING, "Failed to initialize data supply for \"%s\". %s.\n", pJob->data.resourceManager.loadDataBufferNode.pFilePath, ma_result_description(result)); } else { #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(_MSC_VER) @@ -72889,19 +72889,19 @@ done: ma_atomic_compare_and_swap_i32(&pDataBufferNode->result, MA_BUSY, result); /* At this point initialization is complete and we can signal the notification if any. */ - if (pJob->data.resourceManager.loadDataBufferNode.pInitNotification != nullptr) { + if (pJob->data.resourceManager.loadDataBufferNode.pInitNotification != NULL) { ma_async_notification_signal(pJob->data.resourceManager.loadDataBufferNode.pInitNotification); } - if (pJob->data.resourceManager.loadDataBufferNode.pInitFence != nullptr) { + if (pJob->data.resourceManager.loadDataBufferNode.pInitFence != NULL) { ma_fence_release(pJob->data.resourceManager.loadDataBufferNode.pInitFence); } /* If we have a success result it means we've fully loaded the buffer. This will happen in the non-decoding case. */ if (result != MA_BUSY) { - if (pJob->data.resourceManager.loadDataBufferNode.pDoneNotification != nullptr) { + if (pJob->data.resourceManager.loadDataBufferNode.pDoneNotification != NULL) { ma_async_notification_signal(pJob->data.resourceManager.loadDataBufferNode.pDoneNotification); } - if (pJob->data.resourceManager.loadDataBufferNode.pDoneFence != nullptr) { + if (pJob->data.resourceManager.loadDataBufferNode.pDoneFence != NULL) { ma_fence_release(pJob->data.resourceManager.loadDataBufferNode.pDoneFence); } } @@ -72922,24 +72922,24 @@ static ma_result ma_job_process__resource_manager__free_data_buffer_node(ma_job* ma_resource_manager* pResourceManager; ma_resource_manager_data_buffer_node* pDataBufferNode; - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); pResourceManager = (ma_resource_manager*)pJob->data.resourceManager.freeDataBufferNode.pResourceManager; - MA_ASSERT(pResourceManager != nullptr); + MA_ASSERT(pResourceManager != NULL); pDataBufferNode = (ma_resource_manager_data_buffer_node*)pJob->data.resourceManager.freeDataBufferNode.pDataBufferNode; - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pDataBufferNode != NULL); if (pJob->order != ma_atomic_load_32(&pDataBufferNode->executionPointer)) { return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */ } /* The event needs to be signalled last. */ - if (pJob->data.resourceManager.freeDataBufferNode.pDoneNotification != nullptr) { + if (pJob->data.resourceManager.freeDataBufferNode.pDoneNotification != NULL) { ma_async_notification_signal(pJob->data.resourceManager.freeDataBufferNode.pDoneNotification); } - if (pJob->data.resourceManager.freeDataBufferNode.pDoneFence != nullptr) { + if (pJob->data.resourceManager.freeDataBufferNode.pDoneFence != NULL) { ma_fence_release(pJob->data.resourceManager.freeDataBufferNode.pDoneFence); } @@ -72956,13 +72956,13 @@ static ma_result ma_job_process__resource_manager__page_data_buffer_node(ma_job* ma_resource_manager* pResourceManager; ma_resource_manager_data_buffer_node* pDataBufferNode; - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); pResourceManager = (ma_resource_manager*)pJob->data.resourceManager.pageDataBufferNode.pResourceManager; - MA_ASSERT(pResourceManager != nullptr); + MA_ASSERT(pResourceManager != NULL); pDataBufferNode = (ma_resource_manager_data_buffer_node*)pJob->data.resourceManager.pageDataBufferNode.pDataBufferNode; - MA_ASSERT(pDataBufferNode != nullptr); + MA_ASSERT(pDataBufferNode != NULL); if (pJob->order != ma_atomic_load_32(&pDataBufferNode->executionPointer)) { return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */ @@ -73011,11 +73011,11 @@ done: /* Signal the notification after setting the result in case the notification callback wants to inspect the result code. */ if (result != MA_BUSY) { - if (pJob->data.resourceManager.pageDataBufferNode.pDoneNotification != nullptr) { + if (pJob->data.resourceManager.pageDataBufferNode.pDoneNotification != NULL) { ma_async_notification_signal(pJob->data.resourceManager.pageDataBufferNode.pDoneNotification); } - if (pJob->data.resourceManager.pageDataBufferNode.pDoneFence != nullptr) { + if (pJob->data.resourceManager.pageDataBufferNode.pDoneFence != NULL) { ma_fence_release(pJob->data.resourceManager.pageDataBufferNode.pDoneFence); } } @@ -73037,10 +73037,10 @@ static ma_result ma_job_process__resource_manager__load_data_buffer(ma_job* pJob All we're doing here is checking if the node has finished loading. If not, we just re-post the job and keep waiting. Otherwise we increment the execution counter and set the buffer's result code. */ - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); pDataBuffer = (ma_resource_manager_data_buffer*)pJob->data.resourceManager.loadDataBuffer.pDataBuffer; - MA_ASSERT(pDataBuffer != nullptr); + MA_ASSERT(pDataBuffer != NULL); pResourceManager = pDataBuffer->pResourceManager; @@ -73106,10 +73106,10 @@ done: ma_atomic_compare_and_swap_i32(&pDataBuffer->result, MA_BUSY, result); /* Only signal the other threads after the result has been set just for cleanliness sake. */ - if (pJob->data.resourceManager.loadDataBuffer.pDoneNotification != nullptr) { + if (pJob->data.resourceManager.loadDataBuffer.pDoneNotification != NULL) { ma_async_notification_signal(pJob->data.resourceManager.loadDataBuffer.pDoneNotification); } - if (pJob->data.resourceManager.loadDataBuffer.pDoneFence != nullptr) { + if (pJob->data.resourceManager.loadDataBuffer.pDoneFence != NULL) { ma_fence_release(pJob->data.resourceManager.loadDataBuffer.pDoneFence); } @@ -73118,10 +73118,10 @@ done: notification event was never signalled which means we need to signal it here. */ if (ma_resource_manager_data_buffer_has_connector(pDataBuffer) == MA_FALSE && result != MA_SUCCESS) { - if (pJob->data.resourceManager.loadDataBuffer.pInitNotification != nullptr) { + if (pJob->data.resourceManager.loadDataBuffer.pInitNotification != NULL) { ma_async_notification_signal(pJob->data.resourceManager.loadDataBuffer.pInitNotification); } - if (pJob->data.resourceManager.loadDataBuffer.pInitFence != nullptr) { + if (pJob->data.resourceManager.loadDataBuffer.pInitFence != NULL) { ma_fence_release(pJob->data.resourceManager.loadDataBuffer.pInitFence); } } @@ -73135,10 +73135,10 @@ static ma_result ma_job_process__resource_manager__free_data_buffer(ma_job* pJob ma_resource_manager* pResourceManager; ma_resource_manager_data_buffer* pDataBuffer; - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); pDataBuffer = (ma_resource_manager_data_buffer*)pJob->data.resourceManager.freeDataBuffer.pDataBuffer; - MA_ASSERT(pDataBuffer != nullptr); + MA_ASSERT(pDataBuffer != NULL); pResourceManager = pDataBuffer->pResourceManager; @@ -73149,11 +73149,11 @@ static ma_result ma_job_process__resource_manager__free_data_buffer(ma_job* pJob ma_resource_manager_data_buffer_uninit_internal(pDataBuffer); /* The event needs to be signalled last. */ - if (pJob->data.resourceManager.freeDataBuffer.pDoneNotification != nullptr) { + if (pJob->data.resourceManager.freeDataBuffer.pDoneNotification != NULL) { ma_async_notification_signal(pJob->data.resourceManager.freeDataBuffer.pDoneNotification); } - if (pJob->data.resourceManager.freeDataBuffer.pDoneFence != nullptr) { + if (pJob->data.resourceManager.freeDataBuffer.pDoneFence != NULL) { ma_fence_release(pJob->data.resourceManager.freeDataBuffer.pDoneFence); } @@ -73169,10 +73169,10 @@ static ma_result ma_job_process__resource_manager__load_data_stream(ma_job* pJob ma_resource_manager* pResourceManager; ma_resource_manager_data_stream* pDataStream; - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); pDataStream = (ma_resource_manager_data_stream*)pJob->data.resourceManager.loadDataStream.pDataStream; - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); pResourceManager = pDataStream->pResourceManager; @@ -73188,7 +73188,7 @@ static ma_result ma_job_process__resource_manager__load_data_stream(ma_job* pJob /* We need to initialize the decoder first so we can determine the size of the pages. */ decoderConfig = ma_resource_manager__init_decoder_config(pResourceManager); - if (pJob->data.resourceManager.loadDataStream.pFilePath != nullptr) { + if (pJob->data.resourceManager.loadDataStream.pFilePath != NULL) { result = ma_decoder_init_vfs(pResourceManager->config.pVFS, pJob->data.resourceManager.loadDataStream.pFilePath, &decoderConfig, &pDataStream->decoder); } else { result = ma_decoder_init_vfs_w(pResourceManager->config.pVFS, pJob->data.resourceManager.loadDataStream.pFilePathW, &decoderConfig, &pDataStream->decoder); @@ -73217,7 +73217,7 @@ static ma_result ma_job_process__resource_manager__load_data_stream(ma_job* pJob pageBufferSizeInBytes = ma_resource_manager_data_stream_get_page_size_in_frames(pDataStream) * 2 * ma_get_bytes_per_frame(pDataStream->decoder.outputFormat, pDataStream->decoder.outputChannels); pDataStream->pPageData = ma_malloc(pageBufferSizeInBytes, &pResourceManager->config.allocationCallbacks); - if (pDataStream->pPageData == nullptr) { + if (pDataStream->pPageData == NULL) { ma_decoder_uninit(&pDataStream->decoder); result = MA_OUT_OF_MEMORY; goto done; @@ -73240,10 +73240,10 @@ done: ma_atomic_compare_and_swap_i32(&pDataStream->result, MA_BUSY, result); /* Only signal the other threads after the result has been set just for cleanliness sake. */ - if (pJob->data.resourceManager.loadDataStream.pInitNotification != nullptr) { + if (pJob->data.resourceManager.loadDataStream.pInitNotification != NULL) { ma_async_notification_signal(pJob->data.resourceManager.loadDataStream.pInitNotification); } - if (pJob->data.resourceManager.loadDataStream.pInitFence != nullptr) { + if (pJob->data.resourceManager.loadDataStream.pInitFence != NULL) { ma_fence_release(pJob->data.resourceManager.loadDataStream.pInitFence); } @@ -73256,10 +73256,10 @@ static ma_result ma_job_process__resource_manager__free_data_stream(ma_job* pJob ma_resource_manager* pResourceManager; ma_resource_manager_data_stream* pDataStream; - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); pDataStream = (ma_resource_manager_data_stream*)pJob->data.resourceManager.freeDataStream.pDataStream; - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); pResourceManager = pDataStream->pResourceManager; @@ -73274,18 +73274,18 @@ static ma_result ma_job_process__resource_manager__free_data_stream(ma_job* pJob ma_decoder_uninit(&pDataStream->decoder); } - if (pDataStream->pPageData != nullptr) { + if (pDataStream->pPageData != NULL) { ma_free(pDataStream->pPageData, &pResourceManager->config.allocationCallbacks); - pDataStream->pPageData = nullptr; /* Just in case... */ + pDataStream->pPageData = NULL; /* Just in case... */ } ma_data_source_uninit(&pDataStream->ds); /* The event needs to be signalled last. */ - if (pJob->data.resourceManager.freeDataStream.pDoneNotification != nullptr) { + if (pJob->data.resourceManager.freeDataStream.pDoneNotification != NULL) { ma_async_notification_signal(pJob->data.resourceManager.freeDataStream.pDoneNotification); } - if (pJob->data.resourceManager.freeDataStream.pDoneFence != nullptr) { + if (pJob->data.resourceManager.freeDataStream.pDoneFence != NULL) { ma_fence_release(pJob->data.resourceManager.freeDataStream.pDoneFence); } @@ -73299,10 +73299,10 @@ static ma_result ma_job_process__resource_manager__page_data_stream(ma_job* pJob ma_resource_manager* pResourceManager; ma_resource_manager_data_stream* pDataStream; - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); pDataStream = (ma_resource_manager_data_stream*)pJob->data.resourceManager.pageDataStream.pDataStream; - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); pResourceManager = pDataStream->pResourceManager; @@ -73329,10 +73329,10 @@ static ma_result ma_job_process__resource_manager__seek_data_stream(ma_job* pJob ma_resource_manager* pResourceManager; ma_resource_manager_data_stream* pDataStream; - MA_ASSERT(pJob != nullptr); + MA_ASSERT(pJob != NULL); pDataStream = (ma_resource_manager_data_stream*)pJob->data.resourceManager.seekDataStream.pDataStream; - MA_ASSERT(pDataStream != nullptr); + MA_ASSERT(pDataStream != NULL); pResourceManager = pDataStream->pResourceManager; @@ -73365,7 +73365,7 @@ done: MA_API ma_result ma_resource_manager_process_job(ma_resource_manager* pResourceManager, ma_job* pJob) { - if (pResourceManager == nullptr || pJob == nullptr) { + if (pResourceManager == NULL || pJob == NULL) { return MA_INVALID_ARGS; } @@ -73377,7 +73377,7 @@ MA_API ma_result ma_resource_manager_process_next_job(ma_resource_manager* pReso ma_result result; ma_job job; - if (pResourceManager == nullptr) { + if (pResourceManager == NULL) { return MA_INVALID_ARGS; } @@ -73410,12 +73410,12 @@ static ma_stack* ma_stack_init(size_t sizeInBytes, const ma_allocation_callbacks ma_stack* pStack; if (sizeInBytes == 0) { - return nullptr; + return NULL; } pStack = (ma_stack*)ma_malloc(sizeof(*pStack) - sizeof(pStack->_data) + sizeInBytes, pAllocationCallbacks); - if (pStack == nullptr) { - return nullptr; + if (pStack == NULL) { + return NULL; } pStack->offset = 0; @@ -73426,7 +73426,7 @@ static ma_stack* ma_stack_init(size_t sizeInBytes, const ma_allocation_callbacks static void ma_stack_uninit(ma_stack* pStack, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pStack == nullptr) { + if (pStack == NULL) { return; } @@ -73441,7 +73441,7 @@ static void* ma_stack_alloc(ma_stack* pStack, size_t sz) sz = (sz + (sizeof(ma_uintptr) - 1)) & ~(sizeof(ma_uintptr) - 1); /* Padding. */ if (pStack->offset + sz + sizeof(size_t) > pStack->sizeInBytes) { - return nullptr; /* Out of memory. */ + return NULL; /* Out of memory. */ } pStack->offset += sz + sizeof(size_t); @@ -73454,7 +73454,7 @@ static void ma_stack_free(ma_stack* pStack, void* p) { size_t* pSize; - if (p == nullptr) { + if (p == NULL) { return; } @@ -73484,7 +73484,7 @@ MA_API void ma_debug_fill_pcm_frames_with_sine_wave(float* pFramesOut, ma_uint32 waveformConfig = ma_waveform_config_init(format, channels, sampleRate, ma_waveform_type_sine, 1.0, 400); ma_waveform_init(&waveformConfig, &waveform); - ma_waveform_read_pcm_frames(&waveform, pFramesOut, frameCount, nullptr); + ma_waveform_read_pcm_frames(&waveform, pFramesOut, frameCount, NULL); } #else { @@ -73520,14 +73520,14 @@ MA_API ma_node_graph_config ma_node_graph_config_init(ma_uint32 channels) static void ma_node_graph_set_is_reading(ma_node_graph* pNodeGraph, ma_bool32 isReading) { - MA_ASSERT(pNodeGraph != nullptr); + MA_ASSERT(pNodeGraph != NULL); ma_atomic_exchange_32(&pNodeGraph->isReading, isReading); } #if 0 static ma_bool32 ma_node_graph_is_reading(ma_node_graph* pNodeGraph) { - MA_ASSERT(pNodeGraph != nullptr); + MA_ASSERT(pNodeGraph != NULL); return ma_atomic_load_32(&pNodeGraph->isReading); } #endif @@ -73549,7 +73549,7 @@ static void ma_node_graph_node_process_pcm_frames(ma_node* pNode, const float** static ma_node_vtable g_node_graph_node_vtable = { ma_node_graph_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 0, /* 0 input buses. */ 1, /* 1 output bus. */ 0 /* Flags. */ @@ -73557,7 +73557,7 @@ static ma_node_vtable g_node_graph_node_vtable = static void ma_node_graph_endpoint_process_pcm_frames(ma_node* pNode, const float** ppFramesIn, ma_uint32* pFrameCountIn, float** ppFramesOut, ma_uint32* pFrameCountOut) { - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); MA_ASSERT(ma_node_get_input_bus_count(pNode) == 1); MA_ASSERT(ma_node_get_output_bus_count(pNode) == 1); @@ -73573,7 +73573,7 @@ static void ma_node_graph_endpoint_process_pcm_frames(ma_node* pNode, const floa #if 0 /* The data has already been mixed. We just need to move it to the output buffer. */ - if (ppFramesIn != nullptr) { + if (ppFramesIn != NULL) { ma_copy_pcm_frames(ppFramesOut[0], ppFramesIn[0], *pFrameCountOut, ma_format_f32, ma_node_get_output_channels(pNode, 0)); } #endif @@ -73582,7 +73582,7 @@ static void ma_node_graph_endpoint_process_pcm_frames(ma_node* pNode, const floa static ma_node_vtable g_node_graph_endpoint_vtable = { ma_node_graph_endpoint_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* 1 input bus. */ 1, /* 1 output bus. */ MA_NODE_FLAG_PASSTHROUGH /* Flags. The endpoint is a passthrough. */ @@ -73594,7 +73594,7 @@ MA_API ma_result ma_node_graph_init(const ma_node_graph_config* pConfig, const m ma_node_config baseConfig; ma_node_config endpointConfig; - if (pNodeGraph == nullptr) { + if (pNodeGraph == NULL) { return MA_INVALID_ARGS; } @@ -73628,7 +73628,7 @@ MA_API ma_result ma_node_graph_init(const ma_node_graph_config* pConfig, const m /* Processing cache. */ if (pConfig->processingSizeInFrames > 0) { pNodeGraph->pProcessingCache = (float*)ma_malloc(pConfig->processingSizeInFrames * pConfig->channels * sizeof(float), pAllocationCallbacks); - if (pNodeGraph->pProcessingCache == nullptr) { + if (pNodeGraph->pProcessingCache == NULL) { ma_node_uninit(&pNodeGraph->endpoint, pAllocationCallbacks); ma_node_uninit(&pNodeGraph->base, pAllocationCallbacks); return MA_OUT_OF_MEMORY; @@ -73646,10 +73646,10 @@ MA_API ma_result ma_node_graph_init(const ma_node_graph_config* pConfig, const m } pNodeGraph->pPreMixStack = ma_stack_init(preMixStackSizeInBytes, pAllocationCallbacks); - if (pNodeGraph->pPreMixStack == nullptr) { + if (pNodeGraph->pPreMixStack == NULL) { ma_node_uninit(&pNodeGraph->endpoint, pAllocationCallbacks); ma_node_uninit(&pNodeGraph->base, pAllocationCallbacks); - if (pNodeGraph->pProcessingCache != nullptr) { + if (pNodeGraph->pProcessingCache != NULL) { ma_free(pNodeGraph->pProcessingCache, pAllocationCallbacks); } @@ -73663,28 +73663,28 @@ MA_API ma_result ma_node_graph_init(const ma_node_graph_config* pConfig, const m MA_API void ma_node_graph_uninit(ma_node_graph* pNodeGraph, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pNodeGraph == nullptr) { + if (pNodeGraph == NULL) { return; } ma_node_uninit(&pNodeGraph->endpoint, pAllocationCallbacks); ma_node_uninit(&pNodeGraph->base, pAllocationCallbacks); - if (pNodeGraph->pProcessingCache != nullptr) { + if (pNodeGraph->pProcessingCache != NULL) { ma_free(pNodeGraph->pProcessingCache, pAllocationCallbacks); - pNodeGraph->pProcessingCache = nullptr; + pNodeGraph->pProcessingCache = NULL; } - if (pNodeGraph->pPreMixStack != nullptr) { + if (pNodeGraph->pPreMixStack != NULL) { ma_stack_uninit(pNodeGraph->pPreMixStack, pAllocationCallbacks); - pNodeGraph->pPreMixStack = nullptr; + pNodeGraph->pPreMixStack = NULL; } } MA_API ma_node* ma_node_graph_get_endpoint(ma_node_graph* pNodeGraph) { - if (pNodeGraph == nullptr) { - return nullptr; + if (pNodeGraph == NULL) { + return NULL; } return &pNodeGraph->endpoint; @@ -73696,11 +73696,11 @@ MA_API ma_result ma_node_graph_read_pcm_frames(ma_node_graph* pNodeGraph, void* ma_uint64 totalFramesRead; ma_uint32 channels; - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; /* Safety. */ } - if (pNodeGraph == nullptr) { + if (pNodeGraph == NULL) { return MA_INVALID_ARGS; } @@ -73785,7 +73785,7 @@ MA_API ma_result ma_node_graph_read_pcm_frames(ma_node_graph* pNodeGraph, void* ma_silence_pcm_frames(ma_offset_pcm_frames_ptr(pFramesOut, totalFramesRead, ma_format_f32, channels), (frameCount - totalFramesRead), ma_format_f32, channels); } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = totalFramesRead; } @@ -73794,7 +73794,7 @@ MA_API ma_result ma_node_graph_read_pcm_frames(ma_node_graph* pNodeGraph, void* MA_API ma_uint32 ma_node_graph_get_channels(const ma_node_graph* pNodeGraph) { - if (pNodeGraph == nullptr) { + if (pNodeGraph == NULL) { return 0; } @@ -73803,7 +73803,7 @@ MA_API ma_uint32 ma_node_graph_get_channels(const ma_node_graph* pNodeGraph) MA_API ma_uint64 ma_node_graph_get_time(const ma_node_graph* pNodeGraph) { - if (pNodeGraph == nullptr) { + if (pNodeGraph == NULL) { return 0; } @@ -73812,7 +73812,7 @@ MA_API ma_uint64 ma_node_graph_get_time(const ma_node_graph* pNodeGraph) MA_API ma_result ma_node_graph_set_time(ma_node_graph* pNodeGraph, ma_uint64 globalTime) { - if (pNodeGraph == nullptr) { + if (pNodeGraph == NULL) { return MA_INVALID_ARGS; } @@ -73821,7 +73821,7 @@ MA_API ma_result ma_node_graph_set_time(ma_node_graph* pNodeGraph, ma_uint64 glo MA_API ma_uint32 ma_node_graph_get_processing_size_in_frames(const ma_node_graph* pNodeGraph) { - if (pNodeGraph == nullptr) { + if (pNodeGraph == NULL) { return 0; } @@ -73833,7 +73833,7 @@ MA_API ma_uint32 ma_node_graph_get_processing_size_in_frames(const ma_node_graph static ma_result ma_node_output_bus_init(ma_node* pNode, ma_uint32 outputBusIndex, ma_uint32 channels, ma_node_output_bus* pOutputBus) { - MA_ASSERT(pOutputBus != nullptr); + MA_ASSERT(pOutputBus != NULL); MA_ASSERT(outputBusIndex < MA_MAX_NODE_BUS_COUNT); MA_ASSERT(outputBusIndex < ma_node_get_output_bus_count(pNode)); MA_ASSERT(channels < 256); @@ -73898,7 +73898,7 @@ static ma_bool32 ma_node_output_bus_is_attached(ma_node_output_bus* pOutputBus) static ma_result ma_node_output_bus_set_volume(ma_node_output_bus* pOutputBus, float volume) { - MA_ASSERT(pOutputBus != nullptr); + MA_ASSERT(pOutputBus != NULL); if (volume < 0.0f) { volume = 0.0f; @@ -73917,7 +73917,7 @@ static float ma_node_output_bus_get_volume(const ma_node_output_bus* pOutputBus) static ma_result ma_node_input_bus_init(ma_uint32 channels, ma_node_input_bus* pInputBus) { - MA_ASSERT(pInputBus != nullptr); + MA_ASSERT(pInputBus != NULL); MA_ASSERT(channels < 256); MA_ZERO_OBJECT(pInputBus); @@ -73933,14 +73933,14 @@ static ma_result ma_node_input_bus_init(ma_uint32 channels, ma_node_input_bus* p static void ma_node_input_bus_lock(ma_node_input_bus* pInputBus) { - MA_ASSERT(pInputBus != nullptr); + MA_ASSERT(pInputBus != NULL); ma_spinlock_lock(&pInputBus->lock); } static void ma_node_input_bus_unlock(ma_node_input_bus* pInputBus) { - MA_ASSERT(pInputBus != nullptr); + MA_ASSERT(pInputBus != NULL); ma_spinlock_unlock(&pInputBus->lock); } @@ -73970,8 +73970,8 @@ static ma_uint32 ma_node_input_bus_get_channels(const ma_node_input_bus* pInputB static void ma_node_input_bus_detach__no_output_bus_lock(ma_node_input_bus* pInputBus, ma_node_output_bus* pOutputBus) { - MA_ASSERT(pInputBus != nullptr); - MA_ASSERT(pOutputBus != nullptr); + MA_ASSERT(pInputBus != NULL); + MA_ASSERT(pOutputBus != NULL); /* Mark the output bus as detached first. This will prevent future iterations on the audio thread @@ -73996,19 +73996,19 @@ static void ma_node_input_bus_detach__no_output_bus_lock(ma_node_input_bus* pInp ma_node_output_bus* pOldPrev = (ma_node_output_bus*)ma_atomic_load_ptr(&pOutputBus->pPrev); ma_node_output_bus* pOldNext = (ma_node_output_bus*)ma_atomic_load_ptr(&pOutputBus->pNext); - if (pOldPrev != nullptr) { + if (pOldPrev != NULL) { ma_atomic_exchange_ptr(&pOldPrev->pNext, pOldNext); /* <-- This is where the output bus is detached from the list. */ } - if (pOldNext != nullptr) { + if (pOldNext != NULL) { ma_atomic_exchange_ptr(&pOldNext->pPrev, pOldPrev); /* <-- This is required for detachment. */ } } ma_node_input_bus_unlock(pInputBus); /* At this point the output bus is detached and the linked list is completely unaware of it. Reset some data for safety. */ - ma_atomic_exchange_ptr(&pOutputBus->pNext, nullptr); /* Using atomic exchanges here, mainly for the benefit of analysis tools which don't always recognize spinlocks. */ - ma_atomic_exchange_ptr(&pOutputBus->pPrev, nullptr); /* As above. */ - pOutputBus->pInputNode = nullptr; + ma_atomic_exchange_ptr(&pOutputBus->pNext, NULL); /* Using atomic exchanges here, mainly for the benefit of analysis tools which don't always recognize spinlocks. */ + ma_atomic_exchange_ptr(&pOutputBus->pPrev, NULL); /* As above. */ + pOutputBus->pInputNode = NULL; pOutputBus->inputNodeInputBusIndex = 0; @@ -74044,8 +74044,8 @@ static void ma_node_input_bus_detach__no_output_bus_lock(ma_node_input_bus* pInp #if 0 /* Not used at the moment, but leaving here in case I need it later. */ static void ma_node_input_bus_detach(ma_node_input_bus* pInputBus, ma_node_output_bus* pOutputBus) { - MA_ASSERT(pInputBus != nullptr); - MA_ASSERT(pOutputBus != nullptr); + MA_ASSERT(pInputBus != NULL); + MA_ASSERT(pOutputBus != NULL); ma_node_output_bus_lock(pOutputBus); { @@ -74057,15 +74057,15 @@ static void ma_node_input_bus_detach(ma_node_input_bus* pInputBus, ma_node_outpu static void ma_node_input_bus_attach(ma_node_input_bus* pInputBus, ma_node_output_bus* pOutputBus, ma_node* pNewInputNode, ma_uint32 inputNodeInputBusIndex) { - MA_ASSERT(pInputBus != nullptr); - MA_ASSERT(pOutputBus != nullptr); + MA_ASSERT(pInputBus != NULL); + MA_ASSERT(pOutputBus != NULL); ma_node_output_bus_lock(pOutputBus); { ma_node_output_bus* pOldInputNode = (ma_node_output_bus*)ma_atomic_load_ptr(&pOutputBus->pInputNode); /* Detach from any existing attachment first if necessary. */ - if (pOldInputNode != nullptr) { + if (pOldInputNode != NULL) { ma_node_input_bus_detach__no_output_bus_lock(pInputBus, pOutputBus); } @@ -74102,7 +74102,7 @@ static void ma_node_input_bus_attach(ma_node_input_bus* pInputBus, ma_node_outpu ma_atomic_exchange_ptr(&pInputBus->head.pNext, pOutputBus); /* <-- This is where the output bus is actually attached to the input bus. */ /* Do the previous pointer last. This is only used for detachment. */ - if (pNewNext != nullptr) { + if (pNewNext != NULL) { ma_atomic_exchange_ptr(&pNewNext->pPrev, pOutputBus); } } @@ -74121,10 +74121,10 @@ static ma_node_output_bus* ma_node_input_bus_next(ma_node_input_bus* pInputBus, { ma_node_output_bus* pNext; - MA_ASSERT(pInputBus != nullptr); + MA_ASSERT(pInputBus != NULL); - if (pOutputBus == nullptr) { - return nullptr; + if (pOutputBus == NULL) { + return NULL; } ma_node_input_bus_next_begin(pInputBus); @@ -74132,7 +74132,7 @@ static ma_node_output_bus* ma_node_input_bus_next(ma_node_input_bus* pInputBus, pNext = pOutputBus; for (;;) { pNext = (ma_node_output_bus*)ma_atomic_load_ptr(&pNext->pNext); - if (pNext == nullptr) { + if (pNext == NULL) { break; /* Reached the end. */ } @@ -74145,7 +74145,7 @@ static ma_node_output_bus* ma_node_input_bus_next(ma_node_input_bus* pInputBus, } /* We need to increment the reference count of the selected node. */ - if (pNext != nullptr) { + if (pNext != NULL) { ma_atomic_fetch_add_32(&pNext->refCount, 1); } @@ -74189,8 +74189,8 @@ static ma_result ma_node_input_bus_read_pcm_frames(ma_node* pInputNode, ma_node_ do this, we need to read from each attachment in a loop and read as many frames as we can, up to `frameCount`. */ - MA_ASSERT(pInputNode != nullptr); - MA_ASSERT(pFramesRead != nullptr); /* pFramesRead is critical and must always be specified. On input it's undefined and on output it'll be set to the number of frames actually read. */ + MA_ASSERT(pInputNode != NULL); + MA_ASSERT(pFramesRead != NULL); /* pFramesRead is critical and must always be specified. On input it's undefined and on output it'll be set to the number of frames actually read. */ *pFramesRead = 0; /* Safety. */ @@ -74205,20 +74205,20 @@ static ma_result ma_node_input_bus_read_pcm_frames(ma_node* pInputNode, ma_node_ after calling ma_node_input_bus_next(), which we won't be. */ pFirst = ma_node_input_bus_first(pInputBus); - if (pFirst == nullptr) { + if (pFirst == NULL) { return MA_SUCCESS; /* No attachments. Read nothing. */ } - for (pOutputBus = pFirst; pOutputBus != nullptr; pOutputBus = ma_node_input_bus_next(pInputBus, pOutputBus)) { + for (pOutputBus = pFirst; pOutputBus != NULL; pOutputBus = ma_node_input_bus_next(pInputBus, pOutputBus)) { ma_uint32 framesProcessed = 0; ma_bool32 isSilentOutput = MA_FALSE; - MA_ASSERT(pOutputBus->pNode != nullptr); - MA_ASSERT(((ma_node_base*)pOutputBus->pNode)->vtable != nullptr); + MA_ASSERT(pOutputBus->pNode != NULL); + MA_ASSERT(((ma_node_base*)pOutputBus->pNode)->vtable != NULL); isSilentOutput = (((ma_node_base*)pOutputBus->pNode)->vtable->flags & MA_NODE_FLAG_SILENT_OUTPUT) != 0; - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { /* Read. */ while (framesProcessed < frameCount) { float* pRunningFramesOut; @@ -74236,7 +74236,7 @@ static ma_result ma_node_input_bus_read_pcm_frames(ma_node* pInputNode, ma_node_ ma_uint32 preMixBufferCapInFrames = ((ma_node_base*)pInputNode)->cachedDataCapInFramesPerBus; float* pPreMixBuffer = (float*)ma_stack_alloc(((ma_node_base*)pInputNode)->pNodeGraph->pPreMixStack, preMixBufferCapInFrames * inputChannels * sizeof(float)); - if (pPreMixBuffer == nullptr) { + if (pPreMixBuffer == NULL) { /* If you're hitting this assert it means you've got an unusually deep chain of nodes, you've got an excessively large processing size, or you have a combination of both, and as a result have run out of stack space. You can increase this using the @@ -74258,7 +74258,7 @@ static ma_result ma_node_input_bus_read_pcm_frames(ma_node* pInputNode, ma_node_ /* The pre-mix buffer is no longer required. */ ma_stack_free(((ma_node_base*)pInputNode)->pNodeGraph->pPreMixStack, pPreMixBuffer); - pPreMixBuffer = nullptr; + pPreMixBuffer = NULL; } } @@ -74285,12 +74285,12 @@ static ma_result ma_node_input_bus_read_pcm_frames(ma_node* pInputNode, ma_node_ } } else { /* Seek. */ - ma_node_read_pcm_frames(pOutputBus->pNode, pOutputBus->outputBusIndex, nullptr, frameCount, &framesProcessed, globalTime); + ma_node_read_pcm_frames(pOutputBus->pNode, pOutputBus->outputBusIndex, NULL, frameCount, &framesProcessed, globalTime); } } /* If we didn't output anything, output silence. */ - if (doesOutputBufferHaveContent == MA_FALSE && pFramesOut != nullptr) { + if (doesOutputBufferHaveContent == MA_FALSE && pFramesOut != NULL) { ma_silence_pcm_frames(pFramesOut, frameCount, ma_format_f32, inputChannels); } @@ -74342,7 +74342,7 @@ static float* ma_node_get_cached_input_ptr(ma_node* pNode, ma_uint32 inputBusInd ma_uint32 iInputBus; float* pBasePtr; - MA_ASSERT(pNodeBase != nullptr); + MA_ASSERT(pNodeBase != NULL); /* Input data is stored at the front of the buffer. */ pBasePtr = pNodeBase->pCachedData; @@ -74360,7 +74360,7 @@ static float* ma_node_get_cached_output_ptr(ma_node* pNode, ma_uint32 outputBusI ma_uint32 iOutputBus; float* pBasePtr; - MA_ASSERT(pNodeBase != nullptr); + MA_ASSERT(pNodeBase != NULL); /* Cached output data starts after the input data. */ pBasePtr = pNodeBase->pCachedData; @@ -74391,9 +74391,9 @@ static ma_result ma_node_translate_bus_counts(const ma_node_config* pConfig, ma_ ma_uint32 inputBusCount; ma_uint32 outputBusCount; - MA_ASSERT(pConfig != nullptr); - MA_ASSERT(pInputBusCount != nullptr); - MA_ASSERT(pOutputBusCount != nullptr); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pInputBusCount != NULL); + MA_ASSERT(pOutputBusCount != NULL); /* Bus counts are determined by the vtable, unless they're set to `MA_NODE_BUS_COUNT_UNKNWON`, in which case they're taken from the config. */ if (pConfig->vtable->inputBusCount == MA_NODE_BUS_COUNT_UNKNOWN) { @@ -74423,7 +74423,7 @@ static ma_result ma_node_translate_bus_counts(const ma_node_config* pConfig, ma_ /* We must have channel counts for each bus. */ - if ((inputBusCount > 0 && pConfig->pInputChannels == nullptr) || (outputBusCount > 0 && pConfig->pOutputChannels == nullptr)) { + if ((inputBusCount > 0 && pConfig->pInputChannels == NULL) || (outputBusCount > 0 && pConfig->pOutputChannels == NULL)) { return MA_INVALID_ARGS; /* You must specify channel counts for each input and output bus. */ } @@ -74452,11 +74452,11 @@ static ma_result ma_node_get_heap_layout(ma_node_graph* pNodeGraph, const ma_nod ma_uint32 inputBusCount; ma_uint32 outputBusCount; - MA_ASSERT(pHeapLayout != nullptr); + MA_ASSERT(pHeapLayout != NULL); MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr || pConfig->vtable == nullptr || pConfig->vtable->onProcess == nullptr) { + if (pConfig == NULL || pConfig->vtable == NULL || pConfig->vtable->onProcess == NULL) { return MA_INVALID_ARGS; } @@ -74542,7 +74542,7 @@ MA_API ma_result ma_node_get_heap_size(ma_node_graph* pNodeGraph, const ma_node_ ma_result result; ma_node_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -74566,7 +74566,7 @@ MA_API ma_result ma_node_init_preallocated(ma_node_graph* pNodeGraph, const ma_n ma_uint32 iInputBus; ma_uint32 iOutputBus; - if (pNodeBase == nullptr) { + if (pNodeBase == NULL) { return MA_INVALID_ARGS; } @@ -74604,7 +74604,7 @@ MA_API ma_result ma_node_init_preallocated(ma_node_graph* pNodeGraph, const ma_n pNodeBase->pCachedData = (float*)ma_offset_ptr(pHeap, heapLayout.cachedDataOffset); pNodeBase->cachedDataCapInFramesPerBus = ma_node_config_get_cache_size_in_frames(pConfig, pNodeGraph); } else { - pNodeBase->pCachedData = nullptr; + pNodeBase->pCachedData = NULL; } @@ -74625,7 +74625,7 @@ MA_API ma_result ma_node_init_preallocated(ma_node_graph* pNodeGraph, const ma_n /* The cached data needs to be initialized to silence (or a sine wave tone if we're debugging). */ - if (pNodeBase->pCachedData != nullptr) { + if (pNodeBase->pCachedData != NULL) { ma_uint32 iBus; #if 1 /* Toggle this between 0 and 1 to turn debugging on or off. 1 = fill with a sine wave for debugging; 0 = fill with silence. */ @@ -74663,11 +74663,11 @@ MA_API ma_result ma_node_init(ma_node_graph* pNodeGraph, const ma_node_config* p if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_node_init_preallocated(pNodeGraph, pConfig, pHeap, pNode); @@ -74684,7 +74684,7 @@ MA_API void ma_node_uninit(ma_node* pNode, const ma_allocation_callbacks* pAlloc { ma_node_base* pNodeBase = (ma_node_base*)pNode; - if (pNodeBase == nullptr) { + if (pNodeBase == NULL) { return; } @@ -74707,8 +74707,8 @@ MA_API void ma_node_uninit(ma_node* pNode, const ma_allocation_callbacks* pAlloc MA_API ma_node_graph* ma_node_get_node_graph(const ma_node* pNode) { - if (pNode == nullptr) { - return nullptr; + if (pNode == NULL) { + return NULL; } return ((const ma_node_base*)pNode)->pNodeGraph; @@ -74716,7 +74716,7 @@ MA_API ma_node_graph* ma_node_get_node_graph(const ma_node* pNode) MA_API ma_uint32 ma_node_get_input_bus_count(const ma_node* pNode) { - if (pNode == nullptr) { + if (pNode == NULL) { return 0; } @@ -74725,7 +74725,7 @@ MA_API ma_uint32 ma_node_get_input_bus_count(const ma_node* pNode) MA_API ma_uint32 ma_node_get_output_bus_count(const ma_node* pNode) { - if (pNode == nullptr) { + if (pNode == NULL) { return 0; } @@ -74737,7 +74737,7 @@ MA_API ma_uint32 ma_node_get_input_channels(const ma_node* pNode, ma_uint32 inpu { const ma_node_base* pNodeBase = (const ma_node_base*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return 0; } @@ -74752,7 +74752,7 @@ MA_API ma_uint32 ma_node_get_output_channels(const ma_node* pNode, ma_uint32 out { const ma_node_base* pNodeBase = (const ma_node_base*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return 0; } @@ -74769,7 +74769,7 @@ static ma_result ma_node_detach_full(ma_node* pNode) ma_node_base* pNodeBase = (ma_node_base*)pNode; ma_uint32 iInputBus; - if (pNodeBase == nullptr) { + if (pNodeBase == NULL) { return MA_INVALID_ARGS; } @@ -74796,7 +74796,7 @@ static ma_result ma_node_detach_full(ma_node* pNode) linked list logic. We don't need to worry about the audio thread referencing these because the step above severed the connection to the graph. */ - for (pOutputBus = (ma_node_output_bus*)ma_atomic_load_ptr(&pInputBus->head.pNext); pOutputBus != nullptr; pOutputBus = (ma_node_output_bus*)ma_atomic_load_ptr(&pInputBus->head.pNext)) { + for (pOutputBus = (ma_node_output_bus*)ma_atomic_load_ptr(&pInputBus->head.pNext); pOutputBus != NULL; pOutputBus = (ma_node_output_bus*)ma_atomic_load_ptr(&pInputBus->head.pNext)) { ma_node_detach_output_bus(pOutputBus->pNode, pOutputBus->outputBusIndex); /* This won't do any waiting in practice and should be efficient. */ } } @@ -74810,7 +74810,7 @@ MA_API ma_result ma_node_detach_output_bus(ma_node* pNode, ma_uint32 outputBusIn ma_node_base* pNodeBase = (ma_node_base*)pNode; ma_node_base* pInputNodeBase; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -74822,7 +74822,7 @@ MA_API ma_result ma_node_detach_output_bus(ma_node* pNode, ma_uint32 outputBusIn ma_node_output_bus_lock(&pNodeBase->pOutputBuses[outputBusIndex]); { pInputNodeBase = (ma_node_base*)pNodeBase->pOutputBuses[outputBusIndex].pInputNode; - if (pInputNodeBase != nullptr) { + if (pInputNodeBase != NULL) { ma_node_input_bus_detach__no_output_bus_lock(&pInputNodeBase->pInputBuses[pNodeBase->pOutputBuses[outputBusIndex].inputNodeInputBusIndex], &pNodeBase->pOutputBuses[outputBusIndex]); } } @@ -74835,7 +74835,7 @@ MA_API ma_result ma_node_detach_all_output_buses(ma_node* pNode) { ma_uint32 iOutputBus; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -74851,7 +74851,7 @@ MA_API ma_result ma_node_attach_output_bus(ma_node* pNode, ma_uint32 outputBusIn ma_node_base* pNodeBase = (ma_node_base*)pNode; ma_node_base* pOtherNodeBase = (ma_node_base*)pOtherNode; - if (pNodeBase == nullptr || pOtherNodeBase == nullptr) { + if (pNodeBase == NULL || pOtherNodeBase == NULL) { return MA_INVALID_ARGS; } @@ -74878,7 +74878,7 @@ MA_API ma_result ma_node_set_output_bus_volume(ma_node* pNode, ma_uint32 outputB { ma_node_base* pNodeBase = (ma_node_base*)pNode; - if (pNodeBase == nullptr) { + if (pNodeBase == NULL) { return MA_INVALID_ARGS; } @@ -74893,7 +74893,7 @@ MA_API float ma_node_get_output_bus_volume(const ma_node* pNode, ma_uint32 outpu { const ma_node_base* pNodeBase = (const ma_node_base*)pNode; - if (pNodeBase == nullptr) { + if (pNodeBase == NULL) { return 0; } @@ -74908,7 +74908,7 @@ MA_API ma_result ma_node_set_state(ma_node* pNode, ma_node_state state) { ma_node_base* pNodeBase = (ma_node_base*)pNode; - if (pNodeBase == nullptr) { + if (pNodeBase == NULL) { return MA_INVALID_ARGS; } @@ -74921,7 +74921,7 @@ MA_API ma_node_state ma_node_get_state(const ma_node* pNode) { const ma_node_base* pNodeBase = (const ma_node_base*)pNode; - if (pNodeBase == nullptr) { + if (pNodeBase == NULL) { return ma_node_state_stopped; } @@ -74930,7 +74930,7 @@ MA_API ma_node_state ma_node_get_state(const ma_node* pNode) MA_API ma_result ma_node_set_state_time(ma_node* pNode, ma_node_state state, ma_uint64 globalTime) { - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -74946,7 +74946,7 @@ MA_API ma_result ma_node_set_state_time(ma_node* pNode, ma_node_state state, ma_ MA_API ma_uint64 ma_node_get_state_time(const ma_node* pNode, ma_node_state state) { - if (pNode == nullptr) { + if (pNode == NULL) { return 0; } @@ -74960,7 +74960,7 @@ MA_API ma_uint64 ma_node_get_state_time(const ma_node* pNode, ma_node_state stat MA_API ma_node_state ma_node_get_state_by_time(const ma_node* pNode, ma_uint64 globalTime) { - if (pNode == nullptr) { + if (pNode == NULL) { return ma_node_state_stopped; } @@ -74971,7 +74971,7 @@ MA_API ma_node_state ma_node_get_state_by_time_range(const ma_node* pNode, ma_ui { ma_node_state state; - if (pNode == nullptr) { + if (pNode == NULL) { return ma_node_state_stopped; } @@ -75001,7 +75001,7 @@ MA_API ma_node_state ma_node_get_state_by_time_range(const ma_node* pNode, ma_ui MA_API ma_uint64 ma_node_get_time(const ma_node* pNode) { - if (pNode == nullptr) { + if (pNode == NULL) { return 0; } @@ -75010,7 +75010,7 @@ MA_API ma_uint64 ma_node_get_time(const ma_node* pNode) MA_API ma_result ma_node_set_time(ma_node* pNode, ma_uint64 localTime) { - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -75025,7 +75025,7 @@ static void ma_node_process_pcm_frames_internal(ma_node* pNode, const float** pp { ma_node_base* pNodeBase = (ma_node_base*)pNode; - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); if (pNodeBase->vtable->onProcess) { pNodeBase->vtable->onProcess(pNode, ppFramesIn, pFrameCountIn, ppFramesOut, pFrameCountOut); @@ -75057,14 +75057,14 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde expected that the number of frames read may be different to that requested. Therefore, the caller must look at this value to correctly determine how many frames were read. */ - MA_ASSERT(pFramesRead != nullptr); /* <-- If you've triggered this assert, you're using this function wrong. You *must* use this variable and inspect it after the call returns. */ - if (pFramesRead == nullptr) { + MA_ASSERT(pFramesRead != NULL); /* <-- If you've triggered this assert, you're using this function wrong. You *must* use this variable and inspect it after the call returns. */ + if (pFramesRead == NULL) { return MA_INVALID_ARGS; } *pFramesRead = 0; /* Safety. */ - if (pNodeBase == nullptr) { + if (pNodeBase == NULL) { return MA_INVALID_ARGS; } @@ -75142,7 +75142,7 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde ma_silence_pcm_frames(pFramesOut, frameCount, ma_format_f32, ma_node_get_output_channels(pNode, outputBusIndex)); } - ma_node_process_pcm_frames_internal(pNode, nullptr, &frameCountIn, ppFramesOut, &frameCountOut); + ma_node_process_pcm_frames_internal(pNode, NULL, &frameCountIn, ppFramesOut, &frameCountOut); totalFramesRead = frameCountOut; } else { /* Slow path. Need to read input data. */ @@ -75271,7 +75271,7 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde input frames to the maximum number we read from each attachment (the lesser will be padded with silence). If we didn't read anything, this will be set to 0 and the entire buffer will have been assigned to silence. This being equal to 0 is an important property for us because - it allows us to detect when nullptr can be passed into the processing callback for the input + it allows us to detect when NULL can be passed into the processing callback for the input buffer for the purpose of continuous processing. */ pNodeBase->cachedFrameCountIn = (ma_uint16)maxFramesReadIn; @@ -75287,7 +75287,7 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde optimization here - we can set the pointer to the output buffer for this output bus so that the final copy into the output buffer is done directly by onProcess(). */ - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { ppFramesOut[outputBusIndex] = ma_offset_pcm_frames_ptr_f32(pFramesOut, pNodeBase->cachedFrameCountOut, ma_node_get_output_channels(pNode, outputBusIndex)); } @@ -75299,7 +75299,7 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde We need to treat nodes with continuous processing a little differently. For these ones, we always want to fire the callback with the requested number of frames, regardless of pNodeBase->cachedFrameCountIn, which could be 0. Also, we want to check if we can pass - in nullptr for the input buffer to the callback. + in NULL for the input buffer to the callback. */ if ((pNodeBase->vtable->flags & MA_NODE_FLAG_CONTINUOUS_PROCESSING) != 0) { /* We're using continuous processing. Make sure we specify the whole frame count at all times. */ @@ -75332,11 +75332,11 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde } /* - Process data slightly differently depending on whether or not we're consuming nullptr + Process data slightly differently depending on whether or not we're consuming NULL input (checked just above). */ if (consumeNullInput) { - ma_node_process_pcm_frames_internal(pNode, nullptr, &frameCountIn, ppFramesOut, &frameCountOut); + ma_node_process_pcm_frames_internal(pNode, NULL, &frameCountIn, ppFramesOut, &frameCountOut); } else { /* We want to skip processing if there's no input data, but we can only do that safely if @@ -75360,7 +75360,7 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde Thanks to our sneaky optimization above we don't need to do any data copying directly into the output buffer - the onProcess() callback just did that for us. We do, however, need to apply the number of input and output frames that were processed. Note that due to continuous - processing above, we need to do explicit checks here. If we just consumed a nullptr input + processing above, we need to do explicit checks here. If we just consumed a NULL input buffer it means that no actual input data was processed from the internal buffers and we don't want to be modifying any counters. */ @@ -75382,7 +75382,7 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde We're not needing to read anything from the input buffer so just read directly from our already-processed data. */ - if (pFramesOut != nullptr) { + if (pFramesOut != NULL) { ma_copy_pcm_frames(pFramesOut, ma_node_get_cached_output_ptr(pNodeBase, outputBusIndex), pNodeBase->cachedFrameCountOut, ma_format_f32, ma_node_get_output_channels(pNodeBase, outputBusIndex)); } } @@ -75429,8 +75429,8 @@ static void ma_data_source_node_process_pcm_frames(ma_node* pNode, const float** ma_uint32 frameCount; ma_uint64 framesRead = 0; - MA_ASSERT(pDataSourceNode != nullptr); - MA_ASSERT(pDataSourceNode->pDataSource != nullptr); + MA_ASSERT(pDataSourceNode != NULL); + MA_ASSERT(pDataSourceNode->pDataSource != NULL); MA_ASSERT(ma_node_get_input_bus_count(pDataSourceNode) == 0); MA_ASSERT(ma_node_get_output_bus_count(pDataSourceNode) == 1); @@ -75443,7 +75443,7 @@ static void ma_data_source_node_process_pcm_frames(ma_node* pNode, const float** /* miniaudio should never be calling this with a frame count of zero. */ MA_ASSERT(frameCount > 0); - if (ma_data_source_get_data_format(pDataSourceNode->pDataSource, &format, &channels, nullptr, nullptr, 0) == MA_SUCCESS) { /* <-- Don't care about sample rate here. */ + if (ma_data_source_get_data_format(pDataSourceNode->pDataSource, &format, &channels, NULL, NULL, 0) == MA_SUCCESS) { /* <-- Don't care about sample rate here. */ /* The node graph system requires samples be in floating point format. This is checked in ma_data_source_node_init(). */ MA_ASSERT(format == ma_format_f32); (void)format; /* Just to silence some static analysis tools. */ @@ -75457,7 +75457,7 @@ static void ma_data_source_node_process_pcm_frames(ma_node* pNode, const float** static ma_node_vtable g_ma_data_source_node_vtable = { ma_data_source_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 0, /* 0 input buses. */ 1, /* 1 output bus. */ 0 @@ -75470,17 +75470,17 @@ MA_API ma_result ma_data_source_node_init(ma_node_graph* pNodeGraph, const ma_da ma_uint32 channels; /* For specifying the channel count of the output bus. */ ma_node_config baseConfig; - if (pDataSourceNode == nullptr) { + if (pDataSourceNode == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pDataSourceNode); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } - result = ma_data_source_get_data_format(pConfig->pDataSource, &format, &channels, nullptr, nullptr, 0); /* Don't care about sample rate. This will check pDataSource for nullptr. */ + result = ma_data_source_get_data_format(pConfig->pDataSource, &format, &channels, NULL, NULL, 0); /* Don't care about sample rate. This will check pDataSource for NULL. */ if (result != MA_SUCCESS) { return result; } @@ -75497,11 +75497,11 @@ MA_API ma_result ma_data_source_node_init(ma_node_graph* pNodeGraph, const ma_da /* The channel count is defined by the data source. It is invalid for the caller to manually set the channel counts in the config. `ma_data_source_node_config_init()` will have defaulted the - channel count pointer to nullptr which is how it must remain. If you trigger any of these asserts + channel count pointer to NULL which is how it must remain. If you trigger any of these asserts it means you're explicitly setting the channel count. Instead, configure the output channel count of your data source to be the necessary channel count. */ - if (baseConfig.pOutputChannels != nullptr) { + if (baseConfig.pOutputChannels != NULL) { return MA_INVALID_ARGS; } @@ -75524,7 +75524,7 @@ MA_API void ma_data_source_node_uninit(ma_data_source_node* pDataSourceNode, con MA_API ma_result ma_data_source_node_set_looping(ma_data_source_node* pDataSourceNode, ma_bool32 isLooping) { - if (pDataSourceNode == nullptr) { + if (pDataSourceNode == NULL) { return MA_INVALID_ARGS; } @@ -75533,7 +75533,7 @@ MA_API ma_result ma_data_source_node_set_looping(ma_data_source_node* pDataSourc MA_API ma_bool32 ma_data_source_node_is_looping(ma_data_source_node* pDataSourceNode) { - if (pDataSourceNode == nullptr) { + if (pDataSourceNode == NULL) { return MA_FALSE; } @@ -75562,7 +75562,7 @@ static void ma_splitter_node_process_pcm_frames(ma_node* pNode, const float** pp ma_uint32 iOutputBus; ma_uint32 channels; - MA_ASSERT(pNodeBase != nullptr); + MA_ASSERT(pNodeBase != NULL); MA_ASSERT(ma_node_get_input_bus_count(pNodeBase) == 1); /* We don't need to consider the input frame count - it'll be the same as the output frame count and we process everything. */ @@ -75580,7 +75580,7 @@ static void ma_splitter_node_process_pcm_frames(ma_node* pNode, const float** pp static ma_node_vtable g_ma_splitter_node_vtable = { ma_splitter_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* 1 input bus. */ MA_NODE_BUS_COUNT_UNKNOWN, /* The output bus count is specified on a per-node basis. */ 0 @@ -75594,13 +75594,13 @@ MA_API ma_result ma_splitter_node_init(ma_node_graph* pNodeGraph, const ma_split ma_uint32 pOutputChannels[MA_MAX_NODE_BUS_COUNT]; ma_uint32 iOutputBus; - if (pSplitterNode == nullptr) { + if (pSplitterNode == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pSplitterNode); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -75651,7 +75651,7 @@ static void ma_biquad_node_process_pcm_frames(ma_node* pNode, const float** ppFr { ma_biquad_node* pLPFNode = (ma_biquad_node*)pNode; - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); (void)pFrameCountIn; ma_biquad_process_pcm_frames(&pLPFNode->biquad, ppFramesOut[0], ppFramesIn[0], *pFrameCountOut); @@ -75660,7 +75660,7 @@ static void ma_biquad_node_process_pcm_frames(ma_node* pNode, const float** ppFr static ma_node_vtable g_ma_biquad_node_vtable = { ma_biquad_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* One input. */ 1, /* One output. */ 0 /* Default flags. */ @@ -75671,13 +75671,13 @@ MA_API ma_result ma_biquad_node_init(ma_node_graph* pNodeGraph, const ma_biquad_ ma_result result; ma_node_config baseNodeConfig; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pNode); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -75707,7 +75707,7 @@ MA_API ma_result ma_biquad_node_reinit(const ma_biquad_config* pConfig, ma_biqua { ma_biquad_node* pLPFNode = (ma_biquad_node*)pNode; - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); return ma_biquad_reinit(pConfig, &pLPFNode->biquad); } @@ -75716,7 +75716,7 @@ MA_API void ma_biquad_node_uninit(ma_biquad_node* pNode, const ma_allocation_cal { ma_biquad_node* pLPFNode = (ma_biquad_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return; } @@ -75743,7 +75743,7 @@ static void ma_lpf_node_process_pcm_frames(ma_node* pNode, const float** ppFrame { ma_lpf_node* pLPFNode = (ma_lpf_node*)pNode; - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); (void)pFrameCountIn; ma_lpf_process_pcm_frames(&pLPFNode->lpf, ppFramesOut[0], ppFramesIn[0], *pFrameCountOut); @@ -75752,7 +75752,7 @@ static void ma_lpf_node_process_pcm_frames(ma_node* pNode, const float** ppFrame static ma_node_vtable g_ma_lpf_node_vtable = { ma_lpf_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* One input. */ 1, /* One output. */ 0 /* Default flags. */ @@ -75763,13 +75763,13 @@ MA_API ma_result ma_lpf_node_init(ma_node_graph* pNodeGraph, const ma_lpf_node_c ma_result result; ma_node_config baseNodeConfig; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pNode); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -75799,7 +75799,7 @@ MA_API ma_result ma_lpf_node_reinit(const ma_lpf_config* pConfig, ma_lpf_node* p { ma_lpf_node* pLPFNode = (ma_lpf_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -75810,7 +75810,7 @@ MA_API void ma_lpf_node_uninit(ma_lpf_node* pNode, const ma_allocation_callbacks { ma_lpf_node* pLPFNode = (ma_lpf_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return; } @@ -75837,7 +75837,7 @@ static void ma_hpf_node_process_pcm_frames(ma_node* pNode, const float** ppFrame { ma_hpf_node* pHPFNode = (ma_hpf_node*)pNode; - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); (void)pFrameCountIn; ma_hpf_process_pcm_frames(&pHPFNode->hpf, ppFramesOut[0], ppFramesIn[0], *pFrameCountOut); @@ -75846,7 +75846,7 @@ static void ma_hpf_node_process_pcm_frames(ma_node* pNode, const float** ppFrame static ma_node_vtable g_ma_hpf_node_vtable = { ma_hpf_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* One input. */ 1, /* One output. */ 0 /* Default flags. */ @@ -75857,13 +75857,13 @@ MA_API ma_result ma_hpf_node_init(ma_node_graph* pNodeGraph, const ma_hpf_node_c ma_result result; ma_node_config baseNodeConfig; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pNode); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -75893,7 +75893,7 @@ MA_API ma_result ma_hpf_node_reinit(const ma_hpf_config* pConfig, ma_hpf_node* p { ma_hpf_node* pHPFNode = (ma_hpf_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -75904,7 +75904,7 @@ MA_API void ma_hpf_node_uninit(ma_hpf_node* pNode, const ma_allocation_callbacks { ma_hpf_node* pHPFNode = (ma_hpf_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return; } @@ -75932,7 +75932,7 @@ static void ma_bpf_node_process_pcm_frames(ma_node* pNode, const float** ppFrame { ma_bpf_node* pBPFNode = (ma_bpf_node*)pNode; - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); (void)pFrameCountIn; ma_bpf_process_pcm_frames(&pBPFNode->bpf, ppFramesOut[0], ppFramesIn[0], *pFrameCountOut); @@ -75941,7 +75941,7 @@ static void ma_bpf_node_process_pcm_frames(ma_node* pNode, const float** ppFrame static ma_node_vtable g_ma_bpf_node_vtable = { ma_bpf_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* One input. */ 1, /* One output. */ 0 /* Default flags. */ @@ -75952,13 +75952,13 @@ MA_API ma_result ma_bpf_node_init(ma_node_graph* pNodeGraph, const ma_bpf_node_c ma_result result; ma_node_config baseNodeConfig; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pNode); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -75988,7 +75988,7 @@ MA_API ma_result ma_bpf_node_reinit(const ma_bpf_config* pConfig, ma_bpf_node* p { ma_bpf_node* pBPFNode = (ma_bpf_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -75999,7 +75999,7 @@ MA_API void ma_bpf_node_uninit(ma_bpf_node* pNode, const ma_allocation_callbacks { ma_bpf_node* pBPFNode = (ma_bpf_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return; } @@ -76026,7 +76026,7 @@ static void ma_notch_node_process_pcm_frames(ma_node* pNode, const float** ppFra { ma_notch_node* pBPFNode = (ma_notch_node*)pNode; - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); (void)pFrameCountIn; ma_notch2_process_pcm_frames(&pBPFNode->notch, ppFramesOut[0], ppFramesIn[0], *pFrameCountOut); @@ -76035,7 +76035,7 @@ static void ma_notch_node_process_pcm_frames(ma_node* pNode, const float** ppFra static ma_node_vtable g_ma_notch_node_vtable = { ma_notch_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* One input. */ 1, /* One output. */ 0 /* Default flags. */ @@ -76046,13 +76046,13 @@ MA_API ma_result ma_notch_node_init(ma_node_graph* pNodeGraph, const ma_notch_no ma_result result; ma_node_config baseNodeConfig; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pNode); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -76082,7 +76082,7 @@ MA_API ma_result ma_notch_node_reinit(const ma_notch_config* pConfig, ma_notch_n { ma_notch_node* pNotchNode = (ma_notch_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -76093,7 +76093,7 @@ MA_API void ma_notch_node_uninit(ma_notch_node* pNode, const ma_allocation_callb { ma_notch_node* pNotchNode = (ma_notch_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return; } @@ -76120,7 +76120,7 @@ static void ma_peak_node_process_pcm_frames(ma_node* pNode, const float** ppFram { ma_peak_node* pBPFNode = (ma_peak_node*)pNode; - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); (void)pFrameCountIn; ma_peak2_process_pcm_frames(&pBPFNode->peak, ppFramesOut[0], ppFramesIn[0], *pFrameCountOut); @@ -76129,7 +76129,7 @@ static void ma_peak_node_process_pcm_frames(ma_node* pNode, const float** ppFram static ma_node_vtable g_ma_peak_node_vtable = { ma_peak_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* One input. */ 1, /* One output. */ 0 /* Default flags. */ @@ -76140,13 +76140,13 @@ MA_API ma_result ma_peak_node_init(ma_node_graph* pNodeGraph, const ma_peak_node ma_result result; ma_node_config baseNodeConfig; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pNode); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -76177,7 +76177,7 @@ MA_API ma_result ma_peak_node_reinit(const ma_peak_config* pConfig, ma_peak_node { ma_peak_node* pPeakNode = (ma_peak_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -76188,7 +76188,7 @@ MA_API void ma_peak_node_uninit(ma_peak_node* pNode, const ma_allocation_callbac { ma_peak_node* pPeakNode = (ma_peak_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return; } @@ -76215,7 +76215,7 @@ static void ma_loshelf_node_process_pcm_frames(ma_node* pNode, const float** ppF { ma_loshelf_node* pBPFNode = (ma_loshelf_node*)pNode; - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); (void)pFrameCountIn; ma_loshelf2_process_pcm_frames(&pBPFNode->loshelf, ppFramesOut[0], ppFramesIn[0], *pFrameCountOut); @@ -76224,7 +76224,7 @@ static void ma_loshelf_node_process_pcm_frames(ma_node* pNode, const float** ppF static ma_node_vtable g_ma_loshelf_node_vtable = { ma_loshelf_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* One input. */ 1, /* One output. */ 0 /* Default flags. */ @@ -76235,13 +76235,13 @@ MA_API ma_result ma_loshelf_node_init(ma_node_graph* pNodeGraph, const ma_loshel ma_result result; ma_node_config baseNodeConfig; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pNode); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -76271,7 +76271,7 @@ MA_API ma_result ma_loshelf_node_reinit(const ma_loshelf_config* pConfig, ma_los { ma_loshelf_node* pLoshelfNode = (ma_loshelf_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -76282,7 +76282,7 @@ MA_API void ma_loshelf_node_uninit(ma_loshelf_node* pNode, const ma_allocation_c { ma_loshelf_node* pLoshelfNode = (ma_loshelf_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return; } @@ -76309,7 +76309,7 @@ static void ma_hishelf_node_process_pcm_frames(ma_node* pNode, const float** ppF { ma_hishelf_node* pBPFNode = (ma_hishelf_node*)pNode; - MA_ASSERT(pNode != nullptr); + MA_ASSERT(pNode != NULL); (void)pFrameCountIn; ma_hishelf2_process_pcm_frames(&pBPFNode->hishelf, ppFramesOut[0], ppFramesIn[0], *pFrameCountOut); @@ -76318,7 +76318,7 @@ static void ma_hishelf_node_process_pcm_frames(ma_node* pNode, const float** ppF static ma_node_vtable g_ma_hishelf_node_vtable = { ma_hishelf_node_process_pcm_frames, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* One input. */ 1, /* One output. */ 0 /* Default flags. */ @@ -76329,13 +76329,13 @@ MA_API ma_result ma_hishelf_node_init(ma_node_graph* pNodeGraph, const ma_hishel ma_result result; ma_node_config baseNodeConfig; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pNode); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -76365,7 +76365,7 @@ MA_API ma_result ma_hishelf_node_reinit(const ma_hishelf_config* pConfig, ma_his { ma_hishelf_node* pHishelfNode = (ma_hishelf_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return MA_INVALID_ARGS; } @@ -76376,7 +76376,7 @@ MA_API void ma_hishelf_node_uninit(ma_hishelf_node* pNode, const ma_allocation_c { ma_hishelf_node* pHishelfNode = (ma_hishelf_node*)pNode; - if (pNode == nullptr) { + if (pNode == NULL) { return; } @@ -76410,7 +76410,7 @@ static void ma_delay_node_process_pcm_frames(ma_node* pNode, const float** ppFra static ma_node_vtable g_ma_delay_node_vtable = { ma_delay_node_process_pcm_frames, - nullptr, + NULL, 1, /* 1 input channels. */ 1, /* 1 output channel. */ MA_NODE_FLAG_CONTINUOUS_PROCESSING /* Delay requires continuous processing to ensure the tail get's processed. */ @@ -76421,7 +76421,7 @@ MA_API ma_result ma_delay_node_init(ma_node_graph* pNodeGraph, const ma_delay_no ma_result result; ma_node_config baseConfig; - if (pDelayNode == nullptr) { + if (pDelayNode == NULL) { return MA_INVALID_ARGS; } @@ -76448,7 +76448,7 @@ MA_API ma_result ma_delay_node_init(ma_node_graph* pNodeGraph, const ma_delay_no MA_API void ma_delay_node_uninit(ma_delay_node* pDelayNode, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pDelayNode == nullptr) { + if (pDelayNode == NULL) { return; } @@ -76459,7 +76459,7 @@ MA_API void ma_delay_node_uninit(ma_delay_node* pDelayNode, const ma_allocation_ MA_API void ma_delay_node_set_wet(ma_delay_node* pDelayNode, float value) { - if (pDelayNode == nullptr) { + if (pDelayNode == NULL) { return; } @@ -76468,7 +76468,7 @@ MA_API void ma_delay_node_set_wet(ma_delay_node* pDelayNode, float value) MA_API float ma_delay_node_get_wet(const ma_delay_node* pDelayNode) { - if (pDelayNode == nullptr) { + if (pDelayNode == NULL) { return 0; } @@ -76477,7 +76477,7 @@ MA_API float ma_delay_node_get_wet(const ma_delay_node* pDelayNode) MA_API void ma_delay_node_set_dry(ma_delay_node* pDelayNode, float value) { - if (pDelayNode == nullptr) { + if (pDelayNode == NULL) { return; } @@ -76486,7 +76486,7 @@ MA_API void ma_delay_node_set_dry(ma_delay_node* pDelayNode, float value) MA_API float ma_delay_node_get_dry(const ma_delay_node* pDelayNode) { - if (pDelayNode == nullptr) { + if (pDelayNode == NULL) { return 0; } @@ -76495,7 +76495,7 @@ MA_API float ma_delay_node_get_dry(const ma_delay_node* pDelayNode) MA_API void ma_delay_node_set_decay(ma_delay_node* pDelayNode, float value) { - if (pDelayNode == nullptr) { + if (pDelayNode == NULL) { return; } @@ -76504,7 +76504,7 @@ MA_API void ma_delay_node_set_decay(ma_delay_node* pDelayNode, float value) MA_API float ma_delay_node_get_decay(const ma_delay_node* pDelayNode) { - if (pDelayNode == nullptr) { + if (pDelayNode == NULL) { return 0; } @@ -76525,7 +76525,7 @@ Engine static void ma_sound_set_at_end(ma_sound* pSound, ma_bool32 atEnd) { - MA_ASSERT(pSound != nullptr); + MA_ASSERT(pSound != NULL); ma_atomic_exchange_32(&pSound->atEnd, atEnd); /* @@ -76537,7 +76537,7 @@ static void ma_sound_set_at_end(ma_sound* pSound, ma_bool32 atEnd) #if 0 /* Fire any callbacks or events. */ if (atEnd) { - if (pSound->endCallback != nullptr) { + if (pSound->endCallback != NULL) { pSound->endCallback(pSound->pEndCallbackUserData, pSound); } } @@ -76546,7 +76546,7 @@ static void ma_sound_set_at_end(ma_sound* pSound, ma_bool32 atEnd) static ma_bool32 ma_sound_get_at_end(const ma_sound* pSound) { - MA_ASSERT(pSound != nullptr); + MA_ASSERT(pSound != NULL); return ma_atomic_load_32(&pSound->atEnd); } @@ -76572,7 +76572,7 @@ static void ma_engine_node_update_pitch_if_required(ma_engine_node* pEngineNode) ma_bool32 isUpdateRequired = MA_FALSE; float newPitch; - MA_ASSERT(pEngineNode != nullptr); + MA_ASSERT(pEngineNode != NULL); newPitch = ma_atomic_load_explicit_f32(&pEngineNode->pitch, ma_atomic_memory_order_acquire); @@ -76594,7 +76594,7 @@ static void ma_engine_node_update_pitch_if_required(ma_engine_node* pEngineNode) static ma_bool32 ma_engine_node_is_pitching_enabled(const ma_engine_node* pEngineNode) { - MA_ASSERT(pEngineNode != nullptr); + MA_ASSERT(pEngineNode != NULL); /* Don't try to be clever by skipping resampling in the pitch=1 case or else you'll glitch when moving away from 1. */ return !ma_atomic_load_explicit_32(&pEngineNode->isPitchDisabled, ma_atomic_memory_order_acquire); @@ -76602,14 +76602,14 @@ static ma_bool32 ma_engine_node_is_pitching_enabled(const ma_engine_node* pEngin static ma_bool32 ma_engine_node_is_spatialization_enabled(const ma_engine_node* pEngineNode) { - MA_ASSERT(pEngineNode != nullptr); + MA_ASSERT(pEngineNode != NULL); return !ma_atomic_load_explicit_32(&pEngineNode->isSpatializationDisabled, ma_atomic_memory_order_acquire); } static ma_result ma_engine_node_set_volume(ma_engine_node* pEngineNode, float volume) { - if (pEngineNode == nullptr) { + if (pEngineNode == NULL) { return MA_INVALID_ARGS; } @@ -76629,13 +76629,13 @@ static ma_result ma_engine_node_set_volume(ma_engine_node* pEngineNode, float vo static ma_result ma_engine_node_get_volume(const ma_engine_node* pEngineNode, float* pVolume) { - if (pVolume == nullptr) { + if (pVolume == NULL) { return MA_INVALID_ARGS; } *pVolume = 0.0f; - if (pEngineNode == nullptr) { + if (pEngineNode == NULL) { return MA_INVALID_ARGS; } @@ -76821,7 +76821,7 @@ static void ma_engine_node_process_pcm_frames__general(ma_engine_node* pEngineNo } } else { /* Channel conversion required. TODO: Add support for channel maps here. */ - ma_channel_map_apply_f32(pRunningFramesOut, nullptr, channelsOut, pWorkingBuffer, nullptr, channelsIn, framesJustProcessedOut, ma_channel_mix_mode_simple, pEngineNode->monoExpansionMode); + ma_channel_map_apply_f32(pRunningFramesOut, NULL, channelsOut, pWorkingBuffer, NULL, channelsIn, framesJustProcessedOut, ma_channel_mix_mode_simple, pEngineNode->monoExpansionMode); /* If we're using smoothing, the volume will have already been applied. */ if (!isVolumeSmoothingEnabled) { @@ -76873,7 +76873,7 @@ static void ma_engine_node_process_pcm_frames__sound(ma_node* pNode, const float if (ma_sound_at_end(pSound)) { ma_sound_stop(pSound); - if (pSound->endCallback != nullptr) { + if (pSound->endCallback != NULL) { pSound->endCallback(pSound->pEndCallbackUserData, pSound); } @@ -76907,7 +76907,7 @@ static void ma_engine_node_process_pcm_frames__sound(ma_node* pNode, const float For the convenience of the caller, we're doing to allow data sources to use non-floating-point formats and channel counts that differ from the main engine. */ - result = ma_data_source_get_data_format(pSound->pDataSource, &dataSourceFormat, &dataSourceChannels, nullptr, nullptr, 0); + result = ma_data_source_get_data_format(pSound->pDataSource, &dataSourceFormat, &dataSourceChannels, NULL, NULL, 0); if (result == MA_SUCCESS) { tempCapInFrames = sizeof(temp) / ma_get_bytes_per_frame(dataSourceFormat, dataSourceChannels); @@ -77008,7 +77008,7 @@ static void ma_engine_node_process_pcm_frames__group(ma_node* pNode, const float static ma_node_vtable g_ma_engine_node_vtable__sound = { ma_engine_node_process_pcm_frames__sound, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 0, /* Sounds are data source nodes which means they have zero inputs (their input is drawn from the data source itself). */ 1, /* Sounds have one output bus. */ 0 /* Default flags. */ @@ -77017,7 +77017,7 @@ static ma_node_vtable g_ma_engine_node_vtable__sound = static ma_node_vtable g_ma_engine_node_vtable__group = { ma_engine_node_process_pcm_frames__group, - nullptr, /* onGetRequiredInputFrameCount */ + NULL, /* onGetRequiredInputFrameCount */ 1, /* Groups have one input bus. */ 1, /* Groups have one output bus. */ MA_NODE_FLAG_DIFFERENT_PROCESSING_RATES /* The engine node does resampling so should let miniaudio know about it. */ @@ -77075,11 +77075,11 @@ static ma_result ma_engine_node_get_heap_layout(const ma_engine_node_config* pCo MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } - if (pConfig->pEngine == nullptr) { + if (pConfig->pEngine == NULL) { return MA_INVALID_ARGS; /* An engine must be specified. */ } @@ -77158,7 +77158,7 @@ MA_API ma_result ma_engine_node_get_heap_size(const ma_engine_node_config* pConf ma_result result; ma_engine_node_heap_layout heapLayout; - if (pHeapSizeInBytes == nullptr) { + if (pHeapSizeInBytes == NULL) { return MA_INVALID_ARGS; } @@ -77188,7 +77188,7 @@ MA_API ma_result ma_engine_node_init_preallocated(const ma_engine_node_config* p ma_uint32 channelsOut; ma_channel defaultStereoChannelMap[2] = {MA_CHANNEL_SIDE_LEFT, MA_CHANNEL_SIDE_RIGHT}; /* <-- Consistent with the default channel map of a stereo listener. Means channel conversion can run on a fast path. */ - if (pEngineNode == nullptr) { + if (pEngineNode == NULL) { return MA_INVALID_ARGS; } @@ -77318,9 +77318,9 @@ MA_API ma_result ma_engine_node_init_preallocated(const ma_engine_node_config* p return MA_SUCCESS; /* No need for allocation callbacks here because we use a preallocated heap. */ -error3: ma_spatializer_uninit(&pEngineNode->spatializer, nullptr); -error2: ma_resampler_uninit(&pEngineNode->resampler, nullptr); -error1: ma_node_uninit(&pEngineNode->baseNode, nullptr); +error3: ma_spatializer_uninit(&pEngineNode->spatializer, NULL); +error2: ma_resampler_uninit(&pEngineNode->resampler, NULL); +error1: ma_node_uninit(&pEngineNode->baseNode, NULL); error0: return result; } @@ -77337,11 +77337,11 @@ MA_API ma_result ma_engine_node_init(const ma_engine_node_config* pConfig, const if (heapSizeInBytes > 0) { pHeap = ma_malloc(heapSizeInBytes, pAllocationCallbacks); - if (pHeap == nullptr) { + if (pHeap == NULL) { return MA_OUT_OF_MEMORY; } } else { - pHeap = nullptr; + pHeap = NULL; } result = ma_engine_node_init_preallocated(pConfig, pHeap, pEngineNode); @@ -77379,7 +77379,7 @@ MA_API void ma_engine_node_uninit(ma_engine_node* pEngineNode, const ma_allocati MA_API ma_sound_config ma_sound_config_init(void) { - return ma_sound_config_init_2(nullptr); + return ma_sound_config_init_2(NULL); } MA_API ma_sound_config ma_sound_config_init_2(ma_engine* pEngine) @@ -77388,7 +77388,7 @@ MA_API ma_sound_config ma_sound_config_init_2(ma_engine* pEngine) MA_ZERO_OBJECT(&config); - if (pEngine != nullptr) { + if (pEngine != NULL) { config.monoExpansionMode = pEngine->monoExpansionMode; config.pitchResampling = pEngine->pitchResamplingConfig; } else { @@ -77406,7 +77406,7 @@ MA_API ma_sound_config ma_sound_config_init_2(ma_engine* pEngine) MA_API ma_sound_group_config ma_sound_group_config_init(void) { - return ma_sound_group_config_init_2(nullptr); + return ma_sound_group_config_init_2(NULL); } MA_API ma_sound_group_config ma_sound_group_config_init_2(ma_engine* pEngine) @@ -77415,7 +77415,7 @@ MA_API ma_sound_group_config ma_sound_group_config_init_2(ma_engine* pEngine) MA_ZERO_OBJECT(&config); - if (pEngine != nullptr) { + if (pEngine != NULL) { config.monoExpansionMode = pEngine->monoExpansionMode; config.pitchResampling = pEngine->pitchResamplingConfig; } else { @@ -77468,7 +77468,7 @@ static void ma_engine_data_callback_internal(ma_device* pDevice, void* pFramesOu */ #if !defined(MA_NO_RESOURCE_MANAGER) && defined(MA_EMSCRIPTEN) { - if (pEngine->pResourceManager != nullptr) { + if (pEngine->pResourceManager != NULL) { if ((pEngine->pResourceManager->config.flags & MA_RESOURCE_MANAGER_FLAG_NO_THREADING) != 0) { ma_resource_manager_process_next_job(pEngine->pResourceManager); } @@ -77476,7 +77476,7 @@ static void ma_engine_data_callback_internal(ma_device* pDevice, void* pFramesOu } #endif - ma_engine_read_pcm_frames(pEngine, pFramesOut, frameCount, nullptr); + ma_engine_read_pcm_frames(pEngine, pFramesOut, frameCount, NULL); } static ma_uint32 ma_device__get_processing_size_in_frames(ma_device* pDevice) @@ -77503,14 +77503,14 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng ma_spatializer_listener_config listenerConfig; ma_uint32 iListener; - if (pEngine == nullptr) { + if (pEngine == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pEngine); - /* The config is allowed to be nullptr in which case we use defaults for everything. */ - if (pConfig != nullptr) { + /* The config is allowed to be NULL in which case we use defaults for everything. */ + if (pConfig != NULL) { engineConfig = *pConfig; } else { engineConfig = ma_engine_config_init(); @@ -77534,11 +77534,11 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng pEngine->pDevice = engineConfig.pDevice; /* If we don't have a device, we need one. */ - if (pEngine->pDevice == nullptr && engineConfig.noDevice == MA_FALSE) { + if (pEngine->pDevice == NULL && engineConfig.noDevice == MA_FALSE) { ma_device_config deviceConfig; pEngine->pDevice = (ma_device*)ma_malloc(sizeof(*pEngine->pDevice), &pEngine->allocationCallbacks); - if (pEngine->pDevice == nullptr) { + if (pEngine->pDevice == NULL) { return MA_OUT_OF_MEMORY; } @@ -77547,7 +77547,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng deviceConfig.playback.format = ma_format_f32; deviceConfig.playback.channels = engineConfig.channels; deviceConfig.sampleRate = engineConfig.sampleRate; - deviceConfig.dataCallback = (engineConfig.dataCallback != nullptr) ? engineConfig.dataCallback : ma_engine_data_callback_internal; + deviceConfig.dataCallback = (engineConfig.dataCallback != NULL) ? engineConfig.dataCallback : ma_engine_data_callback_internal; deviceConfig.pUserData = pEngine; deviceConfig.notificationCallback = engineConfig.notificationCallback; deviceConfig.periodSizeInFrames = engineConfig.periodSizeInFrames; @@ -77555,7 +77555,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng deviceConfig.noPreSilencedOutputBuffer = MA_TRUE; /* We'll always be outputting to every frame in the callback so there's no need for a pre-silenced buffer. */ deviceConfig.noClip = MA_TRUE; /* The engine will do clipping itself. */ - if (engineConfig.pContext == nullptr) { + if (engineConfig.pContext == NULL) { ma_context_config contextConfig = ma_context_config_init(); contextConfig.allocationCallbacks = pEngine->allocationCallbacks; contextConfig.pLog = engineConfig.pLog; @@ -77563,20 +77563,20 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng /* If the engine config does not specify a log, use the resource manager's if we have one. */ #ifndef MA_NO_RESOURCE_MANAGER { - if (contextConfig.pLog == nullptr && engineConfig.pResourceManager != nullptr) { + if (contextConfig.pLog == NULL && engineConfig.pResourceManager != NULL) { contextConfig.pLog = ma_resource_manager_get_log(engineConfig.pResourceManager); } } #endif - result = ma_device_init_ex(nullptr, 0, &contextConfig, &deviceConfig, pEngine->pDevice); + result = ma_device_init_ex(NULL, 0, &contextConfig, &deviceConfig, pEngine->pDevice); } else { result = ma_device_init(engineConfig.pContext, &deviceConfig, pEngine->pDevice); } if (result != MA_SUCCESS) { ma_free(pEngine->pDevice, &pEngine->allocationCallbacks); - pEngine->pDevice = nullptr; + pEngine->pDevice = NULL; return result; } @@ -77584,7 +77584,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng } /* Update the channel count and sample rate of the engine config so we can reference it below. */ - if (pEngine->pDevice != nullptr) { + if (pEngine->pDevice != NULL) { engineConfig.channels = pEngine->pDevice->playback.channels; engineConfig.sampleRate = pEngine->pDevice->sampleRate; @@ -77606,7 +77606,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng pEngine->sampleRate = engineConfig.sampleRate; /* The engine always uses either the log that was passed into the config, or the context's log is available. */ - if (engineConfig.pLog != nullptr) { + if (engineConfig.pLog != NULL) { pEngine->pLog = engineConfig.pLog; } else { #if !defined(MA_NO_DEVICE_IO) @@ -77615,7 +77615,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng } #else { - pEngine->pLog = nullptr; + pEngine->pLog = NULL; } #endif } @@ -77651,7 +77651,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng */ #if !defined(MA_NO_DEVICE_IO) { - if (pEngine->pDevice != nullptr) { + if (pEngine->pDevice != NULL) { /* Temporarily disabled. There is a subtle bug here where front-left and front-right will be used by the device's channel map, but this is not what we want to use for @@ -77687,11 +77687,11 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng /* We need a resource manager. */ #ifndef MA_NO_RESOURCE_MANAGER { - if (pEngine->pResourceManager == nullptr) { + if (pEngine->pResourceManager == NULL) { ma_resource_manager_config resourceManagerConfig; pEngine->pResourceManager = (ma_resource_manager*)ma_malloc(sizeof(*pEngine->pResourceManager), &pEngine->allocationCallbacks); - if (pEngine->pResourceManager == nullptr) { + if (pEngine->pResourceManager == NULL) { result = MA_OUT_OF_MEMORY; goto on_error_2; } @@ -77725,12 +77725,12 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng /* Setup some stuff for inlined sounds. That is sounds played with ma_engine_play_sound(). */ pEngine->inlinedSoundLock = 0; - pEngine->pInlinedSoundHead = nullptr; + pEngine->pInlinedSoundHead = NULL; /* Start the engine if required. This should always be the last step. */ #if !defined(MA_NO_DEVICE_IO) { - if (engineConfig.noAutoStart == MA_FALSE && pEngine->pDevice != nullptr) { + if (engineConfig.noAutoStart == MA_FALSE && pEngine->pDevice != NULL) { result = ma_engine_start(pEngine); if (result != MA_SUCCESS) { goto on_error_4; /* Failed to start the engine. */ @@ -77773,7 +77773,7 @@ MA_API void ma_engine_uninit(ma_engine* pEngine) { ma_uint32 iListener; - if (pEngine == nullptr) { + if (pEngine == NULL) { return; } @@ -77784,7 +77784,7 @@ MA_API void ma_engine_uninit(ma_engine* pEngine) ma_device_uninit(pEngine->pDevice); ma_free(pEngine->pDevice, &pEngine->allocationCallbacks); } else { - if (pEngine->pDevice != nullptr) { + if (pEngine->pDevice != NULL) { ma_device_stop(pEngine->pDevice); } } @@ -77799,7 +77799,7 @@ MA_API void ma_engine_uninit(ma_engine* pEngine) { for (;;) { ma_sound_inlined* pSoundToDelete = pEngine->pInlinedSoundHead; - if (pSoundToDelete == nullptr) { + if (pSoundToDelete == NULL) { break; /* Done. */ } @@ -77832,7 +77832,7 @@ MA_API ma_result ma_engine_read_pcm_frames(ma_engine* pEngine, void* pFramesOut, ma_result result; ma_uint64 framesRead = 0; - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = 0; } @@ -77841,7 +77841,7 @@ MA_API ma_result ma_engine_read_pcm_frames(ma_engine* pEngine, void* pFramesOut, return result; } - if (pFramesRead != nullptr) { + if (pFramesRead != NULL) { *pFramesRead = framesRead; } @@ -77854,8 +77854,8 @@ MA_API ma_result ma_engine_read_pcm_frames(ma_engine* pEngine, void* pFramesOut, MA_API ma_node_graph* ma_engine_get_node_graph(ma_engine* pEngine) { - if (pEngine == nullptr) { - return nullptr; + if (pEngine == NULL) { + return NULL; } return &pEngine->nodeGraph; @@ -77864,8 +77864,8 @@ MA_API ma_node_graph* ma_engine_get_node_graph(ma_engine* pEngine) #if !defined(MA_NO_RESOURCE_MANAGER) MA_API ma_resource_manager* ma_engine_get_resource_manager(ma_engine* pEngine) { - if (pEngine == nullptr) { - return nullptr; + if (pEngine == NULL) { + return NULL; } #if !defined(MA_NO_RESOURCE_MANAGER) @@ -77874,7 +77874,7 @@ MA_API ma_resource_manager* ma_engine_get_resource_manager(ma_engine* pEngine) } #else { - return nullptr; + return NULL; } #endif } @@ -77882,8 +77882,8 @@ MA_API ma_resource_manager* ma_engine_get_resource_manager(ma_engine* pEngine) MA_API ma_device* ma_engine_get_device(ma_engine* pEngine) { - if (pEngine == nullptr) { - return nullptr; + if (pEngine == NULL) { + return NULL; } #if !defined(MA_NO_DEVICE_IO) @@ -77892,18 +77892,18 @@ MA_API ma_device* ma_engine_get_device(ma_engine* pEngine) } #else { - return nullptr; + return NULL; } #endif } MA_API ma_log* ma_engine_get_log(ma_engine* pEngine) { - if (pEngine == nullptr) { - return nullptr; + if (pEngine == NULL) { + return NULL; } - if (pEngine->pLog != nullptr) { + if (pEngine->pLog != NULL) { return pEngine->pLog; } else { #if !defined(MA_NO_DEVICE_IO) @@ -77912,7 +77912,7 @@ MA_API ma_log* ma_engine_get_log(ma_engine* pEngine) } #else { - return nullptr; + return NULL; } #endif } @@ -77960,7 +77960,7 @@ MA_API ma_uint32 ma_engine_get_channels(const ma_engine* pEngine) MA_API ma_uint32 ma_engine_get_sample_rate(const ma_engine* pEngine) { - if (pEngine == nullptr) { + if (pEngine == NULL) { return 0; } @@ -77972,13 +77972,13 @@ MA_API ma_result ma_engine_start(ma_engine* pEngine) { ma_result result; - if (pEngine == nullptr) { + if (pEngine == NULL) { return MA_INVALID_ARGS; } #if !defined(MA_NO_DEVICE_IO) { - if (pEngine->pDevice != nullptr) { + if (pEngine->pDevice != NULL) { result = ma_device_start(pEngine->pDevice); } else { result = MA_INVALID_OPERATION; /* The engine is running without a device which means there's no real notion of "starting" the engine. */ @@ -78001,13 +78001,13 @@ MA_API ma_result ma_engine_stop(ma_engine* pEngine) { ma_result result; - if (pEngine == nullptr) { + if (pEngine == NULL) { return MA_INVALID_ARGS; } #if !defined(MA_NO_DEVICE_IO) { - if (pEngine->pDevice != nullptr) { + if (pEngine->pDevice != NULL) { result = ma_device_stop(pEngine->pDevice); } else { result = MA_INVALID_OPERATION; /* The engine is running without a device which means there's no real notion of "stopping" the engine. */ @@ -78028,7 +78028,7 @@ MA_API ma_result ma_engine_stop(ma_engine* pEngine) MA_API ma_result ma_engine_set_volume(ma_engine* pEngine, float volume) { - if (pEngine == nullptr) { + if (pEngine == NULL) { return MA_INVALID_ARGS; } @@ -78037,7 +78037,7 @@ MA_API ma_result ma_engine_set_volume(ma_engine* pEngine, float volume) MA_API float ma_engine_get_volume(ma_engine* pEngine) { - if (pEngine == nullptr) { + if (pEngine == NULL) { return 0; } @@ -78057,7 +78057,7 @@ MA_API float ma_engine_get_gain_db(ma_engine* pEngine) MA_API ma_uint32 ma_engine_get_listener_count(const ma_engine* pEngine) { - if (pEngine == nullptr) { + if (pEngine == NULL) { return 0; } @@ -78070,7 +78070,7 @@ MA_API ma_uint32 ma_engine_find_closest_listener(const ma_engine* pEngine, float ma_uint32 iListenerClosest; float closestLen2 = MA_FLT_MAX; - if (pEngine == nullptr || pEngine->listenerCount == 1) { + if (pEngine == NULL || pEngine->listenerCount == 1) { return 0; } @@ -78091,7 +78091,7 @@ MA_API ma_uint32 ma_engine_find_closest_listener(const ma_engine* pEngine, float MA_API void ma_engine_listener_set_position(ma_engine* pEngine, ma_uint32 listenerIndex, float x, float y, float z) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return; } @@ -78100,7 +78100,7 @@ MA_API void ma_engine_listener_set_position(ma_engine* pEngine, ma_uint32 listen MA_API ma_vec3f ma_engine_listener_get_position(const ma_engine* pEngine, ma_uint32 listenerIndex) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return ma_vec3f_init_3f(0, 0, 0); } @@ -78109,7 +78109,7 @@ MA_API ma_vec3f ma_engine_listener_get_position(const ma_engine* pEngine, ma_uin MA_API void ma_engine_listener_set_direction(ma_engine* pEngine, ma_uint32 listenerIndex, float x, float y, float z) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return; } @@ -78118,7 +78118,7 @@ MA_API void ma_engine_listener_set_direction(ma_engine* pEngine, ma_uint32 liste MA_API ma_vec3f ma_engine_listener_get_direction(const ma_engine* pEngine, ma_uint32 listenerIndex) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return ma_vec3f_init_3f(0, 0, -1); } @@ -78127,7 +78127,7 @@ MA_API ma_vec3f ma_engine_listener_get_direction(const ma_engine* pEngine, ma_ui MA_API void ma_engine_listener_set_velocity(ma_engine* pEngine, ma_uint32 listenerIndex, float x, float y, float z) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return; } @@ -78136,7 +78136,7 @@ MA_API void ma_engine_listener_set_velocity(ma_engine* pEngine, ma_uint32 listen MA_API ma_vec3f ma_engine_listener_get_velocity(const ma_engine* pEngine, ma_uint32 listenerIndex) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return ma_vec3f_init_3f(0, 0, 0); } @@ -78145,7 +78145,7 @@ MA_API ma_vec3f ma_engine_listener_get_velocity(const ma_engine* pEngine, ma_uin MA_API void ma_engine_listener_set_cone(ma_engine* pEngine, ma_uint32 listenerIndex, float innerAngleInRadians, float outerAngleInRadians, float outerGain) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return; } @@ -78154,19 +78154,19 @@ MA_API void ma_engine_listener_set_cone(ma_engine* pEngine, ma_uint32 listenerIn MA_API void ma_engine_listener_get_cone(const ma_engine* pEngine, ma_uint32 listenerIndex, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain) { - if (pInnerAngleInRadians != nullptr) { + if (pInnerAngleInRadians != NULL) { *pInnerAngleInRadians = 0; } - if (pOuterAngleInRadians != nullptr) { + if (pOuterAngleInRadians != NULL) { *pOuterAngleInRadians = 0; } - if (pOuterGain != nullptr) { + if (pOuterGain != NULL) { *pOuterGain = 0; } - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return; } @@ -78175,7 +78175,7 @@ MA_API void ma_engine_listener_get_cone(const ma_engine* pEngine, ma_uint32 list MA_API void ma_engine_listener_set_world_up(ma_engine* pEngine, ma_uint32 listenerIndex, float x, float y, float z) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return; } @@ -78184,7 +78184,7 @@ MA_API void ma_engine_listener_set_world_up(ma_engine* pEngine, ma_uint32 listen MA_API ma_vec3f ma_engine_listener_get_world_up(const ma_engine* pEngine, ma_uint32 listenerIndex) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return ma_vec3f_init_3f(0, 1, 0); } @@ -78193,7 +78193,7 @@ MA_API ma_vec3f ma_engine_listener_get_world_up(const ma_engine* pEngine, ma_uin MA_API void ma_engine_listener_set_enabled(ma_engine* pEngine, ma_uint32 listenerIndex, ma_bool32 isEnabled) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return; } @@ -78202,7 +78202,7 @@ MA_API void ma_engine_listener_set_enabled(ma_engine* pEngine, ma_uint32 listene MA_API ma_bool32 ma_engine_listener_is_enabled(const ma_engine* pEngine, ma_uint32 listenerIndex) { - if (pEngine == nullptr || listenerIndex >= pEngine->listenerCount) { + if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) { return MA_FALSE; } @@ -78214,15 +78214,15 @@ MA_API ma_bool32 ma_engine_listener_is_enabled(const ma_engine* pEngine, ma_uint MA_API ma_result ma_engine_play_sound_ex(ma_engine* pEngine, const char* pFilePath, ma_node* pNode, ma_uint32 nodeInputBusIndex) { ma_result result = MA_SUCCESS; - ma_sound_inlined* pSound = nullptr; - ma_sound_inlined* pNextSound = nullptr; + ma_sound_inlined* pSound = NULL; + ma_sound_inlined* pNextSound = NULL; - if (pEngine == nullptr || pFilePath == nullptr) { + if (pEngine == NULL || pFilePath == NULL) { return MA_INVALID_ARGS; } /* Attach to the endpoint node if nothing is specified. */ - if (pNode == nullptr) { + if (pNode == NULL) { pNode = ma_node_graph_get_endpoint(&pEngine->nodeGraph); nodeInputBusIndex = 0; } @@ -78243,7 +78243,7 @@ MA_API ma_result ma_engine_play_sound_ex(ma_engine* pEngine, const char* pFilePa { ma_uint32 soundFlags = 0; - for (pNextSound = pEngine->pInlinedSoundHead; pNextSound != nullptr; pNextSound = pNextSound->pNext) { + for (pNextSound = pEngine->pInlinedSoundHead; pNextSound != NULL; pNextSound = pNextSound->pNext) { if (ma_sound_at_end(&pNextSound->sound)) { /* The sound is at the end which means it's available for recycling. All we need to do @@ -78255,7 +78255,7 @@ MA_API ma_result ma_engine_play_sound_ex(ma_engine* pEngine, const char* pFilePa } } - if (pSound != nullptr) { + if (pSound != NULL) { /* We actually want to detach the sound from the list here. The reason is because we want the sound to be in a consistent state at the non-recycled case to simplify the logic below. @@ -78264,10 +78264,10 @@ MA_API ma_result ma_engine_play_sound_ex(ma_engine* pEngine, const char* pFilePa pEngine->pInlinedSoundHead = pSound->pNext; } - if (pSound->pPrev != nullptr) { + if (pSound->pPrev != NULL) { pSound->pPrev->pNext = pSound->pNext; } - if (pSound->pNext != nullptr) { + if (pSound->pNext != NULL) { pSound->pNext->pPrev = pSound->pPrev; } @@ -78278,7 +78278,7 @@ MA_API ma_result ma_engine_play_sound_ex(ma_engine* pEngine, const char* pFilePa pSound = (ma_sound_inlined*)ma_malloc(sizeof(*pSound), &pEngine->allocationCallbacks); } - if (pSound != nullptr) { /* Safety check for the allocation above. */ + if (pSound != NULL) { /* Safety check for the allocation above. */ /* At this point we should have memory allocated for the inlined sound. We just need to initialize it like a normal sound now. @@ -78288,17 +78288,17 @@ MA_API ma_result ma_engine_play_sound_ex(ma_engine* pEngine, const char* pFilePa soundFlags |= MA_SOUND_FLAG_NO_PITCH; /* Pitching isn't usable with inlined sounds, so disable it to save on speed. */ soundFlags |= MA_SOUND_FLAG_NO_SPATIALIZATION; /* Not currently doing spatialization with inlined sounds, but this might actually change later. For now disable spatialization. Will be removed if we ever add support for spatialization here. */ - result = ma_sound_init_from_file(pEngine, pFilePath, soundFlags, nullptr, nullptr, &pSound->sound); + result = ma_sound_init_from_file(pEngine, pFilePath, soundFlags, NULL, NULL, &pSound->sound); if (result == MA_SUCCESS) { /* Now attach the sound to the graph. */ result = ma_node_attach_output_bus(pSound, 0, pNode, nodeInputBusIndex); if (result == MA_SUCCESS) { /* At this point the sound should be loaded and we can go ahead and add it to the list. The new item becomes the new head. */ pSound->pNext = pEngine->pInlinedSoundHead; - pSound->pPrev = nullptr; + pSound->pPrev = NULL; pEngine->pInlinedSoundHead = pSound; /* <-- This is what attaches the sound to the list. */ - if (pSound->pNext != nullptr) { + if (pSound->pNext != NULL) { pSound->pNext->pPrev = pSound; } } else { @@ -78338,14 +78338,14 @@ MA_API ma_result ma_engine_play_sound(ma_engine* pEngine, const char* pFilePath, static ma_result ma_sound_preinit(ma_engine* pEngine, ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pSound); pSound->seekTarget = MA_SEEK_TARGET_NONE; - if (pEngine == nullptr) { + if (pEngine == NULL) { return MA_INVALID_ARGS; } @@ -78359,16 +78359,16 @@ static ma_result ma_sound_init_from_data_source_internal(ma_engine* pEngine, con ma_engine_node_type type; /* Will be set to ma_engine_node_type_group if no data source is specified. */ /* Do not clear pSound to zero here - that's done at a higher level with ma_sound_preinit(). */ - MA_ASSERT(pEngine != nullptr); - MA_ASSERT(pSound != nullptr); + MA_ASSERT(pEngine != NULL); + MA_ASSERT(pSound != NULL); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } pSound->pDataSource = pConfig->pDataSource; - if (pConfig->pDataSource != nullptr) { + if (pConfig->pDataSource != NULL) { type = ma_engine_node_type_sound; } else { type = ma_engine_node_type_group; @@ -78390,8 +78390,8 @@ static ma_result ma_sound_init_from_data_source_internal(ma_engine* pEngine, con } /* If we're loading from a data source the input channel count needs to be the data source's native channel count. */ - if (pConfig->pDataSource != nullptr) { - result = ma_data_source_get_data_format(pConfig->pDataSource, nullptr, &engineNodeConfig.channelsIn, &engineNodeConfig.sampleRate, nullptr, 0); + if (pConfig->pDataSource != NULL) { + result = ma_data_source_get_data_format(pConfig->pDataSource, NULL, &engineNodeConfig.channelsIn, &engineNodeConfig.sampleRate, NULL, 0); if (result != MA_SUCCESS) { return result; /* Failed to retrieve the channel count. */ } @@ -78413,7 +78413,7 @@ static ma_result ma_sound_init_from_data_source_internal(ma_engine* pEngine, con } /* If no attachment is specified, attach the sound straight to the endpoint. */ - if (pConfig->pInitialAttachment == nullptr) { + if (pConfig->pInitialAttachment == NULL) { /* No group. Attach straight to the endpoint by default, unless the caller has requested that it not. */ if ((pConfig->flags & MA_SOUND_FLAG_NO_DEFAULT_ATTACHMENT) == 0) { result = ma_node_attach_output_bus(pSound, 0, ma_node_graph_get_endpoint(&pEngine->nodeGraph), 0); @@ -78433,7 +78433,7 @@ static ma_result ma_sound_init_from_data_source_internal(ma_engine* pEngine, con When pulling data from a data source we need a processing cache to hold onto unprocessed input data from the data source after doing resampling. */ - if (pSound->pDataSource != nullptr) { + if (pSound->pDataSource != NULL) { pSound->processingCacheFramesRemaining = 0; pSound->processingCacheCap = ma_node_graph_get_processing_size_in_frames(&pEngine->nodeGraph); if (pSound->processingCacheCap == 0) { @@ -78441,7 +78441,7 @@ static ma_result ma_sound_init_from_data_source_internal(ma_engine* pEngine, con } pSound->pProcessingCache = (float*)ma_calloc(pSound->processingCacheCap * ma_get_bytes_per_frame(ma_format_f32, engineNodeConfig.channelsIn), &pEngine->allocationCallbacks); - if (pSound->pProcessingCache == nullptr) { + if (pSound->pProcessingCache == NULL) { ma_engine_node_uninit(&pSound->engineNode, &pEngine->allocationCallbacks); return MA_OUT_OF_MEMORY; } @@ -78486,13 +78486,13 @@ MA_API ma_result ma_sound_init_from_file_internal(ma_engine* pEngine, const ma_s } pSound->pResourceManagerDataSource = (ma_resource_manager_data_source*)ma_malloc(sizeof(*pSound->pResourceManagerDataSource), &pEngine->allocationCallbacks); - if (pSound->pResourceManagerDataSource == nullptr) { + if (pSound->pResourceManagerDataSource == NULL) { return MA_OUT_OF_MEMORY; } /* Removed in 0.12. Set pDoneFence on the notifications. */ notifications = pConfig->initNotifications; - if (pConfig->pDoneFence != nullptr && notifications.done.pFence == nullptr) { + if (pConfig->pDoneFence != NULL && notifications.done.pFence == NULL) { notifications.done.pFence = pConfig->pDoneFence; } @@ -78524,8 +78524,8 @@ MA_API ma_result ma_sound_init_from_file_internal(ma_engine* pEngine, const ma_s /* We need to use a slightly customized version of the config so we'll need to make a copy. */ config = *pConfig; - config.pFilePath = nullptr; - config.pFilePathW = nullptr; + config.pFilePath = NULL; + config.pFilePathW = NULL; config.pDataSource = pSound->pResourceManagerDataSource; result = ma_sound_init_from_data_source_internal(pEngine, &config, pSound); @@ -78545,7 +78545,7 @@ MA_API ma_result ma_sound_init_from_file(ma_engine* pEngine, const char* pFilePa { ma_sound_config config; - if (pFilePath == nullptr) { + if (pFilePath == NULL) { return MA_INVALID_ARGS; } @@ -78562,7 +78562,7 @@ MA_API ma_result ma_sound_init_from_file_w(ma_engine* pEngine, const wchar_t* pF { ma_sound_config config; - if (pFilePath == nullptr) { + if (pFilePath == NULL) { return MA_INVALID_ARGS; } @@ -78585,12 +78585,12 @@ MA_API ma_result ma_sound_init_copy(ma_engine* pEngine, const ma_sound* pExistin return result; } - if (pExistingSound == nullptr) { + if (pExistingSound == NULL) { return MA_INVALID_ARGS; } /* Cloning only works for data buffers (not streams) that are loaded from the resource manager. */ - if (pExistingSound->pResourceManagerDataSource == nullptr) { + if (pExistingSound->pResourceManagerDataSource == NULL) { return MA_INVALID_OPERATION; } @@ -78599,7 +78599,7 @@ MA_API ma_result ma_sound_init_copy(ma_engine* pEngine, const ma_sound* pExistin this will fail. */ pSound->pResourceManagerDataSource = (ma_resource_manager_data_source*)ma_malloc(sizeof(*pSound->pResourceManagerDataSource), &pEngine->allocationCallbacks); - if (pSound->pResourceManagerDataSource == nullptr) { + if (pSound->pResourceManagerDataSource == NULL) { return MA_OUT_OF_MEMORY; } @@ -78649,7 +78649,7 @@ MA_API ma_result ma_sound_init_ex(ma_engine* pEngine, const ma_sound_config* pCo return result; } - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } @@ -78658,7 +78658,7 @@ MA_API ma_result ma_sound_init_ex(ma_engine* pEngine, const ma_sound_config* pCo /* We need to load the sound differently depending on whether or not we're loading from a file. */ #ifndef MA_NO_RESOURCE_MANAGER - if (pConfig->pFilePath != nullptr || pConfig->pFilePathW != nullptr) { + if (pConfig->pFilePath != NULL || pConfig->pFilePathW != NULL) { return ma_sound_init_from_file_internal(pEngine, pConfig, pSound); } else #endif @@ -78675,7 +78675,7 @@ MA_API ma_result ma_sound_init_ex(ma_engine* pEngine, const ma_sound_config* pCo MA_API void ma_sound_uninit(ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -78685,9 +78685,9 @@ MA_API void ma_sound_uninit(ma_sound* pSound) */ ma_engine_node_uninit(&pSound->engineNode, &pSound->engineNode.pEngine->allocationCallbacks); - if (pSound->pProcessingCache != nullptr) { + if (pSound->pProcessingCache != NULL) { ma_free(pSound->pProcessingCache, &pSound->engineNode.pEngine->allocationCallbacks); - pSound->pProcessingCache = nullptr; + pSound->pProcessingCache = NULL; } /* Once the sound is detached from the group we can guarantee that it won't be referenced by the mixer thread which means it's safe for us to destroy the data source. */ @@ -78695,7 +78695,7 @@ MA_API void ma_sound_uninit(ma_sound* pSound) if (pSound->ownsDataSource) { ma_resource_manager_data_source_uninit(pSound->pResourceManagerDataSource); ma_free(pSound->pResourceManagerDataSource, &pSound->engineNode.pEngine->allocationCallbacks); - pSound->pDataSource = nullptr; + pSound->pDataSource = NULL; } #else MA_ASSERT(pSound->ownsDataSource == MA_FALSE); @@ -78704,8 +78704,8 @@ MA_API void ma_sound_uninit(ma_sound* pSound) MA_API ma_engine* ma_sound_get_engine(const ma_sound* pSound) { - if (pSound == nullptr) { - return nullptr; + if (pSound == NULL) { + return NULL; } return pSound->engineNode.pEngine; @@ -78713,8 +78713,8 @@ MA_API ma_engine* ma_sound_get_engine(const ma_sound* pSound) MA_API ma_data_source* ma_sound_get_data_source(const ma_sound* pSound) { - if (pSound == nullptr) { - return nullptr; + if (pSound == NULL) { + return NULL; } return pSound->pDataSource; @@ -78722,7 +78722,7 @@ MA_API ma_data_source* ma_sound_get_data_source(const ma_sound* pSound) MA_API ma_result ma_sound_start(ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } @@ -78750,7 +78750,7 @@ MA_API ma_result ma_sound_start(ma_sound* pSound) MA_API ma_result ma_sound_stop(ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } @@ -78762,7 +78762,7 @@ MA_API ma_result ma_sound_stop(ma_sound* pSound) MA_API ma_result ma_sound_stop_with_fade_in_pcm_frames(ma_sound* pSound, ma_uint64 fadeLengthInFrames) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } @@ -78776,7 +78776,7 @@ MA_API ma_result ma_sound_stop_with_fade_in_milliseconds(ma_sound* pSound, ma_ui { ma_uint64 sampleRate; - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } @@ -78808,7 +78808,7 @@ MA_API void ma_sound_reset_stop_time_and_fade(ma_sound* pSound) MA_API void ma_sound_set_volume(ma_sound* pSound, float volume) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -78819,7 +78819,7 @@ MA_API float ma_sound_get_volume(const ma_sound* pSound) { float volume = 0; - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -78830,7 +78830,7 @@ MA_API float ma_sound_get_volume(const ma_sound* pSound) MA_API void ma_sound_set_pan(ma_sound* pSound, float pan) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -78839,7 +78839,7 @@ MA_API void ma_sound_set_pan(ma_sound* pSound, float pan) MA_API float ma_sound_get_pan(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -78848,7 +78848,7 @@ MA_API float ma_sound_get_pan(const ma_sound* pSound) MA_API void ma_sound_set_pan_mode(ma_sound* pSound, ma_pan_mode panMode) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -78857,7 +78857,7 @@ MA_API void ma_sound_set_pan_mode(ma_sound* pSound, ma_pan_mode panMode) MA_API ma_pan_mode ma_sound_get_pan_mode(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return ma_pan_mode_balance; } @@ -78866,7 +78866,7 @@ MA_API ma_pan_mode ma_sound_get_pan_mode(const ma_sound* pSound) MA_API void ma_sound_set_pitch(ma_sound* pSound, float pitch) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -78879,7 +78879,7 @@ MA_API void ma_sound_set_pitch(ma_sound* pSound, float pitch) MA_API float ma_sound_get_pitch(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -78888,7 +78888,7 @@ MA_API float ma_sound_get_pitch(const ma_sound* pSound) MA_API void ma_sound_set_spatialization_enabled(ma_sound* pSound, ma_bool32 enabled) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -78897,7 +78897,7 @@ MA_API void ma_sound_set_spatialization_enabled(ma_sound* pSound, ma_bool32 enab MA_API ma_bool32 ma_sound_is_spatialization_enabled(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_FALSE; } @@ -78906,7 +78906,7 @@ MA_API ma_bool32 ma_sound_is_spatialization_enabled(const ma_sound* pSound) MA_API void ma_sound_set_pinned_listener_index(ma_sound* pSound, ma_uint32 listenerIndex) { - if (pSound == nullptr || listenerIndex >= ma_engine_get_listener_count(ma_sound_get_engine(pSound))) { + if (pSound == NULL || listenerIndex >= ma_engine_get_listener_count(ma_sound_get_engine(pSound))) { return; } @@ -78915,7 +78915,7 @@ MA_API void ma_sound_set_pinned_listener_index(ma_sound* pSound, ma_uint32 liste MA_API ma_uint32 ma_sound_get_pinned_listener_index(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_LISTENER_INDEX_CLOSEST; } @@ -78926,7 +78926,7 @@ MA_API ma_uint32 ma_sound_get_listener_index(const ma_sound* pSound) { ma_uint32 listenerIndex; - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -78944,23 +78944,23 @@ MA_API ma_vec3f ma_sound_get_direction_to_listener(const ma_sound* pSound) ma_vec3f relativePos; ma_engine* pEngine; - if (pSound == nullptr) { + if (pSound == NULL) { return ma_vec3f_init_3f(0, 0, -1); } pEngine = ma_sound_get_engine(pSound); - if (pEngine == nullptr) { + if (pEngine == NULL) { return ma_vec3f_init_3f(0, 0, -1); } - ma_spatializer_get_relative_position_and_direction(&pSound->engineNode.spatializer, &pEngine->listeners[ma_sound_get_listener_index(pSound)], &relativePos, nullptr); + ma_spatializer_get_relative_position_and_direction(&pSound->engineNode.spatializer, &pEngine->listeners[ma_sound_get_listener_index(pSound)], &relativePos, NULL); return ma_vec3f_normalize(ma_vec3f_neg(relativePos)); } MA_API void ma_sound_set_position(ma_sound* pSound, float x, float y, float z) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -78969,7 +78969,7 @@ MA_API void ma_sound_set_position(ma_sound* pSound, float x, float y, float z) MA_API ma_vec3f ma_sound_get_position(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return ma_vec3f_init_3f(0, 0, 0); } @@ -78978,7 +78978,7 @@ MA_API ma_vec3f ma_sound_get_position(const ma_sound* pSound) MA_API void ma_sound_set_direction(ma_sound* pSound, float x, float y, float z) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -78987,7 +78987,7 @@ MA_API void ma_sound_set_direction(ma_sound* pSound, float x, float y, float z) MA_API ma_vec3f ma_sound_get_direction(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return ma_vec3f_init_3f(0, 0, 0); } @@ -78996,7 +78996,7 @@ MA_API ma_vec3f ma_sound_get_direction(const ma_sound* pSound) MA_API void ma_sound_set_velocity(ma_sound* pSound, float x, float y, float z) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79005,7 +79005,7 @@ MA_API void ma_sound_set_velocity(ma_sound* pSound, float x, float y, float z) MA_API ma_vec3f ma_sound_get_velocity(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return ma_vec3f_init_3f(0, 0, 0); } @@ -79014,7 +79014,7 @@ MA_API ma_vec3f ma_sound_get_velocity(const ma_sound* pSound) MA_API void ma_sound_set_attenuation_model(ma_sound* pSound, ma_attenuation_model attenuationModel) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79023,7 +79023,7 @@ MA_API void ma_sound_set_attenuation_model(ma_sound* pSound, ma_attenuation_mode MA_API ma_attenuation_model ma_sound_get_attenuation_model(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return ma_attenuation_model_none; } @@ -79032,7 +79032,7 @@ MA_API ma_attenuation_model ma_sound_get_attenuation_model(const ma_sound* pSoun MA_API void ma_sound_set_positioning(ma_sound* pSound, ma_positioning positioning) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79041,7 +79041,7 @@ MA_API void ma_sound_set_positioning(ma_sound* pSound, ma_positioning positionin MA_API ma_positioning ma_sound_get_positioning(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return ma_positioning_absolute; } @@ -79050,7 +79050,7 @@ MA_API ma_positioning ma_sound_get_positioning(const ma_sound* pSound) MA_API void ma_sound_set_rolloff(ma_sound* pSound, float rolloff) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79059,7 +79059,7 @@ MA_API void ma_sound_set_rolloff(ma_sound* pSound, float rolloff) MA_API float ma_sound_get_rolloff(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -79068,7 +79068,7 @@ MA_API float ma_sound_get_rolloff(const ma_sound* pSound) MA_API void ma_sound_set_min_gain(ma_sound* pSound, float minGain) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79077,7 +79077,7 @@ MA_API void ma_sound_set_min_gain(ma_sound* pSound, float minGain) MA_API float ma_sound_get_min_gain(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -79086,7 +79086,7 @@ MA_API float ma_sound_get_min_gain(const ma_sound* pSound) MA_API void ma_sound_set_max_gain(ma_sound* pSound, float maxGain) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79095,7 +79095,7 @@ MA_API void ma_sound_set_max_gain(ma_sound* pSound, float maxGain) MA_API float ma_sound_get_max_gain(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -79104,7 +79104,7 @@ MA_API float ma_sound_get_max_gain(const ma_sound* pSound) MA_API void ma_sound_set_min_distance(ma_sound* pSound, float minDistance) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79113,7 +79113,7 @@ MA_API void ma_sound_set_min_distance(ma_sound* pSound, float minDistance) MA_API float ma_sound_get_min_distance(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -79122,7 +79122,7 @@ MA_API float ma_sound_get_min_distance(const ma_sound* pSound) MA_API void ma_sound_set_max_distance(ma_sound* pSound, float maxDistance) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79131,7 +79131,7 @@ MA_API void ma_sound_set_max_distance(ma_sound* pSound, float maxDistance) MA_API float ma_sound_get_max_distance(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -79140,7 +79140,7 @@ MA_API float ma_sound_get_max_distance(const ma_sound* pSound) MA_API void ma_sound_set_cone(ma_sound* pSound, float innerAngleInRadians, float outerAngleInRadians, float outerGain) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79149,19 +79149,19 @@ MA_API void ma_sound_set_cone(ma_sound* pSound, float innerAngleInRadians, float MA_API void ma_sound_get_cone(const ma_sound* pSound, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain) { - if (pInnerAngleInRadians != nullptr) { + if (pInnerAngleInRadians != NULL) { *pInnerAngleInRadians = 0; } - if (pOuterAngleInRadians != nullptr) { + if (pOuterAngleInRadians != NULL) { *pOuterAngleInRadians = 0; } - if (pOuterGain != nullptr) { + if (pOuterGain != NULL) { *pOuterGain = 0; } - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79170,7 +79170,7 @@ MA_API void ma_sound_get_cone(const ma_sound* pSound, float* pInnerAngleInRadian MA_API void ma_sound_set_doppler_factor(ma_sound* pSound, float dopplerFactor) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79179,7 +79179,7 @@ MA_API void ma_sound_set_doppler_factor(ma_sound* pSound, float dopplerFactor) MA_API float ma_sound_get_doppler_factor(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -79188,7 +79188,7 @@ MA_API float ma_sound_get_doppler_factor(const ma_sound* pSound) MA_API void ma_sound_set_directional_attenuation_factor(ma_sound* pSound, float directionalAttenuationFactor) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79197,7 +79197,7 @@ MA_API void ma_sound_set_directional_attenuation_factor(ma_sound* pSound, float MA_API float ma_sound_get_directional_attenuation_factor(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return 1; } @@ -79207,7 +79207,7 @@ MA_API float ma_sound_get_directional_attenuation_factor(const ma_sound* pSound) MA_API void ma_sound_set_fade_in_pcm_frames(ma_sound* pSound, float volumeBeg, float volumeEnd, ma_uint64 fadeLengthInFrames) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79216,7 +79216,7 @@ MA_API void ma_sound_set_fade_in_pcm_frames(ma_sound* pSound, float volumeBeg, f MA_API void ma_sound_set_fade_in_milliseconds(ma_sound* pSound, float volumeBeg, float volumeEnd, ma_uint64 fadeLengthInMilliseconds) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79225,7 +79225,7 @@ MA_API void ma_sound_set_fade_in_milliseconds(ma_sound* pSound, float volumeBeg, MA_API void ma_sound_set_fade_start_in_pcm_frames(ma_sound* pSound, float volumeBeg, float volumeEnd, ma_uint64 fadeLengthInFrames, ma_uint64 absoluteGlobalTimeInFrames) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79244,7 +79244,7 @@ MA_API void ma_sound_set_fade_start_in_milliseconds(ma_sound* pSound, float volu { ma_uint32 sampleRate; - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79255,7 +79255,7 @@ MA_API void ma_sound_set_fade_start_in_milliseconds(ma_sound* pSound, float volu MA_API float ma_sound_get_current_fade_volume(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } @@ -79264,7 +79264,7 @@ MA_API float ma_sound_get_current_fade_volume(const ma_sound* pSound) MA_API void ma_sound_set_start_time_in_pcm_frames(ma_sound* pSound, ma_uint64 absoluteGlobalTimeInFrames) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79273,7 +79273,7 @@ MA_API void ma_sound_set_start_time_in_pcm_frames(ma_sound* pSound, ma_uint64 ab MA_API void ma_sound_set_start_time_in_milliseconds(ma_sound* pSound, ma_uint64 absoluteGlobalTimeInMilliseconds) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79282,7 +79282,7 @@ MA_API void ma_sound_set_start_time_in_milliseconds(ma_sound* pSound, ma_uint64 MA_API void ma_sound_set_stop_time_in_pcm_frames(ma_sound* pSound, ma_uint64 absoluteGlobalTimeInFrames) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79291,7 +79291,7 @@ MA_API void ma_sound_set_stop_time_in_pcm_frames(ma_sound* pSound, ma_uint64 abs MA_API void ma_sound_set_stop_time_in_milliseconds(ma_sound* pSound, ma_uint64 absoluteGlobalTimeInMilliseconds) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79300,7 +79300,7 @@ MA_API void ma_sound_set_stop_time_in_milliseconds(ma_sound* pSound, ma_uint64 a MA_API void ma_sound_set_stop_time_with_fade_in_pcm_frames(ma_sound* pSound, ma_uint64 stopAbsoluteGlobalTimeInFrames, ma_uint64 fadeLengthInFrames) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79319,7 +79319,7 @@ MA_API void ma_sound_set_stop_time_with_fade_in_milliseconds(ma_sound* pSound, m { ma_uint32 sampleRate; - if (pSound == nullptr) { + if (pSound == NULL) { return; } @@ -79330,7 +79330,7 @@ MA_API void ma_sound_set_stop_time_with_fade_in_milliseconds(ma_sound* pSound, m MA_API ma_bool32 ma_sound_is_playing(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_FALSE; } @@ -79339,7 +79339,7 @@ MA_API ma_bool32 ma_sound_is_playing(const ma_sound* pSound) MA_API ma_uint64 ma_sound_get_time_in_pcm_frames(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return 0; } @@ -79358,12 +79358,12 @@ MA_API ma_uint64 ma_sound_get_time_in_milliseconds(const ma_sound* pSound) MA_API void ma_sound_set_looping(ma_sound* pSound, ma_bool32 isLooping) { - if (pSound == nullptr) { + if (pSound == NULL) { return; } /* Looping is only a valid concept if the sound is backed by a data source. */ - if (pSound->pDataSource == nullptr) { + if (pSound->pDataSource == NULL) { return; } @@ -79373,12 +79373,12 @@ MA_API void ma_sound_set_looping(ma_sound* pSound, ma_bool32 isLooping) MA_API ma_bool32 ma_sound_is_looping(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_FALSE; } /* There is no notion of looping for sounds that are not backed by a data source. */ - if (pSound->pDataSource == nullptr) { + if (pSound->pDataSource == NULL) { return MA_FALSE; } @@ -79387,12 +79387,12 @@ MA_API ma_bool32 ma_sound_is_looping(const ma_sound* pSound) MA_API ma_bool32 ma_sound_at_end(const ma_sound* pSound) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_FALSE; } /* There is no notion of an end of a sound if it's not backed by a data source. */ - if (pSound->pDataSource == nullptr) { + if (pSound->pDataSource == NULL) { return MA_FALSE; } @@ -79401,12 +79401,12 @@ MA_API ma_bool32 ma_sound_at_end(const ma_sound* pSound) MA_API ma_result ma_sound_seek_to_pcm_frame(ma_sound* pSound, ma_uint64 frameIndex) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } /* Seeking is only valid for sounds that are backed by a data source. */ - if (pSound->pDataSource == nullptr) { + if (pSound->pDataSource == NULL) { return MA_INVALID_OPERATION; } @@ -79422,11 +79422,11 @@ MA_API ma_result ma_sound_seek_to_second(ma_sound* pSound, float seekPointInSeco ma_uint32 sampleRate; ma_result result; - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } - result = ma_sound_get_data_format(pSound, nullptr, nullptr, &sampleRate, nullptr, 0); + result = ma_sound_get_data_format(pSound, NULL, NULL, &sampleRate, NULL, 0); if (result != MA_SUCCESS) { return result; } @@ -79439,28 +79439,28 @@ MA_API ma_result ma_sound_seek_to_second(ma_sound* pSound, float seekPointInSeco MA_API ma_result ma_sound_get_data_format(const ma_sound* pSound, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } /* The data format is retrieved directly from the data source if the sound is backed by one. Otherwise we pull it from the node. */ - if (pSound->pDataSource == nullptr) { + if (pSound->pDataSource == NULL) { ma_uint32 channels; - if (pFormat != nullptr) { + if (pFormat != NULL) { *pFormat = ma_format_f32; } channels = ma_node_get_input_channels(&pSound->engineNode, 0); - if (pChannels != nullptr) { + if (pChannels != NULL) { *pChannels = channels; } - if (pSampleRate != nullptr) { + if (pSampleRate != NULL) { *pSampleRate = pSound->engineNode.resampler.sampleRateIn; } - if (pChannelMap != nullptr) { + if (pChannelMap != NULL) { ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, channels); } @@ -79474,12 +79474,12 @@ MA_API ma_result ma_sound_get_cursor_in_pcm_frames(const ma_sound* pSound, ma_ui { ma_uint64 seekTarget; - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } /* The notion of a cursor is only valid for sounds that are backed by a data source. */ - if (pSound->pDataSource == nullptr) { + if (pSound->pDataSource == NULL) { return MA_INVALID_OPERATION; } @@ -79494,12 +79494,12 @@ MA_API ma_result ma_sound_get_cursor_in_pcm_frames(const ma_sound* pSound, ma_ui MA_API ma_result ma_sound_get_length_in_pcm_frames(const ma_sound* pSound, ma_uint64* pLength) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } /* The notion of a sound length is only valid for sounds that are backed by a data source. */ - if (pSound->pDataSource == nullptr) { + if (pSound->pDataSource == NULL) { return MA_INVALID_OPERATION; } @@ -79512,7 +79512,7 @@ MA_API ma_result ma_sound_get_cursor_in_seconds(const ma_sound* pSound, float* p ma_uint64 cursorInPCMFrames; ma_uint32 sampleRate; - if (pCursor != nullptr) { + if (pCursor != NULL) { *pCursor = 0; } @@ -79521,7 +79521,7 @@ MA_API ma_result ma_sound_get_cursor_in_seconds(const ma_sound* pSound, float* p return result; } - result = ma_sound_get_data_format(pSound, nullptr, nullptr, &sampleRate, nullptr, 0); + result = ma_sound_get_data_format(pSound, NULL, NULL, &sampleRate, NULL, 0); if (result != MA_SUCCESS) { return result; } @@ -79534,12 +79534,12 @@ MA_API ma_result ma_sound_get_cursor_in_seconds(const ma_sound* pSound, float* p MA_API ma_result ma_sound_get_length_in_seconds(const ma_sound* pSound, float* pLength) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } /* The notion of a sound length is only valid for sounds that are backed by a data source. */ - if (pSound->pDataSource == nullptr) { + if (pSound->pDataSource == NULL) { return MA_INVALID_OPERATION; } @@ -79548,12 +79548,12 @@ MA_API ma_result ma_sound_get_length_in_seconds(const ma_sound* pSound, float* p MA_API ma_result ma_sound_set_end_callback(ma_sound* pSound, ma_sound_end_proc callback, void* pUserData) { - if (pSound == nullptr) { + if (pSound == NULL) { return MA_INVALID_ARGS; } /* The notion of an end is only valid for sounds that are backed by a data source. */ - if (pSound->pDataSource == nullptr) { + if (pSound->pDataSource == NULL) { return MA_INVALID_OPERATION; } @@ -79576,21 +79576,21 @@ MA_API ma_result ma_sound_group_init_ex(ma_engine* pEngine, const ma_sound_group { ma_sound_config soundConfig; - if (pGroup == nullptr) { + if (pGroup == NULL) { return MA_INVALID_ARGS; } MA_ZERO_OBJECT(pGroup); - if (pConfig == nullptr) { + if (pConfig == NULL) { return MA_INVALID_ARGS; } /* A sound group is just a sound without a data source. */ soundConfig = *pConfig; - soundConfig.pFilePath = nullptr; - soundConfig.pFilePathW = nullptr; - soundConfig.pDataSource = nullptr; + soundConfig.pFilePath = NULL; + soundConfig.pFilePathW = NULL; + soundConfig.pDataSource = NULL; /* Groups need to have spatialization disabled by default because I think it'll be pretty rare @@ -80245,55 +80245,55 @@ MA_PRIVATE void ma_dr_wav__free_default(void* p, void* pUserData) } MA_PRIVATE void* ma_dr_wav__malloc_from_callbacks(size_t sz, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks == nullptr) { - return nullptr; + if (pAllocationCallbacks == NULL) { + return NULL; } - if (pAllocationCallbacks->onMalloc != nullptr) { + if (pAllocationCallbacks->onMalloc != NULL) { return pAllocationCallbacks->onMalloc(sz, pAllocationCallbacks->pUserData); } - if (pAllocationCallbacks->onRealloc != nullptr) { - return pAllocationCallbacks->onRealloc(nullptr, sz, pAllocationCallbacks->pUserData); + if (pAllocationCallbacks->onRealloc != NULL) { + return pAllocationCallbacks->onRealloc(NULL, sz, pAllocationCallbacks->pUserData); } - return nullptr; + return NULL; } MA_PRIVATE void* ma_dr_wav__realloc_from_callbacks(void* p, size_t szNew, size_t szOld, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks == nullptr) { - return nullptr; + if (pAllocationCallbacks == NULL) { + return NULL; } - if (pAllocationCallbacks->onRealloc != nullptr) { + if (pAllocationCallbacks->onRealloc != NULL) { return pAllocationCallbacks->onRealloc(p, szNew, pAllocationCallbacks->pUserData); } - if (pAllocationCallbacks->onMalloc != nullptr && pAllocationCallbacks->onFree != nullptr) { + if (pAllocationCallbacks->onMalloc != NULL && pAllocationCallbacks->onFree != NULL) { void* p2; p2 = pAllocationCallbacks->onMalloc(szNew, pAllocationCallbacks->pUserData); - if (p2 == nullptr) { - return nullptr; + if (p2 == NULL) { + return NULL; } - if (p != nullptr) { + if (p != NULL) { MA_DR_WAV_COPY_MEMORY(p2, p, szOld); pAllocationCallbacks->onFree(p, pAllocationCallbacks->pUserData); } return p2; } - return nullptr; + return NULL; } MA_PRIVATE void ma_dr_wav__free_from_callbacks(void* p, const ma_allocation_callbacks* pAllocationCallbacks) { - if (p == nullptr || pAllocationCallbacks == nullptr) { + if (p == NULL || pAllocationCallbacks == NULL) { return; } - if (pAllocationCallbacks->onFree != nullptr) { + if (pAllocationCallbacks->onFree != NULL) { pAllocationCallbacks->onFree(p, pAllocationCallbacks->pUserData); } } MA_PRIVATE ma_allocation_callbacks ma_dr_wav_copy_allocation_callbacks_or_defaults(const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks != nullptr) { + if (pAllocationCallbacks != NULL) { return *pAllocationCallbacks; } else { ma_allocation_callbacks allocationCallbacks; - allocationCallbacks.pUserData = nullptr; + allocationCallbacks.pUserData = NULL; allocationCallbacks.onMalloc = ma_dr_wav__malloc_default; allocationCallbacks.onRealloc = ma_dr_wav__realloc_default; allocationCallbacks.onFree = ma_dr_wav__free_default; @@ -80386,8 +80386,8 @@ MA_PRIVATE ma_bool32 ma_dr_wav__seek_from_start(ma_dr_wav_seek_proc onSeek, ma_u MA_PRIVATE size_t ma_dr_wav__on_read(ma_dr_wav_read_proc onRead, void* pUserData, void* pBufferOut, size_t bytesToRead, ma_uint64* pCursor) { size_t bytesRead; - MA_DR_WAV_ASSERT(onRead != nullptr); - MA_DR_WAV_ASSERT(pCursor != nullptr); + MA_DR_WAV_ASSERT(onRead != NULL); + MA_DR_WAV_ASSERT(pCursor != NULL); bytesRead = onRead(pUserData, pBufferOut, bytesToRead); *pCursor += bytesRead; return bytesRead; @@ -80395,8 +80395,8 @@ MA_PRIVATE size_t ma_dr_wav__on_read(ma_dr_wav_read_proc onRead, void* pUserData #if 0 MA_PRIVATE ma_bool32 ma_dr_wav__on_seek(ma_dr_wav_seek_proc onSeek, void* pUserData, int offset, ma_dr_wav_seek_origin origin, ma_uint64* pCursor) { - MA_DR_WAV_ASSERT(onSeek != nullptr); - MA_DR_WAV_ASSERT(pCursor != nullptr); + MA_DR_WAV_ASSERT(onSeek != NULL); + MA_DR_WAV_ASSERT(pCursor != NULL); if (!onSeek(pUserData, offset, origin)) { return MA_FALSE; } @@ -80474,7 +80474,7 @@ MA_PRIVATE ma_result ma_dr_wav__metadata_alloc(ma_dr_wav__metadata_parser* pPars pAllocationCallbacks->onFree(pParser->pData, pAllocationCallbacks->pUserData); pParser->pData = (ma_uint8*)pAllocationCallbacks->onMalloc(ma_dr_wav__metadata_memory_capacity(pParser), pAllocationCallbacks->pUserData); pParser->pDataCursor = pParser->pData; - if (pParser->pData == nullptr) { + if (pParser->pData == NULL) { return MA_OUT_OF_MEMORY; } pParser->pMetadata = (ma_dr_wav_metadata*)ma_dr_wav__metadata_get_memory(pParser, sizeof(ma_dr_wav_metadata) * pParser->metadataCount, 1); @@ -80484,7 +80484,7 @@ MA_PRIVATE ma_result ma_dr_wav__metadata_alloc(ma_dr_wav__metadata_parser* pPars } MA_PRIVATE size_t ma_dr_wav__metadata_parser_read(ma_dr_wav__metadata_parser* pParser, void* pBufferOut, size_t bytesToRead, ma_uint64* pCursor) { - if (pCursor != nullptr) { + if (pCursor != NULL) { return ma_dr_wav__on_read(pParser->onRead, pParser->pReadSeekUserData, pBufferOut, bytesToRead, pCursor); } else { return pParser->onRead(pParser->pReadSeekUserData, pBufferOut, bytesToRead); @@ -80495,13 +80495,13 @@ MA_PRIVATE ma_uint64 ma_dr_wav__read_smpl_to_metadata_obj(ma_dr_wav__metadata_pa ma_uint8 smplHeaderData[MA_DR_WAV_SMPL_BYTES]; ma_uint64 totalBytesRead = 0; size_t bytesJustRead; - if (pMetadata == nullptr) { + if (pMetadata == NULL) { return 0; } bytesJustRead = ma_dr_wav__metadata_parser_read(pParser, smplHeaderData, sizeof(smplHeaderData), &totalBytesRead); MA_DR_WAV_ASSERT(pParser->stage == ma_dr_wav__metadata_parser_stage_read); - MA_DR_WAV_ASSERT(pChunkHeader != nullptr); - if (pMetadata != nullptr && bytesJustRead == sizeof(smplHeaderData)) { + MA_DR_WAV_ASSERT(pChunkHeader != NULL); + if (pMetadata != NULL && bytesJustRead == sizeof(smplHeaderData)) { ma_uint32 iSampleLoop; pMetadata->type = ma_dr_wav_metadata_type_smpl; pMetadata->data.smpl.manufacturerId = ma_dr_wav_bytes_to_u32(smplHeaderData + 0); @@ -80531,7 +80531,7 @@ MA_PRIVATE ma_uint64 ma_dr_wav__read_smpl_to_metadata_obj(ma_dr_wav__metadata_pa } if (pMetadata->data.smpl.samplerSpecificDataSizeInBytes > 0) { pMetadata->data.smpl.pSamplerSpecificData = ma_dr_wav__metadata_get_memory(pParser, pMetadata->data.smpl.samplerSpecificDataSizeInBytes, 1); - MA_DR_WAV_ASSERT(pMetadata->data.smpl.pSamplerSpecificData != nullptr); + MA_DR_WAV_ASSERT(pMetadata->data.smpl.pSamplerSpecificData != NULL); ma_dr_wav__metadata_parser_read(pParser, pMetadata->data.smpl.pSamplerSpecificData, pMetadata->data.smpl.samplerSpecificDataSizeInBytes, &totalBytesRead); } } @@ -80543,7 +80543,7 @@ MA_PRIVATE ma_uint64 ma_dr_wav__read_cue_to_metadata_obj(ma_dr_wav__metadata_par ma_uint8 cueHeaderSectionData[MA_DR_WAV_CUE_BYTES]; ma_uint64 totalBytesRead = 0; size_t bytesJustRead; - if (pMetadata == nullptr) { + if (pMetadata == NULL) { return 0; } bytesJustRead = ma_dr_wav__metadata_parser_read(pParser, cueHeaderSectionData, sizeof(cueHeaderSectionData), &totalBytesRead); @@ -80553,7 +80553,7 @@ MA_PRIVATE ma_uint64 ma_dr_wav__read_cue_to_metadata_obj(ma_dr_wav__metadata_par pMetadata->data.cue.cuePointCount = ma_dr_wav_bytes_to_u32(cueHeaderSectionData); if (pMetadata->data.cue.cuePointCount == (pChunkHeader->sizeInBytes - MA_DR_WAV_CUE_BYTES) / MA_DR_WAV_CUE_POINT_BYTES) { pMetadata->data.cue.pCuePoints = (ma_dr_wav_cue_point*)ma_dr_wav__metadata_get_memory(pParser, sizeof(ma_dr_wav_cue_point) * pMetadata->data.cue.cuePointCount, MA_DR_WAV_METADATA_ALIGNMENT); - MA_DR_WAV_ASSERT(pMetadata->data.cue.pCuePoints != nullptr); + MA_DR_WAV_ASSERT(pMetadata->data.cue.pCuePoints != NULL); if (pMetadata->data.cue.cuePointCount > 0) { ma_uint32 iCuePoint; for (iCuePoint = 0; iCuePoint < pMetadata->data.cue.cuePointCount; ++iCuePoint) { @@ -80582,10 +80582,10 @@ MA_PRIVATE ma_uint64 ma_dr_wav__read_inst_to_metadata_obj(ma_dr_wav__metadata_pa { ma_uint8 instData[MA_DR_WAV_INST_BYTES]; ma_uint64 bytesRead; - if (pMetadata == nullptr) { + if (pMetadata == NULL) { return 0; } - bytesRead = ma_dr_wav__metadata_parser_read(pParser, instData, sizeof(instData), nullptr); + bytesRead = ma_dr_wav__metadata_parser_read(pParser, instData, sizeof(instData), NULL); MA_DR_WAV_ASSERT(pParser->stage == ma_dr_wav__metadata_parser_stage_read); if (bytesRead == sizeof(instData)) { pMetadata->type = ma_dr_wav_metadata_type_inst; @@ -80603,10 +80603,10 @@ MA_PRIVATE ma_uint64 ma_dr_wav__read_acid_to_metadata_obj(ma_dr_wav__metadata_pa { ma_uint8 acidData[MA_DR_WAV_ACID_BYTES]; ma_uint64 bytesRead; - if (pMetadata == nullptr) { + if (pMetadata == NULL) { return 0; } - bytesRead = ma_dr_wav__metadata_parser_read(pParser, acidData, sizeof(acidData), nullptr); + bytesRead = ma_dr_wav__metadata_parser_read(pParser, acidData, sizeof(acidData), NULL); MA_DR_WAV_ASSERT(pParser->stage == ma_dr_wav__metadata_parser_stage_read); if (bytesRead == sizeof(acidData)) { pMetadata->type = ma_dr_wav_metadata_type_acid; @@ -80642,12 +80642,12 @@ MA_PRIVATE char* ma_dr_wav__metadata_copy_string(ma_dr_wav__metadata_parser* pPa size_t len = ma_dr_wav__strlen_clamped(str, maxToRead); if (len) { char* result = (char*)ma_dr_wav__metadata_get_memory(pParser, len + 1, 1); - MA_DR_WAV_ASSERT(result != nullptr); + MA_DR_WAV_ASSERT(result != NULL); MA_DR_WAV_COPY_MEMORY(result, str, len); result[len] = '\0'; return result; } else { - return nullptr; + return NULL; } } typedef struct @@ -80658,8 +80658,8 @@ typedef struct } ma_dr_wav_buffer_reader; MA_PRIVATE ma_result ma_dr_wav_buffer_reader_init(const void* pBuffer, size_t sizeInBytes, ma_dr_wav_buffer_reader* pReader) { - MA_DR_WAV_ASSERT(pBuffer != nullptr); - MA_DR_WAV_ASSERT(pReader != nullptr); + MA_DR_WAV_ASSERT(pBuffer != NULL); + MA_DR_WAV_ASSERT(pReader != NULL); MA_DR_WAV_ZERO_OBJECT(pReader); pReader->pBuffer = pBuffer; pReader->sizeInBytes = sizeInBytes; @@ -80668,12 +80668,12 @@ MA_PRIVATE ma_result ma_dr_wav_buffer_reader_init(const void* pBuffer, size_t si } MA_PRIVATE const void* ma_dr_wav_buffer_reader_ptr(const ma_dr_wav_buffer_reader* pReader) { - MA_DR_WAV_ASSERT(pReader != nullptr); + MA_DR_WAV_ASSERT(pReader != NULL); return ma_dr_wav_offset_ptr(pReader->pBuffer, pReader->cursor); } MA_PRIVATE ma_result ma_dr_wav_buffer_reader_seek(ma_dr_wav_buffer_reader* pReader, size_t bytesToSeek) { - MA_DR_WAV_ASSERT(pReader != nullptr); + MA_DR_WAV_ASSERT(pReader != NULL); if (pReader->cursor + bytesToSeek > pReader->sizeInBytes) { return MA_BAD_SEEK; } @@ -80684,15 +80684,15 @@ MA_PRIVATE ma_result ma_dr_wav_buffer_reader_read(ma_dr_wav_buffer_reader* pRead { ma_result result = MA_SUCCESS; size_t bytesRemaining; - MA_DR_WAV_ASSERT(pReader != nullptr); - if (pBytesRead != nullptr) { + MA_DR_WAV_ASSERT(pReader != NULL); + if (pBytesRead != NULL) { *pBytesRead = 0; } bytesRemaining = (pReader->sizeInBytes - pReader->cursor); if (bytesToRead > bytesRemaining) { bytesToRead = bytesRemaining; } - if (pDst == nullptr) { + if (pDst == NULL) { result = ma_dr_wav_buffer_reader_seek(pReader, bytesToRead); } else { MA_DR_WAV_COPY_MEMORY(pDst, ma_dr_wav_buffer_reader_ptr(pReader), bytesToRead); @@ -80700,7 +80700,7 @@ MA_PRIVATE ma_result ma_dr_wav_buffer_reader_read(ma_dr_wav_buffer_reader* pRead } MA_DR_WAV_ASSERT(pReader->cursor <= pReader->sizeInBytes); if (result == MA_SUCCESS) { - if (pBytesRead != nullptr) { + if (pBytesRead != NULL) { *pBytesRead = bytesToRead; } } @@ -80711,8 +80711,8 @@ MA_PRIVATE ma_result ma_dr_wav_buffer_reader_read_u16(ma_dr_wav_buffer_reader* p ma_result result; size_t bytesRead; ma_uint8 data[2]; - MA_DR_WAV_ASSERT(pReader != nullptr); - MA_DR_WAV_ASSERT(pDst != nullptr); + MA_DR_WAV_ASSERT(pReader != NULL); + MA_DR_WAV_ASSERT(pDst != NULL); *pDst = 0; result = ma_dr_wav_buffer_reader_read(pReader, data, sizeof(*pDst), &bytesRead); if (result != MA_SUCCESS || bytesRead != sizeof(*pDst)) { @@ -80726,8 +80726,8 @@ MA_PRIVATE ma_result ma_dr_wav_buffer_reader_read_u32(ma_dr_wav_buffer_reader* p ma_result result; size_t bytesRead; ma_uint8 data[4]; - MA_DR_WAV_ASSERT(pReader != nullptr); - MA_DR_WAV_ASSERT(pDst != nullptr); + MA_DR_WAV_ASSERT(pReader != NULL); + MA_DR_WAV_ASSERT(pDst != NULL); *pDst = 0; result = ma_dr_wav_buffer_reader_read(pReader, data, sizeof(*pDst), &bytesRead); if (result != MA_SUCCESS || bytesRead != sizeof(*pDst)) { @@ -80739,7 +80739,7 @@ MA_PRIVATE ma_result ma_dr_wav_buffer_reader_read_u32(ma_dr_wav_buffer_reader* p MA_PRIVATE ma_uint64 ma_dr_wav__read_bext_to_metadata_obj(ma_dr_wav__metadata_parser* pParser, ma_dr_wav_metadata* pMetadata, ma_uint64 chunkSize) { ma_uint8 bextData[MA_DR_WAV_BEXT_BYTES]; - size_t bytesRead = ma_dr_wav__metadata_parser_read(pParser, bextData, sizeof(bextData), nullptr); + size_t bytesRead = ma_dr_wav__metadata_parser_read(pParser, bextData, sizeof(bextData), NULL); MA_DR_WAV_ASSERT(pParser->stage == ma_dr_wav__metadata_parser_stage_read); if (bytesRead == sizeof(bextData)) { ma_dr_wav_buffer_reader reader; @@ -80754,14 +80754,14 @@ MA_PRIVATE ma_uint64 ma_dr_wav__read_bext_to_metadata_obj(ma_dr_wav__metadata_pa ma_dr_wav_buffer_reader_seek(&reader, MA_DR_WAV_BEXT_ORIGINATOR_NAME_BYTES); pMetadata->data.bext.pOriginatorReference = ma_dr_wav__metadata_copy_string(pParser, (const char*)ma_dr_wav_buffer_reader_ptr(&reader), MA_DR_WAV_BEXT_ORIGINATOR_REF_BYTES); ma_dr_wav_buffer_reader_seek(&reader, MA_DR_WAV_BEXT_ORIGINATOR_REF_BYTES); - ma_dr_wav_buffer_reader_read(&reader, pMetadata->data.bext.pOriginationDate, sizeof(pMetadata->data.bext.pOriginationDate), nullptr); - ma_dr_wav_buffer_reader_read(&reader, pMetadata->data.bext.pOriginationTime, sizeof(pMetadata->data.bext.pOriginationTime), nullptr); + ma_dr_wav_buffer_reader_read(&reader, pMetadata->data.bext.pOriginationDate, sizeof(pMetadata->data.bext.pOriginationDate), NULL); + ma_dr_wav_buffer_reader_read(&reader, pMetadata->data.bext.pOriginationTime, sizeof(pMetadata->data.bext.pOriginationTime), NULL); ma_dr_wav_buffer_reader_read_u32(&reader, &timeReferenceLow); ma_dr_wav_buffer_reader_read_u32(&reader, &timeReferenceHigh); pMetadata->data.bext.timeReference = ((ma_uint64)timeReferenceHigh << 32) + timeReferenceLow; ma_dr_wav_buffer_reader_read_u16(&reader, &pMetadata->data.bext.version); pMetadata->data.bext.pUMID = ma_dr_wav__metadata_get_memory(pParser, MA_DR_WAV_BEXT_UMID_BYTES, 1); - ma_dr_wav_buffer_reader_read(&reader, pMetadata->data.bext.pUMID, MA_DR_WAV_BEXT_UMID_BYTES, nullptr); + ma_dr_wav_buffer_reader_read(&reader, pMetadata->data.bext.pUMID, MA_DR_WAV_BEXT_UMID_BYTES, NULL); ma_dr_wav_buffer_reader_read_u16(&reader, &pMetadata->data.bext.loudnessValue); ma_dr_wav_buffer_reader_read_u16(&reader, &pMetadata->data.bext.loudnessRange); ma_dr_wav_buffer_reader_read_u16(&reader, &pMetadata->data.bext.maxTruePeakLevel); @@ -80771,11 +80771,11 @@ MA_PRIVATE ma_uint64 ma_dr_wav__read_bext_to_metadata_obj(ma_dr_wav__metadata_pa extraBytes = (size_t)(chunkSize - MA_DR_WAV_BEXT_BYTES); if (extraBytes > 0) { pMetadata->data.bext.pCodingHistory = (char*)ma_dr_wav__metadata_get_memory(pParser, extraBytes + 1, 1); - MA_DR_WAV_ASSERT(pMetadata->data.bext.pCodingHistory != nullptr); - bytesRead += ma_dr_wav__metadata_parser_read(pParser, pMetadata->data.bext.pCodingHistory, extraBytes, nullptr); + MA_DR_WAV_ASSERT(pMetadata->data.bext.pCodingHistory != NULL); + bytesRead += ma_dr_wav__metadata_parser_read(pParser, pMetadata->data.bext.pCodingHistory, extraBytes, NULL); pMetadata->data.bext.codingHistorySize = (ma_uint32)ma_dr_wav__strlen(pMetadata->data.bext.pCodingHistory); } else { - pMetadata->data.bext.pCodingHistory = nullptr; + pMetadata->data.bext.pCodingHistory = NULL; pMetadata->data.bext.codingHistorySize = 0; } } @@ -80796,11 +80796,11 @@ MA_PRIVATE ma_uint64 ma_dr_wav__read_list_label_or_note_to_metadata_obj(ma_dr_wa if (sizeIncludingNullTerminator > 0) { pMetadata->data.labelOrNote.stringLength = sizeIncludingNullTerminator - 1; pMetadata->data.labelOrNote.pString = (char*)ma_dr_wav__metadata_get_memory(pParser, sizeIncludingNullTerminator, 1); - MA_DR_WAV_ASSERT(pMetadata->data.labelOrNote.pString != nullptr); + MA_DR_WAV_ASSERT(pMetadata->data.labelOrNote.pString != NULL); ma_dr_wav__metadata_parser_read(pParser, pMetadata->data.labelOrNote.pString, sizeIncludingNullTerminator, &totalBytesRead); } else { pMetadata->data.labelOrNote.stringLength = 0; - pMetadata->data.labelOrNote.pString = nullptr; + pMetadata->data.labelOrNote.pString = NULL; } } return totalBytesRead; @@ -80828,11 +80828,11 @@ MA_PRIVATE ma_uint64 ma_dr_wav__read_list_labelled_cue_region_to_metadata_obj(ma if (sizeIncludingNullTerminator > 0) { pMetadata->data.labelledCueRegion.stringLength = sizeIncludingNullTerminator - 1; pMetadata->data.labelledCueRegion.pString = (char*)ma_dr_wav__metadata_get_memory(pParser, sizeIncludingNullTerminator, 1); - MA_DR_WAV_ASSERT(pMetadata->data.labelledCueRegion.pString != nullptr); + MA_DR_WAV_ASSERT(pMetadata->data.labelledCueRegion.pString != NULL); ma_dr_wav__metadata_parser_read(pParser, pMetadata->data.labelledCueRegion.pString, sizeIncludingNullTerminator, &totalBytesRead); } else { pMetadata->data.labelledCueRegion.stringLength = 0; - pMetadata->data.labelledCueRegion.pString = nullptr; + pMetadata->data.labelledCueRegion.pString = NULL; } } return totalBytesRead; @@ -80850,15 +80850,15 @@ MA_PRIVATE ma_uint64 ma_dr_wav__metadata_process_info_text_chunk(ma_dr_wav__meta if (stringSizeWithNullTerminator > 0) { pMetadata->data.infoText.stringLength = stringSizeWithNullTerminator - 1; pMetadata->data.infoText.pString = (char*)ma_dr_wav__metadata_get_memory(pParser, stringSizeWithNullTerminator, 1); - MA_DR_WAV_ASSERT(pMetadata->data.infoText.pString != nullptr); - bytesRead = ma_dr_wav__metadata_parser_read(pParser, pMetadata->data.infoText.pString, (size_t)stringSizeWithNullTerminator, nullptr); + MA_DR_WAV_ASSERT(pMetadata->data.infoText.pString != NULL); + bytesRead = ma_dr_wav__metadata_parser_read(pParser, pMetadata->data.infoText.pString, (size_t)stringSizeWithNullTerminator, NULL); if (bytesRead == chunkSize) { pParser->metadataCursor += 1; } else { } } else { pMetadata->data.infoText.stringLength = 0; - pMetadata->data.infoText.pString = nullptr; + pMetadata->data.infoText.pString = NULL; pParser->metadataCursor += 1; } } @@ -80886,8 +80886,8 @@ MA_PRIVATE ma_uint64 ma_dr_wav__metadata_process_unknown_chunk(ma_dr_wav__metada pMetadata->data.unknown.id[3] = pChunkId[3]; pMetadata->data.unknown.dataSizeInBytes = (ma_uint32)chunkSize; pMetadata->data.unknown.pData = (ma_uint8 *)ma_dr_wav__metadata_get_memory(pParser, (size_t)chunkSize, 1); - MA_DR_WAV_ASSERT(pMetadata->data.unknown.pData != nullptr); - bytesRead = ma_dr_wav__metadata_parser_read(pParser, pMetadata->data.unknown.pData, pMetadata->data.unknown.dataSizeInBytes, nullptr); + MA_DR_WAV_ASSERT(pMetadata->data.unknown.pData != NULL); + bytesRead = ma_dr_wav__metadata_parser_read(pParser, pMetadata->data.unknown.pData, pMetadata->data.unknown.dataSizeInBytes, NULL); if (bytesRead == pMetadata->data.unknown.dataSizeInBytes) { pParser->metadataCursor += 1; } else { @@ -81137,7 +81137,7 @@ MA_PRIVATE ma_uint32 ma_dr_wav_get_bytes_per_pcm_frame(ma_dr_wav* pWav) } MA_API ma_uint16 ma_dr_wav_fmt_get_format(const ma_dr_wav_fmt* pFMT) { - if (pFMT == nullptr) { + if (pFMT == NULL) { return 0; } if (pFMT->formatTag != MA_DR_WAVE_FORMAT_EXTENSIBLE) { @@ -81148,7 +81148,7 @@ MA_API ma_uint16 ma_dr_wav_fmt_get_format(const ma_dr_wav_fmt* pFMT) } MA_PRIVATE ma_bool32 ma_dr_wav_preinit(ma_dr_wav* pWav, ma_dr_wav_read_proc onRead, ma_dr_wav_seek_proc onSeek, ma_dr_wav_tell_proc onTell, void* pReadSeekTellUserData, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pWav == nullptr || onRead == nullptr || onSeek == nullptr) { + if (pWav == NULL || onRead == NULL || onSeek == NULL) { return MA_FALSE; } MA_DR_WAV_ZERO_MEMORY(pWav, sizeof(*pWav)); @@ -81157,7 +81157,7 @@ MA_PRIVATE ma_bool32 ma_dr_wav_preinit(ma_dr_wav* pWav, ma_dr_wav_read_proc onRe pWav->onTell = onTell; pWav->pUserData = pReadSeekTellUserData; pWav->allocationCallbacks = ma_dr_wav_copy_allocation_callbacks_or_defaults(pAllocationCallbacks); - if (pWav->allocationCallbacks.onFree == nullptr || (pWav->allocationCallbacks.onMalloc == nullptr && pWav->allocationCallbacks.onRealloc == nullptr)) { + if (pWav->allocationCallbacks.onFree == NULL || (pWav->allocationCallbacks.onMalloc == NULL && pWav->allocationCallbacks.onRealloc == NULL)) { return MA_FALSE; } return MA_TRUE; @@ -81319,7 +81319,7 @@ MA_PRIVATE ma_bool32 ma_dr_wav_init__internal(ma_dr_wav* pWav, ma_dr_wav_chunk_p break; } chunkSize = header.sizeInBytes; - if (!sequential && onChunk != nullptr) { + if (!sequential && onChunk != NULL) { ma_uint64 callbackBytesRead = onChunk(pChunkUserData, pWav->onRead, pWav->onSeek, pWav->pUserData, &header, pWav->container, &fmt); if (callbackBytesRead > 0) { if (ma_dr_wav__seek_from_start(pWav->onSeek, cursor, pWav->pUserData) == MA_FALSE) { @@ -81610,7 +81610,7 @@ MA_PRIVATE ma_bool32 ma_dr_wav_init__internal(ma_dr_wav* pWav, ma_dr_wav_chunk_p pWav->pMetadata = metadataParser.pMetadata; pWav->metadataCount = metadataParser.metadataCount; } - if (pWav->onTell != nullptr && pWav->onSeek != nullptr) { + if (pWav->onTell != NULL && pWav->onSeek != NULL) { if (pWav->onSeek(pWav->pUserData, 0, MA_DR_WAV_SEEK_END) == MA_TRUE) { ma_int64 fileSize; if (pWav->onTell(pWav->pUserData, &fileSize)) { @@ -81704,7 +81704,7 @@ MA_PRIVATE ma_bool32 ma_dr_wav_init__internal(ma_dr_wav* pWav, ma_dr_wav_chunk_p } MA_API ma_bool32 ma_dr_wav_init(ma_dr_wav* pWav, ma_dr_wav_read_proc onRead, ma_dr_wav_seek_proc onSeek, ma_dr_wav_tell_proc onTell, void* pUserData, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_dr_wav_init_ex(pWav, onRead, onSeek, onTell, nullptr, pUserData, nullptr, 0, pAllocationCallbacks); + return ma_dr_wav_init_ex(pWav, onRead, onSeek, onTell, NULL, pUserData, NULL, 0, pAllocationCallbacks); } MA_API ma_bool32 ma_dr_wav_init_ex(ma_dr_wav* pWav, ma_dr_wav_read_proc onRead, ma_dr_wav_seek_proc onSeek, ma_dr_wav_tell_proc onTell, ma_dr_wav_chunk_proc onChunk, void* pReadSeekTellUserData, void* pChunkUserData, ma_uint32 flags, const ma_allocation_callbacks* pAllocationCallbacks) { @@ -81718,31 +81718,31 @@ MA_API ma_bool32 ma_dr_wav_init_with_metadata(ma_dr_wav* pWav, ma_dr_wav_read_pr if (!ma_dr_wav_preinit(pWav, onRead, onSeek, onTell, pUserData, pAllocationCallbacks)) { return MA_FALSE; } - return ma_dr_wav_init__internal(pWav, nullptr, nullptr, flags | MA_DR_WAV_WITH_METADATA); + return ma_dr_wav_init__internal(pWav, NULL, NULL, flags | MA_DR_WAV_WITH_METADATA); } MA_API ma_dr_wav_metadata* ma_dr_wav_take_ownership_of_metadata(ma_dr_wav* pWav) { ma_dr_wav_metadata *result = pWav->pMetadata; - pWav->pMetadata = nullptr; + pWav->pMetadata = NULL; pWav->metadataCount = 0; return result; } MA_PRIVATE size_t ma_dr_wav__write(ma_dr_wav* pWav, const void* pData, size_t dataSize) { - MA_DR_WAV_ASSERT(pWav != nullptr); - MA_DR_WAV_ASSERT(pWav->onWrite != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); + MA_DR_WAV_ASSERT(pWav->onWrite != NULL); return pWav->onWrite(pWav->pUserData, pData, dataSize); } MA_PRIVATE size_t ma_dr_wav__write_byte(ma_dr_wav* pWav, ma_uint8 byte) { - MA_DR_WAV_ASSERT(pWav != nullptr); - MA_DR_WAV_ASSERT(pWav->onWrite != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); + MA_DR_WAV_ASSERT(pWav->onWrite != NULL); return pWav->onWrite(pWav->pUserData, &byte, 1); } MA_PRIVATE size_t ma_dr_wav__write_u16ne_to_le(ma_dr_wav* pWav, ma_uint16 value) { - MA_DR_WAV_ASSERT(pWav != nullptr); - MA_DR_WAV_ASSERT(pWav->onWrite != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); + MA_DR_WAV_ASSERT(pWav->onWrite != NULL); if (!ma_dr_wav__is_little_endian()) { value = ma_dr_wav__bswap16(value); } @@ -81750,8 +81750,8 @@ MA_PRIVATE size_t ma_dr_wav__write_u16ne_to_le(ma_dr_wav* pWav, ma_uint16 value) } MA_PRIVATE size_t ma_dr_wav__write_u32ne_to_le(ma_dr_wav* pWav, ma_uint32 value) { - MA_DR_WAV_ASSERT(pWav != nullptr); - MA_DR_WAV_ASSERT(pWav->onWrite != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); + MA_DR_WAV_ASSERT(pWav->onWrite != NULL); if (!ma_dr_wav__is_little_endian()) { value = ma_dr_wav__bswap32(value); } @@ -81759,8 +81759,8 @@ MA_PRIVATE size_t ma_dr_wav__write_u32ne_to_le(ma_dr_wav* pWav, ma_uint32 value) } MA_PRIVATE size_t ma_dr_wav__write_u64ne_to_le(ma_dr_wav* pWav, ma_uint64 value) { - MA_DR_WAV_ASSERT(pWav != nullptr); - MA_DR_WAV_ASSERT(pWav->onWrite != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); + MA_DR_WAV_ASSERT(pWav->onWrite != NULL); if (!ma_dr_wav__is_little_endian()) { value = ma_dr_wav__bswap64(value); } @@ -81772,8 +81772,8 @@ MA_PRIVATE size_t ma_dr_wav__write_f32ne_to_le(ma_dr_wav* pWav, float value) ma_uint32 u32; float f32; } u; - MA_DR_WAV_ASSERT(pWav != nullptr); - MA_DR_WAV_ASSERT(pWav->onWrite != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); + MA_DR_WAV_ASSERT(pWav->onWrite != NULL); u.f32 = value; if (!ma_dr_wav__is_little_endian()) { u.u32 = ma_dr_wav__bswap32(u.u32); @@ -81782,28 +81782,28 @@ MA_PRIVATE size_t ma_dr_wav__write_f32ne_to_le(ma_dr_wav* pWav, float value) } MA_PRIVATE size_t ma_dr_wav__write_or_count(ma_dr_wav* pWav, const void* pData, size_t dataSize) { - if (pWav == nullptr) { + if (pWav == NULL) { return dataSize; } return ma_dr_wav__write(pWav, pData, dataSize); } MA_PRIVATE size_t ma_dr_wav__write_or_count_byte(ma_dr_wav* pWav, ma_uint8 byte) { - if (pWav == nullptr) { + if (pWav == NULL) { return 1; } return ma_dr_wav__write_byte(pWav, byte); } MA_PRIVATE size_t ma_dr_wav__write_or_count_u16ne_to_le(ma_dr_wav* pWav, ma_uint16 value) { - if (pWav == nullptr) { + if (pWav == NULL) { return 2; } return ma_dr_wav__write_u16ne_to_le(pWav, value); } MA_PRIVATE size_t ma_dr_wav__write_or_count_u32ne_to_le(ma_dr_wav* pWav, ma_uint32 value) { - if (pWav == nullptr) { + if (pWav == NULL) { return 4; } return ma_dr_wav__write_u32ne_to_le(pWav, value); @@ -81811,7 +81811,7 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count_u32ne_to_le(ma_dr_wav* pWav, ma_uint #if 0 MA_PRIVATE size_t ma_dr_wav__write_or_count_u64ne_to_le(ma_dr_wav* pWav, ma_uint64 value) { - if (pWav == nullptr) { + if (pWav == NULL) { return 8; } return ma_dr_wav__write_u64ne_to_le(pWav, value); @@ -81819,7 +81819,7 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count_u64ne_to_le(ma_dr_wav* pWav, ma_uint #endif MA_PRIVATE size_t ma_dr_wav__write_or_count_f32ne_to_le(ma_dr_wav* pWav, float value) { - if (pWav == nullptr) { + if (pWav == NULL) { return 4; } return ma_dr_wav__write_f32ne_to_le(pWav, value); @@ -81827,7 +81827,7 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count_f32ne_to_le(ma_dr_wav* pWav, float v MA_PRIVATE size_t ma_dr_wav__write_or_count_string_to_fixed_size_buf(ma_dr_wav* pWav, char* str, size_t bufFixedSize) { size_t len; - if (pWav == nullptr) { + if (pWav == NULL) { return bufFixedSize; } len = ma_dr_wav__strlen_clamped(str, bufFixedSize); @@ -81846,7 +81846,7 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count_metadata(ma_dr_wav* pWav, ma_dr_wav_ ma_bool32 hasListAdtl = MA_FALSE; ma_bool32 hasListInfo = MA_FALSE; ma_uint32 iMetadata; - if (pMetadatas == nullptr || metadataCount == 0) { + if (pMetadatas == NULL || metadataCount == 0) { return 0; } for (iMetadata = 0; iMetadata < metadataCount; ++iMetadata) { @@ -81996,7 +81996,7 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count_metadata(ma_dr_wav* pWav, ma_dr_wav_ ma_dr_wav_metadata* pMetadata = &pMetadatas[iMetadata]; ma_uint32 subchunkSize = 0; if (pMetadata->type & ma_dr_wav_metadata_type_list_all_info_strings) { - const char* pID = nullptr; + const char* pID = NULL; switch (pMetadata->type) { case ma_dr_wav_metadata_type_list_info_software: pID = "ISFT"; break; case ma_dr_wav_metadata_type_list_info_copyright: pID = "ICOP"; break; @@ -82014,7 +82014,7 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count_metadata(ma_dr_wav* pWav, ma_dr_wav_ case ma_dr_wav_metadata_type_list_info_description: pID = "ISBJ"; break; default: break; } - MA_DR_WAV_ASSERT(pID != nullptr); + MA_DR_WAV_ASSERT(pID != NULL); if (pMetadata->data.infoText.stringLength) { subchunkSize = pMetadata->data.infoText.stringLength + 1; bytesWritten += ma_dr_wav__write_or_count(pWav, pID, 4); @@ -82083,15 +82083,15 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count_metadata(ma_dr_wav* pWav, ma_dr_wav_ case ma_dr_wav_metadata_type_list_note: { if (pMetadata->data.labelOrNote.stringLength > 0) { - const char *pID = nullptr; + const char *pID = NULL; if (pMetadata->type == ma_dr_wav_metadata_type_list_label) { pID = "labl"; } else if (pMetadata->type == ma_dr_wav_metadata_type_list_note) { pID = "note"; } - MA_DR_WAV_ASSERT(pID != nullptr); - MA_DR_WAV_ASSERT(pMetadata->data.labelOrNote.pString != nullptr); + MA_DR_WAV_ASSERT(pID != NULL); + MA_DR_WAV_ASSERT(pMetadata->data.labelOrNote.pString != NULL); subchunkSize = MA_DR_WAV_LIST_LABEL_OR_NOTE_BYTES; bytesWritten += ma_dr_wav__write_or_count(pWav, pID, 4); subchunkSize += pMetadata->data.labelOrNote.stringLength + 1; @@ -82117,7 +82117,7 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count_metadata(ma_dr_wav* pWav, ma_dr_wav_ bytesWritten += ma_dr_wav__write_or_count_u16ne_to_le(pWav, pMetadata->data.labelledCueRegion.dialect); bytesWritten += ma_dr_wav__write_or_count_u16ne_to_le(pWav, pMetadata->data.labelledCueRegion.codePage); if (pMetadata->data.labelledCueRegion.stringLength > 0) { - MA_DR_WAV_ASSERT(pMetadata->data.labelledCueRegion.pString != nullptr); + MA_DR_WAV_ASSERT(pMetadata->data.labelledCueRegion.pString != NULL); bytesWritten += ma_dr_wav__write_or_count(pWav, pMetadata->data.labelledCueRegion.pString, pMetadata->data.labelledCueRegion.stringLength); bytesWritten += ma_dr_wav__write_or_count_byte(pWav, '\0'); } @@ -82126,7 +82126,7 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count_metadata(ma_dr_wav* pWav, ma_dr_wav_ { if (pMetadata->data.unknown.chunkLocation == ma_dr_wav_metadata_location_inside_adtl_list) { subchunkSize = pMetadata->data.unknown.dataSizeInBytes; - MA_DR_WAV_ASSERT(pMetadata->data.unknown.pData != nullptr); + MA_DR_WAV_ASSERT(pMetadata->data.unknown.pData != NULL); bytesWritten += ma_dr_wav__write_or_count(pWav, pMetadata->data.unknown.id, 4); bytesWritten += ma_dr_wav__write_or_count_u32ne_to_le(pWav, subchunkSize); bytesWritten += ma_dr_wav__write_or_count(pWav, pMetadata->data.unknown.pData, subchunkSize); @@ -82144,7 +82144,7 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count_metadata(ma_dr_wav* pWav, ma_dr_wav_ } MA_PRIVATE ma_uint32 ma_dr_wav__riff_chunk_size_riff(ma_uint64 dataChunkSize, ma_dr_wav_metadata* pMetadata, ma_uint32 metadataCount) { - ma_uint64 chunkSize = 4 + 24 + (ma_uint64)ma_dr_wav__write_or_count_metadata(nullptr, pMetadata, metadataCount) + 8 + dataChunkSize + ma_dr_wav__chunk_padding_size_riff(dataChunkSize); + ma_uint64 chunkSize = 4 + 24 + (ma_uint64)ma_dr_wav__write_or_count_metadata(NULL, pMetadata, metadataCount) + 8 + dataChunkSize + ma_dr_wav__chunk_padding_size_riff(dataChunkSize); if (chunkSize > 0xFFFFFFFFUL) { chunkSize = 0xFFFFFFFFUL; } @@ -82169,7 +82169,7 @@ MA_PRIVATE ma_uint64 ma_dr_wav__data_chunk_size_w64(ma_uint64 dataChunkSize) } MA_PRIVATE ma_uint64 ma_dr_wav__riff_chunk_size_rf64(ma_uint64 dataChunkSize, ma_dr_wav_metadata *metadata, ma_uint32 numMetadata) { - ma_uint64 chunkSize = 4 + 36 + 24 + (ma_uint64)ma_dr_wav__write_or_count_metadata(nullptr, metadata, numMetadata) + 8 + dataChunkSize + ma_dr_wav__chunk_padding_size_riff(dataChunkSize); + ma_uint64 chunkSize = 4 + 36 + 24 + (ma_uint64)ma_dr_wav__write_or_count_metadata(NULL, metadata, numMetadata) + 8 + dataChunkSize + ma_dr_wav__chunk_padding_size_riff(dataChunkSize); if (chunkSize > 0xFFFFFFFFUL) { chunkSize = 0xFFFFFFFFUL; } @@ -82181,10 +82181,10 @@ MA_PRIVATE ma_uint64 ma_dr_wav__data_chunk_size_rf64(ma_uint64 dataChunkSize) } MA_PRIVATE ma_bool32 ma_dr_wav_preinit_write(ma_dr_wav* pWav, const ma_dr_wav_data_format* pFormat, ma_bool32 isSequential, ma_dr_wav_write_proc onWrite, ma_dr_wav_seek_proc onSeek, void* pUserData, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pWav == nullptr || onWrite == nullptr) { + if (pWav == NULL || onWrite == NULL) { return MA_FALSE; } - if (!isSequential && onSeek == nullptr) { + if (!isSequential && onSeek == NULL) { return MA_FALSE; } if (pFormat->format == MA_DR_WAVE_FORMAT_EXTENSIBLE) { @@ -82198,7 +82198,7 @@ MA_PRIVATE ma_bool32 ma_dr_wav_preinit_write(ma_dr_wav* pWav, const ma_dr_wav_da pWav->onSeek = onSeek; pWav->pUserData = pUserData; pWav->allocationCallbacks = ma_dr_wav_copy_allocation_callbacks_or_defaults(pAllocationCallbacks); - if (pWav->allocationCallbacks.onFree == nullptr || (pWav->allocationCallbacks.onMalloc == nullptr && pWav->allocationCallbacks.onRealloc == nullptr)) { + if (pWav->allocationCallbacks.onFree == NULL || (pWav->allocationCallbacks.onMalloc == NULL && pWav->allocationCallbacks.onRealloc == NULL)) { return MA_FALSE; } pWav->fmt.formatTag = (ma_uint16)pFormat->format; @@ -82267,7 +82267,7 @@ MA_PRIVATE ma_bool32 ma_dr_wav_init_write__internal(ma_dr_wav* pWav, const ma_dr runningPos += ma_dr_wav__write_u32ne_to_le(pWav, pWav->fmt.avgBytesPerSec); runningPos += ma_dr_wav__write_u16ne_to_le(pWav, pWav->fmt.blockAlign); runningPos += ma_dr_wav__write_u16ne_to_le(pWav, pWav->fmt.bitsPerSample); - if (!pWav->isSequentialWrite && pWav->pMetadata != nullptr && pWav->metadataCount > 0 && (pFormat->container == ma_dr_wav_container_riff || pFormat->container == ma_dr_wav_container_rf64)) { + if (!pWav->isSequentialWrite && pWav->pMetadata != NULL && pWav->metadataCount > 0 && (pFormat->container == ma_dr_wav_container_riff || pFormat->container == ma_dr_wav_container_rf64)) { runningPos += ma_dr_wav__write_or_count_metadata(pWav, pWav->pMetadata, pWav->metadataCount); } pWav->dataChunkDataPos = runningPos; @@ -82300,14 +82300,14 @@ MA_API ma_bool32 ma_dr_wav_init_write(ma_dr_wav* pWav, const ma_dr_wav_data_form } MA_API ma_bool32 ma_dr_wav_init_write_sequential(ma_dr_wav* pWav, const ma_dr_wav_data_format* pFormat, ma_uint64 totalSampleCount, ma_dr_wav_write_proc onWrite, void* pUserData, const ma_allocation_callbacks* pAllocationCallbacks) { - if (!ma_dr_wav_preinit_write(pWav, pFormat, MA_TRUE, onWrite, nullptr, pUserData, pAllocationCallbacks)) { + if (!ma_dr_wav_preinit_write(pWav, pFormat, MA_TRUE, onWrite, NULL, pUserData, pAllocationCallbacks)) { return MA_FALSE; } return ma_dr_wav_init_write__internal(pWav, pFormat, totalSampleCount); } MA_API ma_bool32 ma_dr_wav_init_write_sequential_pcm_frames(ma_dr_wav* pWav, const ma_dr_wav_data_format* pFormat, ma_uint64 totalPCMFrameCount, ma_dr_wav_write_proc onWrite, void* pUserData, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pFormat == nullptr) { + if (pFormat == NULL) { return MA_FALSE; } return ma_dr_wav_init_write_sequential(pWav, pFormat, totalPCMFrameCount*pFormat->channels, onWrite, pUserData, pAllocationCallbacks); @@ -82361,8 +82361,8 @@ MA_PRIVATE ma_bool32 ma_dr_wav__on_tell_stdio(void* pUserData, ma_int64* pCursor { FILE* pFileStdio = (FILE*)pUserData; ma_int64 result; - MA_DR_WAV_ASSERT(pFileStdio != nullptr); - MA_DR_WAV_ASSERT(pCursor != nullptr); + MA_DR_WAV_ASSERT(pFileStdio != NULL); + MA_DR_WAV_ASSERT(pCursor != NULL); #if defined(_WIN32) && !defined(NXDK) #if defined(_MSC_VER) && _MSC_VER > 1200 result = _ftelli64(pFileStdio); @@ -82377,7 +82377,7 @@ MA_PRIVATE ma_bool32 ma_dr_wav__on_tell_stdio(void* pUserData, ma_int64* pCursor } MA_API ma_bool32 ma_dr_wav_init_file(ma_dr_wav* pWav, const char* filename, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_dr_wav_init_file_ex(pWav, filename, nullptr, nullptr, 0, pAllocationCallbacks); + return ma_dr_wav_init_file_ex(pWav, filename, NULL, NULL, 0, pAllocationCallbacks); } MA_PRIVATE ma_bool32 ma_dr_wav_init_file__internal_FILE(ma_dr_wav* pWav, FILE* pFile, ma_dr_wav_chunk_proc onChunk, void* pChunkUserData, ma_uint32 flags, const ma_allocation_callbacks* pAllocationCallbacks) { @@ -82405,7 +82405,7 @@ MA_API ma_bool32 ma_dr_wav_init_file_ex(ma_dr_wav* pWav, const char* filename, m #ifndef MA_DR_WAV_NO_WCHAR MA_API ma_bool32 ma_dr_wav_init_file_w(ma_dr_wav* pWav, const wchar_t* filename, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_dr_wav_init_file_ex_w(pWav, filename, nullptr, nullptr, 0, pAllocationCallbacks); + return ma_dr_wav_init_file_ex_w(pWav, filename, NULL, NULL, 0, pAllocationCallbacks); } MA_API ma_bool32 ma_dr_wav_init_file_ex_w(ma_dr_wav* pWav, const wchar_t* filename, ma_dr_wav_chunk_proc onChunk, void* pChunkUserData, ma_uint32 flags, const ma_allocation_callbacks* pAllocationCallbacks) { @@ -82422,7 +82422,7 @@ MA_API ma_bool32 ma_dr_wav_init_file_with_metadata(ma_dr_wav* pWav, const char* if (ma_fopen(&pFile, filename, "rb") != MA_SUCCESS) { return MA_FALSE; } - return ma_dr_wav_init_file__internal_FILE(pWav, pFile, nullptr, nullptr, flags | MA_DR_WAV_WITH_METADATA, pAllocationCallbacks); + return ma_dr_wav_init_file__internal_FILE(pWav, pFile, NULL, NULL, flags | MA_DR_WAV_WITH_METADATA, pAllocationCallbacks); } #ifndef MA_DR_WAV_NO_WCHAR MA_API ma_bool32 ma_dr_wav_init_file_with_metadata_w(ma_dr_wav* pWav, const wchar_t* filename, ma_uint32 flags, const ma_allocation_callbacks* pAllocationCallbacks) @@ -82431,7 +82431,7 @@ MA_API ma_bool32 ma_dr_wav_init_file_with_metadata_w(ma_dr_wav* pWav, const wcha if (ma_wfopen(&pFile, filename, L"rb", pAllocationCallbacks) != MA_SUCCESS) { return MA_FALSE; } - return ma_dr_wav_init_file__internal_FILE(pWav, pFile, nullptr, nullptr, flags | MA_DR_WAV_WITH_METADATA, pAllocationCallbacks); + return ma_dr_wav_init_file__internal_FILE(pWav, pFile, NULL, NULL, flags | MA_DR_WAV_WITH_METADATA, pAllocationCallbacks); } #endif MA_PRIVATE ma_bool32 ma_dr_wav_init_file_write__internal_FILE(ma_dr_wav* pWav, FILE* pFile, const ma_dr_wav_data_format* pFormat, ma_uint64 totalSampleCount, ma_bool32 isSequential, const ma_allocation_callbacks* pAllocationCallbacks) @@ -82477,7 +82477,7 @@ MA_API ma_bool32 ma_dr_wav_init_file_write_sequential(ma_dr_wav* pWav, const cha } MA_API ma_bool32 ma_dr_wav_init_file_write_sequential_pcm_frames(ma_dr_wav* pWav, const char* filename, const ma_dr_wav_data_format* pFormat, ma_uint64 totalPCMFrameCount, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pFormat == nullptr) { + if (pFormat == NULL) { return MA_FALSE; } return ma_dr_wav_init_file_write_sequential(pWav, filename, pFormat, totalPCMFrameCount*pFormat->channels, pAllocationCallbacks); @@ -82493,7 +82493,7 @@ MA_API ma_bool32 ma_dr_wav_init_file_write_sequential_w(ma_dr_wav* pWav, const w } MA_API ma_bool32 ma_dr_wav_init_file_write_sequential_pcm_frames_w(ma_dr_wav* pWav, const wchar_t* filename, const ma_dr_wav_data_format* pFormat, ma_uint64 totalPCMFrameCount, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pFormat == nullptr) { + if (pFormat == NULL) { return MA_FALSE; } return ma_dr_wav_init_file_write_sequential_w(pWav, filename, pFormat, totalPCMFrameCount*pFormat->channels, pAllocationCallbacks); @@ -82504,7 +82504,7 @@ MA_PRIVATE size_t ma_dr_wav__on_read_memory(void* pUserData, void* pBufferOut, s { ma_dr_wav* pWav = (ma_dr_wav*)pUserData; size_t bytesRemaining; - MA_DR_WAV_ASSERT(pWav != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); MA_DR_WAV_ASSERT(pWav->memoryStream.dataSize >= pWav->memoryStream.currentReadPos); bytesRemaining = pWav->memoryStream.dataSize - pWav->memoryStream.currentReadPos; if (bytesToRead > bytesRemaining) { @@ -82520,7 +82520,7 @@ MA_PRIVATE ma_bool32 ma_dr_wav__on_seek_memory(void* pUserData, int offset, ma_d { ma_dr_wav* pWav = (ma_dr_wav*)pUserData; ma_int64 newCursor; - MA_DR_WAV_ASSERT(pWav != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); if (origin == MA_DR_WAV_SEEK_SET) { newCursor = 0; } else if (origin == MA_DR_WAV_SEEK_CUR) { @@ -82545,7 +82545,7 @@ MA_PRIVATE size_t ma_dr_wav__on_write_memory(void* pUserData, const void* pDataI { ma_dr_wav* pWav = (ma_dr_wav*)pUserData; size_t bytesRemaining; - MA_DR_WAV_ASSERT(pWav != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); MA_DR_WAV_ASSERT(pWav->memoryStreamWrite.dataCapacity >= pWav->memoryStreamWrite.currentWritePos); bytesRemaining = pWav->memoryStreamWrite.dataCapacity - pWav->memoryStreamWrite.currentWritePos; if (bytesRemaining < bytesToWrite) { @@ -82555,7 +82555,7 @@ MA_PRIVATE size_t ma_dr_wav__on_write_memory(void* pUserData, const void* pDataI newDataCapacity = pWav->memoryStreamWrite.currentWritePos + bytesToWrite; } pNewData = ma_dr_wav__realloc_from_callbacks(*pWav->memoryStreamWrite.ppData, newDataCapacity, pWav->memoryStreamWrite.dataCapacity, &pWav->allocationCallbacks); - if (pNewData == nullptr) { + if (pNewData == NULL) { return 0; } *pWav->memoryStreamWrite.ppData = pNewData; @@ -82573,7 +82573,7 @@ MA_PRIVATE ma_bool32 ma_dr_wav__on_seek_memory_write(void* pUserData, int offset { ma_dr_wav* pWav = (ma_dr_wav*)pUserData; ma_int64 newCursor; - MA_DR_WAV_ASSERT(pWav != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); if (origin == MA_DR_WAV_SEEK_SET) { newCursor = 0; } else if (origin == MA_DR_WAV_SEEK_CUR) { @@ -82597,18 +82597,18 @@ MA_PRIVATE ma_bool32 ma_dr_wav__on_seek_memory_write(void* pUserData, int offset MA_PRIVATE ma_bool32 ma_dr_wav__on_tell_memory(void* pUserData, ma_int64* pCursor) { ma_dr_wav* pWav = (ma_dr_wav*)pUserData; - MA_DR_WAV_ASSERT(pWav != nullptr); - MA_DR_WAV_ASSERT(pCursor != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); + MA_DR_WAV_ASSERT(pCursor != NULL); *pCursor = (ma_int64)pWav->memoryStream.currentReadPos; return MA_TRUE; } MA_API ma_bool32 ma_dr_wav_init_memory(ma_dr_wav* pWav, const void* data, size_t dataSize, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_dr_wav_init_memory_ex(pWav, data, dataSize, nullptr, nullptr, 0, pAllocationCallbacks); + return ma_dr_wav_init_memory_ex(pWav, data, dataSize, NULL, NULL, 0, pAllocationCallbacks); } MA_API ma_bool32 ma_dr_wav_init_memory_ex(ma_dr_wav* pWav, const void* data, size_t dataSize, ma_dr_wav_chunk_proc onChunk, void* pChunkUserData, ma_uint32 flags, const ma_allocation_callbacks* pAllocationCallbacks) { - if (data == nullptr || dataSize == 0) { + if (data == NULL || dataSize == 0) { return MA_FALSE; } if (!ma_dr_wav_preinit(pWav, ma_dr_wav__on_read_memory, ma_dr_wav__on_seek_memory, ma_dr_wav__on_tell_memory, pWav, pAllocationCallbacks)) { @@ -82621,7 +82621,7 @@ MA_API ma_bool32 ma_dr_wav_init_memory_ex(ma_dr_wav* pWav, const void* data, siz } MA_API ma_bool32 ma_dr_wav_init_memory_with_metadata(ma_dr_wav* pWav, const void* data, size_t dataSize, ma_uint32 flags, const ma_allocation_callbacks* pAllocationCallbacks) { - if (data == nullptr || dataSize == 0) { + if (data == NULL || dataSize == 0) { return MA_FALSE; } if (!ma_dr_wav_preinit(pWav, ma_dr_wav__on_read_memory, ma_dr_wav__on_seek_memory, ma_dr_wav__on_tell_memory, pWav, pAllocationCallbacks)) { @@ -82630,14 +82630,14 @@ MA_API ma_bool32 ma_dr_wav_init_memory_with_metadata(ma_dr_wav* pWav, const void pWav->memoryStream.data = (const ma_uint8*)data; pWav->memoryStream.dataSize = dataSize; pWav->memoryStream.currentReadPos = 0; - return ma_dr_wav_init__internal(pWav, nullptr, nullptr, flags | MA_DR_WAV_WITH_METADATA); + return ma_dr_wav_init__internal(pWav, NULL, NULL, flags | MA_DR_WAV_WITH_METADATA); } MA_PRIVATE ma_bool32 ma_dr_wav_init_memory_write__internal(ma_dr_wav* pWav, void** ppData, size_t* pDataSize, const ma_dr_wav_data_format* pFormat, ma_uint64 totalSampleCount, ma_bool32 isSequential, const ma_allocation_callbacks* pAllocationCallbacks) { - if (ppData == nullptr || pDataSize == nullptr) { + if (ppData == NULL || pDataSize == NULL) { return MA_FALSE; } - *ppData = nullptr; + *ppData = NULL; *pDataSize = 0; if (!ma_dr_wav_preinit_write(pWav, pFormat, isSequential, ma_dr_wav__on_write_memory, ma_dr_wav__on_seek_memory_write, pWav, pAllocationCallbacks)) { return MA_FALSE; @@ -82659,7 +82659,7 @@ MA_API ma_bool32 ma_dr_wav_init_memory_write_sequential(ma_dr_wav* pWav, void** } MA_API ma_bool32 ma_dr_wav_init_memory_write_sequential_pcm_frames(ma_dr_wav* pWav, void** ppData, size_t* pDataSize, const ma_dr_wav_data_format* pFormat, ma_uint64 totalPCMFrameCount, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pFormat == nullptr) { + if (pFormat == NULL) { return MA_FALSE; } return ma_dr_wav_init_memory_write_sequential(pWav, ppData, pDataSize, pFormat, totalPCMFrameCount*pFormat->channels, pAllocationCallbacks); @@ -82667,10 +82667,10 @@ MA_API ma_bool32 ma_dr_wav_init_memory_write_sequential_pcm_frames(ma_dr_wav* pW MA_API ma_result ma_dr_wav_uninit(ma_dr_wav* pWav) { ma_result result = MA_SUCCESS; - if (pWav == nullptr) { + if (pWav == NULL) { return MA_INVALID_ARGS; } - if (pWav->onWrite != nullptr) { + if (pWav->onWrite != NULL) { ma_uint32 paddingSize = 0; if (pWav->container == ma_dr_wav_container_riff || pWav->container == ma_dr_wav_container_rf64) { paddingSize = ma_dr_wav__chunk_padding_size_riff(pWav->dataChunkDataSize); @@ -82731,7 +82731,7 @@ MA_API size_t ma_dr_wav_read_raw(ma_dr_wav* pWav, size_t bytesToRead, void* pBuf { size_t bytesRead; ma_uint32 bytesPerFrame; - if (pWav == nullptr || bytesToRead == 0) { + if (pWav == NULL || bytesToRead == 0) { return 0; } if (bytesToRead > pWav->bytesRemaining) { @@ -82744,7 +82744,7 @@ MA_API size_t ma_dr_wav_read_raw(ma_dr_wav* pWav, size_t bytesToRead, void* pBuf if (bytesPerFrame == 0) { return 0; } - if (pBufferOut != nullptr) { + if (pBufferOut != NULL) { bytesRead = pWav->onRead(pWav->pUserData, pBufferOut, bytesToRead); } else { bytesRead = 0; @@ -82781,7 +82781,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames_le(ma_dr_wav* pWav, ma_uint64 framesT ma_uint32 bytesPerFrame; ma_uint64 bytesToRead; ma_uint64 framesRemainingInFile; - if (pWav == nullptr || framesToRead == 0) { + if (pWav == NULL || framesToRead == 0) { return 0; } if (ma_dr_wav__is_compressed_format_tag(pWav->translatedFormatTag)) { @@ -82807,7 +82807,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames_le(ma_dr_wav* pWav, ma_uint64 framesT MA_API ma_uint64 ma_dr_wav_read_pcm_frames_be(ma_dr_wav* pWav, ma_uint64 framesToRead, void* pBufferOut) { ma_uint64 framesRead = ma_dr_wav_read_pcm_frames_le(pWav, framesToRead, pBufferOut); - if (pBufferOut != nullptr) { + if (pBufferOut != NULL) { ma_uint32 bytesPerFrame = ma_dr_wav_get_bytes_per_pcm_frame(pWav); if (bytesPerFrame == 0) { return 0; @@ -82837,7 +82837,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames(ma_dr_wav* pWav, ma_uint64 framesToRe post_process: { if (pWav->container == ma_dr_wav_container_aiff && pWav->bitsPerSample == 8 && pWav->aiff.isUnsigned == MA_FALSE) { - if (pBufferOut != nullptr) { + if (pBufferOut != NULL) { ma_uint64 iSample; for (iSample = 0; iSample < framesRead * pWav->channels; iSample += 1) { ((ma_uint8*)pBufferOut)[iSample] += 128; @@ -82849,7 +82849,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames(ma_dr_wav* pWav, ma_uint64 framesToRe } MA_PRIVATE ma_bool32 ma_dr_wav_seek_to_first_pcm_frame(ma_dr_wav* pWav) { - if (pWav->onWrite != nullptr) { + if (pWav->onWrite != NULL) { return MA_FALSE; } if (!pWav->onSeek(pWav->pUserData, (int)pWav->dataChunkDataPos, MA_DR_WAV_SEEK_SET)) { @@ -82870,10 +82870,10 @@ MA_PRIVATE ma_bool32 ma_dr_wav_seek_to_first_pcm_frame(ma_dr_wav* pWav) } MA_API ma_bool32 ma_dr_wav_seek_to_pcm_frame(ma_dr_wav* pWav, ma_uint64 targetFrameIndex) { - if (pWav == nullptr || pWav->onSeek == nullptr) { + if (pWav == NULL || pWav->onSeek == NULL) { return MA_FALSE; } - if (pWav->onWrite != nullptr) { + if (pWav->onWrite != NULL) { return MA_FALSE; } if (pWav->totalPCMFrameCount == 0) { @@ -82945,11 +82945,11 @@ MA_API ma_bool32 ma_dr_wav_seek_to_pcm_frame(ma_dr_wav* pWav, ma_uint64 targetFr } MA_API ma_result ma_dr_wav_get_cursor_in_pcm_frames(ma_dr_wav* pWav, ma_uint64* pCursor) { - if (pCursor == nullptr) { + if (pCursor == NULL) { return MA_INVALID_ARGS; } *pCursor = 0; - if (pWav == nullptr) { + if (pWav == NULL) { return MA_INVALID_ARGS; } *pCursor = pWav->readCursorInPCMFrames; @@ -82957,11 +82957,11 @@ MA_API ma_result ma_dr_wav_get_cursor_in_pcm_frames(ma_dr_wav* pWav, ma_uint64* } MA_API ma_result ma_dr_wav_get_length_in_pcm_frames(ma_dr_wav* pWav, ma_uint64* pLength) { - if (pLength == nullptr) { + if (pLength == NULL) { return MA_INVALID_ARGS; } *pLength = 0; - if (pWav == nullptr) { + if (pWav == NULL) { return MA_INVALID_ARGS; } *pLength = pWav->totalPCMFrameCount; @@ -82970,7 +82970,7 @@ MA_API ma_result ma_dr_wav_get_length_in_pcm_frames(ma_dr_wav* pWav, ma_uint64* MA_API size_t ma_dr_wav_write_raw(ma_dr_wav* pWav, size_t bytesToWrite, const void* pData) { size_t bytesWritten; - if (pWav == nullptr || bytesToWrite == 0 || pData == nullptr) { + if (pWav == NULL || bytesToWrite == 0 || pData == NULL) { return 0; } bytesWritten = pWav->onWrite(pWav->pUserData, pData, bytesToWrite); @@ -82982,7 +82982,7 @@ MA_API ma_uint64 ma_dr_wav_write_pcm_frames_le(ma_dr_wav* pWav, ma_uint64 frames ma_uint64 bytesToWrite; ma_uint64 bytesWritten; const ma_uint8* pRunningData; - if (pWav == nullptr || framesToWrite == 0 || pData == nullptr) { + if (pWav == NULL || framesToWrite == 0 || pData == NULL) { return 0; } bytesToWrite = ((framesToWrite * pWav->channels * pWav->bitsPerSample) / 8); @@ -83012,7 +83012,7 @@ MA_API ma_uint64 ma_dr_wav_write_pcm_frames_be(ma_dr_wav* pWav, ma_uint64 frames ma_uint64 bytesWritten; ma_uint32 bytesPerSample; const ma_uint8* pRunningData; - if (pWav == nullptr || framesToWrite == 0 || pData == nullptr) { + if (pWav == NULL || framesToWrite == 0 || pData == NULL) { return 0; } bytesToWrite = ((framesToWrite * pWav->channels * pWav->bitsPerSample) / 8); @@ -83065,7 +83065,7 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_s16__msadpcm(ma_dr_wav* pWav, ma_ }; static const ma_int32 coeff1Table[] = { 256, 512, 0, 192, 240, 460, 392 }; static const ma_int32 coeff2Table[] = { 0, -256, 0, 64, 0, -208, -232 }; - MA_DR_WAV_ASSERT(pWav != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); MA_DR_WAV_ASSERT(framesToRead > 0); while (pWav->readCursorInPCMFrames < pWav->totalPCMFrameCount) { MA_DR_WAV_ASSERT(framesToRead > 0); @@ -83112,7 +83112,7 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_s16__msadpcm(ma_dr_wav* pWav, ma_ } } while (framesToRead > 0 && pWav->msadpcm.cachedFrameCount > 0 && pWav->readCursorInPCMFrames < pWav->totalPCMFrameCount) { - if (pBufferOut != nullptr) { + if (pBufferOut != NULL) { ma_uint32 iSample = 0; for (iSample = 0; iSample < pWav->channels; iSample += 1) { pBufferOut[iSample] = (ma_int16)pWav->msadpcm.cachedFrames[(ma_dr_wav_countof(pWav->msadpcm.cachedFrames) - (pWav->msadpcm.cachedFrameCount*pWav->channels)) + iSample]; @@ -83222,7 +83222,7 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_s16__ima(ma_dr_wav* pWav, ma_uint 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 }; - MA_DR_WAV_ASSERT(pWav != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); MA_DR_WAV_ASSERT(framesToRead > 0); while (pWav->readCursorInPCMFrames < pWav->totalPCMFrameCount) { MA_DR_WAV_ASSERT(framesToRead > 0); @@ -83263,7 +83263,7 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_s16__ima(ma_dr_wav* pWav, ma_uint } } while (framesToRead > 0 && pWav->ima.cachedFrameCount > 0 && pWav->readCursorInPCMFrames < pWav->totalPCMFrameCount) { - if (pBufferOut != nullptr) { + if (pBufferOut != NULL) { ma_uint32 iSample; for (iSample = 0; iSample < pWav->channels; iSample += 1) { pBufferOut[iSample] = (ma_int16)pWav->ima.cachedFrames[(ma_dr_wav_countof(pWav->ima.cachedFrames) - (pWav->ima.cachedFrameCount*pWav->channels)) + iSample]; @@ -83426,7 +83426,7 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_s16__pcm(ma_dr_wav* pWav, ma_uint ma_uint32 bytesPerFrame; ma_uint32 bytesPerSample; ma_uint64 samplesRead; - if ((pWav->translatedFormatTag == MA_DR_WAVE_FORMAT_PCM && pWav->bitsPerSample == 16) || pBufferOut == nullptr) { + if ((pWav->translatedFormatTag == MA_DR_WAVE_FORMAT_PCM && pWav->bitsPerSample == 16) || pBufferOut == NULL) { return ma_dr_wav_read_pcm_frames(pWav, framesToRead, pBufferOut); } bytesPerFrame = ma_dr_wav_get_bytes_per_pcm_frame(pWav); @@ -83464,8 +83464,8 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_s16__ieee(ma_dr_wav* pWav, ma_uin ma_uint32 bytesPerFrame; ma_uint32 bytesPerSample; ma_uint64 samplesRead; - if (pBufferOut == nullptr) { - return ma_dr_wav_read_pcm_frames(pWav, framesToRead, nullptr); + if (pBufferOut == NULL) { + return ma_dr_wav_read_pcm_frames(pWav, framesToRead, NULL); } bytesPerFrame = ma_dr_wav_get_bytes_per_pcm_frame(pWav); if (bytesPerFrame == 0) { @@ -83502,8 +83502,8 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_s16__alaw(ma_dr_wav* pWav, ma_uin ma_uint32 bytesPerFrame; ma_uint32 bytesPerSample; ma_uint64 samplesRead; - if (pBufferOut == nullptr) { - return ma_dr_wav_read_pcm_frames(pWav, framesToRead, nullptr); + if (pBufferOut == NULL) { + return ma_dr_wav_read_pcm_frames(pWav, framesToRead, NULL); } bytesPerFrame = ma_dr_wav_get_bytes_per_pcm_frame(pWav); if (bytesPerFrame == 0) { @@ -83550,8 +83550,8 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_s16__mulaw(ma_dr_wav* pWav, ma_ui ma_uint32 bytesPerFrame; ma_uint32 bytesPerSample; ma_uint64 samplesRead; - if (pBufferOut == nullptr) { - return ma_dr_wav_read_pcm_frames(pWav, framesToRead, nullptr); + if (pBufferOut == NULL) { + return ma_dr_wav_read_pcm_frames(pWav, framesToRead, NULL); } bytesPerFrame = ma_dr_wav_get_bytes_per_pcm_frame(pWav); if (bytesPerFrame == 0) { @@ -83593,11 +83593,11 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_s16__mulaw(ma_dr_wav* pWav, ma_ui } MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s16(ma_dr_wav* pWav, ma_uint64 framesToRead, ma_int16* pBufferOut) { - if (pWav == nullptr || framesToRead == 0) { + if (pWav == NULL || framesToRead == 0) { return 0; } - if (pBufferOut == nullptr) { - return ma_dr_wav_read_pcm_frames(pWav, framesToRead, nullptr); + if (pBufferOut == NULL) { + return ma_dr_wav_read_pcm_frames(pWav, framesToRead, NULL); } if (framesToRead * pWav->channels * sizeof(ma_int16) > MA_SIZE_MAX) { framesToRead = MA_SIZE_MAX / sizeof(ma_int16) / pWav->channels; @@ -83625,7 +83625,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s16(ma_dr_wav* pWav, ma_uint64 frames MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s16le(ma_dr_wav* pWav, ma_uint64 framesToRead, ma_int16* pBufferOut) { ma_uint64 framesRead = ma_dr_wav_read_pcm_frames_s16(pWav, framesToRead, pBufferOut); - if (pBufferOut != nullptr && ma_dr_wav__is_little_endian() == MA_FALSE) { + if (pBufferOut != NULL && ma_dr_wav__is_little_endian() == MA_FALSE) { ma_dr_wav__bswap_samples_s16(pBufferOut, framesRead*pWav->channels); } return framesRead; @@ -83633,7 +83633,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s16le(ma_dr_wav* pWav, ma_uint64 fram MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s16be(ma_dr_wav* pWav, ma_uint64 framesToRead, ma_int16* pBufferOut) { ma_uint64 framesRead = ma_dr_wav_read_pcm_frames_s16(pWav, framesToRead, pBufferOut); - if (pBufferOut != nullptr && ma_dr_wav__is_little_endian() == MA_TRUE) { + if (pBufferOut != NULL && ma_dr_wav__is_little_endian() == MA_TRUE) { ma_dr_wav__bswap_samples_s16(pBufferOut, framesRead*pWav->channels); } return framesRead; @@ -83947,11 +83947,11 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_f32__mulaw(ma_dr_wav* pWav, ma_ui } MA_API ma_uint64 ma_dr_wav_read_pcm_frames_f32(ma_dr_wav* pWav, ma_uint64 framesToRead, float* pBufferOut) { - if (pWav == nullptr || framesToRead == 0) { + if (pWav == NULL || framesToRead == 0) { return 0; } - if (pBufferOut == nullptr) { - return ma_dr_wav_read_pcm_frames(pWav, framesToRead, nullptr); + if (pBufferOut == NULL) { + return ma_dr_wav_read_pcm_frames(pWav, framesToRead, NULL); } if (framesToRead * pWav->channels * sizeof(float) > MA_SIZE_MAX) { framesToRead = MA_SIZE_MAX / sizeof(float) / pWav->channels; @@ -83976,7 +83976,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames_f32(ma_dr_wav* pWav, ma_uint64 frames MA_API ma_uint64 ma_dr_wav_read_pcm_frames_f32le(ma_dr_wav* pWav, ma_uint64 framesToRead, float* pBufferOut) { ma_uint64 framesRead = ma_dr_wav_read_pcm_frames_f32(pWav, framesToRead, pBufferOut); - if (pBufferOut != nullptr && ma_dr_wav__is_little_endian() == MA_FALSE) { + if (pBufferOut != NULL && ma_dr_wav__is_little_endian() == MA_FALSE) { ma_dr_wav__bswap_samples_f32(pBufferOut, framesRead*pWav->channels); } return framesRead; @@ -83984,7 +83984,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames_f32le(ma_dr_wav* pWav, ma_uint64 fram MA_API ma_uint64 ma_dr_wav_read_pcm_frames_f32be(ma_dr_wav* pWav, ma_uint64 framesToRead, float* pBufferOut) { ma_uint64 framesRead = ma_dr_wav_read_pcm_frames_f32(pWav, framesToRead, pBufferOut); - if (pBufferOut != nullptr && ma_dr_wav__is_little_endian() == MA_TRUE) { + if (pBufferOut != NULL && ma_dr_wav__is_little_endian() == MA_TRUE) { ma_dr_wav__bswap_samples_f32(pBufferOut, framesRead*pWav->channels); } return framesRead; @@ -83992,7 +83992,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames_f32be(ma_dr_wav* pWav, ma_uint64 fram MA_API void ma_dr_wav_u8_to_f32(float* pOut, const ma_uint8* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } #ifdef MA_DR_WAV_LIBSNDFILE_COMPAT @@ -84011,7 +84011,7 @@ MA_API void ma_dr_wav_u8_to_f32(float* pOut, const ma_uint8* pIn, size_t sampleC MA_API void ma_dr_wav_s16_to_f32(float* pOut, const ma_int16* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84021,7 +84021,7 @@ MA_API void ma_dr_wav_s16_to_f32(float* pOut, const ma_int16* pIn, size_t sample MA_API void ma_dr_wav_s24_to_f32(float* pOut, const ma_uint8* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84036,7 +84036,7 @@ MA_API void ma_dr_wav_s24_to_f32(float* pOut, const ma_uint8* pIn, size_t sample MA_API void ma_dr_wav_s32_to_f32(float* pOut, const ma_int32* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84046,7 +84046,7 @@ MA_API void ma_dr_wav_s32_to_f32(float* pOut, const ma_int32* pIn, size_t sample MA_API void ma_dr_wav_f64_to_f32(float* pOut, const double* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84056,7 +84056,7 @@ MA_API void ma_dr_wav_f64_to_f32(float* pOut, const double* pIn, size_t sampleCo MA_API void ma_dr_wav_alaw_to_f32(float* pOut, const ma_uint8* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84066,7 +84066,7 @@ MA_API void ma_dr_wav_alaw_to_f32(float* pOut, const ma_uint8* pIn, size_t sampl MA_API void ma_dr_wav_mulaw_to_f32(float* pOut, const ma_uint8* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84307,11 +84307,11 @@ MA_PRIVATE ma_uint64 ma_dr_wav_read_pcm_frames_s32__mulaw(ma_dr_wav* pWav, ma_ui } MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s32(ma_dr_wav* pWav, ma_uint64 framesToRead, ma_int32* pBufferOut) { - if (pWav == nullptr || framesToRead == 0) { + if (pWav == NULL || framesToRead == 0) { return 0; } - if (pBufferOut == nullptr) { - return ma_dr_wav_read_pcm_frames(pWav, framesToRead, nullptr); + if (pBufferOut == NULL) { + return ma_dr_wav_read_pcm_frames(pWav, framesToRead, NULL); } if (framesToRead * pWav->channels * sizeof(ma_int32) > MA_SIZE_MAX) { framesToRead = MA_SIZE_MAX / sizeof(ma_int32) / pWav->channels; @@ -84336,7 +84336,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s32(ma_dr_wav* pWav, ma_uint64 frames MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s32le(ma_dr_wav* pWav, ma_uint64 framesToRead, ma_int32* pBufferOut) { ma_uint64 framesRead = ma_dr_wav_read_pcm_frames_s32(pWav, framesToRead, pBufferOut); - if (pBufferOut != nullptr && ma_dr_wav__is_little_endian() == MA_FALSE) { + if (pBufferOut != NULL && ma_dr_wav__is_little_endian() == MA_FALSE) { ma_dr_wav__bswap_samples_s32(pBufferOut, framesRead*pWav->channels); } return framesRead; @@ -84344,7 +84344,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s32le(ma_dr_wav* pWav, ma_uint64 fram MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s32be(ma_dr_wav* pWav, ma_uint64 framesToRead, ma_int32* pBufferOut) { ma_uint64 framesRead = ma_dr_wav_read_pcm_frames_s32(pWav, framesToRead, pBufferOut); - if (pBufferOut != nullptr && ma_dr_wav__is_little_endian() == MA_TRUE) { + if (pBufferOut != NULL && ma_dr_wav__is_little_endian() == MA_TRUE) { ma_dr_wav__bswap_samples_s32(pBufferOut, framesRead*pWav->channels); } return framesRead; @@ -84352,7 +84352,7 @@ MA_API ma_uint64 ma_dr_wav_read_pcm_frames_s32be(ma_dr_wav* pWav, ma_uint64 fram MA_API void ma_dr_wav_u8_to_s32(ma_int32* pOut, const ma_uint8* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84362,7 +84362,7 @@ MA_API void ma_dr_wav_u8_to_s32(ma_int32* pOut, const ma_uint8* pIn, size_t samp MA_API void ma_dr_wav_s16_to_s32(ma_int32* pOut, const ma_int16* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84372,7 +84372,7 @@ MA_API void ma_dr_wav_s16_to_s32(ma_int32* pOut, const ma_int16* pIn, size_t sam MA_API void ma_dr_wav_s24_to_s32(ma_int32* pOut, const ma_uint8* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84386,7 +84386,7 @@ MA_API void ma_dr_wav_s24_to_s32(ma_int32* pOut, const ma_uint8* pIn, size_t sam MA_API void ma_dr_wav_f32_to_s32(ma_int32* pOut, const float* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84396,7 +84396,7 @@ MA_API void ma_dr_wav_f32_to_s32(ma_int32* pOut, const float* pIn, size_t sample MA_API void ma_dr_wav_f64_to_s32(ma_int32* pOut, const double* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84406,7 +84406,7 @@ MA_API void ma_dr_wav_f64_to_s32(ma_int32* pOut, const double* pIn, size_t sampl MA_API void ma_dr_wav_alaw_to_s32(ma_int32* pOut, const ma_uint8* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i = 0; i < sampleCount; ++i) { @@ -84416,7 +84416,7 @@ MA_API void ma_dr_wav_alaw_to_s32(ma_int32* pOut, const ma_uint8* pIn, size_t sa MA_API void ma_dr_wav_mulaw_to_s32(ma_int32* pOut, const ma_uint8* pIn, size_t sampleCount) { size_t i; - if (pOut == nullptr || pIn == nullptr) { + if (pOut == NULL || pIn == NULL) { return; } for (i= 0; i < sampleCount; ++i) { @@ -84428,26 +84428,26 @@ MA_PRIVATE ma_int16* ma_dr_wav__read_pcm_frames_and_close_s16(ma_dr_wav* pWav, u ma_uint64 sampleDataSize; ma_int16* pSampleData; ma_uint64 framesRead; - MA_DR_WAV_ASSERT(pWav != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); if (pWav->channels == 0 || pWav->totalPCMFrameCount > MA_SIZE_MAX / pWav->channels / sizeof(ma_int16)) { ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } sampleDataSize = pWav->totalPCMFrameCount * pWav->channels * sizeof(ma_int16); if (sampleDataSize > MA_SIZE_MAX) { ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } pSampleData = (ma_int16*)ma_dr_wav__malloc_from_callbacks((size_t)sampleDataSize, &pWav->allocationCallbacks); - if (pSampleData == nullptr) { + if (pSampleData == NULL) { ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } framesRead = ma_dr_wav_read_pcm_frames_s16(pWav, (size_t)pWav->totalPCMFrameCount, pSampleData); if (framesRead != pWav->totalPCMFrameCount) { ma_dr_wav__free_from_callbacks(pSampleData, &pWav->allocationCallbacks); ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } ma_dr_wav_uninit(pWav); if (sampleRate) { @@ -84466,26 +84466,26 @@ MA_PRIVATE float* ma_dr_wav__read_pcm_frames_and_close_f32(ma_dr_wav* pWav, unsi ma_uint64 sampleDataSize; float* pSampleData; ma_uint64 framesRead; - MA_DR_WAV_ASSERT(pWav != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); if (pWav->channels == 0 || pWav->totalPCMFrameCount > MA_SIZE_MAX / pWav->channels / sizeof(float)) { ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } sampleDataSize = pWav->totalPCMFrameCount * pWav->channels * sizeof(float); if (sampleDataSize > MA_SIZE_MAX) { ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } pSampleData = (float*)ma_dr_wav__malloc_from_callbacks((size_t)sampleDataSize, &pWav->allocationCallbacks); - if (pSampleData == nullptr) { + if (pSampleData == NULL) { ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } framesRead = ma_dr_wav_read_pcm_frames_f32(pWav, (size_t)pWav->totalPCMFrameCount, pSampleData); if (framesRead != pWav->totalPCMFrameCount) { ma_dr_wav__free_from_callbacks(pSampleData, &pWav->allocationCallbacks); ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } ma_dr_wav_uninit(pWav); if (sampleRate) { @@ -84504,26 +84504,26 @@ MA_PRIVATE ma_int32* ma_dr_wav__read_pcm_frames_and_close_s32(ma_dr_wav* pWav, u ma_uint64 sampleDataSize; ma_int32* pSampleData; ma_uint64 framesRead; - MA_DR_WAV_ASSERT(pWav != nullptr); + MA_DR_WAV_ASSERT(pWav != NULL); if (pWav->channels == 0 || pWav->totalPCMFrameCount > MA_SIZE_MAX / pWav->channels / sizeof(ma_int32)) { ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } sampleDataSize = pWav->totalPCMFrameCount * pWav->channels * sizeof(ma_int32); if (sampleDataSize > MA_SIZE_MAX) { ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } pSampleData = (ma_int32*)ma_dr_wav__malloc_from_callbacks((size_t)sampleDataSize, &pWav->allocationCallbacks); - if (pSampleData == nullptr) { + if (pSampleData == NULL) { ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } framesRead = ma_dr_wav_read_pcm_frames_s32(pWav, (size_t)pWav->totalPCMFrameCount, pSampleData); if (framesRead != pWav->totalPCMFrameCount) { ma_dr_wav__free_from_callbacks(pSampleData, &pWav->allocationCallbacks); ma_dr_wav_uninit(pWav); - return nullptr; + return NULL; } ma_dr_wav_uninit(pWav); if (sampleRate) { @@ -84550,7 +84550,7 @@ MA_API ma_int16* ma_dr_wav_open_and_read_pcm_frames_s16(ma_dr_wav_read_proc onRe *totalFrameCountOut = 0; } if (!ma_dr_wav_init(&wav, onRead, onSeek, onTell, pUserData, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_s16(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84567,7 +84567,7 @@ MA_API float* ma_dr_wav_open_and_read_pcm_frames_f32(ma_dr_wav_read_proc onRead, *totalFrameCountOut = 0; } if (!ma_dr_wav_init(&wav, onRead, onSeek, onTell, pUserData, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_f32(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84584,7 +84584,7 @@ MA_API ma_int32* ma_dr_wav_open_and_read_pcm_frames_s32(ma_dr_wav_read_proc onRe *totalFrameCountOut = 0; } if (!ma_dr_wav_init(&wav, onRead, onSeek, onTell, pUserData, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_s32(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84602,7 +84602,7 @@ MA_API ma_int16* ma_dr_wav_open_file_and_read_pcm_frames_s16(const char* filenam *totalFrameCountOut = 0; } if (!ma_dr_wav_init_file(&wav, filename, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_s16(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84619,7 +84619,7 @@ MA_API float* ma_dr_wav_open_file_and_read_pcm_frames_f32(const char* filename, *totalFrameCountOut = 0; } if (!ma_dr_wav_init_file(&wav, filename, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_f32(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84636,7 +84636,7 @@ MA_API ma_int32* ma_dr_wav_open_file_and_read_pcm_frames_s32(const char* filenam *totalFrameCountOut = 0; } if (!ma_dr_wav_init_file(&wav, filename, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_s32(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84654,7 +84654,7 @@ MA_API ma_int16* ma_dr_wav_open_file_and_read_pcm_frames_s16_w(const wchar_t* fi *totalFrameCountOut = 0; } if (!ma_dr_wav_init_file_w(&wav, filename, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_s16(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84671,7 +84671,7 @@ MA_API float* ma_dr_wav_open_file_and_read_pcm_frames_f32_w(const wchar_t* filen *totalFrameCountOut = 0; } if (!ma_dr_wav_init_file_w(&wav, filename, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_f32(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84688,7 +84688,7 @@ MA_API ma_int32* ma_dr_wav_open_file_and_read_pcm_frames_s32_w(const wchar_t* fi *totalFrameCountOut = 0; } if (!ma_dr_wav_init_file_w(&wav, filename, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_s32(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84707,7 +84707,7 @@ MA_API ma_int16* ma_dr_wav_open_memory_and_read_pcm_frames_s16(const void* data, *totalFrameCountOut = 0; } if (!ma_dr_wav_init_memory(&wav, data, dataSize, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_s16(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84724,7 +84724,7 @@ MA_API float* ma_dr_wav_open_memory_and_read_pcm_frames_f32(const void* data, si *totalFrameCountOut = 0; } if (!ma_dr_wav_init_memory(&wav, data, dataSize, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_f32(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } @@ -84741,17 +84741,17 @@ MA_API ma_int32* ma_dr_wav_open_memory_and_read_pcm_frames_s32(const void* data, *totalFrameCountOut = 0; } if (!ma_dr_wav_init_memory(&wav, data, dataSize, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_wav__read_pcm_frames_and_close_s32(&wav, channelsOut, sampleRateOut, totalFrameCountOut); } #endif MA_API void ma_dr_wav_free(void* p, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks != nullptr) { + if (pAllocationCallbacks != NULL) { ma_dr_wav__free_from_callbacks(p, pAllocationCallbacks); } else { - ma_dr_wav__free_default(p, nullptr); + ma_dr_wav__free_default(p, NULL); } } MA_API ma_uint16 ma_dr_wav_bytes_to_u16(const ma_uint8* data) @@ -85597,8 +85597,8 @@ static void ma_dr_flac__reset_cache(ma_dr_flac_bs* bs) } static MA_INLINE ma_bool32 ma_dr_flac__read_uint32(ma_dr_flac_bs* bs, unsigned int bitCount, ma_uint32* pResultOut) { - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pResultOut != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pResultOut != NULL); MA_DR_FLAC_ASSERT(bitCount > 0); MA_DR_FLAC_ASSERT(bitCount <= 32); if (bs->consumedBits == MA_DR_FLAC_CACHE_L1_SIZE_BITS(bs)) { @@ -85645,8 +85645,8 @@ static MA_INLINE ma_bool32 ma_dr_flac__read_uint32(ma_dr_flac_bs* bs, unsigned i static ma_bool32 ma_dr_flac__read_int32(ma_dr_flac_bs* bs, unsigned int bitCount, ma_int32* pResult) { ma_uint32 result; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pResult != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pResult != NULL); MA_DR_FLAC_ASSERT(bitCount > 0); MA_DR_FLAC_ASSERT(bitCount <= 32); if (!ma_dr_flac__read_uint32(bs, bitCount, &result)) { @@ -85695,8 +85695,8 @@ static ma_bool32 ma_dr_flac__read_int64(ma_dr_flac_bs* bs, unsigned int bitCount static ma_bool32 ma_dr_flac__read_uint16(ma_dr_flac_bs* bs, unsigned int bitCount, ma_uint16* pResult) { ma_uint32 result; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pResult != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pResult != NULL); MA_DR_FLAC_ASSERT(bitCount > 0); MA_DR_FLAC_ASSERT(bitCount <= 16); if (!ma_dr_flac__read_uint32(bs, bitCount, &result)) { @@ -85709,8 +85709,8 @@ static ma_bool32 ma_dr_flac__read_uint16(ma_dr_flac_bs* bs, unsigned int bitCoun static ma_bool32 ma_dr_flac__read_int16(ma_dr_flac_bs* bs, unsigned int bitCount, ma_int16* pResult) { ma_int32 result; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pResult != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pResult != NULL); MA_DR_FLAC_ASSERT(bitCount > 0); MA_DR_FLAC_ASSERT(bitCount <= 16); if (!ma_dr_flac__read_int32(bs, bitCount, &result)) { @@ -85723,8 +85723,8 @@ static ma_bool32 ma_dr_flac__read_int16(ma_dr_flac_bs* bs, unsigned int bitCount static ma_bool32 ma_dr_flac__read_uint8(ma_dr_flac_bs* bs, unsigned int bitCount, ma_uint8* pResult) { ma_uint32 result; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pResult != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pResult != NULL); MA_DR_FLAC_ASSERT(bitCount > 0); MA_DR_FLAC_ASSERT(bitCount <= 8); if (!ma_dr_flac__read_uint32(bs, bitCount, &result)) { @@ -85736,8 +85736,8 @@ static ma_bool32 ma_dr_flac__read_uint8(ma_dr_flac_bs* bs, unsigned int bitCount static ma_bool32 ma_dr_flac__read_int8(ma_dr_flac_bs* bs, unsigned int bitCount, ma_int8* pResult) { ma_int32 result; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pResult != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pResult != NULL); MA_DR_FLAC_ASSERT(bitCount > 0); MA_DR_FLAC_ASSERT(bitCount <= 8); if (!ma_dr_flac__read_int32(bs, bitCount, &result)) { @@ -85793,7 +85793,7 @@ static ma_bool32 ma_dr_flac__seek_bits(ma_dr_flac_bs* bs, size_t bitsToSeek) } static ma_bool32 ma_dr_flac__find_and_seek_to_next_sync_code(ma_dr_flac_bs* bs) { - MA_DR_FLAC_ASSERT(bs != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); if (!ma_dr_flac__seek_bits(bs, MA_DR_FLAC_CACHE_L1_BITS_REMAINING(bs) & 7)) { return MA_FALSE; } @@ -86014,7 +86014,7 @@ static MA_INLINE ma_bool32 ma_dr_flac__seek_past_next_set_bit(ma_dr_flac_bs* bs, } static ma_bool32 ma_dr_flac__seek_to_byte(ma_dr_flac_bs* bs, ma_uint64 offsetFromStart) { - MA_DR_FLAC_ASSERT(bs != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); MA_DR_FLAC_ASSERT(offsetFromStart > 0); if (offsetFromStart > 0x7FFFFFFF) { ma_uint64 bytesRemaining = offsetFromStart; @@ -86048,9 +86048,9 @@ static ma_result ma_dr_flac__read_utf8_coded_number(ma_dr_flac_bs* bs, ma_uint64 ma_uint8 utf8[7] = {0}; int byteCount; int i; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pNumberOut != nullptr); - MA_DR_FLAC_ASSERT(pCRCOut != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pNumberOut != NULL); + MA_DR_FLAC_ASSERT(pCRCOut != NULL); crc = *pCRCOut; if (!ma_dr_flac__read_uint8(bs, 8, utf8)) { *pNumberOut = 0; @@ -86323,8 +86323,8 @@ static MA_INLINE ma_int32 ma_dr_flac__calculate_prediction_64(ma_uint32 order, m static ma_bool32 ma_dr_flac__decode_samples_with_residual__rice__reference(ma_dr_flac_bs* bs, ma_uint32 bitsPerSample, ma_uint32 count, ma_uint8 riceParam, ma_uint32 lpcOrder, ma_int32 lpcShift, ma_uint32 lpcPrecision, const ma_int32* coefficients, ma_int32* pSamplesOut) { ma_uint32 i; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pSamplesOut != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pSamplesOut != NULL); for (i = 0; i < count; ++i) { ma_uint32 zeroCounter = 0; for (;;) { @@ -86600,8 +86600,8 @@ static ma_bool32 ma_dr_flac__decode_samples_with_residual__rice__scalar_zeroorde ma_uint32 riceParamPart0; ma_uint32 riceParamMask; ma_uint32 i; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pSamplesOut != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pSamplesOut != NULL); (void)bitsPerSample; (void)order; (void)shift; @@ -86634,8 +86634,8 @@ static ma_bool32 ma_dr_flac__decode_samples_with_residual__rice__scalar(ma_dr_fl ma_uint32 riceParamMask; const ma_int32* pSamplesOutEnd; ma_uint32 i; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pSamplesOut != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pSamplesOut != NULL); if (lpcOrder == 0) { return ma_dr_flac__decode_samples_with_residual__rice__scalar_zeroorder(bs, bitsPerSample, count, riceParam, lpcOrder, lpcShift, coefficients, pSamplesOut); } @@ -87052,8 +87052,8 @@ static ma_bool32 ma_dr_flac__decode_samples_with_residual__rice__sse41_64(ma_dr_ } static ma_bool32 ma_dr_flac__decode_samples_with_residual__rice__sse41(ma_dr_flac_bs* bs, ma_uint32 bitsPerSample, ma_uint32 count, ma_uint8 riceParam, ma_uint32 lpcOrder, ma_int32 lpcShift, ma_uint32 lpcPrecision, const ma_int32* coefficients, ma_int32* pSamplesOut) { - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pSamplesOut != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pSamplesOut != NULL); if (lpcOrder > 0 && lpcOrder <= 12) { if (ma_dr_flac__use_64_bit_prediction(bitsPerSample, lpcOrder, lpcPrecision)) { return ma_dr_flac__decode_samples_with_residual__rice__sse41_64(bs, count, riceParam, lpcOrder, lpcShift, coefficients, pSamplesOut); @@ -87402,8 +87402,8 @@ static ma_bool32 ma_dr_flac__decode_samples_with_residual__rice__neon_64(ma_dr_f } static ma_bool32 ma_dr_flac__decode_samples_with_residual__rice__neon(ma_dr_flac_bs* bs, ma_uint32 bitsPerSample, ma_uint32 count, ma_uint8 riceParam, ma_uint32 lpcOrder, ma_int32 lpcShift, ma_uint32 lpcPrecision, const ma_int32* coefficients, ma_int32* pSamplesOut) { - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(pSamplesOut != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(pSamplesOut != NULL); if (lpcOrder > 0 && lpcOrder <= 12) { if (ma_dr_flac__use_64_bit_prediction(bitsPerSample, lpcOrder, lpcPrecision)) { return ma_dr_flac__decode_samples_with_residual__rice__neon_64(bs, count, riceParam, lpcOrder, lpcShift, coefficients, pSamplesOut); @@ -87437,7 +87437,7 @@ static ma_bool32 ma_dr_flac__decode_samples_with_residual__rice(ma_dr_flac_bs* b static ma_bool32 ma_dr_flac__read_and_seek_residual__rice(ma_dr_flac_bs* bs, ma_uint32 count, ma_uint8 riceParam) { ma_uint32 i; - MA_DR_FLAC_ASSERT(bs != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); for (i = 0; i < count; ++i) { if (!ma_dr_flac__seek_rice_parts(bs, riceParam)) { return MA_FALSE; @@ -87451,9 +87451,9 @@ __attribute__((no_sanitize("signed-integer-overflow"))) static ma_bool32 ma_dr_flac__decode_samples_with_residual__unencoded(ma_dr_flac_bs* bs, ma_uint32 bitsPerSample, ma_uint32 count, ma_uint8 unencodedBitsPerSample, ma_uint32 lpcOrder, ma_int32 lpcShift, ma_uint32 lpcPrecision, const ma_int32* coefficients, ma_int32* pSamplesOut) { ma_uint32 i; - MA_DR_FLAC_ASSERT(bs != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); MA_DR_FLAC_ASSERT(unencodedBitsPerSample <= 31); - MA_DR_FLAC_ASSERT(pSamplesOut != nullptr); + MA_DR_FLAC_ASSERT(pSamplesOut != NULL); for (i = 0; i < count; ++i) { if (unencodedBitsPerSample > 0) { if (!ma_dr_flac__read_int32(bs, unencodedBitsPerSample, pSamplesOut + i)) { @@ -87476,9 +87476,9 @@ static ma_bool32 ma_dr_flac__decode_samples_with_residual(ma_dr_flac_bs* bs, ma_ ma_uint8 partitionOrder; ma_uint32 samplesInPartition; ma_uint32 partitionsRemaining; - MA_DR_FLAC_ASSERT(bs != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); MA_DR_FLAC_ASSERT(blockSize != 0); - MA_DR_FLAC_ASSERT(pDecodedSamples != nullptr); + MA_DR_FLAC_ASSERT(pDecodedSamples != NULL); if (!ma_dr_flac__read_uint8(bs, 2, &residualMethod)) { return MA_FALSE; } @@ -87544,7 +87544,7 @@ static ma_bool32 ma_dr_flac__read_and_seek_residual(ma_dr_flac_bs* bs, ma_uint32 ma_uint8 partitionOrder; ma_uint32 samplesInPartition; ma_uint32 partitionsRemaining; - MA_DR_FLAC_ASSERT(bs != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); MA_DR_FLAC_ASSERT(blockSize != 0); if (!ma_dr_flac__read_uint8(bs, 2, &residualMethod)) { return MA_FALSE; @@ -87689,8 +87689,8 @@ static ma_bool32 ma_dr_flac__read_next_flac_frame_header(ma_dr_flac_bs* bs, ma_u { const ma_uint32 sampleRateTable[12] = {0, 88200, 176400, 192000, 8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000}; const ma_uint8 bitsPerSampleTable[8] = {0, 8, 12, (ma_uint8)-1, 16, 20, 24, (ma_uint8)-1}; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(header != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(header != NULL); for (;;) { ma_uint8 crc8 = 0xCE; ma_uint8 reserved = 0; @@ -87886,8 +87886,8 @@ static ma_bool32 ma_dr_flac__decode_subframe(ma_dr_flac_bs* bs, ma_dr_flac_frame { ma_dr_flac_subframe* pSubframe; ma_uint32 subframeBitsPerSample; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(frame != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(frame != NULL); pSubframe = frame->subframes + subframeIndex; if (!ma_dr_flac__read_subframe_header(bs, pSubframe)) { return MA_FALSE; @@ -87935,8 +87935,8 @@ static ma_bool32 ma_dr_flac__seek_subframe(ma_dr_flac_bs* bs, ma_dr_flac_frame* { ma_dr_flac_subframe* pSubframe; ma_uint32 subframeBitsPerSample; - MA_DR_FLAC_ASSERT(bs != nullptr); - MA_DR_FLAC_ASSERT(frame != nullptr); + MA_DR_FLAC_ASSERT(bs != NULL); + MA_DR_FLAC_ASSERT(frame != NULL); pSubframe = frame->subframes + subframeIndex; if (!ma_dr_flac__read_subframe_header(bs, pSubframe)) { return MA_FALSE; @@ -87951,7 +87951,7 @@ static ma_bool32 ma_dr_flac__seek_subframe(ma_dr_flac_bs* bs, ma_dr_flac_frame* return MA_FALSE; } subframeBitsPerSample -= pSubframe->wastedBitsPerSample; - pSubframe->pSamplesS32 = nullptr; + pSubframe->pSamplesS32 = NULL; switch (pSubframe->subframeType) { case MA_DR_FLAC_SUBFRAME_CONSTANT: @@ -88084,7 +88084,7 @@ static ma_result ma_dr_flac__seek_flac_frame(ma_dr_flac* pFlac) } static ma_bool32 ma_dr_flac__read_and_decode_next_flac_frame(ma_dr_flac* pFlac) { - MA_DR_FLAC_ASSERT(pFlac != nullptr); + MA_DR_FLAC_ASSERT(pFlac != NULL); for (;;) { ma_result result; if (!ma_dr_flac__read_next_flac_frame_header(&pFlac->bs, pFlac->bitsPerSample, &pFlac->currentFLACFrame.header)) { @@ -88105,7 +88105,7 @@ static void ma_dr_flac__get_pcm_frame_range_of_current_flac_frame(ma_dr_flac* pF { ma_uint64 firstPCMFrame; ma_uint64 lastPCMFrame; - MA_DR_FLAC_ASSERT(pFlac != nullptr); + MA_DR_FLAC_ASSERT(pFlac != NULL); firstPCMFrame = pFlac->currentFLACFrame.header.pcmFrameNumber; if (firstPCMFrame == 0) { firstPCMFrame = ((ma_uint64)pFlac->currentFLACFrame.header.flacFrameNumber) * pFlac->maxBlockSizeInPCMFrames; @@ -88124,7 +88124,7 @@ static void ma_dr_flac__get_pcm_frame_range_of_current_flac_frame(ma_dr_flac* pF static ma_bool32 ma_dr_flac__seek_to_first_frame(ma_dr_flac* pFlac) { ma_bool32 result; - MA_DR_FLAC_ASSERT(pFlac != nullptr); + MA_DR_FLAC_ASSERT(pFlac != NULL); result = ma_dr_flac__seek_to_byte(&pFlac->bs, pFlac->firstFLACFramePosInBytes); MA_DR_FLAC_ZERO_MEMORY(&pFlac->currentFLACFrame, sizeof(pFlac->currentFLACFrame)); pFlac->currentPCMFrame = 0; @@ -88132,7 +88132,7 @@ static ma_bool32 ma_dr_flac__seek_to_first_frame(ma_dr_flac* pFlac) } static MA_INLINE ma_result ma_dr_flac__seek_to_next_flac_frame(ma_dr_flac* pFlac) { - MA_DR_FLAC_ASSERT(pFlac != nullptr); + MA_DR_FLAC_ASSERT(pFlac != NULL); return ma_dr_flac__seek_flac_frame(pFlac); } static ma_uint64 ma_dr_flac__seek_forward_by_pcm_frames(ma_dr_flac* pFlac, ma_uint64 pcmFramesToSeek) @@ -88162,7 +88162,7 @@ static ma_bool32 ma_dr_flac__seek_to_pcm_frame__brute_force(ma_dr_flac* pFlac, m { ma_bool32 isMidFrame = MA_FALSE; ma_uint64 runningPCMFrameCount; - MA_DR_FLAC_ASSERT(pFlac != nullptr); + MA_DR_FLAC_ASSERT(pFlac != NULL); if (pcmFrameIndex >= pFlac->currentPCMFrame) { runningPCMFrameCount = pFlac->currentPCMFrame; if (pFlac->currentPCMFrame == 0 && pFlac->currentFLACFrame.pcmFramesRemaining == 0) { @@ -88234,8 +88234,8 @@ static ma_bool32 ma_dr_flac__seek_to_pcm_frame__brute_force(ma_dr_flac* pFlac, m #define MA_DR_FLAC_BINARY_SEARCH_APPROX_COMPRESSION_RATIO 0.6f static ma_bool32 ma_dr_flac__seek_to_approximate_flac_frame_to_byte(ma_dr_flac* pFlac, ma_uint64 targetByte, ma_uint64 rangeLo, ma_uint64 rangeHi, ma_uint64* pLastSuccessfulSeekOffset) { - MA_DR_FLAC_ASSERT(pFlac != nullptr); - MA_DR_FLAC_ASSERT(pLastSuccessfulSeekOffset != nullptr); + MA_DR_FLAC_ASSERT(pFlac != NULL); + MA_DR_FLAC_ASSERT(pLastSuccessfulSeekOffset != NULL); MA_DR_FLAC_ASSERT(targetByte >= rangeLo); MA_DR_FLAC_ASSERT(targetByte <= rangeHi); *pLastSuccessfulSeekOffset = pFlac->firstFLACFramePosInBytes; @@ -88270,7 +88270,7 @@ static ma_bool32 ma_dr_flac__seek_to_approximate_flac_frame_to_byte(ma_dr_flac* return MA_FALSE; } } - ma_dr_flac__get_pcm_frame_range_of_current_flac_frame(pFlac, &pFlac->currentPCMFrame, nullptr); + ma_dr_flac__get_pcm_frame_range_of_current_flac_frame(pFlac, &pFlac->currentPCMFrame, NULL); MA_DR_FLAC_ASSERT(targetByte <= rangeHi); *pLastSuccessfulSeekOffset = targetByte; return MA_TRUE; @@ -88383,8 +88383,8 @@ static ma_bool32 ma_dr_flac__seek_to_pcm_frame__seek_table(ma_dr_flac* pFlac, ma ma_bool32 isMidFrame = MA_FALSE; ma_uint64 runningPCMFrameCount; ma_uint32 iSeekpoint; - MA_DR_FLAC_ASSERT(pFlac != nullptr); - if (pFlac->pSeekpoints == nullptr || pFlac->seekpointCount == 0) { + MA_DR_FLAC_ASSERT(pFlac != NULL); + if (pFlac->pSeekpoints == NULL || pFlac->seekpointCount == 0) { return MA_FALSE; } if (pFlac->pSeekpoints[0].firstPCMFrame > pcmFrameIndex) { @@ -88419,7 +88419,7 @@ static ma_bool32 ma_dr_flac__seek_to_pcm_frame__seek_table(ma_dr_flac* pFlac, ma } if (ma_dr_flac__seek_to_byte(&pFlac->bs, pFlac->firstFLACFramePosInBytes + pFlac->pSeekpoints[iClosestSeekpoint].flacFrameOffset)) { if (ma_dr_flac__read_next_flac_frame_header(&pFlac->bs, pFlac->bitsPerSample, &pFlac->currentFLACFrame.header)) { - ma_dr_flac__get_pcm_frame_range_of_current_flac_frame(pFlac, &pFlac->currentPCMFrame, nullptr); + ma_dr_flac__get_pcm_frame_range_of_current_flac_frame(pFlac, &pFlac->currentPCMFrame, NULL); if (ma_dr_flac__seek_to_pcm_frame__binary_search_internal(pFlac, pcmFrameIndex, byteRangeLo, byteRangeHi)) { return MA_TRUE; } @@ -88599,45 +88599,45 @@ static void ma_dr_flac__free_default(void* p, void* pUserData) } static void* ma_dr_flac__malloc_from_callbacks(size_t sz, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks == nullptr) { - return nullptr; + if (pAllocationCallbacks == NULL) { + return NULL; } - if (pAllocationCallbacks->onMalloc != nullptr) { + if (pAllocationCallbacks->onMalloc != NULL) { return pAllocationCallbacks->onMalloc(sz, pAllocationCallbacks->pUserData); } - if (pAllocationCallbacks->onRealloc != nullptr) { - return pAllocationCallbacks->onRealloc(nullptr, sz, pAllocationCallbacks->pUserData); + if (pAllocationCallbacks->onRealloc != NULL) { + return pAllocationCallbacks->onRealloc(NULL, sz, pAllocationCallbacks->pUserData); } - return nullptr; + return NULL; } static void* ma_dr_flac__realloc_from_callbacks(void* p, size_t szNew, size_t szOld, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks == nullptr) { - return nullptr; + if (pAllocationCallbacks == NULL) { + return NULL; } - if (pAllocationCallbacks->onRealloc != nullptr) { + if (pAllocationCallbacks->onRealloc != NULL) { return pAllocationCallbacks->onRealloc(p, szNew, pAllocationCallbacks->pUserData); } - if (pAllocationCallbacks->onMalloc != nullptr && pAllocationCallbacks->onFree != nullptr) { + if (pAllocationCallbacks->onMalloc != NULL && pAllocationCallbacks->onFree != NULL) { void* p2; p2 = pAllocationCallbacks->onMalloc(szNew, pAllocationCallbacks->pUserData); - if (p2 == nullptr) { - return nullptr; + if (p2 == NULL) { + return NULL; } - if (p != nullptr) { + if (p != NULL) { MA_DR_FLAC_COPY_MEMORY(p2, p, szOld); pAllocationCallbacks->onFree(p, pAllocationCallbacks->pUserData); } return p2; } - return nullptr; + return NULL; } static void ma_dr_flac__free_from_callbacks(void* p, const ma_allocation_callbacks* pAllocationCallbacks) { - if (p == nullptr || pAllocationCallbacks == nullptr) { + if (p == NULL || pAllocationCallbacks == NULL) { return; } - if (pAllocationCallbacks->onFree != nullptr) { + if (pAllocationCallbacks->onFree != NULL) { pAllocationCallbacks->onFree(p, pAllocationCallbacks->pUserData); } } @@ -88659,7 +88659,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea metadata.type = blockType; metadata.rawDataSize = 0; metadata.rawDataOffset = runningFilePos; - metadata.pRawData = nullptr; + metadata.pRawData = NULL; switch (blockType) { case MA_DR_FLAC_METADATA_BLOCK_TYPE_APPLICATION: @@ -88669,7 +88669,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea } if (onMeta) { void* pRawData = ma_dr_flac__malloc_from_callbacks(blockSize, pAllocationCallbacks); - if (pRawData == nullptr) { + if (pRawData == NULL) { return MA_FALSE; } if (onRead(pUserData, pRawData, blockSize) != blockSize) { @@ -88695,7 +88695,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea void* pRawData; seekpointCount = blockSize/MA_DR_FLAC_SEEKPOINT_SIZE_IN_BYTES; pRawData = ma_dr_flac__malloc_from_callbacks(seekpointCount * sizeof(ma_dr_flac_seekpoint), pAllocationCallbacks); - if (pRawData == nullptr) { + if (pRawData == NULL) { return MA_FALSE; } for (iSeekpoint = 0; iSeekpoint < seekpointCount; ++iSeekpoint) { @@ -88727,7 +88727,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea const char* pRunningDataEnd; ma_uint32 i; pRawData = ma_dr_flac__malloc_from_callbacks(blockSize, pAllocationCallbacks); - if (pRawData == nullptr) { + if (pRawData == NULL) { return MA_FALSE; } if (onRead(pUserData, pRawData, blockSize) != blockSize) { @@ -88781,7 +88781,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea ma_uint8 iIndex; void* pTrackData; pRawData = ma_dr_flac__malloc_from_callbacks(blockSize, pAllocationCallbacks); - if (pRawData == nullptr) { + if (pRawData == NULL) { return MA_FALSE; } if (onRead(pUserData, pRawData, blockSize) != blockSize) { @@ -88796,7 +88796,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea metadata.data.cuesheet.leadInSampleCount = ma_dr_flac__be2host_64(*(const ma_uint64*)pRunningData); pRunningData += 8; metadata.data.cuesheet.isCD = (pRunningData[0] & 0x80) != 0; pRunningData += 259; metadata.data.cuesheet.trackCount = pRunningData[0]; pRunningData += 1; - metadata.data.cuesheet.pTrackData = nullptr; + metadata.data.cuesheet.pTrackData = NULL; { const char* pRunningDataSaved = pRunningData; bufferSize = metadata.data.cuesheet.trackCount * MA_DR_FLAC_CUESHEET_TRACK_SIZE_IN_BYTES; @@ -88823,7 +88823,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea { char* pRunningTrackData; pTrackData = ma_dr_flac__malloc_from_callbacks(bufferSize, pAllocationCallbacks); - if (pTrackData == nullptr) { + if (pTrackData == NULL) { ma_dr_flac__free_from_callbacks(pRawData, pAllocationCallbacks); return MA_FALSE; } @@ -88847,10 +88847,10 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea metadata.data.cuesheet.pTrackData = pTrackData; } ma_dr_flac__free_from_callbacks(pRawData, pAllocationCallbacks); - pRawData = nullptr; + pRawData = NULL; onMeta(pUserDataMD, &metadata); ma_dr_flac__free_from_callbacks(pTrackData, pAllocationCallbacks); - pTrackData = nullptr; + pTrackData = NULL; } } break; case MA_DR_FLAC_METADATA_BLOCK_TYPE_PICTURE: @@ -88861,9 +88861,9 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea if (onMeta) { ma_bool32 result = MA_TRUE; ma_uint32 blockSizeRemaining = blockSize; - char* pMime = nullptr; - char* pDescription = nullptr; - void* pPictureData = nullptr; + char* pMime = NULL; + char* pDescription = NULL; + void* pPictureData = NULL; if (blockSizeRemaining < 4 || onRead(pUserData, &metadata.data.picture.type, 4) != 4) { result = MA_FALSE; goto done_flac; @@ -88877,7 +88877,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea blockSizeRemaining -= 4; metadata.data.picture.mimeLength = ma_dr_flac__be2host_32(metadata.data.picture.mimeLength); pMime = (char*)ma_dr_flac__malloc_from_callbacks(metadata.data.picture.mimeLength + 1, pAllocationCallbacks); - if (pMime == nullptr) { + if (pMime == NULL) { result = MA_FALSE; goto done_flac; } @@ -88895,7 +88895,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea blockSizeRemaining -= 4; metadata.data.picture.descriptionLength = ma_dr_flac__be2host_32(metadata.data.picture.descriptionLength); pDescription = (char*)ma_dr_flac__malloc_from_callbacks(metadata.data.picture.descriptionLength + 1, pAllocationCallbacks); - if (pDescription == nullptr) { + if (pDescription == NULL) { result = MA_FALSE; goto done_flac; } @@ -88943,7 +88943,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea metadata.data.picture.pictureDataOffset = runningFilePos + (blockSize - blockSizeRemaining); #ifndef MA_DR_FLAC_NO_PICTURE_METADATA_MALLOC pPictureData = ma_dr_flac__malloc_from_callbacks(metadata.data.picture.pictureDataSize, pAllocationCallbacks); - if (pPictureData != nullptr) { + if (pPictureData != NULL) { if (onRead(pUserData, pPictureData, metadata.data.picture.pictureDataSize) != metadata.data.picture.pictureDataSize) { result = MA_FALSE; goto done_flac; @@ -88959,7 +88959,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea blockSizeRemaining -= metadata.data.picture.pictureDataSize; (void)blockSizeRemaining; metadata.data.picture.pPictureData = (const ma_uint8*)pPictureData; - if (metadata.data.picture.pictureDataOffset != 0 || metadata.data.picture.pPictureData != nullptr) { + if (metadata.data.picture.pictureDataOffset != 0 || metadata.data.picture.pPictureData != NULL) { onMeta(pUserDataMD, &metadata); } else { } @@ -88995,7 +88995,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea { if (onMeta) { void* pRawData = ma_dr_flac__malloc_from_callbacks(blockSize, pAllocationCallbacks); - if (pRawData != nullptr) { + if (pRawData != NULL) { if (onRead(pUserData, pRawData, blockSize) != blockSize) { ma_dr_flac__free_from_callbacks(pRawData, pAllocationCallbacks); return MA_FALSE; @@ -89012,7 +89012,7 @@ static ma_bool32 ma_dr_flac__read_and_decode_metadata(ma_dr_flac_read_proc onRea } } break; } - if (onMeta == nullptr && blockSize > 0) { + if (onMeta == NULL && blockSize > 0) { if (!onSeek(pUserData, blockSize, MA_DR_FLAC_SEEK_CUR)) { isLastBlock = MA_TRUE; } @@ -89070,7 +89070,7 @@ static ma_bool32 ma_dr_flac__init_private__native(ma_dr_flac_init_info* pInit, m if (onMeta) { ma_dr_flac_metadata metadata; metadata.type = MA_DR_FLAC_METADATA_BLOCK_TYPE_STREAMINFO; - metadata.pRawData = nullptr; + metadata.pRawData = NULL; metadata.rawDataSize = 0; metadata.data.streaminfo = streaminfo; onMeta(pUserDataMD, &metadata); @@ -89430,8 +89430,8 @@ static size_t ma_dr_flac__on_read_ogg(void* pUserData, void* bufferOut, size_t b ma_dr_flac_oggbs* oggbs = (ma_dr_flac_oggbs*)pUserData; ma_uint8* pRunningBufferOut = (ma_uint8*)bufferOut; size_t bytesRead = 0; - MA_DR_FLAC_ASSERT(oggbs != nullptr); - MA_DR_FLAC_ASSERT(pRunningBufferOut != nullptr); + MA_DR_FLAC_ASSERT(oggbs != NULL); + MA_DR_FLAC_ASSERT(pRunningBufferOut != NULL); while (bytesRead < bytesToRead) { size_t bytesRemainingToRead = bytesToRead - bytesRead; if (oggbs->bytesRemainingInPage >= bytesRemainingToRead) { @@ -89457,7 +89457,7 @@ static ma_bool32 ma_dr_flac__on_seek_ogg(void* pUserData, int offset, ma_dr_flac { ma_dr_flac_oggbs* oggbs = (ma_dr_flac_oggbs*)pUserData; int bytesSeeked = 0; - MA_DR_FLAC_ASSERT(oggbs != nullptr); + MA_DR_FLAC_ASSERT(oggbs != NULL); MA_DR_FLAC_ASSERT(offset >= 0); if (origin == MA_DR_FLAC_SEEK_SET) { if (!ma_dr_flac_oggbs__seek_physical(oggbs, (int)oggbs->firstBytePos, MA_DR_FLAC_SEEK_SET)) { @@ -89504,7 +89504,7 @@ static ma_bool32 ma_dr_flac_ogg__seek_to_pcm_frame(ma_dr_flac* pFlac, ma_uint64 ma_uint64 runningGranulePosition; ma_uint64 runningFrameBytePos; ma_uint64 runningPCMFrameCount; - MA_DR_FLAC_ASSERT(oggbs != nullptr); + MA_DR_FLAC_ASSERT(oggbs != NULL); originalBytePos = oggbs->currentBytePos; if (!ma_dr_flac__seek_to_byte(&pFlac->bs, pFlac->firstFLACFramePosInBytes)) { return MA_FALSE; @@ -89655,7 +89655,7 @@ static ma_bool32 ma_dr_flac__init_private__ogg(ma_dr_flac_init_info* pInit, ma_d if (onMeta) { ma_dr_flac_metadata metadata; metadata.type = MA_DR_FLAC_METADATA_BLOCK_TYPE_STREAMINFO; - metadata.pRawData = nullptr; + metadata.pRawData = NULL; metadata.rawDataSize = 0; metadata.data.streaminfo = streaminfo; onMeta(pUserDataMD, &metadata); @@ -89700,7 +89700,7 @@ static ma_bool32 ma_dr_flac__init_private(ma_dr_flac_init_info* pInit, ma_dr_fla { ma_bool32 relaxed; ma_uint8 id[4]; - if (pInit == nullptr || onRead == nullptr || onSeek == nullptr) { + if (pInit == NULL || onRead == NULL || onSeek == NULL) { return MA_FALSE; } MA_DR_FLAC_ZERO_MEMORY(pInit, sizeof(*pInit)); @@ -89766,8 +89766,8 @@ static ma_bool32 ma_dr_flac__init_private(ma_dr_flac_init_info* pInit, ma_dr_fla } static void ma_dr_flac__init_from_info(ma_dr_flac* pFlac, const ma_dr_flac_init_info* pInit) { - MA_DR_FLAC_ASSERT(pFlac != nullptr); - MA_DR_FLAC_ASSERT(pInit != nullptr); + MA_DR_FLAC_ASSERT(pFlac != NULL); + MA_DR_FLAC_ASSERT(pInit != NULL); MA_DR_FLAC_ZERO_MEMORY(pFlac, sizeof(*pFlac)); pFlac->bs = pInit->bs; pFlac->onMeta = pInit->onMeta; @@ -89786,7 +89786,7 @@ static ma_dr_flac* ma_dr_flac_open_with_metadata_private(ma_dr_flac_read_proc on ma_uint32 wholeSIMDVectorCountPerChannel; ma_uint32 decodedSamplesAllocationSize; #ifndef MA_DR_FLAC_NO_OGG - ma_dr_flac_oggbs* pOggbs = nullptr; + ma_dr_flac_oggbs* pOggbs = NULL; #endif ma_uint64 firstFramePos; ma_uint64 seektablePos; @@ -89795,15 +89795,15 @@ static ma_dr_flac* ma_dr_flac_open_with_metadata_private(ma_dr_flac_read_proc on ma_dr_flac* pFlac; ma_dr_flac__init_cpu_caps(); if (!ma_dr_flac__init_private(&init, onRead, onSeek, onTell, onMeta, container, pUserData, pUserDataMD)) { - return nullptr; + return NULL; } - if (pAllocationCallbacks != nullptr) { + if (pAllocationCallbacks != NULL) { allocationCallbacks = *pAllocationCallbacks; - if (allocationCallbacks.onFree == nullptr || (allocationCallbacks.onMalloc == nullptr && allocationCallbacks.onRealloc == nullptr)) { - return nullptr; + if (allocationCallbacks.onFree == NULL || (allocationCallbacks.onMalloc == NULL && allocationCallbacks.onRealloc == NULL)) { + return NULL; } } else { - allocationCallbacks.pUserData = nullptr; + allocationCallbacks.pUserData = NULL; allocationCallbacks.onMalloc = ma_dr_flac__malloc_default; allocationCallbacks.onRealloc = ma_dr_flac__realloc_default; allocationCallbacks.onFree = ma_dr_flac__free_default; @@ -89821,8 +89821,8 @@ static ma_dr_flac* ma_dr_flac_open_with_metadata_private(ma_dr_flac_read_proc on if (init.container == ma_dr_flac_container_ogg) { allocationSize += sizeof(ma_dr_flac_oggbs); pOggbs = (ma_dr_flac_oggbs*)ma_dr_flac__malloc_from_callbacks(sizeof(*pOggbs), &allocationCallbacks); - if (pOggbs == nullptr) { - return nullptr; + if (pOggbs == NULL) { + return NULL; } MA_DR_FLAC_ZERO_MEMORY(pOggbs, sizeof(*pOggbs)); pOggbs->onRead = onRead; @@ -89856,16 +89856,16 @@ static ma_dr_flac* ma_dr_flac_open_with_metadata_private(ma_dr_flac_read_proc on #ifndef MA_DR_FLAC_NO_OGG ma_dr_flac__free_from_callbacks(pOggbs, &allocationCallbacks); #endif - return nullptr; + return NULL; } allocationSize += seekpointCount * sizeof(ma_dr_flac_seekpoint); } pFlac = (ma_dr_flac*)ma_dr_flac__malloc_from_callbacks(allocationSize, &allocationCallbacks); - if (pFlac == nullptr) { + if (pFlac == NULL) { #ifndef MA_DR_FLAC_NO_OGG ma_dr_flac__free_from_callbacks(pOggbs, &allocationCallbacks); #endif - return nullptr; + return NULL; } ma_dr_flac__init_from_info(pFlac, &init); pFlac->allocationCallbacks = allocationCallbacks; @@ -89875,7 +89875,7 @@ static ma_dr_flac* ma_dr_flac_open_with_metadata_private(ma_dr_flac_read_proc on ma_dr_flac_oggbs* pInternalOggbs = (ma_dr_flac_oggbs*)((ma_uint8*)pFlac->pDecodedSamples + decodedSamplesAllocationSize + (seekpointCount * sizeof(ma_dr_flac_seekpoint))); MA_DR_FLAC_COPY_MEMORY(pInternalOggbs, pOggbs, sizeof(*pOggbs)); ma_dr_flac__free_from_callbacks(pOggbs, &allocationCallbacks); - pOggbs = nullptr; + pOggbs = NULL; pFlac->bs.onRead = ma_dr_flac__on_read_ogg; pFlac->bs.onSeek = ma_dr_flac__on_seek_ogg; pFlac->bs.onTell = ma_dr_flac__on_tell_ogg; @@ -89887,7 +89887,7 @@ static ma_dr_flac* ma_dr_flac_open_with_metadata_private(ma_dr_flac_read_proc on #ifndef MA_DR_FLAC_NO_OGG if (init.container == ma_dr_flac_container_ogg) { - pFlac->pSeekpoints = nullptr; + pFlac->pSeekpoints = NULL; pFlac->seekpointCount = 0; } else @@ -89896,8 +89896,8 @@ static ma_dr_flac* ma_dr_flac_open_with_metadata_private(ma_dr_flac_read_proc on if (seektablePos != 0) { pFlac->seekpointCount = seekpointCount; pFlac->pSeekpoints = (ma_dr_flac_seekpoint*)((ma_uint8*)pFlac->pDecodedSamples + decodedSamplesAllocationSize); - MA_DR_FLAC_ASSERT(pFlac->bs.onSeek != nullptr); - MA_DR_FLAC_ASSERT(pFlac->bs.onRead != nullptr); + MA_DR_FLAC_ASSERT(pFlac->bs.onSeek != NULL); + MA_DR_FLAC_ASSERT(pFlac->bs.onRead != NULL); if (pFlac->bs.onSeek(pFlac->bs.pUserData, (int)seektablePos, MA_DR_FLAC_SEEK_SET)) { ma_uint32 iSeekpoint; for (iSeekpoint = 0; iSeekpoint < seekpointCount; iSeekpoint += 1) { @@ -89906,17 +89906,17 @@ static ma_dr_flac* ma_dr_flac_open_with_metadata_private(ma_dr_flac_read_proc on pFlac->pSeekpoints[iSeekpoint].flacFrameOffset = ma_dr_flac__be2host_64(pFlac->pSeekpoints[iSeekpoint].flacFrameOffset); pFlac->pSeekpoints[iSeekpoint].pcmFrameCount = ma_dr_flac__be2host_16(pFlac->pSeekpoints[iSeekpoint].pcmFrameCount); } else { - pFlac->pSeekpoints = nullptr; + pFlac->pSeekpoints = NULL; pFlac->seekpointCount = 0; break; } } if (!pFlac->bs.onSeek(pFlac->bs.pUserData, (int)pFlac->firstFLACFramePosInBytes, MA_DR_FLAC_SEEK_SET)) { ma_dr_flac__free_from_callbacks(pFlac, &allocationCallbacks); - return nullptr; + return NULL; } } else { - pFlac->pSeekpoints = nullptr; + pFlac->pSeekpoints = NULL; pFlac->seekpointCount = 0; } } @@ -89931,12 +89931,12 @@ static ma_dr_flac* ma_dr_flac_open_with_metadata_private(ma_dr_flac_read_proc on if (result == MA_CRC_MISMATCH) { if (!ma_dr_flac__read_next_flac_frame_header(&pFlac->bs, pFlac->bitsPerSample, &pFlac->currentFLACFrame.header)) { ma_dr_flac__free_from_callbacks(pFlac, &allocationCallbacks); - return nullptr; + return NULL; } continue; } else { ma_dr_flac__free_from_callbacks(pFlac, &allocationCallbacks); - return nullptr; + return NULL; } } } @@ -89966,8 +89966,8 @@ static ma_bool32 ma_dr_flac__on_tell_stdio(void* pUserData, ma_int64* pCursor) { FILE* pFileStdio = (FILE*)pUserData; ma_int64 result; - MA_DR_FLAC_ASSERT(pFileStdio != nullptr); - MA_DR_FLAC_ASSERT(pCursor != nullptr); + MA_DR_FLAC_ASSERT(pFileStdio != NULL); + MA_DR_FLAC_ASSERT(pCursor != NULL); #if defined(_WIN32) && !defined(NXDK) #if defined(_MSC_VER) && _MSC_VER > 1200 result = _ftelli64(pFileStdio); @@ -89985,12 +89985,12 @@ MA_API ma_dr_flac* ma_dr_flac_open_file(const char* pFileName, const ma_allocati ma_dr_flac* pFlac; FILE* pFile; if (ma_fopen(&pFile, pFileName, "rb") != MA_SUCCESS) { - return nullptr; + return NULL; } pFlac = ma_dr_flac_open(ma_dr_flac__on_read_stdio, ma_dr_flac__on_seek_stdio, ma_dr_flac__on_tell_stdio, (void*)pFile, pAllocationCallbacks); - if (pFlac == nullptr) { + if (pFlac == NULL) { fclose(pFile); - return nullptr; + return NULL; } return pFlac; } @@ -90000,12 +90000,12 @@ MA_API ma_dr_flac* ma_dr_flac_open_file_w(const wchar_t* pFileName, const ma_all ma_dr_flac* pFlac; FILE* pFile; if (ma_wfopen(&pFile, pFileName, L"rb", pAllocationCallbacks) != MA_SUCCESS) { - return nullptr; + return NULL; } pFlac = ma_dr_flac_open(ma_dr_flac__on_read_stdio, ma_dr_flac__on_seek_stdio, ma_dr_flac__on_tell_stdio, (void*)pFile, pAllocationCallbacks); - if (pFlac == nullptr) { + if (pFlac == NULL) { fclose(pFile); - return nullptr; + return NULL; } return pFlac; } @@ -90015,10 +90015,10 @@ MA_API ma_dr_flac* ma_dr_flac_open_file_with_metadata(const char* pFileName, ma_ ma_dr_flac* pFlac; FILE* pFile; if (ma_fopen(&pFile, pFileName, "rb") != MA_SUCCESS) { - return nullptr; + return NULL; } pFlac = ma_dr_flac_open_with_metadata_private(ma_dr_flac__on_read_stdio, ma_dr_flac__on_seek_stdio, ma_dr_flac__on_tell_stdio, onMeta, ma_dr_flac_container_unknown, (void*)pFile, pUserData, pAllocationCallbacks); - if (pFlac == nullptr) { + if (pFlac == NULL) { fclose(pFile); return pFlac; } @@ -90030,10 +90030,10 @@ MA_API ma_dr_flac* ma_dr_flac_open_file_with_metadata_w(const wchar_t* pFileName ma_dr_flac* pFlac; FILE* pFile; if (ma_wfopen(&pFile, pFileName, L"rb", pAllocationCallbacks) != MA_SUCCESS) { - return nullptr; + return NULL; } pFlac = ma_dr_flac_open_with_metadata_private(ma_dr_flac__on_read_stdio, ma_dr_flac__on_seek_stdio, ma_dr_flac__on_tell_stdio, onMeta, ma_dr_flac_container_unknown, (void*)pFile, pUserData, pAllocationCallbacks); - if (pFlac == nullptr) { + if (pFlac == NULL) { fclose(pFile); return pFlac; } @@ -90045,7 +90045,7 @@ static size_t ma_dr_flac__on_read_memory(void* pUserData, void* bufferOut, size_ { ma_dr_flac__memory_stream* memoryStream = (ma_dr_flac__memory_stream*)pUserData; size_t bytesRemaining; - MA_DR_FLAC_ASSERT(memoryStream != nullptr); + MA_DR_FLAC_ASSERT(memoryStream != NULL); MA_DR_FLAC_ASSERT(memoryStream->dataSize >= memoryStream->currentReadPos); bytesRemaining = memoryStream->dataSize - memoryStream->currentReadPos; if (bytesToRead > bytesRemaining) { @@ -90061,7 +90061,7 @@ static ma_bool32 ma_dr_flac__on_seek_memory(void* pUserData, int offset, ma_dr_f { ma_dr_flac__memory_stream* memoryStream = (ma_dr_flac__memory_stream*)pUserData; ma_int64 newCursor; - MA_DR_FLAC_ASSERT(memoryStream != nullptr); + MA_DR_FLAC_ASSERT(memoryStream != NULL); if (origin == MA_DR_FLAC_SEEK_SET) { newCursor = 0; } else if (origin == MA_DR_FLAC_SEEK_CUR) { @@ -90085,8 +90085,8 @@ static ma_bool32 ma_dr_flac__on_seek_memory(void* pUserData, int offset, ma_dr_f static ma_bool32 ma_dr_flac__on_tell_memory(void* pUserData, ma_int64* pCursor) { ma_dr_flac__memory_stream* memoryStream = (ma_dr_flac__memory_stream*)pUserData; - MA_DR_FLAC_ASSERT(memoryStream != nullptr); - MA_DR_FLAC_ASSERT(pCursor != nullptr); + MA_DR_FLAC_ASSERT(memoryStream != NULL); + MA_DR_FLAC_ASSERT(pCursor != NULL); *pCursor = (ma_int64)memoryStream->currentReadPos; return MA_TRUE; } @@ -90098,8 +90098,8 @@ MA_API ma_dr_flac* ma_dr_flac_open_memory(const void* pData, size_t dataSize, co memoryStream.dataSize = dataSize; memoryStream.currentReadPos = 0; pFlac = ma_dr_flac_open(ma_dr_flac__on_read_memory, ma_dr_flac__on_seek_memory, ma_dr_flac__on_tell_memory, &memoryStream, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } pFlac->memoryStream = memoryStream; #ifndef MA_DR_FLAC_NO_OGG @@ -90123,8 +90123,8 @@ MA_API ma_dr_flac* ma_dr_flac_open_memory_with_metadata(const void* pData, size_ memoryStream.dataSize = dataSize; memoryStream.currentReadPos = 0; pFlac = ma_dr_flac_open_with_metadata_private(ma_dr_flac__on_read_memory, ma_dr_flac__on_seek_memory, ma_dr_flac__on_tell_memory, onMeta, ma_dr_flac_container_unknown, &memoryStream, pUserData, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } pFlac->memoryStream = memoryStream; #ifndef MA_DR_FLAC_NO_OGG @@ -90142,11 +90142,11 @@ MA_API ma_dr_flac* ma_dr_flac_open_memory_with_metadata(const void* pData, size_ } MA_API ma_dr_flac* ma_dr_flac_open(ma_dr_flac_read_proc onRead, ma_dr_flac_seek_proc onSeek, ma_dr_flac_tell_proc onTell, void* pUserData, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_dr_flac_open_with_metadata_private(onRead, onSeek, onTell, nullptr, ma_dr_flac_container_unknown, pUserData, pUserData, pAllocationCallbacks); + return ma_dr_flac_open_with_metadata_private(onRead, onSeek, onTell, NULL, ma_dr_flac_container_unknown, pUserData, pUserData, pAllocationCallbacks); } MA_API ma_dr_flac* ma_dr_flac_open_relaxed(ma_dr_flac_read_proc onRead, ma_dr_flac_seek_proc onSeek, ma_dr_flac_tell_proc onTell, ma_dr_flac_container container, void* pUserData, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_dr_flac_open_with_metadata_private(onRead, onSeek, onTell, nullptr, container, pUserData, pUserData, pAllocationCallbacks); + return ma_dr_flac_open_with_metadata_private(onRead, onSeek, onTell, NULL, container, pUserData, pUserData, pAllocationCallbacks); } MA_API ma_dr_flac* ma_dr_flac_open_with_metadata(ma_dr_flac_read_proc onRead, ma_dr_flac_seek_proc onSeek, ma_dr_flac_tell_proc onTell, ma_dr_flac_meta_proc onMeta, void* pUserData, const ma_allocation_callbacks* pAllocationCallbacks) { @@ -90158,7 +90158,7 @@ MA_API ma_dr_flac* ma_dr_flac_open_with_metadata_relaxed(ma_dr_flac_read_proc on } MA_API void ma_dr_flac_close(ma_dr_flac* pFlac) { - if (pFlac == nullptr) { + if (pFlac == NULL) { return; } #ifndef MA_DR_FLAC_NO_STDIO @@ -90783,10 +90783,10 @@ MA_API ma_uint64 ma_dr_flac_read_pcm_frames_s32(ma_dr_flac* pFlac, ma_uint64 fra { ma_uint64 framesRead; ma_uint32 unusedBitsPerSample; - if (pFlac == nullptr || framesToRead == 0) { + if (pFlac == NULL || framesToRead == 0) { return 0; } - if (pBufferOut == nullptr) { + if (pBufferOut == NULL) { return ma_dr_flac__seek_forward_by_pcm_frames(pFlac, framesToRead); } MA_DR_FLAC_ASSERT(pFlac->bitsPerSample <= 32); @@ -91520,10 +91520,10 @@ MA_API ma_uint64 ma_dr_flac_read_pcm_frames_s16(ma_dr_flac* pFlac, ma_uint64 fra { ma_uint64 framesRead; ma_uint32 unusedBitsPerSample; - if (pFlac == nullptr || framesToRead == 0) { + if (pFlac == NULL || framesToRead == 0) { return 0; } - if (pBufferOut == nullptr) { + if (pBufferOut == NULL) { return ma_dr_flac__seek_forward_by_pcm_frames(pFlac, framesToRead); } MA_DR_FLAC_ASSERT(pFlac->bitsPerSample <= 32); @@ -92247,10 +92247,10 @@ MA_API ma_uint64 ma_dr_flac_read_pcm_frames_f32(ma_dr_flac* pFlac, ma_uint64 fra { ma_uint64 framesRead; ma_uint32 unusedBitsPerSample; - if (pFlac == nullptr || framesToRead == 0) { + if (pFlac == NULL || framesToRead == 0) { return 0; } - if (pBufferOut == nullptr) { + if (pBufferOut == NULL) { return ma_dr_flac__seek_forward_by_pcm_frames(pFlac, framesToRead); } MA_DR_FLAC_ASSERT(pFlac->bitsPerSample <= 32); @@ -92312,7 +92312,7 @@ MA_API ma_uint64 ma_dr_flac_read_pcm_frames_f32(ma_dr_flac* pFlac, ma_uint64 fra } MA_API ma_bool32 ma_dr_flac_seek_to_pcm_frame(ma_dr_flac* pFlac, ma_uint64 pcmFrameIndex) { - if (pFlac == nullptr) { + if (pFlac == NULL) { return MA_FALSE; } if (pFlac->currentPCMFrame == pcmFrameIndex) { @@ -92380,18 +92380,18 @@ MA_API ma_bool32 ma_dr_flac_seek_to_pcm_frame(ma_dr_flac* pFlac, ma_uint64 pcmFr #define MA_DR_FLAC_DEFINE_FULL_READ_AND_CLOSE(extension, type) \ static type* ma_dr_flac__full_read_and_close_ ## extension (ma_dr_flac* pFlac, unsigned int* channelsOut, unsigned int* sampleRateOut, ma_uint64* totalPCMFrameCountOut)\ { \ - type* pSampleData = nullptr; \ + type* pSampleData = NULL; \ ma_uint64 totalPCMFrameCount; \ type buffer[4096]; \ ma_uint64 pcmFramesRead; \ size_t sampleDataBufferSize = sizeof(buffer); \ \ - MA_DR_FLAC_ASSERT(pFlac != nullptr); \ + MA_DR_FLAC_ASSERT(pFlac != NULL); \ \ totalPCMFrameCount = 0; \ \ pSampleData = (type*)ma_dr_flac__malloc_from_callbacks(sampleDataBufferSize, &pFlac->allocationCallbacks); \ - if (pSampleData == nullptr) { \ + if (pSampleData == NULL) { \ goto on_error; \ } \ \ @@ -92402,7 +92402,7 @@ static type* ma_dr_flac__full_read_and_close_ ## extension (ma_dr_flac* pFlac, u \ newSampleDataBufferSize = sampleDataBufferSize * 2; \ pNewSampleData = (type*)ma_dr_flac__realloc_from_callbacks(pSampleData, newSampleDataBufferSize, sampleDataBufferSize, &pFlac->allocationCallbacks); \ - if (pNewSampleData == nullptr) { \ + if (pNewSampleData == NULL) { \ ma_dr_flac__free_from_callbacks(pSampleData, &pFlac->allocationCallbacks); \ goto on_error; \ } \ @@ -92427,7 +92427,7 @@ static type* ma_dr_flac__full_read_and_close_ ## extension (ma_dr_flac* pFlac, u \ on_error: \ ma_dr_flac_close(pFlac); \ - return nullptr; \ + return NULL; \ } MA_DR_FLAC_DEFINE_FULL_READ_AND_CLOSE(s32, ma_int32) MA_DR_FLAC_DEFINE_FULL_READ_AND_CLOSE(s16, ma_int16) @@ -92445,8 +92445,8 @@ MA_API ma_int32* ma_dr_flac_open_and_read_pcm_frames_s32(ma_dr_flac_read_proc on *totalPCMFrameCountOut = 0; } pFlac = ma_dr_flac_open(onRead, onSeek, onTell, pUserData, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } return ma_dr_flac__full_read_and_close_s32(pFlac, channelsOut, sampleRateOut, totalPCMFrameCountOut); } @@ -92463,8 +92463,8 @@ MA_API ma_int16* ma_dr_flac_open_and_read_pcm_frames_s16(ma_dr_flac_read_proc on *totalPCMFrameCountOut = 0; } pFlac = ma_dr_flac_open(onRead, onSeek, onTell, pUserData, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } return ma_dr_flac__full_read_and_close_s16(pFlac, channelsOut, sampleRateOut, totalPCMFrameCountOut); } @@ -92481,8 +92481,8 @@ MA_API float* ma_dr_flac_open_and_read_pcm_frames_f32(ma_dr_flac_read_proc onRea *totalPCMFrameCountOut = 0; } pFlac = ma_dr_flac_open(onRead, onSeek, onTell, pUserData, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } return ma_dr_flac__full_read_and_close_f32(pFlac, channelsOut, sampleRateOut, totalPCMFrameCountOut); } @@ -92500,8 +92500,8 @@ MA_API ma_int32* ma_dr_flac_open_file_and_read_pcm_frames_s32(const char* filena *totalPCMFrameCount = 0; } pFlac = ma_dr_flac_open_file(filename, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } return ma_dr_flac__full_read_and_close_s32(pFlac, channels, sampleRate, totalPCMFrameCount); } @@ -92518,8 +92518,8 @@ MA_API ma_int16* ma_dr_flac_open_file_and_read_pcm_frames_s16(const char* filena *totalPCMFrameCount = 0; } pFlac = ma_dr_flac_open_file(filename, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } return ma_dr_flac__full_read_and_close_s16(pFlac, channels, sampleRate, totalPCMFrameCount); } @@ -92536,8 +92536,8 @@ MA_API float* ma_dr_flac_open_file_and_read_pcm_frames_f32(const char* filename, *totalPCMFrameCount = 0; } pFlac = ma_dr_flac_open_file(filename, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } return ma_dr_flac__full_read_and_close_f32(pFlac, channels, sampleRate, totalPCMFrameCount); } @@ -92555,8 +92555,8 @@ MA_API ma_int32* ma_dr_flac_open_memory_and_read_pcm_frames_s32(const void* data *totalPCMFrameCount = 0; } pFlac = ma_dr_flac_open_memory(data, dataSize, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } return ma_dr_flac__full_read_and_close_s32(pFlac, channels, sampleRate, totalPCMFrameCount); } @@ -92573,8 +92573,8 @@ MA_API ma_int16* ma_dr_flac_open_memory_and_read_pcm_frames_s16(const void* data *totalPCMFrameCount = 0; } pFlac = ma_dr_flac_open_memory(data, dataSize, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } return ma_dr_flac__full_read_and_close_s16(pFlac, channels, sampleRate, totalPCMFrameCount); } @@ -92591,22 +92591,22 @@ MA_API float* ma_dr_flac_open_memory_and_read_pcm_frames_f32(const void* data, s *totalPCMFrameCount = 0; } pFlac = ma_dr_flac_open_memory(data, dataSize, pAllocationCallbacks); - if (pFlac == nullptr) { - return nullptr; + if (pFlac == NULL) { + return NULL; } return ma_dr_flac__full_read_and_close_f32(pFlac, channels, sampleRate, totalPCMFrameCount); } MA_API void ma_dr_flac_free(void* p, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks != nullptr) { + if (pAllocationCallbacks != NULL) { ma_dr_flac__free_from_callbacks(p, pAllocationCallbacks); } else { - ma_dr_flac__free_default(p, nullptr); + ma_dr_flac__free_default(p, NULL); } } MA_API void ma_dr_flac_init_vorbis_comment_iterator(ma_dr_flac_vorbis_comment_iterator* pIter, ma_uint32 commentCount, const void* pComments) { - if (pIter == nullptr) { + if (pIter == NULL) { return; } pIter->countRemaining = commentCount; @@ -92619,8 +92619,8 @@ MA_API const char* ma_dr_flac_next_vorbis_comment(ma_dr_flac_vorbis_comment_iter if (pCommentLengthOut) { *pCommentLengthOut = 0; } - if (pIter == nullptr || pIter->countRemaining == 0 || pIter->pRunningData == nullptr) { - return nullptr; + if (pIter == NULL || pIter->countRemaining == 0 || pIter->pRunningData == NULL) { + return NULL; } length = ma_dr_flac__le2host_32_ptr_unaligned(pIter->pRunningData); pIter->pRunningData += 4; @@ -92634,7 +92634,7 @@ MA_API const char* ma_dr_flac_next_vorbis_comment(ma_dr_flac_vorbis_comment_iter } MA_API void ma_dr_flac_init_cuesheet_track_iterator(ma_dr_flac_cuesheet_track_iterator* pIter, ma_uint32 trackCount, const void* pTrackData) { - if (pIter == nullptr) { + if (pIter == NULL) { return; } pIter->countRemaining = trackCount; @@ -92646,7 +92646,7 @@ MA_API ma_bool32 ma_dr_flac_next_cuesheet_track(ma_dr_flac_cuesheet_track_iterat const char* pRunningData; ma_uint64 offsetHi; ma_uint64 offsetLo; - if (pIter == nullptr || pIter->countRemaining == 0 || pIter->pRunningData == nullptr) { + if (pIter == NULL || pIter->countRemaining == 0 || pIter->pRunningData == NULL) { return MA_FALSE; } pRunningData = pIter->pRunningData; @@ -94289,7 +94289,7 @@ MA_API int ma_dr_mp3dec_decode_frame(ma_dr_mp3dec *dec, const ma_uint8 *mp3, int return 0; } success = ma_dr_mp3_L3_restore_reservoir(dec, bs_frame, &dec->scratch, main_data_begin); - if (success && pcm != nullptr) + if (success && pcm != NULL) { for (igr = 0; igr < (MA_DR_MP3_HDR_TEST_MPEG1(hdr) ? 2 : 1); igr++, pcm = MA_DR_MP3_OFFSET_PTR(pcm, sizeof(ma_dr_mp3d_sample_t)*576*info->channels)) { @@ -94305,7 +94305,7 @@ MA_API int ma_dr_mp3dec_decode_frame(ma_dr_mp3dec *dec, const ma_uint8 *mp3, int return 0; #else ma_dr_mp3_L12_scale_info sci[1]; - if (pcm == nullptr) { + if (pcm == NULL) { return ma_dr_mp3_hdr_frame_samples(hdr); } ma_dr_mp3_L12_read_scale_info(hdr, bs_frame, sci); @@ -94438,55 +94438,55 @@ static void ma_dr_mp3__free_default(void* p, void* pUserData) } static void* ma_dr_mp3__malloc_from_callbacks(size_t sz, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks == nullptr) { - return nullptr; + if (pAllocationCallbacks == NULL) { + return NULL; } - if (pAllocationCallbacks->onMalloc != nullptr) { + if (pAllocationCallbacks->onMalloc != NULL) { return pAllocationCallbacks->onMalloc(sz, pAllocationCallbacks->pUserData); } - if (pAllocationCallbacks->onRealloc != nullptr) { - return pAllocationCallbacks->onRealloc(nullptr, sz, pAllocationCallbacks->pUserData); + if (pAllocationCallbacks->onRealloc != NULL) { + return pAllocationCallbacks->onRealloc(NULL, sz, pAllocationCallbacks->pUserData); } - return nullptr; + return NULL; } static void* ma_dr_mp3__realloc_from_callbacks(void* p, size_t szNew, size_t szOld, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks == nullptr) { - return nullptr; + if (pAllocationCallbacks == NULL) { + return NULL; } - if (pAllocationCallbacks->onRealloc != nullptr) { + if (pAllocationCallbacks->onRealloc != NULL) { return pAllocationCallbacks->onRealloc(p, szNew, pAllocationCallbacks->pUserData); } - if (pAllocationCallbacks->onMalloc != nullptr && pAllocationCallbacks->onFree != nullptr) { + if (pAllocationCallbacks->onMalloc != NULL && pAllocationCallbacks->onFree != NULL) { void* p2; p2 = pAllocationCallbacks->onMalloc(szNew, pAllocationCallbacks->pUserData); - if (p2 == nullptr) { - return nullptr; + if (p2 == NULL) { + return NULL; } - if (p != nullptr) { + if (p != NULL) { MA_DR_MP3_COPY_MEMORY(p2, p, szOld); pAllocationCallbacks->onFree(p, pAllocationCallbacks->pUserData); } return p2; } - return nullptr; + return NULL; } static void ma_dr_mp3__free_from_callbacks(void* p, const ma_allocation_callbacks* pAllocationCallbacks) { - if (p == nullptr || pAllocationCallbacks == nullptr) { + if (p == NULL || pAllocationCallbacks == NULL) { return; } - if (pAllocationCallbacks->onFree != nullptr) { + if (pAllocationCallbacks->onFree != NULL) { pAllocationCallbacks->onFree(p, pAllocationCallbacks->pUserData); } } static ma_allocation_callbacks ma_dr_mp3_copy_allocation_callbacks_or_defaults(const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks != nullptr) { + if (pAllocationCallbacks != NULL) { return *pAllocationCallbacks; } else { ma_allocation_callbacks allocationCallbacks; - allocationCallbacks.pUserData = nullptr; + allocationCallbacks.pUserData = NULL; allocationCallbacks.onMalloc = ma_dr_mp3__malloc_default; allocationCallbacks.onRealloc = ma_dr_mp3__realloc_default; allocationCallbacks.onFree = ma_dr_mp3__free_default; @@ -94496,8 +94496,8 @@ static ma_allocation_callbacks ma_dr_mp3_copy_allocation_callbacks_or_defaults(c static size_t ma_dr_mp3__on_read(ma_dr_mp3* pMP3, void* pBufferOut, size_t bytesToRead) { size_t bytesRead; - MA_DR_MP3_ASSERT(pMP3 != nullptr); - MA_DR_MP3_ASSERT(pMP3->onRead != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + MA_DR_MP3_ASSERT(pMP3->onRead != NULL); if (bytesToRead == 0) { return 0; } @@ -94507,8 +94507,8 @@ static size_t ma_dr_mp3__on_read(ma_dr_mp3* pMP3, void* pBufferOut, size_t bytes } static size_t ma_dr_mp3__on_read_clamped(ma_dr_mp3* pMP3, void* pBufferOut, size_t bytesToRead) { - MA_DR_MP3_ASSERT(pMP3 != nullptr); - MA_DR_MP3_ASSERT(pMP3->onRead != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + MA_DR_MP3_ASSERT(pMP3->onRead != NULL); if (pMP3->streamLength == MA_UINT64_MAX) { return ma_dr_mp3__on_read(pMP3, pBufferOut, bytesToRead); } else { @@ -94572,8 +94572,8 @@ static void ma_dr_mp3__on_meta(ma_dr_mp3* pMP3, ma_dr_mp3_metadata_type type, co static ma_uint32 ma_dr_mp3_decode_next_frame_ex__callbacks(ma_dr_mp3* pMP3, ma_dr_mp3d_sample_t* pPCMFrames, ma_dr_mp3dec_frame_info* pMP3FrameInfo, const ma_uint8** ppMP3FrameData) { ma_uint32 pcmFramesRead = 0; - MA_DR_MP3_ASSERT(pMP3 != nullptr); - MA_DR_MP3_ASSERT(pMP3->onRead != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + MA_DR_MP3_ASSERT(pMP3->onRead != NULL); if (pMP3->atEnd) { return 0; } @@ -94581,7 +94581,7 @@ static ma_uint32 ma_dr_mp3_decode_next_frame_ex__callbacks(ma_dr_mp3* pMP3, ma_d ma_dr_mp3dec_frame_info info; if (pMP3->dataSize < MA_DR_MP3_MIN_DATA_CHUNK_SIZE) { size_t bytesRead; - if (pMP3->pData != nullptr) { + if (pMP3->pData != NULL) { MA_DR_MP3_MOVE_MEMORY(pMP3->pData, pMP3->pData + pMP3->dataConsumed, pMP3->dataSize); } pMP3->dataConsumed = 0; @@ -94590,7 +94590,7 @@ static ma_uint32 ma_dr_mp3_decode_next_frame_ex__callbacks(ma_dr_mp3* pMP3, ma_d size_t newDataCap; newDataCap = MA_DR_MP3_DATA_CHUNK_SIZE; pNewData = (ma_uint8*)ma_dr_mp3__realloc_from_callbacks(pMP3->pData, newDataCap, pMP3->dataCapacity, &pMP3->allocationCallbacks); - if (pNewData == nullptr) { + if (pNewData == NULL) { return 0; } pMP3->pData = pNewData; @@ -94609,9 +94609,9 @@ static ma_uint32 ma_dr_mp3_decode_next_frame_ex__callbacks(ma_dr_mp3* pMP3, ma_d pMP3->atEnd = MA_TRUE; return 0; } - MA_DR_MP3_ASSERT(pMP3->pData != nullptr); + MA_DR_MP3_ASSERT(pMP3->pData != NULL); MA_DR_MP3_ASSERT(pMP3->dataCapacity > 0); - if (pMP3->pData == nullptr) { + if (pMP3->pData == NULL) { return 0; } pcmFramesRead = ma_dr_mp3dec_decode_frame(&pMP3->decoder, pMP3->pData + pMP3->dataConsumed, (int)pMP3->dataSize, pPCMFrames, &info); @@ -94623,10 +94623,10 @@ static ma_uint32 ma_dr_mp3_decode_next_frame_ex__callbacks(ma_dr_mp3* pMP3, ma_d pMP3->pcmFramesRemainingInMP3Frame = pcmFramesRead; pMP3->mp3FrameChannels = info.channels; pMP3->mp3FrameSampleRate = info.sample_rate; - if (pMP3FrameInfo != nullptr) { + if (pMP3FrameInfo != NULL) { *pMP3FrameInfo = info; } - if (ppMP3FrameData != nullptr) { + if (ppMP3FrameData != NULL) { *ppMP3FrameData = pMP3->pData + pMP3->dataConsumed - (size_t)info.frame_bytes; } break; @@ -94639,7 +94639,7 @@ static ma_uint32 ma_dr_mp3_decode_next_frame_ex__callbacks(ma_dr_mp3* pMP3, ma_d size_t newDataCap; newDataCap = pMP3->dataCapacity + MA_DR_MP3_DATA_CHUNK_SIZE; pNewData = (ma_uint8*)ma_dr_mp3__realloc_from_callbacks(pMP3->pData, newDataCap, pMP3->dataCapacity, &pMP3->allocationCallbacks); - if (pNewData == nullptr) { + if (pNewData == NULL) { return 0; } pMP3->pData = pNewData; @@ -94659,8 +94659,8 @@ static ma_uint32 ma_dr_mp3_decode_next_frame_ex__memory(ma_dr_mp3* pMP3, ma_dr_m { ma_uint32 pcmFramesRead = 0; ma_dr_mp3dec_frame_info info; - MA_DR_MP3_ASSERT(pMP3 != nullptr); - MA_DR_MP3_ASSERT(pMP3->memory.pData != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + MA_DR_MP3_ASSERT(pMP3->memory.pData != NULL); if (pMP3->atEnd) { return 0; } @@ -94672,10 +94672,10 @@ static ma_uint32 ma_dr_mp3_decode_next_frame_ex__memory(ma_dr_mp3* pMP3, ma_dr_m pMP3->pcmFramesRemainingInMP3Frame = pcmFramesRead; pMP3->mp3FrameChannels = info.channels; pMP3->mp3FrameSampleRate = info.sample_rate; - if (pMP3FrameInfo != nullptr) { + if (pMP3FrameInfo != NULL) { *pMP3FrameInfo = info; } - if (ppMP3FrameData != nullptr) { + if (ppMP3FrameData != NULL) { *ppMP3FrameData = pMP3->memory.pData + pMP3->memory.currentReadPos; } break; @@ -94692,7 +94692,7 @@ static ma_uint32 ma_dr_mp3_decode_next_frame_ex__memory(ma_dr_mp3* pMP3, ma_dr_m } static ma_uint32 ma_dr_mp3_decode_next_frame_ex(ma_dr_mp3* pMP3, ma_dr_mp3d_sample_t* pPCMFrames, ma_dr_mp3dec_frame_info* pMP3FrameInfo, const ma_uint8** ppMP3FrameData) { - if (pMP3->memory.pData != nullptr && pMP3->memory.dataSize > 0) { + if (pMP3->memory.pData != NULL && pMP3->memory.dataSize > 0) { return ma_dr_mp3_decode_next_frame_ex__memory(pMP3, pPCMFrames, pMP3FrameInfo, ppMP3FrameData); } else { return ma_dr_mp3_decode_next_frame_ex__callbacks(pMP3, pPCMFrames, pMP3FrameInfo, ppMP3FrameData); @@ -94700,15 +94700,15 @@ static ma_uint32 ma_dr_mp3_decode_next_frame_ex(ma_dr_mp3* pMP3, ma_dr_mp3d_samp } static ma_uint32 ma_dr_mp3_decode_next_frame(ma_dr_mp3* pMP3) { - MA_DR_MP3_ASSERT(pMP3 != nullptr); - return ma_dr_mp3_decode_next_frame_ex(pMP3, (ma_dr_mp3d_sample_t*)pMP3->pcmFrames, nullptr, nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + return ma_dr_mp3_decode_next_frame_ex(pMP3, (ma_dr_mp3d_sample_t*)pMP3->pcmFrames, NULL, NULL); } #if 0 static ma_uint32 ma_dr_mp3_seek_next_frame(ma_dr_mp3* pMP3) { ma_uint32 pcmFrameCount; - MA_DR_MP3_ASSERT(pMP3 != nullptr); - pcmFrameCount = ma_dr_mp3_decode_next_frame_ex(pMP3, nullptr, nullptr, nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + pcmFrameCount = ma_dr_mp3_decode_next_frame_ex(pMP3, NULL, NULL, NULL); if (pcmFrameCount == 0) { return 0; } @@ -94724,8 +94724,8 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on const ma_uint8* pFirstFrameData; ma_uint32 firstFramePCMFrameCount; ma_uint32 detectedMP3FrameCount = 0xFFFFFFFF; - MA_DR_MP3_ASSERT(pMP3 != nullptr); - MA_DR_MP3_ASSERT(onRead != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + MA_DR_MP3_ASSERT(onRead != NULL); ma_dr_mp3dec_init(&pMP3->decoder); pMP3->onRead = onRead; pMP3->onSeek = onSeek; @@ -94733,7 +94733,7 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on pMP3->pUserData = pUserData; pMP3->pUserDataMeta = pUserDataMeta; pMP3->allocationCallbacks = ma_dr_mp3_copy_allocation_callbacks_or_defaults(pAllocationCallbacks); - if (pMP3->allocationCallbacks.onFree == nullptr || (pMP3->allocationCallbacks.onMalloc == nullptr && pMP3->allocationCallbacks.onRealloc == nullptr)) { + if (pMP3->allocationCallbacks.onFree == NULL || (pMP3->allocationCallbacks.onMalloc == NULL && pMP3->allocationCallbacks.onRealloc == NULL)) { return MA_FALSE; } pMP3->streamCursor = 0; @@ -94743,7 +94743,7 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on pMP3->paddingInPCMFrames = 0; pMP3->totalPCMFrameCount = MA_UINT64_MAX; #if 1 - if (onSeek != nullptr && onTell != nullptr) { + if (onSeek != NULL && onTell != NULL) { if (onSeek(pUserData, 0, MA_DR_MP3_SEEK_END)) { ma_int64 streamLen; int streamEndOffset = 0; @@ -94754,7 +94754,7 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on if (onRead(pUserData, id3, 3) == 3 && id3[0] == 'T' && id3[1] == 'A' && id3[2] == 'G') { streamEndOffset -= 128; streamLen -= 128; - if (onMeta != nullptr) { + if (onMeta != NULL) { ma_uint8 tag[128]; tag[0] = 'T'; tag[1] = 'A'; tag[2] = 'G'; if (onRead(pUserData, tag + 3, 125) == 125) { @@ -94779,11 +94779,11 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on if (32 + tagSize < streamLen) { streamEndOffset -= 32 + tagSize; streamLen -= 32 + tagSize; - if (onMeta != nullptr) { + if (onMeta != NULL) { if (onSeek(pUserData, streamEndOffset, MA_DR_MP3_SEEK_END)) { size_t apeTagSize = (size_t)tagSize + 32; ma_uint8* pTagData = (ma_uint8*)ma_dr_mp3_malloc(apeTagSize, pAllocationCallbacks); - if (pTagData != nullptr) { + if (pTagData != NULL) { if (onRead(pUserData, pTagData, apeTagSize) == apeTagSize) { ma_dr_mp3__on_meta(pMP3, MA_DR_MP3_METADATA_TYPE_APE, pTagData, apeTagSize); } @@ -94801,7 +94801,7 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on return MA_FALSE; } pMP3->streamLength = (ma_uint64)streamLen; - if (pMP3->memory.pData != nullptr) { + if (pMP3->memory.pData != NULL) { pMP3->memory.dataSize = (size_t)pMP3->streamLength; } } else { @@ -94827,10 +94827,10 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on if (header[5] & 0x10) { tagSize += 10; } - if (onMeta != nullptr) { + if (onMeta != NULL) { size_t tagSizeWithHeader = 10 + tagSize; ma_uint8* pTagData = (ma_uint8*)ma_dr_mp3_malloc(tagSizeWithHeader, pAllocationCallbacks); - if (pTagData != nullptr) { + if (pTagData != NULL) { MA_DR_MP3_COPY_MEMORY(pTagData, header, 10); if (onRead(pUserData, pTagData + 10, tagSize) == tagSize) { ma_dr_mp3__on_meta(pMP3, MA_DR_MP3_METADATA_TYPE_ID3V2, pTagData, tagSizeWithHeader); @@ -94838,7 +94838,7 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on ma_dr_mp3_free(pTagData, pAllocationCallbacks); } } else { - if (onSeek != nullptr) { + if (onSeek != NULL) { if (!onSeek(pUserData, tagSize, MA_DR_MP3_SEEK_CUR)) { return MA_FALSE; } @@ -94859,7 +94859,7 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on pMP3->streamStartOffset += 10 + tagSize; pMP3->streamCursor = pMP3->streamStartOffset; } else { - if (onSeek != nullptr) { + if (onSeek != NULL) { if (!onSeek(pUserData, 0, MA_DR_MP3_SEEK_SET)) { return MA_FALSE; } @@ -94873,7 +94873,7 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on #endif firstFramePCMFrameCount = ma_dr_mp3_decode_next_frame_ex(pMP3, (ma_dr_mp3d_sample_t*)pMP3->pcmFrames, &firstFrameInfo, &pFirstFrameData); if (firstFramePCMFrameCount > 0) { - MA_DR_MP3_ASSERT(pFirstFrameData != nullptr); + MA_DR_MP3_ASSERT(pFirstFrameData != NULL); #if 1 MA_DR_MP3_ASSERT(firstFrameInfo.frame_bytes > 0); { @@ -94930,7 +94930,7 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on } else if (isInfo) { pMP3->isCBR = MA_TRUE; } - if (onMeta != nullptr) { + if (onMeta != NULL) { ma_dr_mp3_metadata_type metadataType = isXing ? MA_DR_MP3_METADATA_TYPE_XING : MA_DR_MP3_METADATA_TYPE_VBRI; size_t tagDataSize; tagDataSize = (size_t)firstFrameInfo.frame_bytes; @@ -94959,7 +94959,7 @@ static ma_bool32 ma_dr_mp3_init_internal(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc on } MA_API ma_bool32 ma_dr_mp3_init(ma_dr_mp3* pMP3, ma_dr_mp3_read_proc onRead, ma_dr_mp3_seek_proc onSeek, ma_dr_mp3_tell_proc onTell, ma_dr_mp3_meta_proc onMeta, void* pUserData, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pMP3 == nullptr || onRead == nullptr) { + if (pMP3 == NULL || onRead == NULL) { return MA_FALSE; } MA_DR_MP3_ZERO_OBJECT(pMP3); @@ -94969,7 +94969,7 @@ static size_t ma_dr_mp3__on_read_memory(void* pUserData, void* pBufferOut, size_ { ma_dr_mp3* pMP3 = (ma_dr_mp3*)pUserData; size_t bytesRemaining; - MA_DR_MP3_ASSERT(pMP3 != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); MA_DR_MP3_ASSERT(pMP3->memory.dataSize >= pMP3->memory.currentReadPos); bytesRemaining = pMP3->memory.dataSize - pMP3->memory.currentReadPos; if (bytesToRead > bytesRemaining) { @@ -94985,7 +94985,7 @@ static ma_bool32 ma_dr_mp3__on_seek_memory(void* pUserData, int byteOffset, ma_d { ma_dr_mp3* pMP3 = (ma_dr_mp3*)pUserData; ma_int64 newCursor; - MA_DR_MP3_ASSERT(pMP3 != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); if (origin == MA_DR_MP3_SEEK_SET) { newCursor = 0; } else if (origin == MA_DR_MP3_SEEK_CUR) { @@ -95009,19 +95009,19 @@ static ma_bool32 ma_dr_mp3__on_seek_memory(void* pUserData, int byteOffset, ma_d static ma_bool32 ma_dr_mp3__on_tell_memory(void* pUserData, ma_int64* pCursor) { ma_dr_mp3* pMP3 = (ma_dr_mp3*)pUserData; - MA_DR_MP3_ASSERT(pMP3 != nullptr); - MA_DR_MP3_ASSERT(pCursor != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + MA_DR_MP3_ASSERT(pCursor != NULL); *pCursor = (ma_int64)pMP3->memory.currentReadPos; return MA_TRUE; } MA_API ma_bool32 ma_dr_mp3_init_memory_with_metadata(ma_dr_mp3* pMP3, const void* pData, size_t dataSize, ma_dr_mp3_meta_proc onMeta, void* pUserDataMeta, const ma_allocation_callbacks* pAllocationCallbacks) { ma_bool32 result; - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_FALSE; } MA_DR_MP3_ZERO_OBJECT(pMP3); - if (pData == nullptr || dataSize == 0) { + if (pData == NULL || dataSize == 0) { return MA_FALSE; } pMP3->memory.pData = (const ma_uint8*)pData; @@ -95041,7 +95041,7 @@ MA_API ma_bool32 ma_dr_mp3_init_memory_with_metadata(ma_dr_mp3* pMP3, const void } MA_API ma_bool32 ma_dr_mp3_init_memory(ma_dr_mp3* pMP3, const void* pData, size_t dataSize, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_dr_mp3_init_memory_with_metadata(pMP3, pData, dataSize, nullptr, nullptr, pAllocationCallbacks); + return ma_dr_mp3_init_memory_with_metadata(pMP3, pData, dataSize, NULL, NULL, pAllocationCallbacks); } #ifndef MA_DR_MP3_NO_STDIO #include @@ -95064,8 +95064,8 @@ static ma_bool32 ma_dr_mp3__on_tell_stdio(void* pUserData, ma_int64* pCursor) { FILE* pFileStdio = (FILE*)pUserData; ma_int64 result; - MA_DR_MP3_ASSERT(pFileStdio != nullptr); - MA_DR_MP3_ASSERT(pCursor != nullptr); + MA_DR_MP3_ASSERT(pFileStdio != NULL); + MA_DR_MP3_ASSERT(pCursor != NULL); #if defined(_WIN32) && !defined(NXDK) #if defined(_MSC_VER) && _MSC_VER > 1200 result = _ftelli64(pFileStdio); @@ -95082,7 +95082,7 @@ MA_API ma_bool32 ma_dr_mp3_init_file_with_metadata(ma_dr_mp3* pMP3, const char* { ma_bool32 result; FILE* pFile; - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_FALSE; } MA_DR_MP3_ZERO_OBJECT(pMP3); @@ -95100,7 +95100,7 @@ MA_API ma_bool32 ma_dr_mp3_init_file_with_metadata_w(ma_dr_mp3* pMP3, const wcha { ma_bool32 result; FILE* pFile; - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_FALSE; } MA_DR_MP3_ZERO_OBJECT(pMP3); @@ -95116,24 +95116,24 @@ MA_API ma_bool32 ma_dr_mp3_init_file_with_metadata_w(ma_dr_mp3* pMP3, const wcha } MA_API ma_bool32 ma_dr_mp3_init_file(ma_dr_mp3* pMP3, const char* pFilePath, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_dr_mp3_init_file_with_metadata(pMP3, pFilePath, nullptr, nullptr, pAllocationCallbacks); + return ma_dr_mp3_init_file_with_metadata(pMP3, pFilePath, NULL, NULL, pAllocationCallbacks); } MA_API ma_bool32 ma_dr_mp3_init_file_w(ma_dr_mp3* pMP3, const wchar_t* pFilePath, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_dr_mp3_init_file_with_metadata_w(pMP3, pFilePath, nullptr, nullptr, pAllocationCallbacks); + return ma_dr_mp3_init_file_with_metadata_w(pMP3, pFilePath, NULL, NULL, pAllocationCallbacks); } #endif MA_API void ma_dr_mp3_uninit(ma_dr_mp3* pMP3) { - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return; } #ifndef MA_DR_MP3_NO_STDIO if (pMP3->onRead == ma_dr_mp3__on_read_stdio) { FILE* pFile = (FILE*)pMP3->pUserData; - if (pFile != nullptr) { + if (pFile != NULL) { fclose(pFile); - pMP3->pUserData = nullptr; + pMP3->pUserData = NULL; } } #endif @@ -95188,8 +95188,8 @@ static void ma_dr_mp3_s16_to_f32(float* dst, const ma_int16* src, ma_uint64 samp static ma_uint64 ma_dr_mp3_read_pcm_frames_raw(ma_dr_mp3* pMP3, ma_uint64 framesToRead, void* pBufferOut) { ma_uint64 totalFramesRead = 0; - MA_DR_MP3_ASSERT(pMP3 != nullptr); - MA_DR_MP3_ASSERT(pMP3->onRead != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + MA_DR_MP3_ASSERT(pMP3->onRead != NULL); while (framesToRead > 0) { ma_uint32 framesToConsume; if (pMP3->currentPCMFrame < pMP3->delayInPCMFrames) { @@ -95209,7 +95209,7 @@ static ma_uint64 ma_dr_mp3_read_pcm_frames_raw(ma_dr_mp3* pMP3, ma_uint64 frames break; } } - if (pBufferOut != nullptr) { + if (pBufferOut != NULL) { #if defined(MA_DR_MP3_FLOAT_OUTPUT) { float* pFramesOutF32 = (float*)MA_DR_MP3_OFFSET_PTR(pBufferOut, sizeof(float) * totalFramesRead * pMP3->channels); @@ -95244,7 +95244,7 @@ static ma_uint64 ma_dr_mp3_read_pcm_frames_raw(ma_dr_mp3* pMP3, ma_uint64 frames } MA_API ma_uint64 ma_dr_mp3_read_pcm_frames_f32(ma_dr_mp3* pMP3, ma_uint64 framesToRead, float* pBufferOut) { - if (pMP3 == nullptr || pMP3->onRead == nullptr) { + if (pMP3 == NULL || pMP3->onRead == NULL) { return 0; } #if defined(MA_DR_MP3_FLOAT_OUTPUT) @@ -95273,7 +95273,7 @@ MA_API ma_uint64 ma_dr_mp3_read_pcm_frames_f32(ma_dr_mp3* pMP3, ma_uint64 frames } MA_API ma_uint64 ma_dr_mp3_read_pcm_frames_s16(ma_dr_mp3* pMP3, ma_uint64 framesToRead, ma_int16* pBufferOut) { - if (pMP3 == nullptr || pMP3->onRead == nullptr) { + if (pMP3 == NULL || pMP3->onRead == NULL) { return 0; } #if !defined(MA_DR_MP3_FLOAT_OUTPUT) @@ -95302,7 +95302,7 @@ MA_API ma_uint64 ma_dr_mp3_read_pcm_frames_s16(ma_dr_mp3* pMP3, ma_uint64 frames } static void ma_dr_mp3_reset(ma_dr_mp3* pMP3) { - MA_DR_MP3_ASSERT(pMP3 != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); pMP3->pcmFramesConsumedInMP3Frame = 0; pMP3->pcmFramesRemainingInMP3Frame = 0; pMP3->currentPCMFrame = 0; @@ -95312,8 +95312,8 @@ static void ma_dr_mp3_reset(ma_dr_mp3* pMP3) } static ma_bool32 ma_dr_mp3_seek_to_start_of_stream(ma_dr_mp3* pMP3) { - MA_DR_MP3_ASSERT(pMP3 != nullptr); - MA_DR_MP3_ASSERT(pMP3->onSeek != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + MA_DR_MP3_ASSERT(pMP3->onSeek != NULL); if (!ma_dr_mp3__on_seek_64(pMP3, pMP3->streamStartOffset, MA_DR_MP3_SEEK_SET)) { return MA_FALSE; } @@ -95324,9 +95324,9 @@ static ma_bool32 ma_dr_mp3_seek_forward_by_pcm_frames__brute_force(ma_dr_mp3* pM { ma_uint64 framesRead; #if defined(MA_DR_MP3_FLOAT_OUTPUT) - framesRead = ma_dr_mp3_read_pcm_frames_f32(pMP3, frameOffset, nullptr); + framesRead = ma_dr_mp3_read_pcm_frames_f32(pMP3, frameOffset, NULL); #else - framesRead = ma_dr_mp3_read_pcm_frames_s16(pMP3, frameOffset, nullptr); + framesRead = ma_dr_mp3_read_pcm_frames_s16(pMP3, frameOffset, NULL); #endif if (framesRead != frameOffset) { return MA_FALSE; @@ -95335,7 +95335,7 @@ static ma_bool32 ma_dr_mp3_seek_forward_by_pcm_frames__brute_force(ma_dr_mp3* pM } static ma_bool32 ma_dr_mp3_seek_to_pcm_frame__brute_force(ma_dr_mp3* pMP3, ma_uint64 frameIndex) { - MA_DR_MP3_ASSERT(pMP3 != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); if (frameIndex == pMP3->currentPCMFrame) { return MA_TRUE; } @@ -95350,7 +95350,7 @@ static ma_bool32 ma_dr_mp3_seek_to_pcm_frame__brute_force(ma_dr_mp3* pMP3, ma_ui static ma_bool32 ma_dr_mp3_find_closest_seek_point(ma_dr_mp3* pMP3, ma_uint64 frameIndex, ma_uint32* pSeekPointIndex) { ma_uint32 iSeekPoint; - MA_DR_MP3_ASSERT(pSeekPointIndex != nullptr); + MA_DR_MP3_ASSERT(pSeekPointIndex != NULL); *pSeekPointIndex = 0; if (frameIndex < pMP3->pSeekPoints[0].pcmFrameIndex) { return MA_FALSE; @@ -95369,8 +95369,8 @@ static ma_bool32 ma_dr_mp3_seek_to_pcm_frame__seek_table(ma_dr_mp3* pMP3, ma_uin ma_uint32 priorSeekPointIndex; ma_uint16 iMP3Frame; ma_uint64 leftoverFrames; - MA_DR_MP3_ASSERT(pMP3 != nullptr); - MA_DR_MP3_ASSERT(pMP3->pSeekPoints != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); + MA_DR_MP3_ASSERT(pMP3->pSeekPoints != NULL); MA_DR_MP3_ASSERT(pMP3->seekPointCount > 0); if (ma_dr_mp3_find_closest_seek_point(pMP3, frameIndex, &priorSeekPointIndex)) { seekPoint = pMP3->pSeekPoints[priorSeekPointIndex]; @@ -95387,11 +95387,11 @@ static ma_bool32 ma_dr_mp3_seek_to_pcm_frame__seek_table(ma_dr_mp3* pMP3, ma_uin for (iMP3Frame = 0; iMP3Frame < seekPoint.mp3FramesToDiscard; ++iMP3Frame) { ma_uint32 pcmFramesRead; ma_dr_mp3d_sample_t* pPCMFrames; - pPCMFrames = nullptr; + pPCMFrames = NULL; if (iMP3Frame == seekPoint.mp3FramesToDiscard-1) { pPCMFrames = (ma_dr_mp3d_sample_t*)pMP3->pcmFrames; } - pcmFramesRead = ma_dr_mp3_decode_next_frame_ex(pMP3, pPCMFrames, nullptr, nullptr); + pcmFramesRead = ma_dr_mp3_decode_next_frame_ex(pMP3, pPCMFrames, NULL, NULL); if (pcmFramesRead == 0) { return MA_FALSE; } @@ -95402,13 +95402,13 @@ static ma_bool32 ma_dr_mp3_seek_to_pcm_frame__seek_table(ma_dr_mp3* pMP3, ma_uin } MA_API ma_bool32 ma_dr_mp3_seek_to_pcm_frame(ma_dr_mp3* pMP3, ma_uint64 frameIndex) { - if (pMP3 == nullptr || pMP3->onSeek == nullptr) { + if (pMP3 == NULL || pMP3->onSeek == NULL) { return MA_FALSE; } if (frameIndex == 0) { return ma_dr_mp3_seek_to_start_of_stream(pMP3); } - if (pMP3->pSeekPoints != nullptr && pMP3->seekPointCount > 0) { + if (pMP3->pSeekPoints != NULL && pMP3->seekPointCount > 0) { return ma_dr_mp3_seek_to_pcm_frame__seek_table(pMP3, frameIndex); } else { return ma_dr_mp3_seek_to_pcm_frame__brute_force(pMP3, frameIndex); @@ -95419,10 +95419,10 @@ MA_API ma_bool32 ma_dr_mp3_get_mp3_and_pcm_frame_count(ma_dr_mp3* pMP3, ma_uint6 ma_uint64 currentPCMFrame; ma_uint64 totalPCMFrameCount; ma_uint64 totalMP3FrameCount; - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_FALSE; } - if (pMP3->onSeek == nullptr) { + if (pMP3->onSeek == NULL) { return MA_FALSE; } currentPCMFrame = pMP3->currentPCMFrame; @@ -95433,7 +95433,7 @@ MA_API ma_bool32 ma_dr_mp3_get_mp3_and_pcm_frame_count(ma_dr_mp3* pMP3, ma_uint6 totalMP3FrameCount = 0; for (;;) { ma_uint32 pcmFramesInCurrentMP3Frame; - pcmFramesInCurrentMP3Frame = ma_dr_mp3_decode_next_frame_ex(pMP3, nullptr, nullptr, nullptr); + pcmFramesInCurrentMP3Frame = ma_dr_mp3_decode_next_frame_ex(pMP3, NULL, NULL, NULL); if (pcmFramesInCurrentMP3Frame == 0) { break; } @@ -95446,10 +95446,10 @@ MA_API ma_bool32 ma_dr_mp3_get_mp3_and_pcm_frame_count(ma_dr_mp3* pMP3, ma_uint6 if (!ma_dr_mp3_seek_to_pcm_frame(pMP3, currentPCMFrame)) { return MA_FALSE; } - if (pMP3FrameCount != nullptr) { + if (pMP3FrameCount != NULL) { *pMP3FrameCount = totalMP3FrameCount; } - if (pPCMFrameCount != nullptr) { + if (pPCMFrameCount != NULL) { *pPCMFrameCount = totalPCMFrameCount; } return MA_TRUE; @@ -95457,7 +95457,7 @@ MA_API ma_bool32 ma_dr_mp3_get_mp3_and_pcm_frame_count(ma_dr_mp3* pMP3, ma_uint6 MA_API ma_uint64 ma_dr_mp3_get_pcm_frame_count(ma_dr_mp3* pMP3) { ma_uint64 totalPCMFrameCount; - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return 0; } if (pMP3->totalPCMFrameCount != MA_UINT64_MAX) { @@ -95472,7 +95472,7 @@ MA_API ma_uint64 ma_dr_mp3_get_pcm_frame_count(ma_dr_mp3* pMP3) } return totalPCMFrameCount; } else { - if (!ma_dr_mp3_get_mp3_and_pcm_frame_count(pMP3, nullptr, &totalPCMFrameCount)) { + if (!ma_dr_mp3_get_mp3_and_pcm_frame_count(pMP3, NULL, &totalPCMFrameCount)) { return 0; } return totalPCMFrameCount; @@ -95481,7 +95481,7 @@ MA_API ma_uint64 ma_dr_mp3_get_pcm_frame_count(ma_dr_mp3* pMP3) MA_API ma_uint64 ma_dr_mp3_get_mp3_frame_count(ma_dr_mp3* pMP3) { ma_uint64 totalMP3FrameCount; - if (!ma_dr_mp3_get_mp3_and_pcm_frame_count(pMP3, &totalMP3FrameCount, nullptr)) { + if (!ma_dr_mp3_get_mp3_and_pcm_frame_count(pMP3, &totalMP3FrameCount, NULL)) { return 0; } return totalMP3FrameCount; @@ -95509,7 +95509,7 @@ MA_API ma_bool32 ma_dr_mp3_calculate_seek_points(ma_dr_mp3* pMP3, ma_uint32* pSe ma_uint64 currentPCMFrame; ma_uint64 totalMP3FrameCount; ma_uint64 totalPCMFrameCount; - if (pMP3 == nullptr || pSeekPointCount == nullptr || pSeekPoints == nullptr) { + if (pMP3 == NULL || pSeekPointCount == NULL || pSeekPoints == NULL) { return MA_FALSE; } seekPointCount = *pSeekPointCount; @@ -95546,7 +95546,7 @@ MA_API ma_bool32 ma_dr_mp3_calculate_seek_points(ma_dr_mp3* pMP3, ma_uint32* pSe MA_DR_MP3_ASSERT(pMP3->streamCursor >= pMP3->dataSize); mp3FrameInfo[iMP3Frame].bytePos = pMP3->streamCursor - pMP3->dataSize; mp3FrameInfo[iMP3Frame].pcmFrameIndex = runningPCMFrameCount; - pcmFramesInCurrentMP3FrameIn = ma_dr_mp3_decode_next_frame_ex(pMP3, nullptr, nullptr, nullptr); + pcmFramesInCurrentMP3FrameIn = ma_dr_mp3_decode_next_frame_ex(pMP3, NULL, NULL, NULL); if (pcmFramesInCurrentMP3FrameIn == 0) { return MA_FALSE; } @@ -95570,7 +95570,7 @@ MA_API ma_bool32 ma_dr_mp3_calculate_seek_points(ma_dr_mp3* pMP3, ma_uint32* pSe } mp3FrameInfo[MA_DR_MP3_COUNTOF(mp3FrameInfo)-1].bytePos = pMP3->streamCursor - pMP3->dataSize; mp3FrameInfo[MA_DR_MP3_COUNTOF(mp3FrameInfo)-1].pcmFrameIndex = runningPCMFrameCount; - pcmFramesInCurrentMP3FrameIn = ma_dr_mp3_decode_next_frame_ex(pMP3, nullptr, nullptr, nullptr); + pcmFramesInCurrentMP3FrameIn = ma_dr_mp3_decode_next_frame_ex(pMP3, NULL, NULL, NULL); if (pcmFramesInCurrentMP3FrameIn == 0) { pSeekPoints[iSeekPoint].seekPosInBytes = mp3FrameInfo[0].bytePos; pSeekPoints[iSeekPoint].pcmFrameIndex = nextTargetPCMFrame; @@ -95594,12 +95594,12 @@ MA_API ma_bool32 ma_dr_mp3_calculate_seek_points(ma_dr_mp3* pMP3, ma_uint32* pSe } MA_API ma_bool32 ma_dr_mp3_bind_seek_table(ma_dr_mp3* pMP3, ma_uint32 seekPointCount, ma_dr_mp3_seek_point* pSeekPoints) { - if (pMP3 == nullptr) { + if (pMP3 == NULL) { return MA_FALSE; } - if (seekPointCount == 0 || pSeekPoints == nullptr) { + if (seekPointCount == 0 || pSeekPoints == NULL) { pMP3->seekPointCount = 0; - pMP3->pSeekPoints = nullptr; + pMP3->pSeekPoints = NULL; } else { pMP3->seekPointCount = seekPointCount; pMP3->pSeekPoints = pSeekPoints; @@ -95610,9 +95610,9 @@ static float* ma_dr_mp3__full_read_and_close_f32(ma_dr_mp3* pMP3, ma_dr_mp3_conf { ma_uint64 totalFramesRead = 0; ma_uint64 framesCapacity = 0; - float* pFrames = nullptr; + float* pFrames = NULL; float temp[4096]; - MA_DR_MP3_ASSERT(pMP3 != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); for (;;) { ma_uint64 framesToReadRightNow = MA_DR_MP3_COUNTOF(temp) / pMP3->channels; ma_uint64 framesJustRead = ma_dr_mp3_read_pcm_frames_f32(pMP3, framesToReadRightNow, temp); @@ -95634,9 +95634,9 @@ static float* ma_dr_mp3__full_read_and_close_f32(ma_dr_mp3* pMP3, ma_dr_mp3_conf break; } pNewFrames = (float*)ma_dr_mp3__realloc_from_callbacks(pFrames, (size_t)newFramesBufferSize, (size_t)oldFramesBufferSize, &pMP3->allocationCallbacks); - if (pNewFrames == nullptr) { + if (pNewFrames == NULL) { ma_dr_mp3__free_from_callbacks(pFrames, &pMP3->allocationCallbacks); - pFrames = nullptr; + pFrames = NULL; totalFramesRead = 0; break; } @@ -95649,7 +95649,7 @@ static float* ma_dr_mp3__full_read_and_close_f32(ma_dr_mp3* pMP3, ma_dr_mp3_conf break; } } - if (pConfig != nullptr) { + if (pConfig != NULL) { pConfig->channels = pMP3->channels; pConfig->sampleRate = pMP3->sampleRate; } @@ -95663,9 +95663,9 @@ static ma_int16* ma_dr_mp3__full_read_and_close_s16(ma_dr_mp3* pMP3, ma_dr_mp3_c { ma_uint64 totalFramesRead = 0; ma_uint64 framesCapacity = 0; - ma_int16* pFrames = nullptr; + ma_int16* pFrames = NULL; ma_int16 temp[4096]; - MA_DR_MP3_ASSERT(pMP3 != nullptr); + MA_DR_MP3_ASSERT(pMP3 != NULL); for (;;) { ma_uint64 framesToReadRightNow = MA_DR_MP3_COUNTOF(temp) / pMP3->channels; ma_uint64 framesJustRead = ma_dr_mp3_read_pcm_frames_s16(pMP3, framesToReadRightNow, temp); @@ -95687,9 +95687,9 @@ static ma_int16* ma_dr_mp3__full_read_and_close_s16(ma_dr_mp3* pMP3, ma_dr_mp3_c break; } pNewFrames = (ma_int16*)ma_dr_mp3__realloc_from_callbacks(pFrames, (size_t)newFramesBufferSize, (size_t)oldFramesBufferSize, &pMP3->allocationCallbacks); - if (pNewFrames == nullptr) { + if (pNewFrames == NULL) { ma_dr_mp3__free_from_callbacks(pFrames, &pMP3->allocationCallbacks); - pFrames = nullptr; + pFrames = NULL; totalFramesRead = 0; break; } @@ -95702,7 +95702,7 @@ static ma_int16* ma_dr_mp3__full_read_and_close_s16(ma_dr_mp3* pMP3, ma_dr_mp3_c break; } } - if (pConfig != nullptr) { + if (pConfig != NULL) { pConfig->channels = pMP3->channels; pConfig->sampleRate = pMP3->sampleRate; } @@ -95715,16 +95715,16 @@ static ma_int16* ma_dr_mp3__full_read_and_close_s16(ma_dr_mp3* pMP3, ma_dr_mp3_c MA_API float* ma_dr_mp3_open_and_read_pcm_frames_f32(ma_dr_mp3_read_proc onRead, ma_dr_mp3_seek_proc onSeek, ma_dr_mp3_tell_proc onTell, void* pUserData, ma_dr_mp3_config* pConfig, ma_uint64* pTotalFrameCount, const ma_allocation_callbacks* pAllocationCallbacks) { ma_dr_mp3 mp3; - if (!ma_dr_mp3_init(&mp3, onRead, onSeek, onTell, nullptr, pUserData, pAllocationCallbacks)) { - return nullptr; + if (!ma_dr_mp3_init(&mp3, onRead, onSeek, onTell, NULL, pUserData, pAllocationCallbacks)) { + return NULL; } return ma_dr_mp3__full_read_and_close_f32(&mp3, pConfig, pTotalFrameCount); } MA_API ma_int16* ma_dr_mp3_open_and_read_pcm_frames_s16(ma_dr_mp3_read_proc onRead, ma_dr_mp3_seek_proc onSeek, ma_dr_mp3_tell_proc onTell, void* pUserData, ma_dr_mp3_config* pConfig, ma_uint64* pTotalFrameCount, const ma_allocation_callbacks* pAllocationCallbacks) { ma_dr_mp3 mp3; - if (!ma_dr_mp3_init(&mp3, onRead, onSeek, onTell, nullptr, pUserData, pAllocationCallbacks)) { - return nullptr; + if (!ma_dr_mp3_init(&mp3, onRead, onSeek, onTell, NULL, pUserData, pAllocationCallbacks)) { + return NULL; } return ma_dr_mp3__full_read_and_close_s16(&mp3, pConfig, pTotalFrameCount); } @@ -95732,7 +95732,7 @@ MA_API float* ma_dr_mp3_open_memory_and_read_pcm_frames_f32(const void* pData, s { ma_dr_mp3 mp3; if (!ma_dr_mp3_init_memory(&mp3, pData, dataSize, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_mp3__full_read_and_close_f32(&mp3, pConfig, pTotalFrameCount); } @@ -95740,7 +95740,7 @@ MA_API ma_int16* ma_dr_mp3_open_memory_and_read_pcm_frames_s16(const void* pData { ma_dr_mp3 mp3; if (!ma_dr_mp3_init_memory(&mp3, pData, dataSize, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_mp3__full_read_and_close_s16(&mp3, pConfig, pTotalFrameCount); } @@ -95749,7 +95749,7 @@ MA_API float* ma_dr_mp3_open_file_and_read_pcm_frames_f32(const char* filePath, { ma_dr_mp3 mp3; if (!ma_dr_mp3_init_file(&mp3, filePath, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_mp3__full_read_and_close_f32(&mp3, pConfig, pTotalFrameCount); } @@ -95757,25 +95757,25 @@ MA_API ma_int16* ma_dr_mp3_open_file_and_read_pcm_frames_s16(const char* filePat { ma_dr_mp3 mp3; if (!ma_dr_mp3_init_file(&mp3, filePath, pAllocationCallbacks)) { - return nullptr; + return NULL; } return ma_dr_mp3__full_read_and_close_s16(&mp3, pConfig, pTotalFrameCount); } #endif MA_API void* ma_dr_mp3_malloc(size_t sz, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks != nullptr) { + if (pAllocationCallbacks != NULL) { return ma_dr_mp3__malloc_from_callbacks(sz, pAllocationCallbacks); } else { - return ma_dr_mp3__malloc_default(sz, nullptr); + return ma_dr_mp3__malloc_default(sz, NULL); } } MA_API void ma_dr_mp3_free(void* p, const ma_allocation_callbacks* pAllocationCallbacks) { - if (pAllocationCallbacks != nullptr) { + if (pAllocationCallbacks != NULL) { ma_dr_mp3__free_from_callbacks(p, pAllocationCallbacks); } else { - ma_dr_mp3__free_default(p, nullptr); + ma_dr_mp3__free_default(p, NULL); } } #endif diff --git a/Minecraft.Client/Common/C4JMemoryPool.h b/Minecraft.Client/Common/C4JMemoryPool.h index 9e9b4db9..e1e795ec 100644 --- a/Minecraft.Client/Common/C4JMemoryPool.h +++ b/Minecraft.Client/Common/C4JMemoryPool.h @@ -36,8 +36,8 @@ public: m_sizeOfEachBlock = 0; m_numFreeBlocks = 0; m_numInitialized = 0; - m_memStart = nullptr; - m_memEnd = nullptr; + m_memStart = NULL; + m_memEnd = NULL; m_next = 0; } @@ -65,7 +65,7 @@ public: void DestroyPool() { delete[] m_memStart; - m_memStart = nullptr; + m_memStart = NULL; } uchar* AddrFromIndex(uint i) const @@ -89,7 +89,7 @@ public: *p = m_numInitialized + 1; m_numInitialized++; } - void* ret = nullptr; + void* ret = NULL; if ( m_numFreeBlocks > 0 ) { ret = (void*)m_next; @@ -100,7 +100,7 @@ public: } else { - m_next = nullptr; + m_next = NULL; } } // LeaveCriticalSection(&m_CS); @@ -115,7 +115,7 @@ public: return; } // EnterCriticalSection(&m_CS); - if (m_next != nullptr) + if (m_next != NULL) { (*(uint*)ptr) = IndexFromAddr( m_next ); m_next = (uchar*)ptr; diff --git a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp index b93debde..1e625098 100644 --- a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp +++ b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp @@ -289,9 +289,9 @@ bool CPlatformNetworkManagerStub::CanAcceptMoreConnections() { #ifdef _WINDOWS64 MinecraftServer* server = MinecraftServer::getInstance(); - if (server == nullptr) return true; + if (server == NULL) return true; PlayerList* list = server->getPlayerList(); - if (list == nullptr) return true; + if (list == NULL) return true; return static_cast(list->players.size()) < static_cast(list->getMaxPlayers()); #else return true; diff --git a/Minecraft.Client/Common/Network/SessionInfo.h b/Minecraft.Client/Common/Network/SessionInfo.h index 3d29581e..4e091c87 100644 --- a/Minecraft.Client/Common/Network/SessionInfo.h +++ b/Minecraft.Client/Common/Network/SessionInfo.h @@ -133,14 +133,14 @@ public: displayLabelViewableStartIndex = other.displayLabelViewableStartIndex; data = other.data; hasPartyMember = other.hasPartyMember; - if (other.displayLabel != nullptr) + if (other.displayLabel != NULL) { displayLabel = new wchar_t[displayLabelLength + 1]; wcscpy_s(displayLabel, displayLabelLength + 1, other.displayLabel); } else { - displayLabel = nullptr; + displayLabel = NULL; } } diff --git a/Minecraft.Client/Common/Network/Sony/SonyCommerce.cpp b/Minecraft.Client/Common/Network/Sony/SonyCommerce.cpp index 70e72cb5..8435cd56 100644 --- a/Minecraft.Client/Common/Network/Sony/SonyCommerce.cpp +++ b/Minecraft.Client/Common/Network/Sony/SonyCommerce.cpp @@ -9,22 +9,22 @@ bool SonyCommerce::m_bCommerceInitialised = false; SceNpCommerce2SessionInfo SonyCommerce::m_sessionInfo; SonyCommerce::State SonyCommerce::m_state = e_state_noSession; int SonyCommerce::m_errorCode = 0; -LPVOID SonyCommerce::m_callbackParam = nullptr; +LPVOID SonyCommerce::m_callbackParam = NULL; -void* SonyCommerce::m_receiveBuffer = nullptr; +void* SonyCommerce::m_receiveBuffer = NULL; SonyCommerce::Event SonyCommerce::m_event; std::queue SonyCommerce::m_messageQueue; -std::vector* SonyCommerce::m_pProductInfoList = nullptr; -SonyCommerce::ProductInfoDetailed* SonyCommerce::m_pProductInfoDetailed = nullptr; -SonyCommerce::ProductInfo* SonyCommerce::m_pProductInfo = nullptr; +std::vector* SonyCommerce::m_pProductInfoList = NULL; +SonyCommerce::ProductInfoDetailed* SonyCommerce::m_pProductInfoDetailed = NULL; +SonyCommerce::ProductInfo* SonyCommerce::m_pProductInfo = NULL; -SonyCommerce::CategoryInfo* SonyCommerce::m_pCategoryInfo = nullptr; -const char* SonyCommerce::m_pProductID = nullptr; -char* SonyCommerce::m_pCategoryID = nullptr; +SonyCommerce::CategoryInfo* SonyCommerce::m_pCategoryInfo = NULL; +const char* SonyCommerce::m_pProductID = NULL; +char* SonyCommerce::m_pCategoryID = NULL; SonyCommerce::CheckoutInputParams SonyCommerce::m_checkoutInputParams; SonyCommerce::DownloadListInputParams SonyCommerce::m_downloadInputParams; -SonyCommerce::CallbackFunc SonyCommerce::m_callbackFunc = nullptr; +SonyCommerce::CallbackFunc SonyCommerce::m_callbackFunc = NULL; sys_memory_container_t SonyCommerce::m_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID; bool SonyCommerce::m_bUpgradingTrial = false; @@ -40,19 +40,19 @@ bool SonyCommerce::m_contextCreated=false; ///< npcommerce2 context ID creat SonyCommerce::Phase SonyCommerce::m_currentPhase = e_phase_stopped; ///< Current commerce2 util char SonyCommerce::m_commercebuffer[SCE_NP_COMMERCE2_RECV_BUF_SIZE]; -C4JThread* SonyCommerce::m_tickThread = nullptr; +C4JThread* SonyCommerce::m_tickThread = NULL; bool SonyCommerce::m_bLicenseChecked=false; // Check the trial/full license for the game SonyCommerce::ProductInfoDetailed s_trialUpgradeProductInfoDetailed; void SonyCommerce::Delete() { - m_pProductInfoList=nullptr; - m_pProductInfoDetailed=nullptr; - m_pProductInfo=nullptr; - m_pCategoryInfo = nullptr; - m_pProductID = nullptr; - m_pCategoryID = nullptr; + m_pProductInfoList=NULL; + m_pProductInfoDetailed=NULL; + m_pProductInfo=NULL; + m_pCategoryInfo = NULL; + m_pProductID = NULL; + m_pCategoryID = NULL; } void SonyCommerce::Init() { @@ -103,7 +103,7 @@ bool SonyCommerce::LicenseChecked() void SonyCommerce::CheckForTrialUpgradeKey() { - StorageManager.CheckForTrialUpgradeKey(CheckForTrialUpgradeKey_Callback, nullptr); + StorageManager.CheckForTrialUpgradeKey(CheckForTrialUpgradeKey_Callback, NULL); } int SonyCommerce::Shutdown() @@ -490,7 +490,7 @@ int SonyCommerce::getDetailedProductInfo(ProductInfoDetailed *pInfo, const char if (categoryId && categoryId[0] != 0) { ret = sceNpCommerce2GetProductInfoStart(requestId, categoryId, productId); } else { - ret = sceNpCommerce2GetProductInfoStart(requestId, nullptr, productId); + ret = sceNpCommerce2GetProductInfoStart(requestId, NULL, productId); } if (ret < 0) { sceNpCommerce2DestroyReq(requestId); @@ -821,12 +821,12 @@ void SonyCommerce::UpgradeTrialCallback1(LPVOID lpParam,int err) if(s_trialUpgradeProductInfoDetailed.purchasabilityFlag == SCE_NP_COMMERCE2_SKU_PURCHASABILITY_FLAG_OFF) { app.DebugPrintf(4,"UpgradeTrialCallback1 - DownloadAlreadyPurchased\n"); - SonyCommerce::DownloadAlreadyPurchased( UpgradeTrialCallback2, nullptr, skuID); + SonyCommerce::DownloadAlreadyPurchased( UpgradeTrialCallback2, NULL, skuID); } else { app.DebugPrintf(4,"UpgradeTrialCallback1 - Checkout\n"); - SonyCommerce::Checkout( UpgradeTrialCallback2, nullptr, skuID); + SonyCommerce::Checkout( UpgradeTrialCallback2, NULL, skuID); } } else @@ -854,7 +854,7 @@ void SonyCommerce::UpgradeTrial(CallbackFunc cb, LPVOID lpParam) // static char szTrialUpgradeSkuID[64]; // sprintf(szTrialUpgradeSkuID, "%s-TRIALUPGRADE0001", app.GetCommerceCategory());//, szSKUSuffix); - GetDetailedProductInfo(UpgradeTrialCallback1, nullptr, &s_trialUpgradeProductInfoDetailed, app.GetUpgradeKey(), app.GetCommerceCategory()); + GetDetailedProductInfo(UpgradeTrialCallback1, NULL, &s_trialUpgradeProductInfoDetailed, app.GetUpgradeKey(), app.GetCommerceCategory()); } @@ -878,7 +878,7 @@ int SonyCommerce::createContext() } // Create commerce2 context - ret = sceNpCommerce2CreateCtx(SCE_NP_COMMERCE2_VERSION, &npId, commerce2Handler, nullptr, &m_contextId); + ret = sceNpCommerce2CreateCtx(SCE_NP_COMMERCE2_VERSION, &npId, commerce2Handler, NULL, &m_contextId); if (ret < 0) { app.DebugPrintf(4,"createContext sceNpCommerce2CreateCtx problem\n"); @@ -1316,7 +1316,7 @@ void SonyCommerce::processEvent() m_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID; // 4J-PB - if there's been an error - like dlc already purchased, the runcallback has already happened, and will crash this time - if(m_callbackFunc!=nullptr) + if(m_callbackFunc!=NULL) { runCallback(); } @@ -1336,7 +1336,7 @@ void SonyCommerce::processEvent() m_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID; // 4J-PB - if there's been an error - like dlc already purchased, the runcallback has already happened, and will crash this time - if(m_callbackFunc!=nullptr) + if(m_callbackFunc!=NULL) { runCallback(); } @@ -1389,8 +1389,8 @@ void SonyCommerce::CreateSession( CallbackFunc cb, LPVOID lpParam ) EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); m_messageQueue.push(e_message_commerceCreateSession); - if(m_tickThread == nullptr) - m_tickThread = new C4JThread(TickLoop, nullptr, "SonyCommerce tick"); + if(m_tickThread == NULL) + m_tickThread = new C4JThread(TickLoop, NULL, "SonyCommerce tick"); if(m_tickThread->isRunning() == false) { m_currentPhase = e_phase_idle; diff --git a/Minecraft.Client/Common/UI/UIControl.cpp b/Minecraft.Client/Common/UI/UIControl.cpp index 428e39ac..7582e82f 100644 --- a/Minecraft.Client/Common/UI/UIControl.cpp +++ b/Minecraft.Client/Common/UI/UIControl.cpp @@ -13,7 +13,7 @@ UIControl::UIControl() m_bHidden = false; m_eControlType = eNoControl; m_id = -1; - m_pParentPanel = nullptr; + m_pParentPanel = NULL; } bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName) diff --git a/Minecraft.Client/Common/UI/UIControl_TextInput.cpp b/Minecraft.Client/Common/UI/UIControl_TextInput.cpp index db0af9a3..8e679b7c 100644 --- a/Minecraft.Client/Common/UI/UIControl_TextInput.cpp +++ b/Minecraft.Client/Common/UI/UIControl_TextInput.cpp @@ -106,7 +106,7 @@ void UIControl_TextInput::setCaretVisible(bool visible) if (IggyValuePathMakeNameRef(&caretPath, getIggyValuePath(), "m_mcCaret")) { rrbool test = false; - IggyResult res = IggyValueGetBooleanRS(&caretPath, m_nameVisible, nullptr, &test); + IggyResult res = IggyValueGetBooleanRS(&caretPath, m_nameVisible, NULL, &test); m_bHasCaret = (res == 0); } else @@ -121,7 +121,7 @@ void UIControl_TextInput::setCaretVisible(bool visible) IggyValuePath caretPath; if (IggyValuePathMakeNameRef(&caretPath, getIggyValuePath(), "m_mcCaret")) { - IggyValueSetBooleanRS(&caretPath, m_nameVisible, nullptr, visible); + IggyValueSetBooleanRS(&caretPath, m_nameVisible, NULL, visible); } } diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 3b3bcfdf..c1f1bac5 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -913,7 +913,7 @@ void UIController::tickInput() { int hitControlId = -1; S32 hitArea = INT_MAX; - UIControl *hitCtrl = nullptr; + UIControl *hitCtrl = NULL; for (size_t i = 0; i < controls->size(); ++i) { UIControl *ctrl = (*controls)[i]; @@ -954,7 +954,7 @@ void UIController::tickInput() static_cast(sceneMouseX), static_cast(sceneMouseY), false); hitControlId = -1; hitArea = INT_MAX; - hitCtrl = nullptr; + hitCtrl = NULL; break; // ButtonList takes priority } if (type == UIControl::eTexturePackList) @@ -967,7 +967,7 @@ void UIController::tickInput() m_bMouseHoverHorizontalList = true; hitControlId = -1; hitArea = INT_MAX; - hitCtrl = nullptr; + hitCtrl = NULL; break; } S32 area = cw * ch; diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index d7bda6d1..303897a7 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -544,7 +544,7 @@ bool UIScene::handleMouseClick(F32 x, F32 y) // overlapping Flash bounds correctly without sacrificing precision. int bestId = -1; S32 bestArea = INT_MAX; - UIControl *bestCtrl = nullptr; + UIControl *bestCtrl = NULL; for (size_t i = 0; i < controls->size(); ++i) { diff --git a/Minecraft.Client/Common/UI/UIScene.h b/Minecraft.Client/Common/UI/UIScene.h index 0d795264..ca089d39 100644 --- a/Minecraft.Client/Common/UI/UIScene.h +++ b/Minecraft.Client/Common/UI/UIScene.h @@ -18,7 +18,7 @@ class UILayer; { \ parentClass::mapElementsAndNames(); \ IggyValuePath *currentRoot = IggyPlayerRootPath ( getMovie() ); \ - UIControl *_mapPanel = nullptr; + UIControl *_mapPanel = NULL; #define UI_END_MAP_ELEMENTS_AND_NAMES() \ return true; \ diff --git a/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp b/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp index 779aa10c..d698b51f 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp @@ -52,7 +52,7 @@ UIControl_TextInput* UIScene_DebugCreateSchematic::getTextInputForControl(eContr case eControl_EndX: return &m_textInputEndX; case eControl_EndY: return &m_textInputEndY; case eControl_EndZ: return &m_textInputEndZ; - default: return nullptr; + default: return NULL; } } diff --git a/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp b/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp index e8c8a9b9..51eab5aa 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp @@ -73,7 +73,7 @@ UIControl_TextInput* UIScene_DebugSetCamera::getTextInputForControl(eControls ct case eControl_CamZ: return &m_textInputZ; case eControl_YRot: return &m_textInputYRot; case eControl_Elevation: return &m_textInputElevation; - default: return nullptr; + default: return NULL; } } diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index 68329be8..d7ad789a 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -1975,7 +1975,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() vector* newSessions = g_NetworkManager.GetSessionList( m_iPad, 1, m_bShowingPartyGamesOnly ); - if (m_currentSessions != nullptr && m_currentSessions->size() == newSessions->size()) + if (m_currentSessions != NULL && m_currentSessions->size() == newSessions->size()) { bool same = true; for (size_t i = 0; i < newSessions->size(); i++) diff --git a/Minecraft.Client/Common/XUI/SlotProgressControl.cpp b/Minecraft.Client/Common/XUI/SlotProgressControl.cpp index 7b376148..91f362a3 100644 --- a/Minecraft.Client/Common/XUI/SlotProgressControl.cpp +++ b/Minecraft.Client/Common/XUI/SlotProgressControl.cpp @@ -17,13 +17,13 @@ int SlotProgressControl::GetValue() void* pvUserData; XuiElementGetUserData( hParent, &pvUserData ); - if( pvUserData != nullptr ) + if( pvUserData != NULL ) { SlotControlUserDataContainer* pUserDataContainer = (SlotControlUserDataContainer*)pvUserData; shared_ptr item = shared_ptr(); - if( pUserDataContainer->slot != nullptr ) + if( pUserDataContainer->slot != NULL ) { item = pUserDataContainer->slot->getItem(); } @@ -32,7 +32,7 @@ int SlotProgressControl::GetValue() item = pUserDataContainer->item; } - if( item != nullptr ) + if( item != NULL ) { // TODO Should use getDamage instead even though it returns the same value if( item->isDamaged() ) @@ -65,13 +65,13 @@ void SlotProgressControl::GetRange(int *pnRangeMin, int *pnRangeMax) void* pvUserData; XuiElementGetUserData( hParent, &pvUserData ); - if( pvUserData != nullptr ) + if( pvUserData != NULL ) { SlotControlUserDataContainer* pUserDataContainer = (SlotControlUserDataContainer*)pvUserData; shared_ptr item = shared_ptr(); - if( pUserDataContainer->slot != nullptr ) + if( pUserDataContainer->slot != NULL ) { item = pUserDataContainer->slot->getItem(); } @@ -80,7 +80,7 @@ void SlotProgressControl::GetRange(int *pnRangeMin, int *pnRangeMax) item = pUserDataContainer->item; } - if( item != nullptr ) + if( item != NULL ) { *pnRangeMax = item->getMaxDamage(); } diff --git a/Minecraft.Client/Common/XUI/XUI_Control_ComboBox.cpp b/Minecraft.Client/Common/XUI/XUI_Control_ComboBox.cpp index 2935e8c5..0096da44 100644 --- a/Minecraft.Client/Common/XUI/XUI_Control_ComboBox.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Control_ComboBox.cpp @@ -5,7 +5,7 @@ HRESULT CXuiControl4JComboBox::OnInit(XUIMessageInit *pInitData, BOOL& bHandled) { m_ListData.nItems=0; - m_ListData.pItems=nullptr; + m_ListData.pItems=NULL; return S_OK; } @@ -25,7 +25,7 @@ void CXuiControl4JComboBox::SetData(LIST_ITEM_INFO *pItems,int iCount) int CXuiControl4JComboBox::GetSelectedIndex() { - return XuiListGetCurSel(GetListObject(),nullptr); + return XuiListGetCurSel(GetListObject(),NULL); } // Gets called every frame @@ -55,7 +55,7 @@ HRESULT CXuiControl4JComboBox::OnGetSourceDataImage(XUIMessageGetSourceImage *pG //{ // // Check for a brush - // if(m_ListData.pItems[pGetSourceImageData->iItem].hXuiBrush!=nullptr) + // if(m_ListData.pItems[pGetSourceImageData->iItem].hXuiBrush!=NULL) // { // pGetSourceImageData->hBrush=m_ListData.pItems[pGetSourceImageData->iItem].hXuiBrush; // } @@ -71,7 +71,7 @@ HRESULT CXuiControl4JComboBox::OnGetSourceDataImage(XUIMessageGetSourceImage *pG HRESULT CXuiControl4JComboBox::OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableData,BOOL& bHandled) { - if(m_ListData.pItems!=nullptr && m_ListData.nItems!=0) + if(m_ListData.pItems!=NULL && m_ListData.nItems!=0) { pGetItemEnableData->bEnabled = m_ListData.pItems[pGetItemEnableData->iItem].fEnabled; diff --git a/Minecraft.Client/Common/zlib/zlib.h b/Minecraft.Client/Common/zlib/zlib.h index c8dea9e9..0a9e7909 100644 --- a/Minecraft.Client/Common/zlib/zlib.h +++ b/Minecraft.Client/Common/zlib/zlib.h @@ -96,7 +96,7 @@ typedef struct z_stream_s { uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total number of bytes output so far */ - z_const char *msg; /* last error message, nullptr if no error */ + z_const char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ @@ -1388,13 +1388,13 @@ ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode); reading, this will be detected automatically by looking for the magic two- byte gzip header. - gzopen returns nullptr if the file could not be opened, if there was + gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). errno can be checked to determine if the reason gzopen failed was that the file could not be opened. Note that if 'N' is in mode for non-blocking, the open() itself can fail in order to not block. In that case gzopen() will - return nullptr and errno will be EAGAIN or ENONBLOCK. The call to gzopen() can + return NULL and errno will be EAGAIN or ENONBLOCK. The call to gzopen() can then be re-tried. If the application would like to block on opening the file, then it can use open() without O_NONBLOCK, and then gzdopen() with the resulting file descriptor and 'N' in the mode, which will set it to non- @@ -1419,7 +1419,7 @@ ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode); close the associated file descriptor, so they need to have different file descriptors. - gzdopen returns nullptr if there was insufficient memory to allocate the + gzdopen returns NULL if there was insufficient memory to allocate the gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided), or if fd is -1. The file descriptor is not used until the next gz* read, write, seek, or close operation, so gzdopen @@ -1594,10 +1594,10 @@ ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len); are read due to an end-of-file or len is less than one, then the buffer is left untouched. - gzgets returns buf which is a null-terminated string, or it returns nullptr + gzgets returns buf which is a null-terminated string, or it returns NULL for end-of-file or in case of error. If some data was read before an error, then that data is returned until exhausted, after which the next call will - return nullptr to signal the error. + return NULL to signal the error. gzgets can be used on a file being concurrently written, and on a non- blocking device, both as for gzread(). However lines may be broken in the @@ -1619,7 +1619,7 @@ ZEXTERN int ZEXPORT gzgetc(gzFile file); This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file - is nullptr, nor whether the structure file points to has been clobbered or not. + is NULL, nor whether the structure file points to has been clobbered or not. gzgetc can be used to read a gzip file on a non-blocking device. If the input stalls and there is no uncompressed data to return, then gzgetc() will @@ -1775,7 +1775,7 @@ ZEXTERN int ZEXPORT gzclose_w(gzFile file); ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum); /* Return the error message for the last error which occurred on file. - If errnum is not nullptr, *errnum is set to zlib error number. If an error + If errnum is not NULL, *errnum is set to zlib error number. If an error occurred in the file system and not in the compression library, *errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. diff --git a/Minecraft.Client/CreativeMode.cpp b/Minecraft.Client/CreativeMode.cpp index cf09cba9..48342ebc 100644 --- a/Minecraft.Client/CreativeMode.cpp +++ b/Minecraft.Client/CreativeMode.cpp @@ -41,7 +41,7 @@ void CreativeMode::adjustPlayer(shared_ptr player) for (int i = 0; i < 9; i++) { - if (player->inventory->items[i] == nullptr) + if (player->inventory->items[i] == NULL) { player->inventory->items[i] = shared_ptr( new ItemInstance(User::allowedTiles[i]) ); } @@ -68,7 +68,7 @@ bool CreativeMode::useItemOn(shared_ptr player, Level *level, shared_ptr { if (Tile::tiles[t]->use(level, x, y, z, player)) return true; } - if (item == nullptr) return false; + if (item == NULL) return false; int aux = item->getAuxValue(); int count = item->count; bool success = item->useOn(player, level, x, y, z, face); diff --git a/Minecraft.Client/CreativeMode.h b/Minecraft.Client/CreativeMode.h index 87c04b7e..10b27a53 100644 --- a/Minecraft.Client/CreativeMode.h +++ b/Minecraft.Client/CreativeMode.h @@ -13,7 +13,7 @@ public: static void disableCreativeForPlayer(shared_ptr player); virtual void adjustPlayer(shared_ptr player); static void creativeDestroyBlock(Minecraft *minecraft, GameMode *gameMode, int x, int y, int z, int face); - virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem = nullptr); + virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem = NULL); virtual void startDestroyBlock(int x, int y, int z, int face); virtual void continueDestroyBlock(int x, int y, int z, int face); virtual void stopDestroyBlock(); diff --git a/Minecraft.Client/GameMode.cpp b/Minecraft.Client/GameMode.cpp index 7650c2e6..a11d6c07 100644 --- a/Minecraft.Client/GameMode.cpp +++ b/Minecraft.Client/GameMode.cpp @@ -24,7 +24,7 @@ bool GameMode::destroyBlock(int x, int y, int z, int face) { Level *level = minecraft->level; Tile *oldTile = Tile::tiles[level->getTile(x, y, z)]; - if (oldTile == nullptr) return false; + if (oldTile == NULL) return false; // 4J - Let the rendering side of thing know we are about to destroy the tile, so we can synchronise collision with async render data upates. minecraft->levelRenderer->destroyedTileManager->destroyingTileAt(level, x, y, z); @@ -35,7 +35,7 @@ bool GameMode::destroyBlock(int x, int y, int z, int face) level->getChunkAt(x,z)->recalcHeightmapOnly(); bool changed = level->setTile(x, y, z, 0); - if (oldTile != nullptr && changed) + if (oldTile != NULL && changed) { oldTile->destroy(level, x, y, z, data); } @@ -95,7 +95,7 @@ void GameMode::adjustPlayer(shared_ptr player) // } // } // -// if (item == nullptr) return false; +// if (item == NULL) return false; // return item->useOn(player, level, x, y, z, face, bTestUseOnOnly); //} diff --git a/Minecraft.Client/GameMode.h b/Minecraft.Client/GameMode.h index 6a120f02..ab9ec9d1 100644 --- a/Minecraft.Client/GameMode.h +++ b/Minecraft.Client/GameMode.h @@ -30,7 +30,7 @@ public: virtual bool canHurtPlayer() = 0; virtual void adjustPlayer(shared_ptr player); virtual bool useItem(shared_ptr player, Level *level, shared_ptr item, bool bTestUseOnly=false); - virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem = nullptr) = 0; + virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem = NULL) = 0; virtual shared_ptr createPlayer(Level *level); virtual bool interact(shared_ptr player, shared_ptr entity); @@ -55,5 +55,5 @@ public: // 4J Stu - Added for tutorial checks virtual bool isInputAllowed(int mapping) { return true; } virtual bool isTutorial() { return false; } - virtual Tutorial *getTutorial() { return nullptr; } + virtual Tutorial *getTutorial() { return NULL; } }; diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 2833127c..f0d44319 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -247,8 +247,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) shared_ptr headGear = minecraft->player->inventory->getArmor(3); // 4J-PB - changing this to be per player - //if (!minecraft->options->thirdPersonView && headGear != nullptr && headGear->id == Tile::pumpkin_Id) renderPumpkin(screenWidth, screenHeight); - if ((minecraft->player->ThirdPersonView()==0) && headGear != nullptr && headGear->id == Tile::pumpkin_Id) renderPumpkin(screenWidth, screenHeight); + //if (!minecraft->options->thirdPersonView && headGear != NULL && headGear->id == Tile::pumpkin_Id) renderPumpkin(screenWidth, screenHeight); + if ((minecraft->player->ThirdPersonView()==0) && headGear != NULL && headGear->id == Tile::pumpkin_Id) renderPumpkin(screenWidth, screenHeight); if (!minecraft->player->hasEffect(MobEffect::confusion)) { float pt = minecraft->player->oPortalTime + (minecraft->player->portalTime - minecraft->player->oPortalTime) * a; @@ -533,7 +533,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) std::shared_ptr riding = minecraft->localplayers[iPad].get()->riding; std::shared_ptr living = dynamic_pointer_cast(riding); - if (riding == nullptr) + if (riding == NULL) { // render food for (int i = 0; i < FoodConstants::MAX_FOOD / 2; i++) @@ -893,7 +893,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) unsigned int max = 10; bool isChatting = false; - if (dynamic_cast(minecraft->screen) != nullptr) + if (dynamic_cast(minecraft->screen) != NULL) { max = 20; isChatting = true; @@ -1115,10 +1115,10 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) const wchar_t* cardinals[] = { L"south", L"west", L"north", L"east" }; lines.push_back(L"Facing: " + std::wstring(cardinals[direction]) + L" (" + angleString + L")"); - if (minecraft->level != nullptr && minecraft->level->hasChunkAt(xBlockPos, fmod(yBlockPos, 256), zBlockPos)) + if (minecraft->level != NULL && minecraft->level->hasChunkAt(xBlockPos, fmod(yBlockPos, 256), zBlockPos)) { LevelChunk *chunkAt = minecraft->level->getChunkAt(xBlockPos, zBlockPos); - if (chunkAt != nullptr) + if (chunkAt != NULL) { int skyLight = chunkAt->getBrightness(LightLayer::Sky, xChunkOffset, yChunkOffset, zChunkOffset); int blockLight = chunkAt->getBrightness(LightLayer::Block, xChunkOffset, yChunkOffset, zChunkOffset); @@ -1199,10 +1199,10 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) // Moved to the xui base scene // void Gui::renderBossHealth(void) // { -// if (EnderDragonRenderer::bossInstance == nullptr) return; +// if (EnderDragonRenderer::bossInstance == NULL) return; // // shared_ptr boss = EnderDragonRenderer::bossInstance; -// EnderDragonRenderer::bossInstance = nullptr; +// EnderDragonRenderer::bossInstance = NULL; // // Minecraft *pMinecraft=Minecraft::GetInstance(); // @@ -1323,7 +1323,7 @@ void Gui::renderTp(float br, int w, int h) void Gui::renderSlot(int slot, int x, int y, float a) { shared_ptr item = minecraft->player->inventory->items[slot]; - if (item == nullptr) return; + if (item == NULL) return; float pop = item->popTime - a; if (pop > 0) @@ -1569,7 +1569,7 @@ void Gui::renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataASc int height = minecraft->height; // This causes us to cover xScale*dataLength pixels in the horizontal int xScale = 1; - if(dataA != nullptr && dataB != nullptr) xScale = 2; + if(dataA != NULL && dataB != NULL) xScale = 2; glClear(GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); @@ -1592,7 +1592,7 @@ void Gui::renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataASc int cc2 = cc * cc / 255; cc2 = cc2 * cc2 / 255; - if( dataA != nullptr ) + if( dataA != NULL ) { if (dataA[i] > dataAWarning) { @@ -1609,7 +1609,7 @@ void Gui::renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataASc t->vertex((float)(xScale*i + 0.5f), (float)( height + 0.5f), static_cast(0)); } - if( dataB != nullptr ) + if( dataB != NULL ) { if (dataB[i]>dataBWarning) { diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 1c7f4623..1ba432fd 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -4680,7 +4680,7 @@ void Minecraft::startAndConnectTo(const wstring& name, const wstring& sid, const */ Minecraft *minecraft; - // 4J - was new Minecraft(frame, canvas, nullptr, 854, 480, fullScreen); + // 4J - was new Minecraft(frame, canvas, NULL, 854, 480, fullScreen); // Logical width is proportional to the real screen aspect ratio so that // the ortho projection and HUD layout match the viewport without stretching. extern int g_iScreenWidth; diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index 43971e2b..1e3ed74e 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -2398,7 +2398,7 @@ bool MinecraftServer::chunkPacketManagement_CanSendTo(INetworkPlayer *player) if( currentPlayerCount == 0 ) return false; int index = s_slowQueuePlayerIndex % (int)currentPlayerCount; INetworkPlayer *queuePlayer = g_NetworkManager.GetPlayerByIndex( index ); - if( queuePlayer != nullptr && (player == queuePlayer || player->IsSameSystem(queuePlayer)) && (time - s_slowQueueLastTime) > MINECRAFT_SERVER_SLOW_QUEUE_DELAY ) + if( queuePlayer != NULL && (player == queuePlayer || player->IsSameSystem(queuePlayer)) && (time - s_slowQueueLastTime) > MINECRAFT_SERVER_SLOW_QUEUE_DELAY ) { return true; } diff --git a/Minecraft.Client/PlayerConnection.cpp b/Minecraft.Client/PlayerConnection.cpp index c6dacea8..6319b660 100644 --- a/Minecraft.Client/PlayerConnection.cpp +++ b/Minecraft.Client/PlayerConnection.cpp @@ -86,7 +86,7 @@ PlayerConnection::PlayerConnection(MinecraftServer *server, Connection *connecti m_logSmallId = 0; // Cache the first valid transport smallId because disconnect teardown can clear it before the server logger runs. - if (this->connection != nullptr && this->connection->getSocket() != nullptr) + if (this->connection != NULL && this->connection->getSocket() != NULL) { m_logSmallId = this->connection->getSocket()->getSmallId(); } @@ -103,7 +103,7 @@ PlayerConnection::~PlayerConnection() unsigned char PlayerConnection::getLogSmallId() { // Fall back to the live socket only while the cached value is still empty. - if (m_logSmallId == 0 && connection != nullptr && connection->getSocket() != nullptr) + if (m_logSmallId == 0 && connection != NULL && connection->getSocket() != NULL) { m_logSmallId = connection->getSocket()->getSmallId(); } @@ -156,7 +156,7 @@ void PlayerConnection::disconnect(DisconnectPacket::eDisconnectReason reason) #if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD) ServerRuntime::ServerLogManager::OnPlayerDisconnected( getLogSmallId(), - (player != nullptr) ? player->name : std::wstring(), + (player != NULL) ? player->name : std::wstring(), reason, true); #endif @@ -591,7 +591,7 @@ void PlayerConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason, #if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD) ServerRuntime::ServerLogManager::OnPlayerDisconnected( getLogSmallId(), - (player != nullptr) ? player->name : std::wstring(), + (player != NULL) ? player->name : std::wstring(), reason, false); #endif diff --git a/Minecraft.Client/ServerConnection.cpp b/Minecraft.Client/ServerConnection.cpp index 26257e19..0f96e032 100644 --- a/Minecraft.Client/ServerConnection.cpp +++ b/Minecraft.Client/ServerConnection.cpp @@ -54,7 +54,7 @@ void ServerConnection::stop() for (unsigned int i = 0; i < pendingSnapshot.size(); i++) { shared_ptr uc = pendingSnapshot[i]; - if (uc != nullptr && !uc->done) + if (uc != NULL && !uc->done) { uc->disconnect(DisconnectPacket::eDisconnect_Closed); } @@ -65,7 +65,7 @@ void ServerConnection::stop() for (unsigned int i = 0; i < playerSnapshot.size(); i++) { shared_ptr player = playerSnapshot[i]; - if (player != nullptr && !player->done) + if (player != NULL && !player->done) { player->disconnect(DisconnectPacket::eDisconnect_Quitting); } diff --git a/Minecraft.Client/SurvivalMode.cpp b/Minecraft.Client/SurvivalMode.cpp index 465bef88..27a992df 100644 --- a/Minecraft.Client/SurvivalMode.cpp +++ b/Minecraft.Client/SurvivalMode.cpp @@ -22,7 +22,7 @@ SurvivalMode::SurvivalMode(Minecraft *minecraft) : GameMode(minecraft) if (ClientConstants::IS_DEMO_VERSION) { - if( dynamic_cast(this) == nullptr ) + if( dynamic_cast(this) == NULL ) { assert(false); // throw new IllegalStateException("Invalid game mode"); // 4J - removed @@ -65,7 +65,7 @@ bool SurvivalMode::destroyBlock(int x, int y, int z, int face) shared_ptr item = minecraft->player->getSelectedItem(); bool couldDestroy = minecraft->player->canDestroy(Tile::tiles[t]); - if (item != nullptr) + if (item != NULL) { item->mineBlock(t, x, y, z, minecraft->player); if (item->count == 0) @@ -117,7 +117,7 @@ void SurvivalMode::continueDestroyBlock(int x, int y, int z, int face) if (destroyTicks % 4 == 0) { - if (tile != nullptr) + if (tile != NULL) { minecraft->soundEngine->play(tile->soundType->getStepSound(), x + 0.5f, y + 0.5f, z + 0.5f, (tile->soundType->getVolume() + 1) / 8, tile->soundType->getPitch() * 0.5f); } @@ -196,7 +196,7 @@ bool SurvivalMode::useItemOn(shared_ptr player, Level *level, shared_ptr { if (Tile::tiles[t]->use(level, x, y, z, player)) return true; } - if (item == nullptr) return false; + if (item == NULL) return false; return item->useOn(player, level, x, y, z, face); } diff --git a/Minecraft.Client/SurvivalMode.h b/Minecraft.Client/SurvivalMode.h index 7f6aec15..b4ce5e6d 100644 --- a/Minecraft.Client/SurvivalMode.h +++ b/Minecraft.Client/SurvivalMode.h @@ -27,6 +27,6 @@ public: virtual void initLevel(Level *level); virtual shared_ptr createPlayer(Level *level); virtual void tick(); - virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem=nullptr); + virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem=NULL); virtual bool hasExperience(); }; \ No newline at end of file diff --git a/Minecraft.Client/Textures.cpp b/Minecraft.Client/Textures.cpp index dcfce17e..ba7c0282 100644 --- a/Minecraft.Client/Textures.cpp +++ b/Minecraft.Client/Textures.cpp @@ -1001,8 +1001,8 @@ void Textures::releaseTexture(int id) loadedImages.erase(id); // TextureFree() has no bounds check and crashes on stale IDs (e.g. after // RenderManager.Initialise() which memsets the texture table to zero). - // TextureGetTexture() IS safe — returns nullptr for invalid/unallocated IDs. - if (RenderManager.TextureGetTexture(id) != nullptr) + // TextureGetTexture() IS safe — returns NULL for invalid/unallocated IDs. + if (RenderManager.TextureGetTexture(id) != NULL) { glDeleteTextures(id); } diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d.cpp b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d.cpp index 30c4cf44..50dabfc3 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d.cpp +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d.cpp @@ -189,9 +189,9 @@ static U16 quad_ib[QUAD_IB_COUNT*6]; static void report_d3d_error(HRESULT hr, char *call, char *context) { if (hr == E_OUTOFMEMORY) - IggyGDrawSendWarning(nullptr, "GDraw D3D out of memory in %s%s", call, context); + IggyGDrawSendWarning(NULL, "GDraw D3D out of memory in %s%s", call, context); else - IggyGDrawSendWarning(nullptr, "GDraw D3D error in %s%s: 0x%08x", call, context, hr); + IggyGDrawSendWarning(NULL, "GDraw D3D error in %s%s: 0x%08x", call, context, hr); } @@ -205,7 +205,7 @@ static void safe_release(T *&p) { if (p) { p->Release(); - p = nullptr; + p = NULL; } } @@ -217,10 +217,10 @@ static void unbind_resources(void) // unset active textures and vertex/index buffers, // to make sure there are no dangling refs for (i=0; i < 3; ++i) - d3d->SetTexture(i, nullptr); + d3d->SetTexture(i, NULL); - d3d->SetStreamSource(0, nullptr, 0, 0); - d3d->SetIndices(nullptr); + d3d->SetStreamSource(0, NULL, 0, 0); + d3d->SetIndices(NULL); } static void api_free_resource(GDrawHandle *r) @@ -254,7 +254,7 @@ extern GDrawTexture *gdraw_D3D_WrappedTextureCreate(IDirect3DTexture9 *texhandle p->handle.tex.d3d = texhandle; p->handle.tex.w = 1; p->handle.tex.h = 1; - gdraw_HandleCacheAllocateEnd(p, 0, nullptr, GDRAW_HANDLE_STATE_user_owned); + gdraw_HandleCacheAllocateEnd(p, 0, NULL, GDRAW_HANDLE_STATE_user_owned); return (GDrawTexture *) p; } @@ -282,7 +282,7 @@ static void RADLINK gdraw_SetTextureUniqueID(GDrawTexture *tex, void *old_id, vo static rrbool RADLINK gdraw_MakeTextureBegin(void *owner, S32 width, S32 height, gdraw_texture_format format, U32 flags, GDraw_MakeTexture_ProcessingInfo *p, GDrawStats *stats) { - GDrawHandle *t = nullptr; + GDrawHandle *t = NULL; D3DFORMAT d3dfmt; S32 bpp; @@ -302,14 +302,14 @@ static rrbool RADLINK gdraw_MakeTextureBegin(void *owner, S32 width, S32 height, // allocate a handle and make room in the cache for this much data t = gdraw_res_alloc_begin(gdraw->texturecache, size, stats); if (!t) - return nullptr; + return NULL; HRESULT hr = gdraw->d3d_device->CreateTexture(width, height, (flags & GDRAW_MAKETEXTURE_FLAGS_mipmap) ? 0 : 1, - 0, d3dfmt, D3DPOOL_MANAGED, &t->handle.tex.d3d, nullptr); + 0, d3dfmt, D3DPOOL_MANAGED, &t->handle.tex.d3d, NULL); if (FAILED(hr)) { gdraw_HandleCacheAllocateFail(t); - IggyGDrawSendWarning(nullptr, "GDraw CreateTexture() call failed with error code 0x%08x", hr); + IggyGDrawSendWarning(NULL, "GDraw CreateTexture() call failed with error code 0x%08x", hr); return false; } @@ -326,7 +326,7 @@ static rrbool RADLINK gdraw_MakeTextureBegin(void *owner, S32 width, S32 height, if (flags & GDRAW_MAKETEXTURE_FLAGS_mipmap) { rrbool ok; - assert(p->temp_buffer != nullptr); + assert(p->temp_buffer != NULL); ok = gdraw_MipmapBegin(&gdraw->mipmap, width, height, t->handle.tex.d3d->GetLevelCount(), bpp, p->temp_buffer, p->temp_buffer_bytes); assert(ok); // this should never trigger unless the temp_buffer is way too small @@ -338,21 +338,21 @@ static rrbool RADLINK gdraw_MakeTextureBegin(void *owner, S32 width, S32 height, p->i1 = bpp; } else { D3DLOCKED_RECT z; - hr = t->handle.tex.d3d->LockRect(0, &z, nullptr, 0); + hr = t->handle.tex.d3d->LockRect(0, &z, NULL, 0); if (FAILED(hr)) { t->handle.tex.d3d->Release(); gdraw_HandleCacheAllocateFail(t); if (hr == E_OUTOFMEMORY) { - IggyGDrawSendWarning(nullptr, "GDraw out of texture memory allocating %dx%d (%dbpp) texture", width, height, 8*bpp); + IggyGDrawSendWarning(NULL, "GDraw out of texture memory allocating %dx%d (%dbpp) texture", width, height, 8*bpp); return false; } else { - IggyGDrawSendWarning(nullptr, "GDraw LockRect for texture allocation failed, D3D error 0x%08x\n", hr); + IggyGDrawSendWarning(NULL, "GDraw LockRect for texture allocation failed, D3D error 0x%08x\n", hr); return false; } } - p->p1 = nullptr; + p->p1 = NULL; p->texture_data = (U8 *) z.pBits; p->num_rows = height; p->stride_in_bytes = z.Pitch; @@ -380,7 +380,7 @@ static rrbool RADLINK gdraw_MakeTextureMore(GDraw_MakeTexture_ProcessingInfo *p) do { // upload data for this miplevel D3DLOCKED_RECT z; - HRESULT hr = t->handle.tex.d3d->LockRect(level, &z, nullptr, 0); + HRESULT hr = t->handle.tex.d3d->LockRect(level, &z, NULL, 0); if (FAILED(hr)) return false; @@ -447,8 +447,8 @@ static void RADLINK gdraw_UpdateTextureEnd(GDrawTexture *t, void * /*unique_id*/ static void RADLINK gdraw_FreeTexture(GDrawTexture *tt, void *unique_id, GDrawStats *stats) { GDrawHandle *t = (GDrawHandle *) tt; - assert(t != nullptr); // @GDRAW_ASSERT - if (t->owner == unique_id || unique_id == nullptr) { + assert(t != NULL); // @GDRAW_ASSERT + if (t->owner == unique_id || unique_id == NULL) { if (t->cache == &gdraw->rendertargets) { gdraw_HandleCacheUnlock(t); // cache it by simply not freeing it @@ -481,13 +481,13 @@ static void RADLINK gdraw_SetAntialiasTexture(S32 width, U8 *rgba) safe_release(gdraw->aa_tex); // release the old texture, if any. - hr = gdraw->d3d_device->CreateTexture(width, 1, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &gdraw->aa_tex, nullptr); + hr = gdraw->d3d_device->CreateTexture(width, 1, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &gdraw->aa_tex, NULL); if (FAILED(hr)) { IggyGDrawSendWarning(0, "GDraw D3D error in CreateTexture 0x%08x", hr); return; } - hr = gdraw->aa_tex->LockRect(0, &lr, nullptr, 0); + hr = gdraw->aa_tex->LockRect(0, &lr, NULL, 0); if (!FAILED(hr)) { d = (U8 *) lr.pBits; for (i=0; i < width; i++) { @@ -514,14 +514,14 @@ static rrbool RADLINK gdraw_MakeVertexBufferBegin(void *unique_id, gdraw_vformat if (!vb) return false; - vb->handle.vbuf.base = nullptr; - vb->handle.vbuf.indices = nullptr; + vb->handle.vbuf.base = NULL; + vb->handle.vbuf.indices = NULL; HRESULT hr; - hr = gdraw->d3d_device->CreateVertexBuffer(vbuf_size, D3DUSAGE_WRITEONLY, 0, D3DPOOL_MANAGED, &vb->handle.vbuf.base, nullptr); + hr = gdraw->d3d_device->CreateVertexBuffer(vbuf_size, D3DUSAGE_WRITEONLY, 0, D3DPOOL_MANAGED, &vb->handle.vbuf.base, NULL); failed_call = "CreateVertexBuffer"; if (!FAILED(hr)) { - hr = gdraw->d3d_device->CreateIndexBuffer(ibuf_size, D3DUSAGE_WRITEONLY, D3DFMT_INDEX16, D3DPOOL_MANAGED, &vb->handle.vbuf.indices, nullptr); + hr = gdraw->d3d_device->CreateIndexBuffer(ibuf_size, D3DUSAGE_WRITEONLY, D3DFMT_INDEX16, D3DPOOL_MANAGED, &vb->handle.vbuf.indices, NULL); failed_call = "CreateIndexBuffer"; } if (!FAILED(hr)) { @@ -574,7 +574,7 @@ static rrbool RADLINK gdraw_TryLockVertexBuffer(GDrawVertexBuffer *vb, void *uni static void RADLINK gdraw_FreeVertexBuffer(GDrawVertexBuffer *vb, void *unique_id, GDrawStats *stats) { GDrawHandle *h = (GDrawHandle *) vb; - assert(h != nullptr); // @GDRAW_ASSERT + assert(h != NULL); // @GDRAW_ASSERT if (h->owner == unique_id) gdraw_res_free(h, stats); } @@ -602,22 +602,22 @@ static GDrawHandle *get_color_rendertarget(GDrawStats *stats) // ran out of RTs, allocate a new one S32 size = gdraw->frametex_width * gdraw->frametex_height * 4; if (gdraw->rendertargets.bytes_free < size) { - IggyGDrawSendWarning(nullptr, "GDraw rendertarget allocation failed: hit size limit of %d bytes", gdraw->rendertargets.total_bytes); - return nullptr; + IggyGDrawSendWarning(NULL, "GDraw rendertarget allocation failed: hit size limit of %d bytes", gdraw->rendertargets.total_bytes); + return NULL; } t = gdraw_HandleCacheAllocateBegin(&gdraw->rendertargets); if (!t) { - IggyGDrawSendWarning(nullptr, "GDraw rendertarget allocation failed: hit handle limit"); + IggyGDrawSendWarning(NULL, "GDraw rendertarget allocation failed: hit handle limit"); return t; } HRESULT hr = gdraw->d3d_device->CreateTexture(gdraw->frametex_width, gdraw->frametex_height, 1, D3DUSAGE_RENDERTARGET, - D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &t->handle.tex.d3d, nullptr); + D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &t->handle.tex.d3d, NULL); if (FAILED(hr)) { report_d3d_error(hr, "CreateTexture", " creating rendertarget"); gdraw_HandleCacheAllocateFail(t); - return nullptr; + return NULL; } gdraw_HandleCacheAllocateEnd(t, size, (void *) 1, GDRAW_HANDLE_STATE_locked); @@ -631,9 +631,9 @@ static GDrawHandle *get_color_rendertarget(GDrawStats *stats) static IDirect3DSurface9 *get_rendertarget_depthbuffer(GDrawStats *stats) { if (!gdraw->rt_depthbuffer) { - HRESULT hr = gdraw->d3d_device->CreateDepthStencilSurface(gdraw->frametex_width, gdraw->frametex_height, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, TRUE, &gdraw->rt_depthbuffer, nullptr); + HRESULT hr = gdraw->d3d_device->CreateDepthStencilSurface(gdraw->frametex_width, gdraw->frametex_height, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, TRUE, &gdraw->rt_depthbuffer, NULL); if (FAILED(hr)) - IggyGDrawSendWarning(nullptr, "GDraw D3D error in CreateDepthStencilSurface: 0x%08x", hr); + IggyGDrawSendWarning(NULL, "GDraw D3D error in CreateDepthStencilSurface: 0x%08x", hr); else { stats->nonzero_flags |= GDRAW_STATS_alloc_tex; stats->alloc_tex += 1; @@ -829,12 +829,12 @@ static void clear_renderstate(void) { IDirect3DDevice9 *d3d = gdraw->d3d_device; - d3d->SetTexture(0, nullptr); - d3d->SetTexture(1, nullptr); - d3d->SetTexture(2, nullptr); - d3d->SetTexture(AATEX_SAMPLER, nullptr); - d3d->SetStreamSource(0, nullptr, 0, 0); - d3d->SetIndices(nullptr); + d3d->SetTexture(0, NULL); + d3d->SetTexture(1, NULL); + d3d->SetTexture(2, NULL); + d3d->SetTexture(AATEX_SAMPLER, NULL); + d3d->SetStreamSource(0, NULL, 0, 0); + d3d->SetIndices(NULL); d3d->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); d3d->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS); @@ -877,7 +877,7 @@ static void clear_zbuffer(IDirect3DSurface9 *surf, U32 flags) d3d->SetRenderTarget(0, target); d3d->SetDepthStencilSurface(surf); d3d->SetViewport(&vp); - d3d->Clear(0, nullptr, flags, 0, 1.0f, 0); + d3d->Clear(0, NULL, flags, 0, 1.0f, 0); if (target != gdraw->main_framebuffer) target->Release(); @@ -922,7 +922,7 @@ static void RADLINK gdraw_SetViewSizeAndWorldScale(S32 w, S32 h, F32 scale_x, F3 static void RADLINK gdraw_Set3DTransform(F32 *mat) { - if (mat == nullptr) + if (mat == NULL) gdraw->use_3d = 0; else { gdraw->use_3d = 1; @@ -1029,7 +1029,7 @@ static void RADLINK gdraw_GetInfo(GDrawInfo *d) static void set_render_target(GDrawStats *stats) { - IDirect3DSurface9 *target = nullptr, *depth = nullptr; + IDirect3DSurface9 *target = NULL, *depth = NULL; if (gdraw->cur->color_buffer) { S32 need_depth; @@ -1070,7 +1070,7 @@ static rrbool RADLINK gdraw_TextureDrawBufferBegin(gswf_recti *region, gdraw_tex return false; if (n >= &gdraw->frame[MAX_RENDER_STACK_DEPTH]) { - IggyGDrawSendWarning(nullptr, "GDraw rendertarget nesting exceeds MAX_RENDER_STACK_DEPTH"); + IggyGDrawSendWarning(NULL, "GDraw rendertarget nesting exceeds MAX_RENDER_STACK_DEPTH"); return false; } @@ -1086,12 +1086,12 @@ static rrbool RADLINK gdraw_TextureDrawBufferBegin(gswf_recti *region, gdraw_tex IDirect3DTexture9 * tex; HRESULT hr = gdraw->d3d_device->CreateTexture(w,h,1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, - D3DPOOL_DEFAULT, &tex, nullptr); + D3DPOOL_DEFAULT, &tex, NULL); if (FAILED(hr)) { if (t) gdraw_HandleCacheAllocateFail(t); - IggyGDrawSendWarning(nullptr, "GDraw D3D error for CreateTexture for cacheAsBitmap rendertarget: 0x%08x", hr); + IggyGDrawSendWarning(NULL, "GDraw D3D error for CreateTexture for cacheAsBitmap rendertarget: 0x%08x", hr); return false; } @@ -1109,10 +1109,10 @@ static rrbool RADLINK gdraw_TextureDrawBufferBegin(gswf_recti *region, gdraw_tex n->flags = flags; n->color_buffer = t; - assert(n->color_buffer != nullptr); // @GDRAW_ASSERT + assert(n->color_buffer != NULL); // @GDRAW_ASSERT ++gdraw->cur; - gdraw->cur->cached = owner != nullptr; + gdraw->cur->cached = owner != NULL; if (owner) { gdraw->cur->base_x = region->x0; gdraw->cur->base_y = region->y0; @@ -1162,7 +1162,7 @@ static rrbool RADLINK gdraw_TextureDrawBufferBegin(gswf_recti *region, gdraw_tex gdraw->rt_valid[k].x1 = xt1; gdraw->rt_valid[k].y1 = yt1; } else { - gdraw->d3d_device->Clear(0, nullptr, D3DCLEAR_TARGET, 0, 1, 0); + gdraw->d3d_device->Clear(0, NULL, D3DCLEAR_TARGET, 0, 1, 0); gdraw->rt_valid[k].x0 = 0; gdraw->rt_valid[k].y0 = 0; gdraw->rt_valid[k].x1 = gdraw->frametex_width; @@ -1185,9 +1185,9 @@ static GDrawTexture *RADLINK gdraw_TextureDrawBufferEnd(GDrawStats *stats) assert(m >= gdraw->frame); // bug in Iggy -- unbalanced if (m != gdraw->frame) { - assert(m->color_buffer != nullptr); // @GDRAW_ASSERT + assert(m->color_buffer != NULL); // @GDRAW_ASSERT } - assert(n->color_buffer != nullptr); // @GDRAW_ASSERT + assert(n->color_buffer != NULL); // @GDRAW_ASSERT // switch back to old render target set_render_target(stats); @@ -1493,7 +1493,7 @@ static int vertsize[ASSERT_COUNT(GDRAW_vformat__count, 3)] = { // Draw triangles with a given renderstate // -static void tag_resources(void *r1, void *r2=nullptr, void *r3=nullptr, void *r4=nullptr) +static void tag_resources(void *r1, void *r2=NULL, void *r3=NULL, void *r4=NULL) { U64 now = gdraw->frame_counter; if (r1) ((GDrawHandle *) r1)->fence.value = now; @@ -1632,7 +1632,7 @@ static void gdraw_Filter(GDrawRenderState *r, gswf_recti *s, float *tc, int isbe { ProgramWithCachedVariableLocations *prg = &gdraw->filter_prog[isbevel][r->filter_mode]; - if (!gdraw_TextureDrawBufferBegin(s, GDRAW_TEXTURE_FORMAT_rgba32, GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, nullptr, stats)) + if (!gdraw_TextureDrawBufferBegin(s, GDRAW_TEXTURE_FORMAT_rgba32, GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, NULL, stats)) return; gdraw->d3d_device->SetPixelShader(prg->pshader); @@ -1730,7 +1730,7 @@ static void RADLINK gdraw_FilterQuad(GDrawRenderState *r, S32 x0, S32 y0, S32 x1 assert(0); } } else { - GDrawHandle *blend_tex = nullptr; + GDrawHandle *blend_tex = NULL; static S16 zero[4] = { 0, 0, 0, 0 }; // for crazy blend modes, we need to read back from the framebuffer @@ -1739,7 +1739,7 @@ static void RADLINK gdraw_FilterQuad(GDrawRenderState *r, S32 x0, S32 y0, S32 x1 // to be able to render over the user's existing framebuffer, which might // not be a texture. note that this causes MSAA issues! if (r->blend_mode == GDRAW_BLEND_special && - (blend_tex = get_color_rendertarget(stats)) != nullptr) { + (blend_tex = get_color_rendertarget(stats)) != NULL) { IDirect3DSurface9 *src; HRESULT hr = d3d->GetRenderTarget(0, &src); @@ -1803,8 +1803,8 @@ static void create_pixel_shader(ProgramWithCachedVariableLocations *p, ProgramWi if(p->bytecode) { HRESULT hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, &p->pshader); if (FAILED(hr)) { - IggyGDrawSendWarning(nullptr, "GDraw D3D error creating pixel shader: 0x%08x", hr); - p->pshader = nullptr; + IggyGDrawSendWarning(NULL, "GDraw D3D error creating pixel shader: 0x%08x", hr); + p->pshader = NULL; } } } @@ -1815,8 +1815,8 @@ static void create_vertex_shader(ProgramWithCachedVariableLocations *p, ProgramW if(p->bytecode) { HRESULT hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, &p->vshader); if (FAILED(hr)) { - IggyGDrawSendWarning(nullptr, "GDraw D3D error creating vertex shader: 0x%08x", hr); - p->vshader = nullptr; + IggyGDrawSendWarning(NULL, "GDraw D3D error creating vertex shader: 0x%08x", hr); + p->vshader = NULL; } } } @@ -1840,7 +1840,7 @@ static void create_all_shaders(void) for (i=0; i < GDRAW_vformat__count; i++) { HRESULT hr = gdraw->d3d_device->CreateVertexDeclaration(vformats[i], &gdraw->vdec[i]); if (FAILED(hr)) - IggyGDrawSendWarning(nullptr, "GDraw D3D error in CreateVertexDeclaration: 0x%08x", hr); + IggyGDrawSendWarning(NULL, "GDraw D3D error in CreateVertexDeclaration: 0x%08x", hr); create_vertex_shader(&gdraw->vert[i], vshader_vsd3d9_arr + i); } @@ -1899,7 +1899,7 @@ static void free_gdraw() if (gdraw->texturecache) IggyGDrawFree(gdraw->texturecache); if (gdraw->vbufcache) IggyGDrawFree(gdraw->vbufcache); IggyGDrawFree(gdraw); - gdraw = nullptr; + gdraw = NULL; } int gdraw_D3D_SetResourceLimits(gdraw_d3d_resourcetype type, S32 num_handles, S32 num_bytes) @@ -1938,7 +1938,7 @@ int gdraw_D3D_SetResourceLimits(gdraw_d3d_resourcetype type, S32 num_handles, S3 IggyGDrawFree(gdraw->texturecache); } gdraw->texturecache = make_handle_cache(GDRAW_D3D_RESOURCE_texture); - return gdraw->texturecache != nullptr; + return gdraw->texturecache != NULL; case GDRAW_D3D_RESOURCE_vertexbuffer: if (gdraw->vbufcache) { @@ -1946,7 +1946,7 @@ int gdraw_D3D_SetResourceLimits(gdraw_d3d_resourcetype type, S32 num_handles, S3 IggyGDrawFree(gdraw->vbufcache); } gdraw->vbufcache = make_handle_cache(GDRAW_D3D_RESOURCE_vertexbuffer); - return gdraw->vbufcache != nullptr; + return gdraw->vbufcache != NULL; default: return 0; @@ -1956,7 +1956,7 @@ int gdraw_D3D_SetResourceLimits(gdraw_d3d_resourcetype type, S32 num_handles, S3 GDrawFunctions *gdraw_D3D_CreateContext(IDirect3DDevice9 *dev, S32 w, S32 h) { gdraw = (GDraw *) IggyGDrawMalloc(sizeof(*gdraw)); - if (!gdraw) return nullptr; + if (!gdraw) return NULL; memset(gdraw, 0, sizeof(*gdraw)); @@ -1969,7 +1969,7 @@ GDrawFunctions *gdraw_D3D_CreateContext(IDirect3DDevice9 *dev, S32 w, S32 h) if (!gdraw->texturecache || !gdraw->vbufcache) { free_gdraw(); - return nullptr; + return NULL; } if (!quad_ib[1]) { @@ -2052,7 +2052,7 @@ void gdraw_D3D_DestroyContext(void) flush_rendertargets(&stats); safe_release(gdraw->aa_tex); - gdraw->d3d_device = nullptr; + gdraw->d3d_device = NULL; } free_gdraw(); @@ -2101,7 +2101,7 @@ void RADLINK gdraw_D3D_GetResourceUsageStats(gdraw_d3d_resourcetype type, S32 *h case GDRAW_D3D_RESOURCE_rendertarget: cache = &gdraw->rendertargets; break; case GDRAW_D3D_RESOURCE_texture: cache = gdraw->texturecache; break; case GDRAW_D3D_RESOURCE_vertexbuffer: cache = gdraw->vbufcache; break; - default: cache = nullptr; break; + default: cache = NULL; break; } *handles_used = *bytes_used = 0; @@ -2151,13 +2151,13 @@ GDrawTexture * RADLINK gdraw_D3D_MakeTextureFromResource(U8 *resource_file, S32 } HRESULT hr = gdraw->d3d_device->CreateTexture(width, height, mipmaps, - 0, d3dfmt, D3DPOOL_MANAGED, &tex, nullptr); + 0, d3dfmt, D3DPOOL_MANAGED, &tex, NULL); if (FAILED(hr)) { if (size >= 8 && ((width & 3) || (height & 3))) - IggyGDrawSendWarning(nullptr, "GDraw D3D error, dxtc texture dimensions must be multiples of 4"); + IggyGDrawSendWarning(NULL, "GDraw D3D error, dxtc texture dimensions must be multiples of 4"); else report_d3d_error(hr, "CreateTexture", ""); - return nullptr; + return NULL; } U8 *data = resource_file + texture->file_offset; @@ -2171,11 +2171,11 @@ GDrawTexture * RADLINK gdraw_D3D_MakeTextureFromResource(U8 *resource_file, S32 effective_height = height; D3DLOCKED_RECT z; - hr = tex->LockRect(level, &z, nullptr, 0); + hr = tex->LockRect(level, &z, NULL, 0); if (FAILED(hr)) { report_d3d_error(hr, "LockRect", " while creating texture"); tex->Release(); - return nullptr; + return NULL; } U8 *pixels = (U8*) z.pBits; for (S32 j=0; j < effective_height; ++j) { diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d.h b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d.h index cbf8fd77..927688e4 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d.h +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d.h @@ -41,7 +41,7 @@ IDOC extern GDrawFunctions * gdraw_D3D_CreateContext(IDirect3DDevice9 *dev, S32 There can only be one D3D GDraw context active at any one time. If initialization fails for some reason (the main reason would be an out of memory condition), - nullptr is returned. Otherwise, you can pass the return value to IggySetGDraw. */ + NULL is returned. Otherwise, you can pass the return value to IggySetGDraw. */ IDOC extern void gdraw_D3D_SetRendertargetSize(S32 w, S32 h); /* Reset the size used for internal rendertargets defined by CreateContext. Flushes diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d10.cpp b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d10.cpp index a7cb4e8f..225f2581 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d10.cpp +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d10.cpp @@ -60,7 +60,7 @@ static void *map_buffer(ID3D1XContext *, ID3D10Buffer *buf, bool discard) { void *ptr; if (FAILED(buf->Map(discard ? D3D10_MAP_WRITE_DISCARD : D3D10_MAP_WRITE_NO_OVERWRITE, 0, &ptr))) - return nullptr; + return NULL; else return ptr; } @@ -96,7 +96,7 @@ static ID3D10BlendState *create_blend_state(ID3D10Device *dev, BOOL blend, D3D10 HRESULT hr = dev->CreateBlendState(&desc, &res); if (FAILED(hr)) { report_d3d_error(hr, "CreateBlendState", ""); - res = nullptr; + res = NULL; } return res; @@ -112,7 +112,7 @@ static void create_pixel_shader(ProgramWithCachedVariableLocations *p, ProgramWi HRESULT hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, &p->pshader); if (FAILED(hr)) { report_d3d_error(hr, "CreatePixelShader", ""); - p->pshader = nullptr; + p->pshader = NULL; return; } } @@ -125,7 +125,7 @@ static void create_vertex_shader(ProgramWithCachedVariableLocations *p, ProgramW HRESULT hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, &p->vshader); if (FAILED(hr)) { report_d3d_error(hr, "CreateVertexShader", ""); - p->vshader = nullptr; + p->vshader = NULL; return; } } diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d10.h b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d10.h index d4443004..929146b2 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d10.h +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d10.h @@ -40,7 +40,7 @@ IDOC extern GDrawFunctions * gdraw_D3D10_CreateContext(ID3D10Device *dev, S32 w, There can only be one D3D GDraw context active at any one time. If initialization fails for some reason (the main reason would be an out of memory condition), - nullptr is returned. Otherwise, you can pass the return value to IggySetGDraw. */ + NULL is returned. Otherwise, you can pass the return value to IggySetGDraw. */ IDOC extern void gdraw_D3D10_DestroyContext(void); /* Destroys the current GDraw context, if any. */ @@ -68,7 +68,7 @@ IDOC extern void gdraw_D3D10_SetTileOrigin(ID3D10RenderTargetView *main_rt, ID3D If your rendertarget uses multisampling, you also need to specify a shader resource view for a non-MSAA rendertarget texture (identically sized to main_rt) in non_msaa_rt. This is only used if the Flash content includes non-standard - blend modes which have to use a special blend shader, so you can leave it nullptr + blend modes which have to use a special blend shader, so you can leave it NULL if you forbid such content. You need to call this before Iggy calls any rendering functions. */ diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d9_shaders.inl b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d9_shaders.inl index cac4b880..ce13993b 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d9_shaders.inl +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d9_shaders.inl @@ -214,24 +214,24 @@ static DWORD pshader_basic_17[68] = { }; static ProgramWithCachedVariableLocations pshader_basic_arr[18] = { - { pshader_basic_0, nullptr, { -1, 7, 0, -1, -1, } }, - { pshader_basic_1, nullptr, { -1, 7, 0, 1, -1, } }, - { pshader_basic_2, nullptr, { -1, 7, 0, 1, -1, } }, - { pshader_basic_3, nullptr, { 0, 7, 0, -1, -1, } }, - { pshader_basic_4, nullptr, { 0, 7, 0, 1, -1, } }, - { pshader_basic_5, nullptr, { 0, 7, 0, 1, -1, } }, - { pshader_basic_6, nullptr, { 0, 7, 0, -1, -1, } }, - { pshader_basic_7, nullptr, { 0, 7, 0, 1, -1, } }, - { pshader_basic_8, nullptr, { 0, 7, 0, 1, -1, } }, - { pshader_basic_9, nullptr, { 0, 7, 0, -1, -1, } }, - { pshader_basic_10, nullptr, { 0, 7, 0, 1, -1, } }, - { pshader_basic_11, nullptr, { 0, 7, 0, 1, -1, } }, - { pshader_basic_12, nullptr, { 0, 7, 0, -1, 2, } }, - { pshader_basic_13, nullptr, { 0, 7, 0, 1, 2, } }, - { pshader_basic_14, nullptr, { 0, 7, 0, 1, 2, } }, - { pshader_basic_15, nullptr, { 0, 7, 0, -1, -1, } }, - { pshader_basic_16, nullptr, { 0, 7, 0, 1, -1, } }, - { pshader_basic_17, nullptr, { 0, 7, 0, 1, -1, } }, + { pshader_basic_0, NULL, { -1, 7, 0, -1, -1, } }, + { pshader_basic_1, NULL, { -1, 7, 0, 1, -1, } }, + { pshader_basic_2, NULL, { -1, 7, 0, 1, -1, } }, + { pshader_basic_3, NULL, { 0, 7, 0, -1, -1, } }, + { pshader_basic_4, NULL, { 0, 7, 0, 1, -1, } }, + { pshader_basic_5, NULL, { 0, 7, 0, 1, -1, } }, + { pshader_basic_6, NULL, { 0, 7, 0, -1, -1, } }, + { pshader_basic_7, NULL, { 0, 7, 0, 1, -1, } }, + { pshader_basic_8, NULL, { 0, 7, 0, 1, -1, } }, + { pshader_basic_9, NULL, { 0, 7, 0, -1, -1, } }, + { pshader_basic_10, NULL, { 0, 7, 0, 1, -1, } }, + { pshader_basic_11, NULL, { 0, 7, 0, 1, -1, } }, + { pshader_basic_12, NULL, { 0, 7, 0, -1, 2, } }, + { pshader_basic_13, NULL, { 0, 7, 0, 1, 2, } }, + { pshader_basic_14, NULL, { 0, 7, 0, 1, 2, } }, + { pshader_basic_15, NULL, { 0, 7, 0, -1, -1, } }, + { pshader_basic_16, NULL, { 0, 7, 0, 1, -1, } }, + { pshader_basic_17, NULL, { 0, 7, 0, 1, -1, } }, }; static DWORD pshader_exceptional_blend_1[72] = { @@ -423,19 +423,19 @@ static DWORD pshader_exceptional_blend_12[39] = { }; static ProgramWithCachedVariableLocations pshader_exceptional_blend_arr[13] = { - { nullptr, nullptr, { -1, -1, -1, -1, } }, - { pshader_exceptional_blend_1, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_2, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_3, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_4, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_5, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_6, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_7, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_8, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_9, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_10, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_11, nullptr, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_12, nullptr, { 0, 1, 0, 1, } }, + { NULL, NULL, { -1, -1, -1, -1, } }, + { pshader_exceptional_blend_1, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_2, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_3, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_4, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_5, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_6, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_7, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_8, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_9, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_10, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_11, NULL, { 0, 1, 0, 1, } }, + { pshader_exceptional_blend_12, NULL, { 0, 1, 0, 1, } }, }; static DWORD pshader_filter_0[77] = { @@ -779,38 +779,38 @@ static DWORD pshader_filter_27[80] = { }; static ProgramWithCachedVariableLocations pshader_filter_arr[32] = { - { pshader_filter_0, nullptr, { 0, 1, 6, 7, -1, 4, 5, -1, } }, - { pshader_filter_1, nullptr, { 0, 1, 6, 7, -1, 4, 5, -1, } }, - { pshader_filter_2, nullptr, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_3, nullptr, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_4, nullptr, { 0, 1, 6, 7, -1, 4, 5, -1, } }, - { pshader_filter_5, nullptr, { 0, 1, 6, 7, -1, 4, 5, -1, } }, - { pshader_filter_6, nullptr, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_7, nullptr, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_8, nullptr, { -1, 1, 5, -1, -1, -1, 4, -1, } }, - { pshader_filter_9, nullptr, { -1, -1, 4, -1, -1, -1, -1, -1, } }, - { pshader_filter_10, nullptr, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_11, nullptr, { 0, -1, -1, 5, 2, 4, -1, -1, } }, - { nullptr, nullptr, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { nullptr, nullptr, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { nullptr, nullptr, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { nullptr, nullptr, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { pshader_filter_16, nullptr, { 0, 1, 6, 8, -1, 4, 5, 7, } }, - { pshader_filter_17, nullptr, { 0, 1, 6, 8, -1, 4, 5, 7, } }, - { pshader_filter_18, nullptr, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_19, nullptr, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_20, nullptr, { 0, 1, 6, 8, -1, 4, 5, 7, } }, - { pshader_filter_21, nullptr, { 0, 1, 6, 8, -1, 4, 5, 7, } }, - { pshader_filter_22, nullptr, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_23, nullptr, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_24, nullptr, { 0, 1, 6, 8, -1, 4, 5, 7, } }, - { pshader_filter_25, nullptr, { 0, -1, 5, 7, -1, 4, -1, 6, } }, - { pshader_filter_26, nullptr, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_27, nullptr, { 0, -1, -1, 5, 2, 4, -1, -1, } }, - { nullptr, nullptr, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { nullptr, nullptr, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { nullptr, nullptr, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { nullptr, nullptr, { -1, -1, -1, -1, -1, -1, -1, -1, } }, + { pshader_filter_0, NULL, { 0, 1, 6, 7, -1, 4, 5, -1, } }, + { pshader_filter_1, NULL, { 0, 1, 6, 7, -1, 4, 5, -1, } }, + { pshader_filter_2, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, + { pshader_filter_3, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, + { pshader_filter_4, NULL, { 0, 1, 6, 7, -1, 4, 5, -1, } }, + { pshader_filter_5, NULL, { 0, 1, 6, 7, -1, 4, 5, -1, } }, + { pshader_filter_6, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, + { pshader_filter_7, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, + { pshader_filter_8, NULL, { -1, 1, 5, -1, -1, -1, 4, -1, } }, + { pshader_filter_9, NULL, { -1, -1, 4, -1, -1, -1, -1, -1, } }, + { pshader_filter_10, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, + { pshader_filter_11, NULL, { 0, -1, -1, 5, 2, 4, -1, -1, } }, + { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, + { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, + { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, + { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, + { pshader_filter_16, NULL, { 0, 1, 6, 8, -1, 4, 5, 7, } }, + { pshader_filter_17, NULL, { 0, 1, 6, 8, -1, 4, 5, 7, } }, + { pshader_filter_18, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, + { pshader_filter_19, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, + { pshader_filter_20, NULL, { 0, 1, 6, 8, -1, 4, 5, 7, } }, + { pshader_filter_21, NULL, { 0, 1, 6, 8, -1, 4, 5, 7, } }, + { pshader_filter_22, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, + { pshader_filter_23, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, + { pshader_filter_24, NULL, { 0, 1, 6, 8, -1, 4, 5, 7, } }, + { pshader_filter_25, NULL, { 0, -1, 5, 7, -1, 4, -1, 6, } }, + { pshader_filter_26, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, + { pshader_filter_27, NULL, { 0, -1, -1, 5, 2, 4, -1, -1, } }, + { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, + { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, + { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, + { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, }; static DWORD pshader_blur_2[60] = { @@ -989,16 +989,16 @@ static DWORD pshader_blur_9[235] = { }; static ProgramWithCachedVariableLocations pshader_blur_arr[10] = { - { nullptr, nullptr, { -1, -1, -1, } }, - { nullptr, nullptr, { -1, -1, -1, } }, - { pshader_blur_2, nullptr, { 0, 4, 6, } }, - { pshader_blur_3, nullptr, { 0, 4, 7, } }, - { pshader_blur_4, nullptr, { 0, 4, 8, } }, - { pshader_blur_5, nullptr, { 0, 4, 9, } }, - { pshader_blur_6, nullptr, { 0, 4, 10, } }, - { pshader_blur_7, nullptr, { 0, 4, 11, } }, - { pshader_blur_8, nullptr, { 0, 4, 12, } }, - { pshader_blur_9, nullptr, { 0, 4, 13, } }, + { NULL, NULL, { -1, -1, -1, } }, + { NULL, NULL, { -1, -1, -1, } }, + { pshader_blur_2, NULL, { 0, 4, 6, } }, + { pshader_blur_3, NULL, { 0, 4, 7, } }, + { pshader_blur_4, NULL, { 0, 4, 8, } }, + { pshader_blur_5, NULL, { 0, 4, 9, } }, + { pshader_blur_6, NULL, { 0, 4, 10, } }, + { pshader_blur_7, NULL, { 0, 4, 11, } }, + { pshader_blur_8, NULL, { 0, 4, 12, } }, + { pshader_blur_9, NULL, { 0, 4, 13, } }, }; static DWORD pshader_color_matrix_0[50] = { @@ -1012,7 +1012,7 @@ static DWORD pshader_color_matrix_0[50] = { }; static ProgramWithCachedVariableLocations pshader_color_matrix_arr[1] = { - { pshader_color_matrix_0, nullptr, { 0, 4, } }, + { pshader_color_matrix_0, NULL, { 0, 4, } }, }; static DWORD pshader_manual_clear_0[5] = { @@ -1020,7 +1020,7 @@ static DWORD pshader_manual_clear_0[5] = { }; static ProgramWithCachedVariableLocations pshader_manual_clear_arr[1] = { - { pshader_manual_clear_0, nullptr, { 0, } }, + { pshader_manual_clear_0, NULL, { 0, } }, }; static DWORD vshader_vsd3d9_0[65] = { @@ -1068,8 +1068,8 @@ static DWORD vshader_vsd3d9_2[60] = { }; static ProgramWithCachedVariableLocations vshader_vsd3d9_arr[3] = { - { vshader_vsd3d9_0, nullptr, { 0 } }, - { vshader_vsd3d9_1, nullptr, { 0 } }, - { vshader_vsd3d9_2, nullptr, { 0 } }, + { vshader_vsd3d9_0, NULL, { 0 } }, + { vshader_vsd3d9_1, NULL, { 0 } }, + { vshader_vsd3d9_2, NULL, { 0 } }, }; diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_wgl.c b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_wgl.c index 34b66830..f4f477aa 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_wgl.c +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_wgl.c @@ -142,9 +142,9 @@ GDrawFunctions *gdraw_GL_CreateContext(S32 w, S32 h, S32 msaa_samples) // check for the extensions we need s = (const char *) glGetString(GL_EXTENSIONS); - if (s == nullptr) { - assert(s != nullptr); // if this is nullptr, you're probably trying to create the device too early - return nullptr; + if (s == NULL) { + assert(s != NULL); // if this is NULL, you're probably trying to create the device too early + return NULL; } // check for the extensions we won't work without @@ -157,16 +157,16 @@ GDrawFunctions *gdraw_GL_CreateContext(S32 w, S32 h, S32 msaa_samples) !hasext(s, "GL_ARB_shader_objects") || !hasext(s, "GL_ARB_vertex_shader") || !hasext(s, "GL_ARB_fragment_shader")) - return nullptr; + return NULL; // if user requests multisampling and HW doesn't support it, bail if (!hasext(s, "GL_EXT_framebuffer_multisample") && msaa_samples > 1) - return nullptr; + return NULL; load_extensions(); funcs = create_context(w, h); if (!funcs) - return nullptr; + return NULL; gdraw->tex_formats = tex_formats; diff --git a/Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp b/Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp index cedfcdff..981ab3ab 100644 --- a/Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp +++ b/Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp @@ -554,7 +554,7 @@ void WinsockNetLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, unsig if (pPlayerFrom == nullptr || pPlayerTo == nullptr) { - app.DebugPrintf("NET RECV: DROPPED %u bytes from=%d to=%d (player nullptr: from=%p to=%p)\n", + app.DebugPrintf("NET RECV: DROPPED %u bytes from=%d to=%d (player NULL: from=%p to=%p)\n", dataSize, fromSmallId, toSmallId, pPlayerFrom, pPlayerTo); return; } @@ -565,7 +565,7 @@ void WinsockNetLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, unsig if (pSocket != nullptr) pSocket->pushDataToQueue(data, dataSize, false); else - app.DebugPrintf("NET RECV: DROPPED %u bytes, host pSocket nullptr for from=%d\n", dataSize, fromSmallId); + app.DebugPrintf("NET RECV: DROPPED %u bytes, host pSocket NULL for from=%d\n", dataSize, fromSmallId); } else { @@ -573,7 +573,7 @@ void WinsockNetLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, unsig if (pSocket != nullptr) pSocket->pushDataToQueue(data, dataSize, true); else - app.DebugPrintf("NET RECV: DROPPED %u bytes, client pSocket nullptr for to=%d\n", dataSize, toSmallId); + app.DebugPrintf("NET RECV: DROPPED %u bytes, client pSocket NULL for to=%d\n", dataSize, toSmallId); } } diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 1bc0ece2..81430ffc 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -975,9 +975,9 @@ static bool ResizeD3D(int newW, int newH) g_pImmediateContext->Flush(); // Release OUR views and depth buffer - if (g_pRenderTargetView) { g_pRenderTargetView->Release(); g_pRenderTargetView = nullptr; } - if (g_pDepthStencilView) { g_pDepthStencilView->Release(); g_pDepthStencilView = nullptr; } - if (g_pDepthStencilBuffer) { g_pDepthStencilBuffer->Release(); g_pDepthStencilBuffer = nullptr; } + if (g_pRenderTargetView) { g_pRenderTargetView->Release(); g_pRenderTargetView = NULL; } + if (g_pDepthStencilView) { g_pDepthStencilView->Release(); g_pDepthStencilView = NULL; } + if (g_pDepthStencilBuffer) { g_pDepthStencilBuffer->Release(); g_pDepthStencilBuffer = NULL; } gdraw_D3D11_PreReset(); @@ -988,9 +988,9 @@ static bool ResizeD3D(int newW, int newH) bool success = false; HRESULT hr; - IDXGIDevice* dxgiDevice = nullptr; - IDXGIAdapter* dxgiAdapter = nullptr; - IDXGIFactory* dxgiFactory = nullptr; + IDXGIDevice* dxgiDevice = NULL; + IDXGIAdapter* dxgiAdapter = NULL; + IDXGIFactory* dxgiFactory = NULL; hr = g_pd3dDevice->QueryInterface(__uuidof(IDXGIDevice), (void**)&dxgiDevice); if (FAILED(hr)) goto postReset; hr = dxgiDevice->GetParent(__uuidof(IDXGIAdapter), (void**)&dxgiAdapter); @@ -1015,10 +1015,10 @@ static bool ResizeD3D(int newW, int newH) sd.SampleDesc.Quality = 0; sd.Windowed = TRUE; - IDXGISwapChain* pNewSwapChain = nullptr; + IDXGISwapChain* pNewSwapChain = NULL; hr = dxgiFactory->CreateSwapChain(g_pd3dDevice, &sd, &pNewSwapChain); dxgiFactory->Release(); - if (FAILED(hr) || pNewSwapChain == nullptr) + if (FAILED(hr) || pNewSwapChain == NULL) { app.DebugPrintf("[RESIZE] CreateSwapChain FAILED hr=0x%08X — keeping old swap chain\n", (unsigned)hr); goto postReset; @@ -1037,16 +1037,16 @@ static bool ResizeD3D(int newW, int newH) // Create render target views from new backbuffer { - ID3D11Texture2D* pBackBuffer = nullptr; + ID3D11Texture2D* pBackBuffer = NULL; hr = g_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&pBackBuffer); if (FAILED(hr)) goto postReset; // Our RTV - hr = g_pd3dDevice->CreateRenderTargetView(pBackBuffer, nullptr, &g_pRenderTargetView); + hr = g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL, &g_pRenderTargetView); if (FAILED(hr)) { pBackBuffer->Release(); goto postReset; } // Renderer's internal RTV (offset 0x28) - hr = g_pd3dDevice->CreateRenderTargetView(pBackBuffer, nullptr, ppRM_RTV); + hr = g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL, ppRM_RTV); if (FAILED(hr)) { pBackBuffer->Release(); goto postReset; } // Renderer's SRV: separate texture matching backbuffer dims (used by CaptureThumbnail) @@ -1056,11 +1056,11 @@ static bool ResizeD3D(int newW, int newH) D3D11_TEXTURE2D_DESC srvDesc = backDesc; srvDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE; - ID3D11Texture2D* srvTexture = nullptr; - hr = g_pd3dDevice->CreateTexture2D(&srvDesc, nullptr, &srvTexture); + ID3D11Texture2D* srvTexture = NULL; + hr = g_pd3dDevice->CreateTexture2D(&srvDesc, NULL, &srvTexture); if (SUCCEEDED(hr)) { - hr = g_pd3dDevice->CreateShaderResourceView(srvTexture, nullptr, ppRM_SRV); + hr = g_pd3dDevice->CreateShaderResourceView(srvTexture, NULL, ppRM_SRV); srvTexture->Release(); } if (FAILED(hr)) goto postReset; @@ -1078,7 +1078,7 @@ static bool ResizeD3D(int newW, int newH) descDepth.SampleDesc.Quality = 0; descDepth.Usage = D3D11_USAGE_DEFAULT; descDepth.BindFlags = D3D11_BIND_DEPTH_STENCIL; - hr = g_pd3dDevice->CreateTexture2D(&descDepth, nullptr, &g_pDepthStencilBuffer); + hr = g_pd3dDevice->CreateTexture2D(&descDepth, NULL, &g_pDepthStencilBuffer); if (FAILED(hr)) goto postReset; D3D11_DEPTH_STENCIL_VIEW_DESC descDSView = {}; @@ -1120,7 +1120,7 @@ static bool ResizeD3D(int newW, int newH) success = true; postReset: - if (!success && g_pSwapChain != nullptr) + if (!success && g_pSwapChain != NULL) { // Failure recovery: recreate our views from whatever swap chain survived // so ui.m_pRenderTargetView / m_pDepthStencilView don't dangle. @@ -1129,25 +1129,25 @@ postReset: int recW = (int)recoveryDesc.BufferDesc.Width; int recH = (int)recoveryDesc.BufferDesc.Height; - if (g_pRenderTargetView == nullptr) + if (g_pRenderTargetView == NULL) { - ID3D11Texture2D* pBB = nullptr; + ID3D11Texture2D* pBB = NULL; if (SUCCEEDED(g_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&pBB))) { - g_pd3dDevice->CreateRenderTargetView(pBB, nullptr, &g_pRenderTargetView); + g_pd3dDevice->CreateRenderTargetView(pBB, NULL, &g_pRenderTargetView); pBB->Release(); } } - if (g_pDepthStencilView == nullptr) + if (g_pDepthStencilView == NULL) { D3D11_TEXTURE2D_DESC dd = {}; dd.Width = recW; dd.Height = recH; dd.MipLevels = 1; dd.ArraySize = 1; dd.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; dd.SampleDesc.Count = 1; dd.Usage = D3D11_USAGE_DEFAULT; dd.BindFlags = D3D11_BIND_DEPTH_STENCIL; - if (g_pDepthStencilBuffer == nullptr) - g_pd3dDevice->CreateTexture2D(&dd, nullptr, &g_pDepthStencilBuffer); - if (g_pDepthStencilBuffer != nullptr) + if (g_pDepthStencilBuffer == NULL) + g_pd3dDevice->CreateTexture2D(&dd, NULL, &g_pDepthStencilBuffer); + if (g_pDepthStencilBuffer != NULL) { D3D11_DEPTH_STENCIL_VIEW_DESC dsvd = {}; dsvd.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; @@ -1155,7 +1155,7 @@ postReset: g_pd3dDevice->CreateDepthStencilView(g_pDepthStencilBuffer, &dsvd, &g_pDepthStencilView); } } - if (g_pRenderTargetView != nullptr) + if (g_pRenderTargetView != NULL) g_pImmediateContext->OMSetRenderTargets(1, &g_pRenderTargetView, g_pDepthStencilView); ui.updateRenderTargets(g_pRenderTargetView, g_pDepthStencilView); @@ -1814,7 +1814,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } // Open chat - if (g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CHAT) && app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == nullptr) + if (g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CHAT) && app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL) { g_KBMInput.ClearCharBuffer(); pMinecraft->setScreen(new ChatScreen()); diff --git a/Minecraft.Client/Windows64/Windows64_Xuid.h b/Minecraft.Client/Windows64/Windows64_Xuid.h index 156146d0..f5fd62b9 100644 --- a/Minecraft.Client/Windows64/Windows64_Xuid.h +++ b/Minecraft.Client/Windows64/Windows64_Xuid.h @@ -40,18 +40,18 @@ namespace Win64Xuid // ./uid.dat inline bool BuildUidFilePath(char* outPath, size_t outPathSize) { - if (outPath == nullptr || outPathSize == 0) + if (outPath == NULL || outPathSize == 0) return false; outPath[0] = 0; char exePath[MAX_PATH] = {}; - DWORD len = GetModuleFileNameA(nullptr, exePath, MAX_PATH); + DWORD len = GetModuleFileNameA(NULL, exePath, MAX_PATH); if (len == 0 || len >= MAX_PATH) return false; char* lastSlash = strrchr(exePath, '\\'); - if (lastSlash != nullptr) + if (lastSlash != NULL) { *(lastSlash + 1) = 0; } @@ -66,15 +66,15 @@ namespace Win64Xuid inline bool ReadUid(PlayerUID* outXuid) { - if (outXuid == nullptr) + if (outXuid == NULL) return false; char path[MAX_PATH] = {}; if (!BuildUidFilePath(path, MAX_PATH)) return false; - FILE* f = nullptr; - if (fopen_s(&f, path, "rb") != 0 || f == nullptr) + FILE* f = NULL; + if (fopen_s(&f, path, "rb") != 0 || f == NULL) return false; char buffer[128] = {}; @@ -105,7 +105,7 @@ namespace Win64Xuid } errno = 0; - char* end = nullptr; + char* end = NULL; uint64_t raw = _strtoui64(begin, &end, 0); if (begin == end || errno != 0) return false; @@ -131,8 +131,8 @@ namespace Win64Xuid if (!BuildUidFilePath(path, MAX_PATH)) return false; - FILE* f = nullptr; - if (fopen_s(&f, path, "wb") != 0 || f == nullptr) + FILE* f = NULL; + if (fopen_s(&f, path, "wb") != 0 || f == NULL) return false; int written = fprintf_s(f, "0x%016llX\n", (unsigned long long)xuid); @@ -164,7 +164,7 @@ namespace Win64Xuid seed ^= (uint64_t)GetCurrentThreadId(); seed ^= (uint64_t)GetTickCount(); seed ^= (uint64_t)(size_t)&qpc; - seed ^= (uint64_t)(size_t)GetModuleHandleA(nullptr); + seed ^= (uint64_t)(size_t)GetModuleHandleA(NULL); uint64_t raw = Mix64(seed) ^ Mix64(seed + 0xA0761D6478BD642FULL); raw ^= 0x8F4B2D6C1A93E705ULL; diff --git a/Minecraft.Server/Common/StringUtils.cpp b/Minecraft.Server/Common/StringUtils.cpp index b88d420c..40881ae7 100644 --- a/Minecraft.Server/Common/StringUtils.cpp +++ b/Minecraft.Server/Common/StringUtils.cpp @@ -18,7 +18,7 @@ namespace ServerRuntime return std::string(); } - int charCount = WideCharToMultiByte(CP_UTF8, 0, value.c_str(), (int)value.length(), nullptr, 0, nullptr, nullptr); + int charCount = WideCharToMultiByte(CP_UTF8, 0, value.c_str(), (int)value.length(), NULL, 0, NULL, NULL); if (charCount <= 0) { return std::string(); @@ -26,22 +26,22 @@ namespace ServerRuntime std::string utf8; utf8.resize(charCount); - WideCharToMultiByte(CP_UTF8, 0, value.c_str(), (int)value.length(), &utf8[0], charCount, nullptr, nullptr); + WideCharToMultiByte(CP_UTF8, 0, value.c_str(), (int)value.length(), &utf8[0], charCount, NULL, NULL); return utf8; } std::wstring Utf8ToWide(const char *value) { - if (value == nullptr || value[0] == 0) + if (value == NULL || value[0] == 0) { return std::wstring(); } - int wideCount = MultiByteToWideChar(CP_UTF8, 0, value, -1, nullptr, 0); + int wideCount = MultiByteToWideChar(CP_UTF8, 0, value, -1, NULL, 0); if (wideCount <= 0) { // Fall back to the current ANSI code page so legacy non-UTF-8 inputs remain readable. - wideCount = MultiByteToWideChar(CP_ACP, 0, value, -1, nullptr, 0); + wideCount = MultiByteToWideChar(CP_ACP, 0, value, -1, NULL, 0); if (wideCount <= 0) { return std::wstring(); diff --git a/Minecraft.Server/Console/ServerCliEngine.cpp b/Minecraft.Server/Console/ServerCliEngine.cpp index 85acca13..82bbdcc8 100644 --- a/Minecraft.Server/Console/ServerCliEngine.cpp +++ b/Minecraft.Server/Console/ServerCliEngine.cpp @@ -159,7 +159,7 @@ namespace ServerRuntime } IServerCliCommand *command = m_registry->FindMutable(parsed.tokens[0]); - if (command == nullptr) + if (command == NULL) { LogWarn("Unknown command: " + parsed.tokens[0]); return false; @@ -170,7 +170,7 @@ namespace ServerRuntime void ServerCliEngine::BuildCompletions(const std::string &line, std::vector *out) const { - if (out == nullptr) + if (out == NULL) { return; } @@ -211,7 +211,7 @@ namespace ServerRuntime else { const IServerCliCommand *command = m_registry->Find(commandToken); - if (command != nullptr) + if (command != NULL) { command->Complete(context, this, out); } @@ -254,13 +254,13 @@ namespace ServerRuntime { std::vector result; MinecraftServer *server = MinecraftServer::getInstance(); - if (server == nullptr) + if (server == NULL) { return result; } PlayerList *players = server->getPlayers(); - if (players == nullptr) + if (players == NULL) { return result; } @@ -268,7 +268,7 @@ namespace ServerRuntime for (size_t i = 0; i < players->players.size(); ++i) { std::shared_ptr player = players->players[i]; - if (player != nullptr) + if (player != NULL) { result.push_back(StringUtils::WideToUtf8(player->getName())); } @@ -280,13 +280,13 @@ namespace ServerRuntime std::shared_ptr ServerCliEngine::FindPlayerByNameUtf8(const std::string &name) const { MinecraftServer *server = MinecraftServer::getInstance(); - if (server == nullptr) + if (server == NULL) { return nullptr; } PlayerList *players = server->getPlayers(); - if (players == nullptr) + if (players == NULL) { return nullptr; } @@ -295,7 +295,7 @@ namespace ServerRuntime for (size_t i = 0; i < players->players.size(); ++i) { std::shared_ptr player = players->players[i]; - if (player != nullptr && equalsIgnoreCase(player->getName(), target)) + if (player != NULL && equalsIgnoreCase(player->getName(), target)) { return player; } @@ -345,28 +345,28 @@ namespace ServerRuntime return GameType::CREATIVE; } - char *end = nullptr; + char *end = NULL; long id = strtol(lowered.c_str(), &end, 10); - if (end != nullptr && *end == 0) + if (end != NULL && *end == 0) { // Numeric fallback supports extended ids handled by level settings. return LevelSettings::validateGameType((int)id); } - return nullptr; + return NULL; } bool ServerCliEngine::DispatchWorldCommand(EGameCommand command, byteArray commandData, const std::shared_ptr &sender) const { MinecraftServer *server = MinecraftServer::getInstance(); - if (server == nullptr) + if (server == NULL) { LogWarn("MinecraftServer instance is not available."); return false; } CommandDispatcher *dispatcher = server->getCommandDispatcher(); - if (dispatcher == nullptr) + if (dispatcher == NULL) { LogWarn("Command dispatcher is not available."); return false; diff --git a/Minecraft.Server/Console/ServerCliInput.cpp b/Minecraft.Server/Console/ServerCliInput.cpp index 8064cfed..d873980a 100644 --- a/Minecraft.Server/Console/ServerCliInput.cpp +++ b/Minecraft.Server/Console/ServerCliInput.cpp @@ -14,7 +14,7 @@ namespace bool UseStreamInputMode() { const char *mode = getenv("SERVER_CLI_INPUT_MODE"); - if (mode != nullptr) + if (mode != NULL) { return _stricmp(mode, "stream") == 0 || _stricmp(mode, "stdin") == 0; @@ -25,7 +25,7 @@ namespace int WaitForStdinReadable(HANDLE stdinHandle, DWORD waitMs) { - if (stdinHandle == nullptr || stdinHandle == INVALID_HANDLE_VALUE) + if (stdinHandle == NULL || stdinHandle == INVALID_HANDLE_VALUE) { return -1; } @@ -34,7 +34,7 @@ namespace if (fileType == FILE_TYPE_PIPE) { DWORD available = 0; - if (!PeekNamedPipe(stdinHandle, nullptr, 0, nullptr, &available, nullptr)) + if (!PeekNamedPipe(stdinHandle, NULL, 0, NULL, &available, NULL)) { return -1; } @@ -64,11 +64,11 @@ namespace namespace ServerRuntime { // C-style completion callback bridge requires a static instance pointer. - ServerCliInput *ServerCliInput::s_instance = nullptr; + ServerCliInput *ServerCliInput::s_instance = NULL; ServerCliInput::ServerCliInput() : m_running(false) - , m_engine(nullptr) + , m_engine(NULL) { } @@ -79,7 +79,7 @@ namespace ServerRuntime void ServerCliInput::Start(ServerCliEngine *engine) { - if (engine == nullptr || m_running.exchange(true)) + if (engine == NULL || m_running.exchange(true)) { return; } @@ -107,14 +107,14 @@ namespace ServerRuntime CancelSynchronousIo((HANDLE)m_inputThread.native_handle()); m_inputThread.join(); } - linenoiseSetCompletionCallback(nullptr); + linenoiseSetCompletionCallback(NULL); if (s_instance == this) { - s_instance = nullptr; + s_instance = NULL; } - m_engine = nullptr; + m_engine = NULL; LogInfo("console", "CLI input thread stopped."); } @@ -143,9 +143,9 @@ namespace ServerRuntime while (m_running) { char *line = linenoise("server> "); - if (line == nullptr) + if (line == NULL) { - // nullptr is expected on stop request (or Ctrl+C inside linenoise). + // NULL is expected on stop request (or Ctrl+C inside linenoise). if (!m_running) { break; @@ -166,7 +166,7 @@ namespace ServerRuntime void ServerCliInput::RunStreamInputLoop() { HANDLE stdinHandle = GetStdHandle(STD_INPUT_HANDLE); - if (stdinHandle == nullptr || stdinHandle == INVALID_HANDLE_VALUE) + if (stdinHandle == NULL || stdinHandle == INVALID_HANDLE_VALUE) { LogWarn("console", "stream input mode requested but STDIN handle is unavailable; falling back to linenoise."); RunLinenoiseLoop(); @@ -190,7 +190,7 @@ namespace ServerRuntime char ch = 0; DWORD bytesRead = 0; - if (!ReadFile(stdinHandle, &ch, 1, &bytesRead, nullptr) || bytesRead == 0) + if (!ReadFile(stdinHandle, &ch, 1, &bytesRead, NULL) || bytesRead == 0) { Sleep(10); continue; @@ -249,7 +249,7 @@ namespace ServerRuntime void ServerCliInput::EnqueueLine(const char *line) { - if (line == nullptr || line[0] == 0 || m_engine == nullptr) + if (line == NULL || line[0] == 0 || m_engine == NULL) { return; } @@ -262,7 +262,7 @@ namespace ServerRuntime void ServerCliInput::CompletionThunk(const char *line, linenoiseCompletions *completions) { // Static thunk forwards callback into instance state. - if (s_instance != nullptr) + if (s_instance != NULL) { s_instance->BuildCompletions(line, completions); } @@ -270,7 +270,7 @@ namespace ServerRuntime void ServerCliInput::BuildCompletions(const char *line, linenoiseCompletions *completions) { - if (line == nullptr || completions == nullptr || m_engine == nullptr) + if (line == NULL || completions == NULL || m_engine == NULL) { return; } diff --git a/Minecraft.Server/Console/ServerCliRegistry.cpp b/Minecraft.Server/Console/ServerCliRegistry.cpp index 0bb666ca..432907b2 100644 --- a/Minecraft.Server/Console/ServerCliRegistry.cpp +++ b/Minecraft.Server/Console/ServerCliRegistry.cpp @@ -52,7 +52,7 @@ namespace ServerRuntime auto it = m_lookup.find(key); if (it == m_lookup.end()) { - return nullptr; + return NULL; } return it->second; } @@ -63,7 +63,7 @@ namespace ServerRuntime auto it = m_lookup.find(key); if (it == m_lookup.end()) { - return nullptr; + return NULL; } return it->second; } diff --git a/Minecraft.Server/Console/commands/list/CliCommandList.cpp b/Minecraft.Server/Console/commands/list/CliCommandList.cpp index dcace876..a9c5a212 100644 --- a/Minecraft.Server/Console/commands/list/CliCommandList.cpp +++ b/Minecraft.Server/Console/commands/list/CliCommandList.cpp @@ -28,7 +28,7 @@ namespace ServerRuntime { (void)line; MinecraftServer *server = MinecraftServer::getInstance(); - if (server == nullptr || server->getPlayers() == nullptr) + if (server == NULL || server->getPlayers() == NULL) { engine->LogWarn("Player list is not available."); return false; diff --git a/Minecraft.Server/ServerLogManager.cpp b/Minecraft.Server/ServerLogManager.cpp index 89ab2d5f..84805f7e 100644 --- a/Minecraft.Server/ServerLogManager.cpp +++ b/Minecraft.Server/ServerLogManager.cpp @@ -47,7 +47,7 @@ namespace ServerRuntime static void ResetConnectionLogEntry(ConnectionLogEntry *entry) { - if (entry == nullptr) + if (entry == NULL) { return; } @@ -58,7 +58,7 @@ namespace ServerRuntime static std::string NormalizeRemoteIp(const char *ip) { - if (ip == nullptr || ip[0] == 0) + if (ip == NULL || ip[0] == 0) { return std::string("unknown"); } @@ -80,7 +80,7 @@ namespace ServerRuntime // Default to the main app channel when the caller does not provide a source tag. static const char *NormalizeClientLogSource(const char *source) { - if (source == nullptr || source[0] == 0) + if (source == NULL || source[0] == 0) { return "app"; } @@ -101,7 +101,7 @@ namespace ServerRuntime // Split one debug payload into individual lines so each line becomes a prompt-safe server log entry. static void ForwardClientDebugMessage(const char *source, const char *message) { - if (message == nullptr || message[0] == 0) + if (message == NULL || message[0] == 0) { return; } @@ -131,7 +131,7 @@ namespace ServerRuntime // Share the same formatting path for app, user, and legacy debug-spew forwards. static void ForwardFormattedClientDebugLogV(const char *source, const char *format, va_list args) { - if (!IsDedicatedServerLoggingEnabled() || format == nullptr || format[0] == 0) + if (!IsDedicatedServerLoggingEnabled() || format == NULL || format[0] == 0) { return; } @@ -376,7 +376,7 @@ namespace ServerRuntime */ bool TryGetConnectionRemoteIp(unsigned char smallId, std::string *outIp) { - if (!IsDedicatedServerLoggingEnabled() || outIp == nullptr) + if (!IsDedicatedServerLoggingEnabled() || outIp == NULL) { return false; } diff --git a/Minecraft.Server/ServerLogger.cpp b/Minecraft.Server/ServerLogger.cpp index 14aa7e1a..0c7c567f 100644 --- a/Minecraft.Server/ServerLogger.cpp +++ b/Minecraft.Server/ServerLogger.cpp @@ -14,7 +14,7 @@ static volatile LONG g_minLogLevel = (LONG)eServerLogLevel_Info; static const char *NormalizeCategory(const char *category) { - if (category == nullptr || category[0] == 0) + if (category == NULL || category[0] == 0) { return "server"; } @@ -56,7 +56,7 @@ static WORD LogLevelToColor(EServerLogLevel level) static void BuildTimestamp(char *buffer, size_t bufferSize) { - if (buffer == nullptr || bufferSize == 0) + if (buffer == NULL || bufferSize == 0) { return; } @@ -91,7 +91,7 @@ static void WriteLogLine(EServerLogLevel level, const char *category, const char linenoiseExternalWriteBegin(); const char *safeCategory = NormalizeCategory(category); - const char *safeMessage = (message != nullptr) ? message : ""; + const char *safeMessage = (message != NULL) ? message : ""; char timestamp[32] = {}; BuildTimestamp(timestamp, sizeof(timestamp)); @@ -99,7 +99,7 @@ static void WriteLogLine(EServerLogLevel level, const char *category, const char HANDLE stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO originalInfo; bool hasColorConsole = false; - if (stdoutHandle != INVALID_HANDLE_VALUE && stdoutHandle != nullptr) + if (stdoutHandle != INVALID_HANDLE_VALUE && stdoutHandle != NULL) { if (GetConsoleScreenBufferInfo(stdoutHandle, &originalInfo)) { @@ -127,7 +127,7 @@ static void WriteLogLine(EServerLogLevel level, const char *category, const char static void WriteLogLineV(EServerLogLevel level, const char *category, const char *format, va_list args) { char messageBuffer[2048] = {}; - if (format == nullptr) + if (format == NULL) { WriteLogLine(level, category, ""); return; @@ -139,7 +139,7 @@ static void WriteLogLineV(EServerLogLevel level, const char *category, const cha bool TryParseServerLogLevel(const char *value, EServerLogLevel *outLevel) { - if (value == nullptr || outLevel == nullptr) + if (value == NULL || outLevel == NULL) { return false; } @@ -252,7 +252,7 @@ void LogWorldIO(const char *message) void LogWorldName(const char *prefix, const std::wstring &name) { std::string utf8 = StringUtils::WideToUtf8(name); - LogInfof("world-io", "%s: %s", (prefix != nullptr) ? prefix : "name", utf8.c_str()); + LogInfof("world-io", "%s: %s", (prefix != NULL) ? prefix : "name", utf8.c_str()); } } diff --git a/Minecraft.Server/ServerProperties.cpp b/Minecraft.Server/ServerProperties.cpp index f8c8de36..d6ba64e7 100644 --- a/Minecraft.Server/ServerProperties.cpp +++ b/Minecraft.Server/ServerProperties.cpp @@ -117,7 +117,7 @@ static int ClampInt(int value, int minValue, int maxValue) static bool TryParseBool(const std::string &value, bool *outValue) { - if (outValue == nullptr) + if (outValue == NULL) { return false; } @@ -138,7 +138,7 @@ static bool TryParseBool(const std::string &value, bool *outValue) static bool TryParseInt(const std::string &value, int *outValue) { - if (outValue == nullptr) + if (outValue == NULL) { return false; } @@ -149,7 +149,7 @@ static bool TryParseInt(const std::string &value, int *outValue) return false; } - char *end = nullptr; + char *end = NULL; long parsed = strtol(trimmed.c_str(), &end, 10); if (end == trimmed.c_str() || *end != 0) { @@ -162,7 +162,7 @@ static bool TryParseInt(const std::string &value, int *outValue) static bool TryParseInt64(const std::string &value, __int64 *outValue) { - if (outValue == nullptr) + if (outValue == NULL) { return false; } @@ -173,7 +173,7 @@ static bool TryParseInt64(const std::string &value, __int64 *outValue) return false; } - char *end = nullptr; + char *end = NULL; __int64 parsed = _strtoi64(trimmed.c_str(), &end, 10); if (end == trimmed.c_str() || *end != 0) { @@ -265,7 +265,7 @@ static std::string NormalizeSaveId(const std::string &source) static void ApplyDefaultServerProperties(std::unordered_map *properties) { - if (properties == nullptr) + if (properties == NULL) { return; } @@ -288,13 +288,13 @@ static void ApplyDefaultServerProperties(std::unordered_map *properties, int *outParsedCount) { - if (properties == nullptr) + if (properties == NULL) { return false; } std::string text; - if (filePath == nullptr || !FileUtils::ReadTextFile(filePath, &text)) + if (filePath == NULL || !FileUtils::ReadTextFile(filePath, &text)) { return false; } @@ -373,7 +373,7 @@ static bool ReadServerPropertiesFile(const char *filePath, std::unordered_map &properties) { - if (filePath == nullptr) + if (filePath == NULL) { return false; } @@ -428,7 +428,7 @@ static bool ReadNormalizedBoolProperty( if (raw != normalized) { (*properties)[key] = normalized; - if (shouldWrite != nullptr) + if (shouldWrite != NULL) { *shouldWrite = true; } @@ -457,7 +457,7 @@ static int ReadNormalizedIntProperty( if (raw != normalized) { (*properties)[key] = normalized; - if (shouldWrite != nullptr) + if (shouldWrite != NULL) { *shouldWrite = true; } @@ -486,7 +486,7 @@ static std::string ReadNormalizedStringProperty( if (value != (*properties)[key]) { (*properties)[key] = value; - if (shouldWrite != nullptr) + if (shouldWrite != NULL) { *shouldWrite = true; } @@ -507,7 +507,7 @@ static bool ReadNormalizedOptionalInt64Property( if ((*properties)[key] != "") { (*properties)[key] = ""; - if (shouldWrite != nullptr) + if (shouldWrite != NULL) { *shouldWrite = true; } @@ -519,7 +519,7 @@ static bool ReadNormalizedOptionalInt64Property( if (!TryParseInt64(raw, &parsed)) { (*properties)[key] = ""; - if (shouldWrite != nullptr) + if (shouldWrite != NULL) { *shouldWrite = true; } @@ -530,13 +530,13 @@ static bool ReadNormalizedOptionalInt64Property( if (raw != normalized) { (*properties)[key] = normalized; - if (shouldWrite != nullptr) + if (shouldWrite != NULL) { *shouldWrite = true; } } - if (outValue != nullptr) + if (outValue != NULL) { *outValue = parsed; } @@ -560,7 +560,7 @@ static EServerLogLevel ReadNormalizedLogLevelProperty( if (raw != normalized) { (*properties)[key] = normalized; - if (shouldWrite != nullptr) + if (shouldWrite != NULL) { *shouldWrite = true; } @@ -594,13 +594,13 @@ static std::string ReadNormalizedLevelTypeProperty( if (raw != normalized) { (*properties)[key] = normalized; - if (shouldWrite != nullptr) + if (shouldWrite != NULL) { *shouldWrite = true; } } - if (outIsFlat != nullptr) + if (outIsFlat != NULL) { *outIsFlat = isFlat; } @@ -658,7 +658,7 @@ static int WorldSizeToHellScale(int worldSize) static bool TryParseWorldSize(const std::string &lowered, int *outWorldSize) { - if (outWorldSize == nullptr) + if (outWorldSize == NULL) { return false; } @@ -712,17 +712,17 @@ static int ReadNormalizedWorldSizeProperty( if (raw != normalized) { (*properties)[key] = normalized; - if (shouldWrite != nullptr) + if (shouldWrite != NULL) { *shouldWrite = true; } } - if (outXzChunks != nullptr) + if (outXzChunks != NULL) { *outXzChunks = WorldSizeToXzChunks(worldSize); } - if (outHellScale != nullptr) + if (outHellScale != NULL) { *outHellScale = WorldSizeToHellScale(worldSize); } diff --git a/Minecraft.Server/Windows64/ServerMain.cpp b/Minecraft.Server/Windows64/ServerMain.cpp index 6ad62b90..a8d5fc66 100644 --- a/Minecraft.Server/Windows64/ServerMain.cpp +++ b/Minecraft.Server/Windows64/ServerMain.cpp @@ -183,10 +183,10 @@ using ServerRuntime::WorldBootstrapResult; static bool ParseIntArg(const char *value, int *outValue) { - if (value == nullptr || *value == 0) + if (value == NULL || *value == 0) return false; - char *end = nullptr; + char *end = NULL; long parsed = strtol(value, &end, 10); if (end == value || *end != 0) return false; @@ -197,10 +197,10 @@ static bool ParseIntArg(const char *value, int *outValue) static bool ParseInt64Arg(const char *value, __int64 *outValue) { - if (value == nullptr || *value == 0) + if (value == NULL || *value == 0) return false; - char *end = nullptr; + char *end = NULL; __int64 parsed = _strtoi64(value, &end, 10); if (end == value || *end != 0) return false; @@ -277,9 +277,9 @@ static bool ParseCommandLine(int argc, char **argv, DedicatedServerConfig *confi static void SetExeWorkingDirectory() { char exePath[MAX_PATH] = {}; - GetModuleFileNameA(nullptr, exePath, MAX_PATH); + GetModuleFileNameA(NULL, exePath, MAX_PATH); char *slash = strrchr(exePath, '\\'); - if (slash != nullptr) + if (slash != NULL) { *(slash + 1) = 0; SetCurrentDirectoryA(exePath); @@ -288,7 +288,7 @@ static void SetExeWorkingDirectory() static void ApplyServerPropertiesToDedicatedConfig(const ServerPropertiesConfig &serverProperties, DedicatedServerConfig *config) { - if (config == nullptr) + if (config == NULL) { return; } @@ -420,7 +420,7 @@ int main(int argc, char **argv) #endif LogStartupStep("registering hidden window class"); - HINSTANCE hInstance = GetModuleHandle(nullptr); + HINSTANCE hInstance = GetModuleHandle(NULL); MyRegisterClass(hInstance); LogStartupStep("creating hidden window"); @@ -490,7 +490,7 @@ int main(int argc, char **argv) LogStartupStep("creating Minecraft singleton"); Minecraft::main(); Minecraft *minecraft = Minecraft::GetInstance(); - if (minecraft == nullptr) + if (minecraft == NULL) { LogError("startup", "Minecraft initialization failed."); CleanupDevice(); @@ -685,11 +685,11 @@ int main(int argc, char **argv) LogInfof("shutdown", "Dedicated server stopped"); MinecraftServer *server = MinecraftServer::getInstance(); - if (server != nullptr) + if (server != NULL) { server->setSaveOnExit(true); } - if (server != nullptr) + if (server != NULL) { LogWorldIO("requesting save before shutdown"); LogWorldIO("using saveOnExit for shutdown"); @@ -699,7 +699,7 @@ int main(int argc, char **argv) if (g_NetworkManager.ServerStoppedValid()) { - C4JThread waitThread(&WaitForServerStoppedThreadProc, nullptr, "WaitServerStopped"); + C4JThread waitThread(&WaitForServerStoppedThreadProc, NULL, "WaitServerStopped"); waitThread.Run(); waitThread.WaitForCompletion(INFINITE); } diff --git a/Minecraft.Server/WorldManager.cpp b/Minecraft.Server/WorldManager.cpp index 91c36dc1..b9ec3dd9 100644 --- a/Minecraft.Server/WorldManager.cpp +++ b/Minecraft.Server/WorldManager.cpp @@ -31,7 +31,7 @@ struct SaveInfoQueryContext SaveInfoQueryContext() : done(false) , success(false) - , details(nullptr) + , details(NULL) { } }; @@ -75,7 +75,7 @@ static void SetStorageSaveUniqueFilename(const std::string &saveFilename) static void LogSaveFilename(const char *prefix, const std::string &saveFilename) { - LogInfof("world-io", "%s: %s", (prefix != nullptr) ? prefix : "save-filename", saveFilename.c_str()); + LogInfof("world-io", "%s: %s", (prefix != NULL) ? prefix : "save-filename", saveFilename.c_str()); } /** @@ -86,7 +86,7 @@ static void LogSaveFilename(const char *prefix, const std::string &saveFilename) */ static bool EnsureDirectoryExists(const std::wstring &directoryPath, bool *outCreated) { - if (outCreated != nullptr) + if (outCreated != NULL) { *outCreated = false; } @@ -107,9 +107,9 @@ static bool EnsureDirectoryExists(const std::wstring &directoryPath, bool *outCr return false; } - if (CreateDirectoryW(directoryPath.c_str(), nullptr)) + if (CreateDirectoryW(directoryPath.c_str(), NULL)) { - if (outCreated != nullptr) + if (outCreated != NULL) { *outCreated = true; } @@ -189,7 +189,7 @@ static void LogEnumeratedSaveInfo(int index, const SAVE_INFO &saveInfo) static int GetSavesInfoCallbackProc(LPVOID lpParam, SAVE_DETAILS *pSaveDetails, const bool bRes) { SaveInfoQueryContext *context = (SaveInfoQueryContext *)lpParam; - if (context != nullptr) + if (context != NULL) { context->details = pSaveDetails; context->success = bRes; @@ -207,7 +207,7 @@ static int GetSavesInfoCallbackProc(LPVOID lpParam, SAVE_DETAILS *pSaveDetails, static int LoadSaveDataCallbackProc(LPVOID lpParam, const bool bIsCorrupt, const bool bIsOwner) { SaveDataLoadContext *context = (SaveDataLoadContext *)lpParam; - if (context != nullptr) + if (context != NULL) { context->isCorrupt = bIsCorrupt; context->isOwner = bIsOwner; @@ -236,12 +236,12 @@ static bool WaitForSaveInfoResult(SaveInfoQueryContext *context, DWORD timeoutMs return true; } - if (context->details == nullptr) + if (context->details == NULL) { // Some implementations fill ReturnSavesInfo before the callback // Keep polling as a fallback instead of relying only on callback completion SAVE_DETAILS *details = StorageManager.ReturnSavesInfo(); - if (details != nullptr) + if (details != NULL) { context->details = details; context->success = true; @@ -250,7 +250,7 @@ static bool WaitForSaveInfoResult(SaveInfoQueryContext *context, DWORD timeoutMs } } - if (tickProc != nullptr) + if (tickProc != NULL) { tickProc(); } @@ -278,7 +278,7 @@ static bool WaitForSaveLoadResult(SaveDataLoadContext *context, DWORD timeoutMs, return true; } - if (tickProc != nullptr) + if (tickProc != NULL) { tickProc(); } @@ -370,12 +370,12 @@ static EWorldSaveLoadResult PrepareWorldSaveData( LoadSaveDataThreadParam **outSaveData, std::string *outResolvedSaveFilename) { - if (outSaveData == nullptr) + if (outSaveData == NULL) { return eWorldSaveLoad_Failed; } - *outSaveData = nullptr; - if (outResolvedSaveFilename != nullptr) + *outSaveData = NULL; + if (outResolvedSaveFilename != NULL) { outResolvedSaveFilename->clear(); } @@ -403,11 +403,11 @@ static EWorldSaveLoadResult PrepareWorldSaveData( return eWorldSaveLoad_Failed; } - if (infoContext.details == nullptr) + if (infoContext.details == NULL) { infoContext.details = StorageManager.ReturnSavesInfo(); } - if (infoContext.details == nullptr) + if (infoContext.details == NULL) { LogWorldIO("failed to retrieve save list"); return eWorldSaveLoad_Failed; @@ -485,7 +485,7 @@ static EWorldSaveLoadResult PrepareWorldSaveData( resolvedSaveFilename = targetSaveFilename; } - if (outResolvedSaveFilename != nullptr) + if (outResolvedSaveFilename != NULL) { *outResolvedSaveFilename = resolvedSaveFilename; } @@ -620,11 +620,11 @@ bool WaitForWorldActionIdle( { // Keep network and storage progressing while waiting // If this stops, save action itself may stall and time out - if (tickProc != nullptr) + if (tickProc != NULL) { tickProc(); } - if (handleActionsProc != nullptr) + if (handleActionsProc != NULL) { handleActionsProc(); } diff --git a/Minecraft.Server/WorldManager.h b/Minecraft.Server/WorldManager.h index 579b05c9..a4a8e77b 100644 --- a/Minecraft.Server/WorldManager.h +++ b/Minecraft.Server/WorldManager.h @@ -41,14 +41,14 @@ namespace ServerRuntime { /** Bootstrap status */ EWorldBootstrapStatus status; - /** Save data used for server initialization, `nullptr` when creating a new world */ + /** Save data used for server initialization, `NULL` when creating a new world */ LoadSaveDataThreadParam *saveData; /** Save ID that was actually selected */ std::string resolvedSaveId; WorldBootstrapResult() : status(eWorldBootstrap_Failed) - , saveData(nullptr) + , saveData(NULL) { } }; diff --git a/Minecraft.Server/vendor/linenoise/linenoise.c b/Minecraft.Server/vendor/linenoise/linenoise.c index 7a770d2e..a5b8ac5f 100644 --- a/Minecraft.Server/vendor/linenoise/linenoise.c +++ b/Minecraft.Server/vendor/linenoise/linenoise.c @@ -17,9 +17,9 @@ typedef struct linenoiseHistory { int maxLen; } linenoiseHistory; -static linenoiseCompletionCallback *g_completionCallback = nullptr; +static linenoiseCompletionCallback *g_completionCallback = NULL; static volatile LONG g_stopRequested = 0; -static linenoiseHistory g_history = { nullptr, 0, 0, 128 }; +static linenoiseHistory g_history = { NULL, 0, 0, 128 }; /* Guards redraw/log interleaving so prompt and log lines do not overlap. */ static CRITICAL_SECTION g_ioLock; static volatile LONG g_ioLockState = 0; /* 0=not init, 1=init in progress, 2=ready */ @@ -71,9 +71,9 @@ static void linenoiseUnlockIo(void) */ static void linenoiseUpdateEditorState(const char *prompt, const char *buf, int len, int pos, int prevLen) { - if (prompt == nullptr) + if (prompt == NULL) prompt = ""; - if (buf == nullptr) + if (buf == NULL) buf = ""; strncpy_s(g_editorPrompt, sizeof(g_editorPrompt), prompt, _TRUNCATE); @@ -98,8 +98,8 @@ static char *linenoiseStrdup(const char *src) { size_t n = strlen(src) + 1; char *out = (char *)malloc(n); - if (out == nullptr) - return nullptr; + if (out == NULL) + return NULL; memcpy(out, src, n); return out; } @@ -114,7 +114,7 @@ static void linenoiseEnsureHistoryCapacity(int wanted) newCap *= 2; char **newItems = (char **)realloc(g_history.items, sizeof(char *) * (size_t)newCap); - if (newItems == nullptr) + if (newItems == NULL) return; g_history.items = newItems; @@ -129,19 +129,19 @@ static void linenoiseClearCompletions(linenoiseCompletions *lc) free(lc->cvec[i]); } free(lc->cvec); - lc->cvec = nullptr; + lc->cvec = NULL; lc->len = 0; } void linenoiseAddCompletion(linenoiseCompletions *lc, const char *str) { char **newVec = (char **)realloc(lc->cvec, sizeof(char *) * (lc->len + 1)); - if (newVec == nullptr) + if (newVec == NULL) return; lc->cvec = newVec; lc->cvec[lc->len] = linenoiseStrdup(str); - if (lc->cvec[lc->len] == nullptr) + if (lc->cvec[lc->len] == NULL) return; lc->len += 1; @@ -175,13 +175,13 @@ int linenoiseHistorySetMaxLen(int len) int linenoiseHistoryAdd(const char *line) { - if (line == nullptr || line[0] == 0) + if (line == NULL || line[0] == 0) return 0; if (g_history.len > 0) { const char *last = g_history.items[g_history.len - 1]; - if (last != nullptr && strcmp(last, line) == 0) + if (last != NULL && strcmp(last, line) == 0) return 1; } @@ -190,7 +190,7 @@ int linenoiseHistoryAdd(const char *line) return 0; g_history.items[g_history.len] = linenoiseStrdup(line); - if (g_history.items[g_history.len] == nullptr) + if (g_history.items[g_history.len] == NULL) return 0; g_history.len += 1; @@ -226,13 +226,13 @@ static void linenoiseWriteHint(const char *hint, size_t hintLen) CONSOLE_SCREEN_BUFFER_INFO originalInfo; int hasColorConsole = 0; - if (hint == nullptr || hintLen == 0) + if (hint == NULL || hintLen == 0) { return; } stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE); - if (stdoutHandle != INVALID_HANDLE_VALUE && stdoutHandle != nullptr) + if (stdoutHandle != INVALID_HANDLE_VALUE && stdoutHandle != NULL) { if (GetConsoleScreenBufferInfo(stdoutHandle, &originalInfo)) { @@ -270,19 +270,19 @@ static size_t linenoiseBuildHint(const char *buf, char *hint, size_t hintSize) size_t inputLen = 0; size_t i = 0; - if (hint == nullptr || hintSize == 0) + if (hint == NULL || hintSize == 0) { return 0; } hint[0] = 0; - if (buf == nullptr || buf[0] == 0 || g_completionCallback == nullptr) + if (buf == NULL || buf[0] == 0 || g_completionCallback == NULL) { return 0; } lc.len = 0; - lc.cvec = nullptr; + lc.cvec = NULL; /* Reuse the completion callback and derive a "ghost text" suffix from the first extending match. */ g_completionCallback(buf, &lc); @@ -290,7 +290,7 @@ static size_t linenoiseBuildHint(const char *buf, char *hint, size_t hintSize) for (i = 0; i < lc.len; ++i) { const char *candidate = lc.cvec[i]; - if (candidate == nullptr) + if (candidate == NULL) { continue; } @@ -412,14 +412,14 @@ static void linenoiseApplyCompletion(const char *prompt, char *buf, int *len, in linenoiseCompletions lc; int i; - if (g_completionCallback == nullptr) + if (g_completionCallback == NULL) { Beep(750, 15); return; } lc.len = 0; - lc.cvec = nullptr; + lc.cvec = NULL; g_completionCallback(buf, &lc); if (lc.len == 0) @@ -471,7 +471,7 @@ char *linenoise(const char *prompt) int prevLen = 0; int historyIndex = g_history.len; - if (prompt == nullptr) + if (prompt == NULL) prompt = ""; buf[0] = 0; @@ -547,7 +547,7 @@ char *linenoise(const char *prompt) fputc('\n', stdout); fflush(stdout); linenoiseUnlockIo(); - return nullptr; + return NULL; } if (c == '\r' || c == '\n') @@ -606,7 +606,7 @@ char *linenoise(const char *prompt) fputc('\n', stdout); fflush(stdout); linenoiseUnlockIo(); - return nullptr; + return NULL; } void linenoiseExternalWriteBegin(void) diff --git a/Minecraft.Server/vendor/nlohmann/json.hpp b/Minecraft.Server/vendor/nlohmann/json.hpp index d4190117..82d69f7c 100644 --- a/Minecraft.Server/vendor/nlohmann/json.hpp +++ b/Minecraft.Server/vendor/nlohmann/json.hpp @@ -2211,13 +2211,13 @@ JSON_HEDLEY_DIAGNOSTIC_POP #if defined(__cplusplus) #if __cplusplus >= 201103L #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) - #elif defined(nullptr) - #define JSON_HEDLEY_NULL nullptr + #elif defined(NULL) + #define JSON_HEDLEY_NULL NULL #else #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0) #endif -#elif defined(nullptr) - #define JSON_HEDLEY_NULL nullptr +#elif defined(NULL) + #define JSON_HEDLEY_NULL NULL #else #define JSON_HEDLEY_NULL ((void*) 0) #endif diff --git a/Minecraft.World/ArrowAttackGoal.cpp b/Minecraft.World/ArrowAttackGoal.cpp index f04615e1..23a2d2ac 100644 --- a/Minecraft.World/ArrowAttackGoal.cpp +++ b/Minecraft.World/ArrowAttackGoal.cpp @@ -27,14 +27,14 @@ ArrowAttackGoal::ArrowAttackGoal(Mob *mob, float speed, int projectileType, int bool ArrowAttackGoal::canUse() { shared_ptr bestTarget = mob->getTarget(); - if (bestTarget == nullptr) return false; + if (bestTarget == NULL) return false; target = weak_ptr(bestTarget); return true; } bool ArrowAttackGoal::canContinueToUse() { - return target.lock() != nullptr && (canUse() || !mob->getNavigation()->isDone()); + return target.lock() != NULL && (canUse() || !mob->getNavigation()->isDone()); } void ArrowAttackGoal::stop() diff --git a/Minecraft.World/ByteArrayInputStream.cpp b/Minecraft.World/ByteArrayInputStream.cpp index c1a24926..29f6fc26 100644 --- a/Minecraft.World/ByteArrayInputStream.cpp +++ b/Minecraft.World/ByteArrayInputStream.cpp @@ -135,7 +135,7 @@ __int64 ByteArrayInputStream::skip(__int64 n) ByteArrayInputStream::~ByteArrayInputStream() { - if (buf.data != nullptr) + if (buf.data != NULL) { delete[] buf.data; } diff --git a/Minecraft.World/ByteArrayOutputStream.cpp b/Minecraft.World/ByteArrayOutputStream.cpp index 933b5cdd..9173941f 100644 --- a/Minecraft.World/ByteArrayOutputStream.cpp +++ b/Minecraft.World/ByteArrayOutputStream.cpp @@ -20,7 +20,7 @@ ByteArrayOutputStream::ByteArrayOutputStream(unsigned int size) ByteArrayOutputStream::~ByteArrayOutputStream() { - if (buf.data != nullptr) + if (buf.data != NULL) { delete[] buf.data; } diff --git a/Minecraft.World/ClothTile.cpp b/Minecraft.World/ClothTile.cpp index 301fbb7d..8c18b01c 100644 --- a/Minecraft.World/ClothTile.cpp +++ b/Minecraft.World/ClothTile.cpp @@ -4,7 +4,7 @@ ClothTile::ClothTile() : Tile(35, Material::cloth) { - icons = nullptr; + icons = NULL; } Icon *ClothTile::getTexture(int face, int data) diff --git a/Minecraft.World/ConsoleSaveFileOriginal.cpp b/Minecraft.World/ConsoleSaveFileOriginal.cpp index 7348effc..8a7d1f9e 100644 --- a/Minecraft.World/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/ConsoleSaveFileOriginal.cpp @@ -214,7 +214,7 @@ ConsoleSaveFileOriginal::~ConsoleSaveFileOriginal() pagesCommitted = 0; // Make sure we don't have any thumbnail data still waiting round - we can't need it now we've destroyed the save file anyway #if defined _XBOX - app.GetSaveThumbnail(nullptr,nullptr); + app.GetSaveThumbnail(NULL,NULL); #elif defined __PS3__ app.GetSaveThumbnail(nullptr,nullptr, nullptr,nullptr); #endif @@ -473,7 +473,7 @@ void ConsoleSaveFileOriginal::finalizeWrite() { unsigned int pagesRequired = ( desiredSize + (CSF_PAGE_SIZE - 1 ) ) / CSF_PAGE_SIZE; void *pvRet = VirtualAlloc(pvHeap, pagesRequired * CSF_PAGE_SIZE, COMMIT_ALLOCATION, PAGE_READWRITE); - if( pvRet == nullptr ) + if( pvRet == NULL ) { __debugbreak(); } diff --git a/Minecraft.World/EntityTile.cpp b/Minecraft.World/EntityTile.cpp index edf869fb..8dd68ff2 100644 --- a/Minecraft.World/EntityTile.cpp +++ b/Minecraft.World/EntityTile.cpp @@ -25,7 +25,7 @@ void EntityTile::triggerEvent(Level *level, int x, int y, int z, int b0, int b1) { Tile::triggerEvent(level, x, y, z, b0, b1); shared_ptr te = level->getTileEntity(x, y, z); - if (te != nullptr) + if (te != NULL) { te->triggerEvent(b0, b1); } diff --git a/Minecraft.World/FlatLevelSource.cpp b/Minecraft.World/FlatLevelSource.cpp index 0a9fb6b9..9ea1ed36 100644 --- a/Minecraft.World/FlatLevelSource.cpp +++ b/Minecraft.World/FlatLevelSource.cpp @@ -140,7 +140,7 @@ wstring FlatLevelSource::gatherStats() vector *FlatLevelSource::getMobsAt(MobCategory *mobCategory, int x, int y, int z) { Biome *biome = level->getBiome(x, z); - if (biome == nullptr) + if (biome == NULL) { return nullptr; } diff --git a/Minecraft.World/LevelChunk.cpp b/Minecraft.World/LevelChunk.cpp index f68c5896..584e3df1 100644 --- a/Minecraft.World/LevelChunk.cpp +++ b/Minecraft.World/LevelChunk.cpp @@ -1228,11 +1228,11 @@ void LevelChunk::addRidingEntities(shared_ptr rider, CompoundTag *riderT CompoundTag *mountTag = riderTag; shared_ptr ridingEntity = rider; - while (mountTag != nullptr && mountTag->contains(Entity::RIDING_TAG)) + while (mountTag != NULL && mountTag->contains(Entity::RIDING_TAG)) { CompoundTag *nextMountTag = mountTag->getCompound(Entity::RIDING_TAG); shared_ptr mount = EntityIO::loadStatic(nextMountTag, level); - if (mount == nullptr) + if (mount == NULL) { break; } diff --git a/Minecraft.World/LevelData.cpp b/Minecraft.World/LevelData.cpp index a64b8ab7..fbc10ddb 100644 --- a/Minecraft.World/LevelData.cpp +++ b/Minecraft.World/LevelData.cpp @@ -193,7 +193,7 @@ LevelData::LevelData(CompoundTag *tag) this->loadedPlayerTag = nullptr; ======= { - this->loadedPlayerTag = nullptr; + this->loadedPlayerTag = NULL; >>>>>>> origin/main } */ diff --git a/Minecraft.World/MonsterPlacerItem.cpp b/Minecraft.World/MonsterPlacerItem.cpp index 3b4cffa0..e5a84122 100644 --- a/Minecraft.World/MonsterPlacerItem.cpp +++ b/Minecraft.World/MonsterPlacerItem.cpp @@ -15,7 +15,7 @@ MonsterPlacerItem::MonsterPlacerItem(int id) : Item(id) { setMaxStackSize(16); // 4J-PB brought forward. It is 64 on PC, but we'll never be able to place that many setStackedByData(true); - overlay = nullptr; + overlay = NULL; } wstring MonsterPlacerItem::getHoverName(shared_ptr itemInstance) @@ -68,7 +68,7 @@ Icon *MonsterPlacerItem::getLayerIcon(int auxValue, int spriteLayer) shared_ptr MonsterPlacerItem::canSpawn(int iAuxVal, Level *level, int *piResult) { shared_ptr newEntity = EntityIO::newById(iAuxVal, level); - if (newEntity != nullptr) + if (newEntity != NULL) { bool canSpawn = false; @@ -182,7 +182,7 @@ bool MonsterPlacerItem::useOn(shared_ptr itemInstance, shared_ptr< level->setTile(x,y,z,0); level->setTile(x,y,z,Tile::mobSpawner_Id); shared_ptr mste = dynamic_pointer_cast( level->getTileEntity(x,y,z) ); - if(mste != nullptr) + if(mste != NULL) { mste->setEntityId( EntityIO::getEncodeId(itemInstance->getAuxValue()) ); return true; @@ -203,7 +203,7 @@ bool MonsterPlacerItem::useOn(shared_ptr itemInstance, shared_ptr< } int iResult=0; - bool spawned = spawnMobAt(level, itemInstance->getAuxValue(), x + .5, y + yOff, z + .5, &iResult) != nullptr; + bool spawned = spawnMobAt(level, itemInstance->getAuxValue(), x + .5, y + yOff, z + .5, &iResult) != NULL; if(bTestUseOnOnly) { diff --git a/Minecraft.World/MusicTile.cpp b/Minecraft.World/MusicTile.cpp index b8290c5e..ebdb9680 100644 --- a/Minecraft.World/MusicTile.cpp +++ b/Minecraft.World/MusicTile.cpp @@ -14,7 +14,7 @@ void MusicTile::neighborChanged(Level *level, int x, int y, int z, int type) bool signal = level->hasNeighborSignal(x, y, z); shared_ptr mte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); app.DebugPrintf("-------- Signal is %s, tile is currently %s\n",signal?"TRUE":"FALSE", mte->on?"ON":"OFF"); - if (mte != nullptr && mte->on != signal) + if (mte != NULL && mte->on != signal) { if (signal) { @@ -35,7 +35,7 @@ bool MusicTile::use(Level *level, int x, int y, int z, shared_ptr player if (soundOnly) return false; if (level->isClientSide) return true; shared_ptr mte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); - if (mte != nullptr ) + if (mte != NULL ) { mte->tune(); mte->playNote(level, x, y, z); @@ -47,7 +47,7 @@ void MusicTile::attack(Level *level, int x, int y, int z, shared_ptr pla { if (level->isClientSide) return; shared_ptr mte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); - if( mte != nullptr ) mte->playNote(level, x, y, z); + if( mte != NULL ) mte->playNote(level, x, y, z); } shared_ptr MusicTile::newTileEntity(Level *level) diff --git a/Minecraft.World/NetherStalkTile.cpp b/Minecraft.World/NetherStalkTile.cpp index adc9e26d..eadf9646 100644 --- a/Minecraft.World/NetherStalkTile.cpp +++ b/Minecraft.World/NetherStalkTile.cpp @@ -12,7 +12,7 @@ NetherStalkTile::NetherStalkTile(int id) : Bush(id) setTicking(true); updateDefaultShape(); - icons = nullptr; + icons = NULL; } // 4J Added override @@ -39,7 +39,7 @@ void NetherStalkTile::tick(Level *level, int x, int y, int z, Random *random) if (age < MAX_AGE) { //Biome *biome = biomeSource->getBiome(x, z); - //if (dynamic_cast(biome) != nullptr) + //if (dynamic_cast(biome) != NULL) //{ if (random->nextInt(10) == 0) { diff --git a/Minecraft.World/Ozelot.cpp b/Minecraft.World/Ozelot.cpp index f4a011a2..3c05f357 100644 --- a/Minecraft.World/Ozelot.cpp +++ b/Minecraft.World/Ozelot.cpp @@ -214,7 +214,7 @@ bool Ozelot::interact(shared_ptr player) } else { - if (temptGoal->isRunning() && item != nullptr && item->id == Item::fish_raw_Id && player->distanceToSqr(shared_from_this()) < 3 * 3) + if (temptGoal->isRunning() && item != NULL && item->id == Item::fish_raw_Id && player->distanceToSqr(shared_from_this()) < 3 * 3) { // 4J-PB - don't lose the fish in creative mode if (!player->abilities.instabuild) item->count--; @@ -272,7 +272,7 @@ shared_ptr Ozelot::getBreedOffspring(shared_ptr target) bool Ozelot::isFood(shared_ptr itemInstance) { - return itemInstance != nullptr && itemInstance->id == Item::fish_raw_Id; + return itemInstance != NULL && itemInstance->id == Item::fish_raw_Id; } bool Ozelot::canMate(shared_ptr animal) @@ -281,7 +281,7 @@ bool Ozelot::canMate(shared_ptr animal) if (!isTame()) return false; shared_ptr partner = dynamic_pointer_cast(animal); - if (partner == nullptr) return false; + if (partner == NULL) return false; if (!partner->isTame()) return false; return isInLove() && partner->isInLove(); diff --git a/Minecraft.World/OzelotAttackGoal.cpp b/Minecraft.World/OzelotAttackGoal.cpp index ab3336ec..27ca2b5c 100644 --- a/Minecraft.World/OzelotAttackGoal.cpp +++ b/Minecraft.World/OzelotAttackGoal.cpp @@ -21,14 +21,14 @@ OzelotAttackGoal::OzelotAttackGoal(Mob *mob) bool OzelotAttackGoal::canUse() { shared_ptr bestTarget = mob->getTarget(); - if (bestTarget == nullptr) return false; + if (bestTarget == NULL) return false; target = weak_ptr(bestTarget); return true; } bool OzelotAttackGoal::canContinueToUse() { - if (target.lock() == nullptr || !target.lock()->isAlive()) return false; + if (target.lock() == NULL || !target.lock()->isAlive()) return false; if (mob->distanceToSqr(target.lock()) > 15 * 15) return false; return !mob->getNavigation()->isDone() || canUse(); } diff --git a/Minecraft.World/RecordPlayerTile.cpp b/Minecraft.World/RecordPlayerTile.cpp index 4e7dba49..de5f7386 100644 --- a/Minecraft.World/RecordPlayerTile.cpp +++ b/Minecraft.World/RecordPlayerTile.cpp @@ -10,7 +10,7 @@ RecordPlayerTile::RecordPlayerTile(int id) : EntityTile(id, Material::wood) { - iconTop = nullptr; + iconTop = NULL; } Icon *RecordPlayerTile::getTexture(int face, int data) @@ -54,7 +54,7 @@ void RecordPlayerTile::dropRecording(Level *level, int x, int y, int z) if (level->isClientSide) return; shared_ptr rte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); - if( rte == nullptr ) return; + if( rte == NULL ) return; int oldRecord = rte->record; if (oldRecord == 0) return; diff --git a/Minecraft.World/RepairMenu.cpp b/Minecraft.World/RepairMenu.cpp index 7b0078b9..a4c48edf 100644 --- a/Minecraft.World/RepairMenu.cpp +++ b/Minecraft.World/RepairMenu.cpp @@ -55,7 +55,7 @@ void RepairMenu::createResult() if (DEBUG_COST) app.DebugPrintf("----"); - if (input == nullptr) + if (input == NULL) { resultSlots->setItem(0, nullptr); cost = 0; @@ -68,15 +68,15 @@ void RepairMenu::createResult() unordered_map *enchantments = EnchantmentHelper::getEnchantments(result); bool usingBook = false; - tax += input->getBaseRepairCost() + (addition == nullptr ? 0 : addition->getBaseRepairCost()); + tax += input->getBaseRepairCost() + (addition == NULL ? 0 : addition->getBaseRepairCost()); if (DEBUG_COST) { - app.DebugPrintf("Starting with base repair tax of %d (%d + %d)\n", tax, input->getBaseRepairCost(), (addition == nullptr ? 0 : addition->getBaseRepairCost())); + app.DebugPrintf("Starting with base repair tax of %d (%d + %d)\n", tax, input->getBaseRepairCost(), (addition == NULL ? 0 : addition->getBaseRepairCost())); } repairItemCountCost = 0; - if (addition != nullptr) + if (addition != NULL) { usingBook = addition->id == Item::enchantedBook_Id && Item::enchantedBook->getEnchantments(addition)->size() > 0; @@ -273,10 +273,10 @@ void RepairMenu::createResult() result = nullptr; } - if (result != nullptr) + if (result != NULL) { int baseCost = result->getBaseRepairCost(); - if (addition != nullptr && baseCost < addition->getBaseRepairCost()) baseCost = addition->getBaseRepairCost(); + if (addition != NULL && baseCost < addition->getBaseRepairCost()) baseCost = addition->getBaseRepairCost(); if (result->hasCustomHoverName()) baseCost -= 9; if (baseCost < 0) baseCost = 0; baseCost += 2; @@ -327,7 +327,7 @@ void RepairMenu::removed(shared_ptr player) for (int i = 0; i < repairSlots->getContainerSize(); i++) { shared_ptr item = repairSlots->removeItemNoUpdate(i); - if (item != nullptr) + if (item != NULL) { player->drop(item); } @@ -345,7 +345,7 @@ shared_ptr RepairMenu::quickMoveStack(shared_ptr player, i { shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); - if (slot != nullptr && slot->hasItem()) + if (slot != NULL && slot->hasItem()) { shared_ptr stack = slot->getItem(); clicked = stack->copy(); diff --git a/Minecraft.World/SetRidingPacket.cpp b/Minecraft.World/SetRidingPacket.cpp index 32dc0dbe..454da047 100644 --- a/Minecraft.World/SetRidingPacket.cpp +++ b/Minecraft.World/SetRidingPacket.cpp @@ -16,7 +16,7 @@ SetRidingPacket::SetRidingPacket() SetRidingPacket::SetRidingPacket(shared_ptr rider, shared_ptr riding) { this->riderId = rider->entityId; - this->riddenId = riding != nullptr ? riding->entityId : -1; + this->riddenId = riding != NULL ? riding->entityId : -1; } int SetRidingPacket::getEstimatedSize()