mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-10-26 12:27:44 +00:00 
			
		
		
		
	stdlib: Document SDL_strtox functions
This commit is contained in:
		 Carl Åstholm
					Carl Åstholm
				
			
				
					committed by
					
						 Sam Lantinga
						Sam Lantinga
					
				
			
			
				
	
			
			
			 Sam Lantinga
						Sam Lantinga
					
				
			
						parent
						
							8092e35287
						
					
				
				
					commit
					7d94bf528d
				
			| @@ -1719,21 +1719,18 @@ extern SDL_DECLSPEC double SDLCALL SDL_atof(const char *str); | |||||||
| /** | /** | ||||||
|  * Parse a `long` from a string. |  * Parse a `long` from a string. | ||||||
|  * |  * | ||||||
|  * This function makes fewer guarantees than the C runtime `strtol`: |  * If `str` starts with whitespace, then those whitespace characters are skipped before attempting to parse the number. | ||||||
|  * |  * | ||||||
|  * - Only the bases 10 and 16 are guaranteed to be supported. The behavior for |  * If the parsed number does not fit inside a `long`, the result is clamped to the minimum and maximum representable `long` values. | ||||||
|  *   other bases is unspecified. |  | ||||||
|  * - It is unspecified what this function returns when the parsed integer does |  | ||||||
|  *   not fit inside a `long`. |  | ||||||
|  * |  * | ||||||
|  * \param str The null-terminated string to read. Must not be NULL. |  * \param str The null-terminated string to read. Must not be NULL. | ||||||
|  * \param endp If not NULL, the address of the first invalid character (i.e. |  * \param endp If not NULL, the address of the first invalid character (i.e. | ||||||
|  *             the next character after the parsed number) will be written to |  *             the next character after the parsed number) will be written to | ||||||
|  *             this pointer. |  *             this pointer. | ||||||
|  * \param base The base of the integer to read. The values 0, 10 and 16 are |  * \param base The base of the integer to read. Supported values are 0 and 2 to 36 inclusive. | ||||||
|  *             supported. If 0, the base will be inferred from the integer's |  *             If 0, the base will be inferred from the number's | ||||||
|  *             prefix. |  *             prefix (0x for hexadecimal, 0 for octal, decimal otherwise). | ||||||
|  * \returns The parsed `long`. |  * \returns The parsed `long`, or 0 if no number could be parsed. | ||||||
|  * |  * | ||||||
|  * \threadsafety It is safe to call this function from any thread. |  * \threadsafety It is safe to call this function from any thread. | ||||||
|  * |  * | ||||||
| @@ -1753,21 +1750,19 @@ extern SDL_DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int ba | |||||||
| /** | /** | ||||||
|  * Parse an `unsigned long` from a string. |  * Parse an `unsigned long` from a string. | ||||||
|  * |  * | ||||||
|  * This function makes fewer guarantees than the C runtime `strtoul`: |  * If `str` starts with whitespace, then those whitespace characters are skipped before attempting to parse the number. | ||||||
|  * |  * | ||||||
|  * - Only the bases 10 and 16 are guaranteed to be supported. The behavior for |  * If the parsed number does not fit inside an `unsigned long`, | ||||||
|  *   other bases is unspecified. |  * the result is clamped to the maximum representable `unsigned long` value. | ||||||
|  * - It is unspecified what this function returns when the parsed integer does |  | ||||||
|  *   not fit inside an `unsigned long`. |  | ||||||
|  * |  * | ||||||
|  * \param str The null-terminated string to read. Must not be NULL. |  * \param str The null-terminated string to read. Must not be NULL. | ||||||
|  * \param endp If not NULL, the address of the first invalid character (i.e. |  * \param endp If not NULL, the address of the first invalid character (i.e. | ||||||
|  *             the next character after the parsed number) will be written to |  *             the next character after the parsed number) will be written to | ||||||
|  *             this pointer. |  *             this pointer. | ||||||
|  * \param base The base of the integer to read. The values 0, 10 and 16 are |  * \param base The base of the integer to read. Supported values are 0 and 2 to 36 inclusive. | ||||||
|  *             supported. If 0, the base will be inferred from the integer's |  *             If 0, the base will be inferred from the number's | ||||||
|  *             prefix. |  *             prefix (0x for hexadecimal, 0 for octal, decimal otherwise). | ||||||
|  * \returns The parsed `unsigned long`. |  * \returns The parsed `unsigned long`, or 0 if no number could be parsed. | ||||||
|  * |  * | ||||||
|  * \threadsafety It is safe to call this function from any thread. |  * \threadsafety It is safe to call this function from any thread. | ||||||
|  * |  * | ||||||
| @@ -1786,21 +1781,18 @@ extern SDL_DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **en | |||||||
| /** | /** | ||||||
|  * Parse a `long long` from a string. |  * Parse a `long long` from a string. | ||||||
|  * |  * | ||||||
|  * This function makes fewer guarantees than the C runtime `strtoll`: |  * If `str` starts with whitespace, then those whitespace characters are skipped before attempting to parse the number. | ||||||
|  * |  * | ||||||
|  * - Only the bases 10 and 16 are guaranteed to be supported. The behavior for |  * If the parsed number does not fit inside a `long long`, the result is clamped to the minimum and maximum representable `long long` values. | ||||||
|  *   other bases is unspecified. |  | ||||||
|  * - It is unspecified what this function returns when the parsed integer does |  | ||||||
|  *   not fit inside a `long long`. |  | ||||||
|  * |  * | ||||||
|  * \param str The null-terminated string to read. Must not be NULL. |  * \param str The null-terminated string to read. Must not be NULL. | ||||||
|  * \param endp If not NULL, the address of the first invalid character (i.e. |  * \param endp If not NULL, the address of the first invalid character (i.e. | ||||||
|  *             the next character after the parsed number) will be written to |  *             the next character after the parsed number) will be written to | ||||||
|  *             this pointer. |  *             this pointer. | ||||||
|  * \param base The base of the integer to read. The values 0, 10 and 16 are |  * \param base The base of the integer to read. Supported values are 0 and 2 to 36 inclusive. | ||||||
|  *             supported. If 0, the base will be inferred from the integer's |  *             If 0, the base will be inferred from the number's | ||||||
|  *             prefix. |  *             prefix (0x for hexadecimal, 0 for octal, decimal otherwise). | ||||||
|  * \returns The parsed `long long`. |  * \returns The parsed `long long`, or 0 if no number could be parsed. | ||||||
|  * |  * | ||||||
|  * \threadsafety It is safe to call this function from any thread. |  * \threadsafety It is safe to call this function from any thread. | ||||||
|  * |  * | ||||||
| @@ -1831,7 +1823,7 @@ extern SDL_DECLSPEC long long SDLCALL SDL_strtoll(const char *str, char **endp, | |||||||
|  * \param base The base of the integer to read. Supported values are 0 and 2 to 36 inclusive. |  * \param base The base of the integer to read. Supported values are 0 and 2 to 36 inclusive. | ||||||
|  *             If 0, the base will be inferred from the number's |  *             If 0, the base will be inferred from the number's | ||||||
|  *             prefix (0x for hexadecimal, 0 for octal, decimal otherwise). |  *             prefix (0x for hexadecimal, 0 for octal, decimal otherwise). | ||||||
|  * \returns The parsed `unsigned long long`. |  * \returns The parsed `unsigned long long`, or 0 if no number could be parsed. | ||||||
|  * |  * | ||||||
|  * \threadsafety It is safe to call this function from any thread. |  * \threadsafety It is safe to call this function from any thread. | ||||||
|  * |  * | ||||||
| @@ -1861,7 +1853,7 @@ extern SDL_DECLSPEC unsigned long long SDLCALL SDL_strtoull(const char *str, cha | |||||||
|  * \param endp If not NULL, the address of the first invalid character (i.e. |  * \param endp If not NULL, the address of the first invalid character (i.e. | ||||||
|  *             the next character after the parsed number) will be written to |  *             the next character after the parsed number) will be written to | ||||||
|  *             this pointer. |  *             this pointer. | ||||||
|  * \returns The parsed `double`. |  * \returns The parsed `double`, or 0 if no number could be parsed. | ||||||
|  * |  * | ||||||
|  * \threadsafety It is safe to call this function from any thread. |  * \threadsafety It is safe to call this function from any thread. | ||||||
|  * |  * | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user