[c23,winpr] replace NULL with nullptr

This commit is contained in:
Armin Novak
2026-02-26 14:32:50 +01:00
parent f38e03d982
commit 822257bf7c
276 changed files with 4138 additions and 4149 deletions

View File

@@ -159,7 +159,7 @@ extern "C"
/** @brief free arrays allocated by CommandLineParseCommaSeparatedValues(Ex)
*
* @param ptr the pointer to free, may be \b NULL
* @param ptr the pointer to free, may be \b nullptr
*
* @since version 3.10.0
*/

View File

@@ -63,14 +63,14 @@ extern "C"
/** @brief helper function to clone a string
* @param pvstr the source string to clone
* @return A clone of the source or \b NULL
* @return A clone of the source or \b nullptr
* @since version 3.3.0
*/
WINPR_API void* winpr_ObjectStringClone(const void* pvstr);
/** @brief helper function to clone a WCHAR string
* @param pvstr the source string to clone
* @return A clone of the source or \b NULL
* @return A clone of the source or \b nullptr
* @since version 3.3.0
*/
WINPR_API void* winpr_ObjectWStringClone(const void* pvstr);
@@ -87,7 +87,7 @@ extern "C"
/** @brief Return the number of elements in the queue
*
* @param queue A pointer to a queue, must not be \b NULL
* @param queue A pointer to a queue, must not be \b nullptr
*
* @return the number of objects queued
*/
@@ -95,7 +95,7 @@ extern "C"
/** @brief Return the allocated elements in the queue
*
* @param queue A pointer to a queue, must not be \b NULL
* @param queue A pointer to a queue, must not be \b nullptr
*
* @return the number of objects allocated
*/
@@ -103,26 +103,26 @@ extern "C"
/** @brief Mutex-Lock a queue
*
* @param queue A pointer to a queue, must not be \b NULL
* @param queue A pointer to a queue, must not be \b nullptr
*/
WINPR_API void Queue_Lock(wQueue* queue);
/** @brief Mutex-Unlock a queue
*
* @param queue A pointer to a queue, must not be \b NULL
* @param queue A pointer to a queue, must not be \b nullptr
*/
WINPR_API void Queue_Unlock(wQueue* queue);
/** @brief Get an event handle for the queue, usable by \b WaitForSingleObject or \b
* WaitForMultipleObjects
*
* @param queue A pointer to a queue, must not be \b NULL
* @param queue A pointer to a queue, must not be \b nullptr
*/
WINPR_API HANDLE Queue_Event(wQueue* queue);
/** @brief Mutex-Lock a queue
*
* @param queue A pointer to a queue, must not be \b NULL
* @param queue A pointer to a queue, must not be \b nullptr
*
* @return A pointer to a \b wObject that contains the allocation/cleanup handlers for queue
* elements
@@ -131,13 +131,13 @@ extern "C"
/** @brief Remove all elements from a queue, call \b wObject cleanup functions \b fnObjectFree
*
* @param queue A pointer to a queue, must not be \b NULL
* @param queue A pointer to a queue, must not be \b nullptr
*/
WINPR_API void Queue_Clear(wQueue* queue);
/** @brief Check if the queue contains an object
*
* @param queue A pointer to a queue, must not be \b NULL
* @param queue A pointer to a queue, must not be \b nullptr
* @param obj The object to look for. \b fnObjectEquals is called internally
*
* @return \b TRUE if the object was found, \b FALSE otherwise.
@@ -160,7 +160,7 @@ extern "C"
*
* \param queue The queue to check
*
* \return NULL if empty, a pointer to the memory on top of the queue otherwise.
* \return nullptr if empty, a pointer to the memory on top of the queue otherwise.
*/
WINPR_API void* Queue_Dequeue(wQueue* queue);
@@ -169,7 +169,7 @@ extern "C"
*
* \param queue The queue to check
*
* \return NULL if empty, a pointer to the memory on top of the queue otherwise.
* \return nullptr if empty, a pointer to the memory on top of the queue otherwise.
*/
WINPR_API void* Queue_Peek(wQueue* queue);
@@ -184,7 +184,7 @@ extern "C"
/** @brief Clean up a queue, free all resources (e.g. calls \b Queue_Clear)
*
* @param queue The queue to free, may be \b NULL
* @param queue The queue to free, may be \b nullptr
*/
WINPR_API void Queue_Free(wQueue* queue);
@@ -198,7 +198,7 @@ extern "C"
* values increase the allocation contingent. \b 0 or \b -1 apply default settings.
*
*
* @return A newly allocated queue or \b NULL in case of failure
* @return A newly allocated queue or \b nullptr in case of failure
*/
WINPR_ATTR_MALLOC(Queue_Free, 1)
WINPR_ATTR_NODISCARD
@@ -282,23 +282,23 @@ extern "C"
/** @brief Get the \b wObject function pointer struct for the \b key of the dictionary.
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
*
* @return a \b wObject used to initialize the key object, \b NULL in case of failure
* @return a \b wObject used to initialize the key object, \b nullptr in case of failure
*/
WINPR_API wObject* ListDictionary_KeyObject(wListDictionary* listDictionary);
/** @brief Get the \b wObject function pointer struct for the \b value of the dictionary.
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
*
* @return a \b wObject used to initialize the value object, \b NULL in case of failure
* @return a \b wObject used to initialize the value object, \b nullptr in case of failure
*/
WINPR_API wObject* ListDictionary_ValueObject(wListDictionary* listDictionary);
/** @brief Return the number of entries in the dictionary
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
*
* @return the number of entries
*/
@@ -306,20 +306,20 @@ extern "C"
/** @brief mutex-lock a dictionary
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
*/
WINPR_API void ListDictionary_Lock(wListDictionary* listDictionary);
/** @brief mutex-unlock a dictionary
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
*/
WINPR_API void ListDictionary_Unlock(wListDictionary* listDictionary);
/** @brief mutex-lock a dictionary
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
* @param key The key identifying the entry, if set cloned with \b fnObjectNew
* @param value The value to store for the \b key. May be \b NULL. if set cloned with \b
* @param value The value to store for the \b key. May be \b nullptr. if set cloned with \b
* fnObjectNew
*
* @return \b TRUE for successful addition, \b FALSE for failure
@@ -329,16 +329,16 @@ extern "C"
/** @brief Remove an item from the dictionary and return the value. Cleanup is up to the caller.
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
* @param key The key identifying the entry
*
* @return a pointer to the value stored or \b NULL in case of failure or not found
* @return a pointer to the value stored or \b nullptr in case of failure or not found
*/
WINPR_API void* ListDictionary_Take(wListDictionary* listDictionary, const void* key);
/** @brief Remove an item from the dictionary and call \b fnObjectFree for key and value
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
* @param key The key identifying the entry
*/
WINPR_API void ListDictionary_Remove(wListDictionary* listDictionary, const void* key);
@@ -346,27 +346,27 @@ extern "C"
/** @brief Remove the head item from the dictionary and return the value. Cleanup is up to the
* caller.
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
*
* @return a pointer to the value stored or \b NULL in case of failure or not found
* @return a pointer to the value stored or \b nullptr in case of failure or not found
*/
WINPR_API void* ListDictionary_Take_Head(wListDictionary* listDictionary);
/** @brief Remove the head item from the dictionary and call \b fnObjectFree for key and value
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
*/
WINPR_API void ListDictionary_Remove_Head(wListDictionary* listDictionary);
/** @brief Remove all items from the dictionary and call \b fnObjectFree for key and value
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
*/
WINPR_API void ListDictionary_Clear(wListDictionary* listDictionary);
/** @brief Check if a dictionary contains \b key (\b fnObjectEquals of the key object is called)
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
* @param key A key to look for
*
* @return \b TRUE if found, \b FALSE otherwise
@@ -375,28 +375,28 @@ extern "C"
/** @brief return all keys the dictionary contains
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
* @param ppKeys A pointer to a \b ULONG_PTR array that will hold the result keys. Call \b free
* if no longer required
*
* @return the number of keys found in the dictionary or \b 0 if \b ppKeys is \b NULL
* @return the number of keys found in the dictionary or \b 0 if \b ppKeys is \b nullptr
*/
WINPR_API size_t ListDictionary_GetKeys(wListDictionary* listDictionary, ULONG_PTR** ppKeys);
/** @brief Get the value in the dictionary for a \b key. The ownership of the data stays with
* the dictionary.
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
* @param key A key to look for (\b fnObjectEquals of the key object is called)
*
* @return A pointer to the data in the dictionary or \b NULL if not found
* @return A pointer to the data in the dictionary or \b nullptr if not found
*/
WINPR_API void* ListDictionary_GetItemValue(wListDictionary* listDictionary, const void* key);
/** @brief Set the value in the dictionary for a \b key. The entry must already exist, \b value
* is copied if \b fnObjectNew is set
*
* @param listDictionary A dictionary to query, must not be \b NULL
* @param listDictionary A dictionary to query, must not be \b nullptr
* @param key A key to look for (\b fnObjectEquals of the key object is called)
* @param value A pointer to the value to set
*
@@ -407,7 +407,7 @@ extern "C"
/** @brief Free memory allocated by a dictionary. Calls \b ListDictionary_Clear
*
* @param listDictionary A dictionary to query, may be \b NULL
* @param listDictionary A dictionary to query, may be \b nullptr
*/
WINPR_API void ListDictionary_Free(wListDictionary* listDictionary);
@@ -415,7 +415,7 @@ extern "C"
*
* @param synchronized Create the dictionary with automatic mutex lock
*
* @return A newly allocated dictionary or \b NULL in case of failure
* @return A newly allocated dictionary or \b nullptr in case of failure
*/
WINPR_ATTR_MALLOC(ListDictionary_Free, 1)
WINPR_ATTR_NODISCARD
@@ -427,7 +427,7 @@ extern "C"
/** @brief Return the current number of elements in the linked list
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
*
* @return the number of elements in the list
*/
@@ -435,23 +435,23 @@ extern "C"
/** @brief Return the first element of the list, ownership stays with the list
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
*
* @return A pointer to the element or \b NULL if empty
* @return A pointer to the element or \b nullptr if empty
*/
WINPR_API void* LinkedList_First(wLinkedList* list);
/** @brief Return the last element of the list, ownership stays with the list
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
*
* @return A pointer to the element or \b NULL if empty
* @return A pointer to the element or \b nullptr if empty
*/
WINPR_API void* LinkedList_Last(wLinkedList* list);
/** @brief Check if the linked list contains a value
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
* @param value A value to check for
*
* @return \b TRUE if found, \b FALSE otherwise
@@ -461,7 +461,7 @@ extern "C"
/** @brief Remove all elements of the linked list. \b fnObjectUninit and \b fnObjectFree are
* called for each entry
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
*
*/
WINPR_API void LinkedList_Clear(wLinkedList* list);
@@ -469,7 +469,7 @@ extern "C"
/** @brief Add a new element at the start of the linked list. \b fnObjectNew and \b fnObjectInit
* is called for the new entry
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
* @param value The value to add
*
* @return \b TRUE if successful, \b FALSE otherwise.
@@ -479,7 +479,7 @@ extern "C"
/** @brief Add a new element at the end of the linked list. \b fnObjectNew and \b fnObjectInit
* is called for the new entry
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
* @param value The value to add
*
* @return \b TRUE if successful, \b FALSE otherwise.
@@ -489,7 +489,7 @@ extern "C"
/** @brief Remove a element identified by \b value from the linked list. \b fnObjectUninit and
* \b fnObjectFree is called for the entry
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
* @param value The value to remove
*
* @return \b TRUE if successful, \b FALSE otherwise.
@@ -499,7 +499,7 @@ extern "C"
/** @brief Remove the first element from the linked list. \b fnObjectUninit and \b fnObjectFree
* is called for the entry
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
*
*/
WINPR_API void LinkedList_RemoveFirst(wLinkedList* list);
@@ -507,29 +507,29 @@ extern "C"
/** @brief Remove the last element from the linked list. \b fnObjectUninit and \b fnObjectFree
* is called for the entry
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
*
*/
WINPR_API void LinkedList_RemoveLast(wLinkedList* list);
/** @brief Move enumerator to the first element
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
*
*/
WINPR_API void LinkedList_Enumerator_Reset(wLinkedList* list);
/** @brief Return the value for the current position of the enumerator
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
*
* @return A pointer to the current entry or \b NULL
* @return A pointer to the current entry or \b nullptr
*/
WINPR_API void* LinkedList_Enumerator_Current(wLinkedList* list);
/** @brief Move enumerator to the next element
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
*
* @return \b TRUE if the move was successful, \b FALSE if not (e.g. no more entries)
*/
@@ -537,13 +537,13 @@ extern "C"
/** @brief Free a linked list
*
* @param list A pointer to the list, may be \b NULL
* @param list A pointer to the list, may be \b nullptr
*/
WINPR_API void LinkedList_Free(wLinkedList* list);
/** @brief Allocate a linked list
*
* @return A pointer to the newly allocated linked list or \b NULL in case of failure
* @return A pointer to the newly allocated linked list or \b nullptr in case of failure
*/
WINPR_ATTR_MALLOC(LinkedList_Free, 1)
WINPR_ATTR_NODISCARD
@@ -551,9 +551,9 @@ extern "C"
/** @brief Return the \b wObject function pointers for list elements
*
* @param list A pointer to the list, must not be \b NULL
* @param list A pointer to the list, must not be \b nullptr
*
* @return A pointer to the wObject or \b NULL in case of failure
* @return A pointer to the wObject or \b nullptr in case of failure
*/
WINPR_API wObject* LinkedList_Object(wLinkedList* list);
@@ -565,7 +565,7 @@ extern "C"
/** @brief return the current event count of the CountdownEvent
*
* @param countdown A pointer to a CountdownEvent, must not be \b NULL
* @param countdown A pointer to a CountdownEvent, must not be \b nullptr
*
* @return The current event count
*/
@@ -573,7 +573,7 @@ extern "C"
/** @brief return the initial event count of the CountdownEvent
*
* @param countdown A pointer to a CountdownEvent, must not be \b NULL
* @param countdown A pointer to a CountdownEvent, must not be \b nullptr
*
* @return The initial event count
*/
@@ -581,7 +581,7 @@ extern "C"
/** @brief return the current event state of the CountdownEvent
*
* @param countdown A pointer to a CountdownEvent, must not be \b NULL
* @param countdown A pointer to a CountdownEvent, must not be \b nullptr
*
* @return \b TRUE if set, \b FALSE otherwise
*/
@@ -590,15 +590,15 @@ extern "C"
/** @brief return the event HANDLE of the CountdownEvent to be used by \b WaitForSingleObject or
* \b WaitForMultipleObjects
*
* @param countdown A pointer to a CountdownEvent, must not be \b NULL
* @param countdown A pointer to a CountdownEvent, must not be \b nullptr
*
* @return a \b HANDLE or \b NULL in case of failure
* @return a \b HANDLE or \b nullptr in case of failure
*/
WINPR_API HANDLE CountdownEvent_WaitHandle(wCountdownEvent* countdown);
/** @brief add \b signalCount to the current event count of the CountdownEvent
*
* @param countdown A pointer to a CountdownEvent, must not be \b NULL
* @param countdown A pointer to a CountdownEvent, must not be \b nullptr
* @param signalCount The amount to add to CountdownEvent
*
*/
@@ -606,7 +606,7 @@ extern "C"
/** @brief Increase the current event signal state of the CountdownEvent
*
* @param countdown A pointer to a CountdownEvent, must not be \b NULL
* @param countdown A pointer to a CountdownEvent, must not be \b nullptr
* @param signalCount The amount of signaled events to add
*
* @return \b TRUE if event is set, \b FALSE otherwise
@@ -615,14 +615,14 @@ extern "C"
/** @brief reset the CountdownEvent
*
* @param countdown A pointer to a CountdownEvent, must not be \b NULL
* @param countdown A pointer to a CountdownEvent, must not be \b nullptr
*
*/
WINPR_API void CountdownEvent_Reset(wCountdownEvent* countdown, size_t count);
/** @brief Free a CountdownEvent
*
* @param countdown A pointer to a CountdownEvent, may be \b NULL
* @param countdown A pointer to a CountdownEvent, may be \b nullptr
*/
WINPR_API void CountdownEvent_Free(wCountdownEvent* countdown);
@@ -630,7 +630,7 @@ extern "C"
*
* @param initialCount The initial value of the event
*
* @return The newly allocated event or \b NULL in case of failure
* @return The newly allocated event or \b nullptr in case of failure
*/
WINPR_ATTR_MALLOC(CountdownEvent_Free, 1)
WINPR_ATTR_NODISCARD
@@ -746,7 +746,7 @@ extern "C"
/** @brief return the currently used number of elements in the queue
*
* @param queue A pointer to the queue to query. Must not be \b NULL
* @param queue A pointer to the queue to query. Must not be \b nullptr
*
* @return The number of elements in the queue
*/
@@ -754,7 +754,7 @@ extern "C"
/** @brief return the currently allocated elements in the queue
*
* @param queue A pointer to the queue to query. Must not be \b NULL
* @param queue A pointer to the queue to query. Must not be \b nullptr
*
* @return The number of currently allocated elements in the queue
*/
@@ -801,9 +801,9 @@ extern "C"
* 'MessageQueue_Clear'.
*
* \param callback a pointer to custom initialization / cleanup functions.
* Can be NULL if not used.
* Can be nullptr if not used.
*
* \return A pointer to a newly allocated MessageQueue or NULL.
* \return A pointer to a newly allocated MessageQueue or nullptr.
*/
WINPR_ATTR_MALLOC(MessageQueue_Free, 1)
WINPR_ATTR_NODISCARD
@@ -892,12 +892,12 @@ extern "C"
DEFINE_EVENT_SUBSCRIBE(name) \
DEFINE_EVENT_UNSUBSCRIBE(name)
#define DEFINE_EVENT_ENTRY(name) \
{ \
#name, { sizeof(name##EventArgs), NULL }, 0, \
{ \
NULL \
} \
#define DEFINE_EVENT_ENTRY(name) \
{ \
#name, { sizeof(name##EventArgs), nullptr }, 0, \
{ \
nullptr \
} \
}
typedef struct s_wPubSub wPubSub;

View File

@@ -240,7 +240,8 @@ extern "C"
#endif /* !defined(_WIN32) || (defined(__MINGW32__) ... */
#if defined(_WIN32) && (!defined(__MINGW32__) || defined(_UCRT))
#define winpr_aligned_calloc(count, size, alignment) _aligned_recalloc(NULL, count, size, alignment)
#define winpr_aligned_calloc(count, size, alignment) \
_aligned_recalloc(nullptr, count, size, alignment)
#endif /* defined(_WIN32) && (!defined(__MINGW32__) || defined(_UCRT)) */
// NOLINTEND(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)

View File

@@ -288,7 +288,7 @@ extern "C"
* @param iv A pointer to the IV material (size must match expectations for the cipher used)
* @param ivlen The length in bytes of the IV
*
* @return A newly allocated context or \b NULL
* @return A newly allocated context or \b nullptr
*
* @since version 3.10.0
*/

View File

@@ -133,8 +133,8 @@ extern "C"
*
* @since version 3.3.0
*
* @return \b NULL in case of failure, a pointer to an allocated buffer otherwise. Use \b free
* as deallocator
* @return \b nullptr in case of failure, a pointer to an allocated buffer otherwise. Use \b
* free as deallocator
*/
WINPR_ATTR_MALLOC(free, 1)
WINPR_ATTR_NODISCARD
@@ -163,7 +163,7 @@ extern "C"
*
* @since version 3.3.0
*
* @return a extension string if format has one or \b NULL
* @return a extension string if format has one or \b nullptr
*/
WINPR_API const char* winpr_image_format_extension(UINT32 format);
@@ -173,7 +173,7 @@ extern "C"
*
* @since version 3.3.0
*
* @return a mime type string if format has one or \b NULL
* @return a mime type string if format has one or \b nullptr
*/
WINPR_API const char* winpr_image_format_mime(UINT32 format);

View File

@@ -32,7 +32,7 @@ extern "C"
/** @brief read an ini file from a buffer
*
* @param ini The instance to use, must not be \b NULL
* @param ini The instance to use, must not be \b nullptr
* @param buffer The buffer to read from, must be a '\0' terminated string.
*
* @return > 0 for success, < 0 for failure
@@ -41,7 +41,7 @@ extern "C"
/** @brief read an ini file from a file
*
* @param ini The instance to use, must not be \b NULL
* @param ini The instance to use, must not be \b nullptr
* @param filename The name of the file to read from, must be a '\0' terminated string.
*
* @return > 0 for success, < 0 for failure
@@ -50,15 +50,15 @@ extern "C"
/** @brief write an ini instance to a buffer
*
* @param ini The instance to use, must not be \b NULL
* @param ini The instance to use, must not be \b nullptr
*
* @return A newly allocated string, use \b free after use. \b NULL in case of failure
* @return A newly allocated string, use \b free after use. \b nullptr in case of failure
*/
WINPR_API char* IniFile_WriteBuffer(wIniFile* ini);
/** @brief write an ini instance to a file
*
* @param ini The instance to use, must not be \b NULL
* @param ini The instance to use, must not be \b nullptr
* @param filename The name of the file as '\0' terminated string.
*
* @return > 0 for success, < 0 for failure
@@ -67,7 +67,7 @@ extern "C"
/** @brief Get the number and names of sections in the ini instance
*
* @param ini The instance to use, must not be \b NULL
* @param ini The instance to use, must not be \b nullptr
* @param count A buffer that will contain the number of sections
*
* @return A newly allocated array of strings (size \b count). Use \b free after use
@@ -76,7 +76,7 @@ extern "C"
/** @brief Get the number and names of keys of a section in the ini instance
*
* @param ini The instance to use, must not be \b NULL
* @param ini The instance to use, must not be \b nullptr
* @param section The name of the section as '\0' terminated string.
* @param count A buffer that will contain the number of sections
*
@@ -86,18 +86,18 @@ extern "C"
/** @brief Get an ini [section/key] value of type string
*
* @param ini The instance to use, must not be \b NULL
* @param ini The instance to use, must not be \b nullptr
* @param section The name of the section as '\0' terminated string.
* @param key The name of the key as '\0' terminated string.
*
* @return The value of the [section/key] as '\0' terminated string or \b NULL
* @return The value of the [section/key] as '\0' terminated string or \b nullptr
*/
WINPR_API const char* IniFile_GetKeyValueString(wIniFile* ini, const char* section,
const char* key);
/** @brief Get an ini [section/key] value of type int
*
* @param ini The instance to use, must not be \b NULL
* @param ini The instance to use, must not be \b nullptr
* @param section The name of the section as '\0' terminated string.
* @param key The name of the key as '\0' terminated string.
*
@@ -107,7 +107,7 @@ extern "C"
/** @brief Set an ini [section/key] value of type string
*
* @param ini The instance to use, must not be \b NULL
* @param ini The instance to use, must not be \b nullptr
* @param section The name of the section as '\0' terminated string.
* @param key The name of the key as '\0' terminated string.
* @param value The value of the [section/key] as '\0' terminated string.
@@ -119,7 +119,7 @@ extern "C"
/** @brief Set an ini [section/key] value of type int
*
* @param ini The instance to use, must not be \b NULL
* @param ini The instance to use, must not be \b nullptr
* @param section The name of the section as '\0' terminated string.
* @param key The name of the key as '\0' terminated string.
* @param value The value of the [section/key]
@@ -131,13 +131,13 @@ extern "C"
/** @brief Free a ini instance
*
* @param ini The instance to free, may be \b NULL
* @param ini The instance to free, may be \b nullptr
*/
WINPR_API void IniFile_Free(wIniFile* ini);
/** @brief Create a new ini instance
*
* @return The newly allocated instance or \b NULL if failed.
* @return The newly allocated instance or \b nullptr if failed.
*/
WINPR_ATTR_MALLOC(IniFile_Free, 1)
WINPR_ATTR_NODISCARD
@@ -145,9 +145,9 @@ extern "C"
/** @brief Clone a ini instance
*
* @param ini The instance to free, may be \b NULL
* @param ini The instance to free, may be \b nullptr
*
* @return the cloned instance or \b NULL in case of \b ini was \b NULL or failure
* @return the cloned instance or \b nullptr in case of \b ini was \b nullptr or failure
*/
WINPR_API wIniFile* IniFile_Clone(const wIniFile* ini);

View File

@@ -60,7 +60,7 @@ extern "C"
* @brief Parse a '\0' terminated JSON string
*
* @param value A '\0' terminated JSON string
* @return A @ref WINPR_JSON object holding the parsed string or \b NULL if failed
* @return A @ref WINPR_JSON object holding the parsed string or \b nullptr if failed
* @since version 3.6.0
*/
WINPR_ATTR_MALLOC(WINPR_JSON_Delete, 1)
@@ -72,7 +72,7 @@ extern "C"
*
* @param value A JSON string
* @param buffer_length The length in bytes of the JSON string
* @return A @ref WINPR_JSON object holding the parsed string or \b NULL if failed
* @return A @ref WINPR_JSON object holding the parsed string or \b nullptr if failed
* @since version 3.6.0
*/
WINPR_ATTR_MALLOC(WINPR_JSON_Delete, 1)
@@ -83,7 +83,7 @@ extern "C"
* @brief Parse a JSON string read from a file \b filename
*
* @param filename the name of the file to read from
* @return A @ref WINPR_JSON object holding the parsed string or \b NULL if failed
* @return A @ref WINPR_JSON object holding the parsed string or \b nullptr if failed
* @since version 3.16.0
*/
WINPR_ATTR_MALLOC(WINPR_JSON_Delete, 1)
@@ -94,7 +94,7 @@ extern "C"
* @brief Parse a JSON string read from a \b FILE
*
* @param fp a \b FILE pointer to read from.
* @return A @ref WINPR_JSON object holding the parsed string or \b NULL if failed
* @return A @ref WINPR_JSON object holding the parsed string or \b nullptr if failed
* @since version 3.16.0
*/
WINPR_ATTR_MALLOC(WINPR_JSON_Delete, 1)
@@ -115,7 +115,7 @@ extern "C"
*
* @param array the JSON instance to query
* @param index The index of the array item
* @return A pointer to the array item or \b NULL if failed
* @return A pointer to the array item or \b nullptr if failed
* @since version 3.6.0
*/
WINPR_API WINPR_JSON* WINPR_JSON_GetArrayItem(const WINPR_JSON* array, size_t index);
@@ -125,7 +125,7 @@ extern "C"
* @param object the JSON object
* @param string the name of the object (case is ignored)
*
* @return A pointer to the object identified by \b string or \b NULL
* @return A pointer to the object identified by \b string or \b nullptr
* @since version 3.6.0
*/
WINPR_API WINPR_JSON* WINPR_JSON_GetObjectItem(const WINPR_JSON* object, const char* string);
@@ -135,7 +135,7 @@ extern "C"
*
* @param object the JSON instance to query
* @param string the name of the object
* @return A pointer to the object identified by \b string or \b NULL
* @return A pointer to the object identified by \b string or \b nullptr
* @since version 3.6.0
*/
WINPR_API WINPR_JSON* WINPR_JSON_GetObjectItemCaseSensitive(const WINPR_JSON* object,
@@ -152,7 +152,7 @@ extern "C"
/**
* @brief Return an error string
* @return A string describing the last error that occurred or \b NULL
* @return A string describing the last error that occurred or \b nullptr
* @since version 3.6.0
*/
WINPR_API const char* WINPR_JSON_GetErrorPtr(void);
@@ -160,7 +160,7 @@ extern "C"
/**
* @brief Return the String value of a JSON item
* @param item the JSON item to query
* @return The string value or \b NULL if failed
* @return The string value or \b nullptr if failed
* @since version 3.6.0
*/
WINPR_API const char* WINPR_JSON_GetStringValue(WINPR_JSON* item);
@@ -391,8 +391,8 @@ extern "C"
/**
* @brief Add an item to an existing array
* @param array An array to add to, must not be \b NULL
* @param item An item to add, must not be \b NULL
* @param array An array to add to, must not be \b nullptr
* @param item An item to add, must not be \b nullptr
* @return \b TRUE for success, \b FALSE for failure
* @since version 3.7.0
*/
@@ -403,7 +403,7 @@ extern "C"
* for minimal size without formatting see @ref WINPR_JSON_PrintUnformatted
*
* @param item The JSON instance to serialize
* @return A string representation of the JSON instance or \b NULL
* @return A string representation of the JSON instance or \b nullptr
* @since version 3.6.0
*/
WINPR_ATTR_MALLOC(free, 1)
@@ -415,7 +415,7 @@ extern "C"
* for human readable formatted output see @ref WINPR_JSON_Print
*
* @param item The JSON instance to serialize
* @return A string representation of the JSON instance or \b NULL
* @return A string representation of the JSON instance or \b nullptr
* @since version 3.6.0
*/
WINPR_ATTR_MALLOC(free, 1)

View File

@@ -91,7 +91,7 @@ extern "C"
* @param name The name of the function
* @param type The type of the function pointer
* @since version 3.9.0
* @return A new function pointer or \b NULL
* @return A new function pointer or \b nullptr
*/
#define GetProcAddressAs(module, name, type) WINPR_FUNC_PTR_CAST(GetProcAddress(module, name), type)

View File

@@ -203,7 +203,7 @@ extern "C"
*
* @param phProvider [out] resulting provider handle
* @param dwFlags [in] the flags to use
* @param modulePaths [in] an array of library path to try to load ended with a NULL string
* @param modulePaths [in] an array of library path to try to load ended with a nullptr string
* @return ERROR_SUCCESS or an NTE error code something failed
*/
WINPR_API SECURITY_STATUS winpr_NCryptOpenStorageProviderEx(NCRYPT_PROV_HANDLE* phProvider,

View File

@@ -46,7 +46,7 @@ extern "C"
/*
* Maximum number of characters we support using the "\\?\" syntax
* (0x7FFF + 1 for NULL terminator)
* (0x7FFF + 1 for nullptr terminator)
*/
#define PATHCCH_MAX_CCH 0x8000
@@ -310,14 +310,14 @@ extern "C"
#endif
/** @brief Return the absolute path of a configuration file (the path of the configuration
* directory if \b filename is \b NULL)
* directory if \b filename is \b nullptr)
*
* @param system a boolean indicating the configuration base, \b TRUE for system configuration,
* \b FALSE for user configuration
* @param filename an optional configuration file name to append.
*
* @return The absolute path of the desired configuration or \b NULL in case of failure. Use \b
* free to clean up the allocated string.
* @return The absolute path of the desired configuration or \b nullptr in case of failure. Use
* \b free to clean up the allocated string.
*
*
* @since version 3.9.0
@@ -329,10 +329,10 @@ extern "C"
/** @brief Get a config file sub path with a formatting argument constructing the filename
*
* @param system \b TRUE to return a system config path
* @param filename The format string to generate the filename. Must not be \b NULL. Must not
* @param filename The format string to generate the filename. Must not be \b nullptr. Must not
* contain any forbidden characters.
*
* @return A (absolute) configuration file path or \b NULL in case of failure.
* @return A (absolute) configuration file path or \b nullptr in case of failure.
* @since version 3.23.0
*/
WINPR_ATTR_MALLOC(free, 1)
@@ -344,11 +344,11 @@ extern "C"
/** @brief Get a config file sub path with a formatting argument constructing the filename
*
* @param system \b TRUE to return a system config path
* @param filename The format string to generate the filename. Must not be \b NULL. Must not
* @param filename The format string to generate the filename. Must not be \b nullptr. Must not
* contain any forbidden characters.
* @param ap The argument list
*
* @return A (absolute) configuration file path or \b NULL in case of failure.
* @return A (absolute) configuration file path or \b nullptr in case of failure.
* @since version 3.23.0
*/
WINPR_ATTR_MALLOC(free, 1)
@@ -370,9 +370,9 @@ extern "C"
/** @brief Append a path to some existing known path type.
*
* @param id a \ref eKnownPathTypes known path id
* @param path the format string generating the subpath. Must not be \b NULL
* @param path the format string generating the subpath. Must not be \b nullptr
*
* @return A string of combined \b id path and \b path or \b NULL in case of an error.
* @return A string of combined \b id path and \b path or \b nullptr in case of an error.
* @since version 3.23.0
*/
WINPR_ATTR_MALLOC(free, 1)
@@ -383,10 +383,10 @@ extern "C"
/** @brief Append a path to some existing known path type.
*
* @param id a \ref eKnownPathTypes known path id
* @param path the format string generating the subpath. Must not be \b NULL
* @param path the format string generating the subpath. Must not be \b nullptr
* @param ap a va_list containing the format string arguments
* * @return A string of combined \b basePath and \b path or \b NULL in case of an
* error.
* * @return A string of combined \b basePath and \b path or \b nullptr in case of
* an error.
* * @version since 3.23.0
*/
WINPR_ATTR_MALLOC(free, 1)
@@ -404,10 +404,10 @@ extern "C"
/** @brief Append a path to some existing environment name.
*
* @param name The prefix path to use, must not be \b NULL
* @param path A format string used to generate the path to append. Must not be \b NULL
* @param name The prefix path to use, must not be \b nullptr
* @param path A format string used to generate the path to append. Must not be \b nullptr
*
* @return A string of combined \b basePath and \b path or \b NULL in case of an error.
* @return A string of combined \b basePath and \b path or \b nullptr in case of an error.
* @version since 3.23.0
*/
WINPR_ATTR_MALLOC(free, 1)
@@ -417,11 +417,12 @@ extern "C"
/** @brief Append a path to some existing environment name.
*
* @param name The prefix path to use, must not be \b NULL
* @param path A format string used to generate the path to append. Must not be \b NULL
* @param name The prefix path to use, must not be \b nullptr
* @param path A format string used to generate the path to append. Must not be \b nullptr
* @param ap a va_list containing the format string arguments
*
* @return A string of combined \b basePath and \b path or \b NULL in case of an error.
* @return A string of combined \b basePath and \b path or \b nullptr in case of an
* error.
* * @version since 3.23.0
*/
WINPR_ATTR_MALLOC(free, 1)
@@ -439,10 +440,12 @@ extern "C"
*
* @bug before version 3.23.0 the function did not allow subPath to be a format string.
*
* @param basePath The prefix path to use, must not be \b NULL
* @param subPathFmt A format string used to generate the path to append. Must not be \b NULL
* @param basePath The prefix path to use, must not be \b nullptr
* @param subPathFmt A format string used to generate the path to append. Must not be \b
* nullptr
*
* @return A string of combined \b basePath and \b subPathFmt or \b NULL in case of an error.
* @return A string of combined \b basePath and \b subPathFmt or \b nullptr in case of an
* error.
*/
WINPR_ATTR_MALLOC(free, 1)
WINPR_ATTR_NODISCARD
@@ -453,11 +456,13 @@ extern "C"
/** @brief Append a path to some existing path. A system dependent path separator will be added
* automatically.
*
* @param basePath The prefix path to use, must not be \b NULL
* @param subPathFmt A format string used to generate the path to append. Must not be \b NULL
* @param basePath The prefix path to use, must not be \b nullptr
* @param subPathFmt A format string used to generate the path to append. Must not be \b
* nullptr
* @param ap a va_list containing the format string arguments
*
* @return A string of combined \b basePath and \b subPathFmt or \b NULL in case of an error.
* @return A string of combined \b basePath and \b subPathFmt or \b nullptr in case of an
* error.
* @version since 3.23.0
*/
WINPR_ATTR_MALLOC(free, 1)

View File

@@ -58,7 +58,7 @@ extern "C"
*/
static inline wStream Stream_Init(void)
{
const wStream empty = { NULL, NULL, 0, 0, 0, NULL, FALSE, FALSE };
const wStream empty = { nullptr, nullptr, 0, 0, 0, nullptr, FALSE, FALSE };
return empty;
}
@@ -820,7 +820,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_INT8 instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_INT8_unchecked(wStream* _s, INT8 _v)
@@ -845,7 +845,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_UINT8 instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_UINT8_unchecked(wStream* _s, UINT8 _v)
@@ -871,7 +871,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_INT16 instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_INT16_unchecked(wStream* _s, INT16 _v)
@@ -897,7 +897,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_UINT16 instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_UINT16_unchecked(wStream* _s, UINT16 _v)
@@ -923,7 +923,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_UINT16_BE instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_UINT16_BE_unchecked(wStream* _s, UINT16 _v)
@@ -949,7 +949,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_UINT16_BE instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*
* @since version 3.10.0
@@ -977,7 +977,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_UINT24_BE instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_UINT24_BE_unchecked(wStream* _s, UINT32 _v)
@@ -1005,7 +1005,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_INT32 instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_INT32_unchecked(wStream* _s, INT32 _v)
@@ -1031,7 +1031,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_INT32 instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*
* @since version 3.10.0
@@ -1059,7 +1059,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_UINT32 instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_UINT32_unchecked(wStream* _s, UINT32 _v)
@@ -1085,7 +1085,7 @@ extern "C"
*
* Do not use directly, use the define @ref Stream_Write_UINT32_BE instead
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_UINT32_BE_unchecked(wStream* _s, UINT32 _v)
@@ -1099,7 +1099,7 @@ extern "C"
/** @brief writes a \b UINT64 as \b little endian to a \b wStream. The stream must be large
* enough to hold the data.
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_UINT64(wStream* _s, UINT64 _v)
@@ -1115,7 +1115,7 @@ extern "C"
/** @brief writes a \b UINT64 as \b big endian to a \b wStream. The stream must be large enough
* to hold the data.
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
*/
static inline void Stream_Write_UINT64_BE(wStream* _s, UINT64 _v)
@@ -1131,7 +1131,7 @@ extern "C"
/** @brief writes a \b INT64 as \b little endian to a \b wStream. The stream must be large
* enough to hold the data.
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
* \since version 3.10.0
*/
@@ -1148,7 +1148,7 @@ extern "C"
/** @brief writes a \b INT64 as \b big endian to a \b wStream. The stream must be large enough
* to hold the data.
*
* \param _s The stream to write to, must not be \b NULL
* \param _s The stream to write to, must not be \b nullptr
* \param _v The value to write
* \since version 3.10.0
*/
@@ -1341,9 +1341,9 @@ extern "C"
*
* \param s The stream to read data from
* \param wcharLength The number of WCHAR characters to read (NOT the size in bytes!)
* \param pUtfCharLength Ignored if \b NULL, otherwise will be set to the number of
* \param pUtfCharLength Ignored if \b nullptr, otherwise will be set to the number of
* characters in the resulting UTF-8 string
* \return A '\0' terminated UTF-8 encoded string or NULL for any failure.
* \return A '\0' terminated UTF-8 encoded string or nullptr for any failure.
*/
WINPR_API char* Stream_Read_UTF16_String_As_UTF8(wStream* s, size_t wcharLength,
size_t* pUtfCharLength);
@@ -1404,7 +1404,7 @@ extern "C"
/** Return the number of streams still not returned to the pool
*
* @param pool The pool to query, must not be \b NULL
* @param pool The pool to query, must not be \b nullptr
*
* @return the number of streams still in use
*
@@ -1415,7 +1415,7 @@ extern "C"
/** Wait up to \b timeoutMS milliseconds for streams to be returned to the pool.
* Use \b INFINITE for an infinite timeout
*
* @param pool The pool to query, must not be \b NULL
* @param pool The pool to query, must not be \b nullptr
* @param timeoutMS Milliseconds to wait at most, use \b INFINITE for no timeout.
*
* @return \b TRUE in case all streams were returned, \b FALSE otherwise.

View File

@@ -180,9 +180,9 @@ extern "C"
#define sprintf_s snprintf
#define _snprintf snprintf
#define _scprintf(...) snprintf(NULL, 0, __VA_ARGS__)
#define _scprintf(...) snprintf(nullptr, 0, __VA_ARGS__)
#define _scprintf(...) snprintf(NULL, 0, __VA_ARGS__)
#define _scprintf(...) snprintf(nullptr, 0, __VA_ARGS__)
/* Unicode Conversion */
@@ -212,7 +212,7 @@ extern "C"
* \warning Supplying a buffer length smaller than required will result in
* platform dependent (=undefined) behaviour!
*
* \param wstr A '\0' terminated WCHAR string, may be NULL
* \param wstr A '\0' terminated WCHAR string, may be nullptr
* \param str A pointer to the result string
* \param len The length in characters of the result buffer
*
@@ -268,7 +268,7 @@ extern "C"
* \warning Supplying a buffer length smaller than required will result in
* platform dependent (=undefined) behaviour!
*
* \param str A '\0' terminated CHAR string, may be NULL
* \param str A '\0' terminated CHAR string, may be nullptr
* \param wstr A pointer to the result WCHAR string
* \param wlen The length in WCHAR characters of the result buffer
*
@@ -319,11 +319,11 @@ extern "C"
*
* The function does string conversions of any '\0' terminated input string
*
* \param wstr A '\0' terminated WCHAR string, may be NULL
* \param pUtfCharLength Ignored if NULL, otherwise receives the length of the result string in
* characters (strlen)
* \param wstr A '\0' terminated WCHAR string, may be nullptr
* \param pUtfCharLength Ignored if nullptr, otherwise receives the length of the result string
* in characters (strlen)
*
* \return An allocated zero terminated UTF-8 string or NULL in case of failure.
* \return An allocated zero terminated UTF-8 string or nullptr in case of failure.
*/
WINPR_API char* ConvertWCharToUtf8Alloc(const WCHAR* wstr, size_t* pUtfCharLength);
@@ -334,10 +334,10 @@ extern "C"
*
* \param wstr A WCHAR string of \b wlen length
* \param wlen The (buffer) length in characters of \b wstr
* \param pUtfCharLength Ignored if NULL, otherwise receives the length of the result string in
* characters (strlen)
* \param pUtfCharLength Ignored if nullptr, otherwise receives the length of the result string
* in characters (strlen)
*
* \return An allocated zero terminated UTF-8 string or NULL in case of failure.
* \return An allocated zero terminated UTF-8 string or nullptr in case of failure.
*/
WINPR_API char* ConvertWCharNToUtf8Alloc(const WCHAR* wstr, size_t wlen,
size_t* pUtfCharLength);
@@ -349,10 +349,10 @@ extern "C"
*
* \param wstr A WCHAR string of \b len character length
* \param wlen The (buffer) length in characters of \b str
* \param pUtfCharLength Ignored if NULL, otherwise receives the length of the result string in
* characters (including any '\0' character)
* \param pUtfCharLength Ignored if nullptr, otherwise receives the length of the result string
* in characters (including any '\0' character)
*
* \return An allocated double zero terminated UTF-8 string or NULL in case of failure.
* \return An allocated double zero terminated UTF-8 string or nullptr in case of failure.
*/
WINPR_API char* ConvertMszWCharNToUtf8Alloc(const WCHAR* wstr, size_t wlen,
size_t* pUtfCharLength);
@@ -361,11 +361,11 @@ extern "C"
*
* The function does string conversions of any '\0' terminated input string
*
* \param str A '\0' terminated CHAR string, may be NULL
* \param pSize Ignored if NULL, otherwise receives the length of the result string in
* \param str A '\0' terminated CHAR string, may be nullptr
* \param pSize Ignored if nullptr, otherwise receives the length of the result string in
* characters (wcslen)
*
* \return An allocated zero terminated UTF-16 string or NULL in case of failure.
* \return An allocated zero terminated UTF-16 string or nullptr in case of failure.
*/
WINPR_API WCHAR* ConvertUtf8ToWCharAlloc(const char* str, size_t* pSize);
@@ -376,10 +376,10 @@ extern "C"
*
* \param str A CHAR string of \b len length
* \param len The (buffer) length in characters of \b str
* \param pSize Ignored if NULL, otherwise receives the length of the result string in
* \param pSize Ignored if nullptr, otherwise receives the length of the result string in
* characters (wcslen)
*
* \return An allocated zero terminated UTF-16 string or NULL in case of failure.
* \return An allocated zero terminated UTF-16 string or nullptr in case of failure.
*/
WINPR_API WCHAR* ConvertUtf8NToWCharAlloc(const char* str, size_t len, size_t* pSize);
@@ -390,10 +390,10 @@ extern "C"
*
* \param str A CHAR string of \b len byte length
* \param len The (buffer) length in characters of \b str
* \param pSize Ignored if NULL, otherwise receives the length of the result string in
* \param pSize Ignored if nullptr, otherwise receives the length of the result string in
* characters (including any '\0' character)
*
* \return An allocated double zero terminated UTF-16 string or NULL in case of failure.
* \return An allocated double zero terminated UTF-16 string or nullptr in case of failure.
*/
WINPR_API WCHAR* ConvertMszUtf8NToWCharAlloc(const char* str, size_t len, size_t* pSize);

View File

@@ -42,9 +42,9 @@ WINPR_API const char* winpr_get_build_config(void);
* is ignored and the config path will always have the format 'vendor/product' or 'vendor/product1'
* (1 for the actual version set)
*
* @param vendor A vendor name to use. Must not be \b NULL. Must not contain forbidden
* @param vendor A vendor name to use. Must not be \b nullptr. Must not contain forbidden
* filesystem symbols for any os. Must be less than \b MAX_PATH bytes.
* @param product A product name to use. Must not be \b NULL. Must not contain forbidden
* @param product A product name to use. Must not be \b nullptr. Must not contain forbidden
* filesystem symbols for any os. Must be less than \b MAX_PATH bytes.
* @param version An optional versioning value to append to paths to settings. Use \b -1 to
* disable.

View File

@@ -184,7 +184,7 @@ extern "C"
/** @brief Set a custom context for a dynamic logger.
* This can be used to print a customized prefix, e.g. some session id for a specific context
*
* @param log The logger to ste the context for. Must not be \b NULL
* @param log The logger to ste the context for. Must not be \b nullptr
* @param fkt A function pointer that is called to get the custimized string.
* @param context A context \b fkt is called with. Caller must ensure it is still allocated
* when \b log is used
@@ -211,7 +211,7 @@ extern "C"
#define WLog_Print_tag(_tag, _log_level, ...) \
do \
{ \
static wLog* _log_cached_ptr = NULL; \
static wLog* _log_cached_ptr = nullptr; \
if (!_log_cached_ptr) \
_log_cached_ptr = WLog_Get(_tag); \
WLog_Print(_log_cached_ptr, _log_level, __VA_ARGS__); \
@@ -267,7 +267,7 @@ extern "C"
size_t line, const char* file, const char* fkt,
WINPR_FORMAT_ARG const char* fmt, ...)
{
static wLog* log_cached_ptr = NULL;
static wLog* log_cached_ptr = nullptr;
if (!log_cached_ptr)
log_cached_ptr = WLog_Get(tag);

View File

@@ -262,9 +262,9 @@ typedef HRESULT(VCAPITYPE* PFNVCAPIGETINSTANCE)(REFIID refiid, PULONG pNumObjs,
* Windows Terminal Services API (wtsapi32.h)
*/
#define WTS_CURRENT_SERVER ((HANDLE)NULL)
#define WTS_CURRENT_SERVER_HANDLE ((HANDLE)NULL)
#define WTS_CURRENT_SERVER_NAME (NULL)
#define WTS_CURRENT_SERVER ((HANDLE) nullptr)
#define WTS_CURRENT_SERVER_HANDLE ((HANDLE) nullptr)
#define WTS_CURRENT_SERVER_NAME (nullptr)
#define WTS_CURRENT_SESSION ((DWORD)-1)