In part 1of day 5 and 6 parse_number will return now uint64_t.

This commit is contained in:
Alexander Andreev 2023-12-07 01:02:32 +04:00
parent 1953469f35
commit 0760a2d627
Signed by: Arav
GPG Key ID: D22A817D95815393
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
#include <stdint.h> #include <stdint.h>
inline int64_t parse_number(const char *end); inline uint64_t parse_number(const char *end);
int main(int argc, char **argv) { int main(int argc, char **argv) {
@ -69,7 +69,7 @@ int main(int argc, char **argv) {
return 0; return 0;
} }
inline int64_t parse_number(const char *end) { inline uint64_t parse_number(const char *end) {
int64_t num = 0; int64_t num = 0;
for (size_t m = 1;; m *= 10) { for (size_t m = 1;; m *= 10) {

View File

@ -7,7 +7,7 @@
#define ISDIGIT(c) (c >= 0x30 && c <= 0x39) #define ISDIGIT(c) (c >= 0x30 && c <= 0x39)
inline int64_t parse_number(const char *end); inline uint64_t parse_number(const char *end);
int main(int argc, char **argv) { int main(int argc, char **argv) {
@ -96,7 +96,7 @@ int main(int argc, char **argv) {
return 0; return 0;
} }
inline int64_t parse_number(const char *end) { inline uint64_t parse_number(const char *end) {
int64_t num = 0; int64_t num = 0;
for (size_t m = 1;; m *= 10) { for (size_t m = 1;; m *= 10) {