Make my_str_len/my_itos take uintmax_t

R=digit at https://breakpad.appspot.com/452004/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1038 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ted.mielczarek@gmail.com
2012-09-17 14:01:19 +00:00
parent 54ede03227
commit a61c7e6927
4 changed files with 38 additions and 34 deletions

View File

@@ -52,17 +52,16 @@ extern int my_strncmp(const char* a, const char* b, size_t len);
// Return true iff successful.
extern bool my_strtoui(int* result, const char* s);
// Return the length of the given, non-negative integer when expressed in base
// 10.
extern unsigned my_int_len(intmax_t i);
// Return the length of the given unsigned integer when expressed in base 10.
extern unsigned my_uint_len(uintmax_t i);
// Convert a non-negative integer to a string
// Convert an unsigned integer to a string
// output: (output) the resulting string is written here. This buffer must be
// large enough to hold the resulting string. Call |my_int_len| to get the
// required length.
// i: the non-negative integer to serialise.
// i_len: the length of the integer in base 10 (see |my_int_len|).
extern void my_itos(char* output, intmax_t i, unsigned i_len);
// i: the unsigned integer to serialise.
// i_len: the length of the integer in base 10 (see |my_uint_len|).
extern void my_uitos(char* output, uintmax_t i, unsigned i_len);
extern const char* my_strchr(const char* haystack, char needle);