Migrate more strings

FossilOrigin-Name: 0d125c31daf305a4363234402dbf375ecd71b24da762aa8e8c59751678cf47ec
This commit is contained in:
Jonathan Schleifer 2025-03-02 19:52:00 +00:00
parent ce5944a7b1
commit b00de734e8
25 changed files with 476 additions and 439 deletions

View file

@ -166,22 +166,25 @@ struct pool {
void dealloc(void *p, size_t size);
void *realloc(void *p, size_t oldsize, size_t newsize);
char *string(char *s, size_t l);
char *string(const char *s, size_t l);
char *
string(char *s)
string(const char *s)
{
return string(s, strlen(s));
};
}
void
deallocstr(char *s)
{
dealloc(s, strlen(s) + 1);
};
}
char *
stringbuf(char *s)
stringbuf(const char *s)
{
return string(s, _MAXDEFSTR - 1);
};
}
void dealloc_block(void *b);
void allocnext(size_t allocsize);
@ -379,19 +382,21 @@ template <class T> struct hashtable {
}
inline char *
newstring(char *s)
newstring(const char *s)
{
return gp()->string(s);
};
}
inline char *
newstring(char *s, size_t l)
newstring(const char *s, size_t l)
{
return gp()->string(s, l);
};
}
inline char *
newstringbuf(char *s)
newstringbuf(const char *s)
{
return gp()->stringbuf(s);
};
}
#endif