Pass allocator as const *
This commit is contained in:
parent
645686ae22
commit
be64571b0e
@ -10,8 +10,8 @@ extern "C" {
|
|||||||
|
|
||||||
typedef struct dstr String;
|
typedef struct dstr String;
|
||||||
|
|
||||||
String *wapp_dstr_with_capacity(u64 capacity, Allocator *allocator);
|
String *wapp_dstr_with_capacity(u64 capacity, const Allocator *allocator);
|
||||||
String *wapp_dstr_from_string(const char *str, Allocator *allocator);
|
String *wapp_dstr_from_string(const char *str, const Allocator *allocator);
|
||||||
void wapp_dstr_update(String **dst, const char *src);
|
void wapp_dstr_update(String **dst, const char *src);
|
||||||
void wapp_dstr_free(String **str);
|
void wapp_dstr_free(String **str);
|
||||||
void wapp_dstr_concat(String **dst, const char *src);
|
void wapp_dstr_concat(String **dst, const char *src);
|
||||||
|
@ -17,7 +17,7 @@ struct dstr {
|
|||||||
char buf[];
|
char buf[];
|
||||||
};
|
};
|
||||||
|
|
||||||
String *wapp_dstr_with_capacity(u64 capacity, Allocator *allocator) {
|
String *wapp_dstr_with_capacity(u64 capacity, const Allocator *allocator) {
|
||||||
Allocator alloc;
|
Allocator alloc;
|
||||||
if (allocator) {
|
if (allocator) {
|
||||||
alloc = *allocator;
|
alloc = *allocator;
|
||||||
@ -38,7 +38,7 @@ String *wapp_dstr_with_capacity(u64 capacity, Allocator *allocator) {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
String *wapp_dstr_from_string(const char *str, Allocator *allocator) {
|
String *wapp_dstr_from_string(const char *str, const Allocator *allocator) {
|
||||||
if (!str) {
|
if (!str) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user