Skip to content

Commit 95f8880

Browse files
remove separate hextoint, we dont need it because we have atoll with radix
1 parent 952a032 commit 95f8880

3 files changed

Lines changed: 2 additions & 16 deletions

File tree

include/string.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,6 @@ const char* gc_strdup(basic_ctx* ctx, const char* string);
217217
*/
218218
int gc(basic_ctx* ctx);
219219

220-
/**
221-
* @brief Convert a hex string to integer.
222-
*
223-
* @param n1 Hex string (e.g. "1A3F")
224-
* @return uint64_t Converted value
225-
*/
226-
uint64_t hextoint(const char* n1);
227-
228220
/**
229221
* @brief Check if a character is a decimal digit.
230222
*

src/debugger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void init_debug()
146146
break;
147147
}
148148
memcpy(thisentry->name, symbol, length);
149-
thisentry->address = hextoint(symbol_address);
149+
thisentry->address = (uint64_t)atoll(symbol_address, 16);
150150
thisentry->type = *type;
151151
symbol_t* next = kmalloc(sizeof(symbol_t));
152152
if (!next) {

src/string.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,7 @@ __attribute__((hot)) int strncmp(const char *s1, const char *s2, uint32_t n) {
109109
return 0;
110110
}
111111

112-
uint64_t hextoint(const char* n1)
113-
{
114-
return atoll(n1, 16);
115-
}
116-
117-
uint32_t strlcat(char *dst, const char *src, uint32_t siz)
118-
{
112+
uint32_t strlcat(char *dst, const char *src, uint32_t siz) {
119113
if (!src || !dst) {
120114
return 0;
121115
}

0 commit comments

Comments
 (0)