Rename vec_erase_ptr_at to vec_erase_at.

This commit is contained in:
Christoffer Lerno
2024-09-06 00:41:07 +02:00
parent ad0e97ab7b
commit 1e570bf506
4 changed files with 10 additions and 10 deletions

View File

@@ -516,7 +516,7 @@ void update_feature_flags(const char ***flags, const char ***removed_flags, cons
{ {
if (str_eq(value, arg)) if (str_eq(value, arg))
{ {
vec_erase_ptr_at(*to_remove_from, i); vec_erase_at(*to_remove_from, i);
break; break;
} }
} }

View File

@@ -288,7 +288,7 @@ static void update_build_target_from_options(BuildTarget *target, BuildOptions *
{ {
if (str_eq(feature, remove_feature)) if (str_eq(feature, remove_feature))
{ {
vec_erase_ptr_at(target->feature_list, i); vec_erase_at(target->feature_list, i);
break; break;
} }
} }

View File

@@ -332,7 +332,7 @@ static bool sema_analyse_union_members(SemaContext *context, Decl *decl)
// If we need to erase it then do so. // If we need to erase it then do so.
if (erase_decl) if (erase_decl)
{ {
vec_erase_ptr_at(members, i); vec_erase_at(members, i);
member_count--; member_count--;
// Go back and take the next one. // Go back and take the next one.
if (i < member_count) goto AGAIN; if (i < member_count) goto AGAIN;
@@ -503,7 +503,7 @@ static bool sema_analyse_struct_members(SemaContext *context, Decl *decl)
// If we should erase it, do so. // If we should erase it, do so.
if (erase_decl) if (erase_decl)
{ {
vec_erase_ptr_at(struct_members, i); vec_erase_at(struct_members, i);
member_count--; member_count--;
if (i < member_count) goto AGAIN; if (i < member_count) goto AGAIN;
break; break;
@@ -963,14 +963,14 @@ static bool sema_analyse_interface(SemaContext *context, Decl *decl, bool *erase
{ {
// This is necessary in order to allow this check to run again. // This is necessary in order to allow this check to run again.
decl_poison(method); decl_poison(method);
vec_erase_ptr_at(method->func_decl.signature.params, 0); vec_erase_at(method->func_decl.signature.params, 0);
return false; return false;
} }
// We might need to erase the function. // We might need to erase the function.
if (erase) if (erase)
{ {
vec_erase_ptr_at(functions, i); vec_erase_at(functions, i);
count--; count--;
if (i >= count) break; if (i >= count) break;
goto RETRY; goto RETRY;
@@ -1071,7 +1071,7 @@ static bool sema_analyse_bitstruct(SemaContext *context, Decl *decl, bool *erase
if (!sema_analyse_bitstruct_member(context, decl, member, i, decl->bitstruct.overlap, &erase_decl_member)) goto ERROR; if (!sema_analyse_bitstruct_member(context, decl, member, i, decl->bitstruct.overlap, &erase_decl_member)) goto ERROR;
if (erase_decl_member) if (erase_decl_member)
{ {
vec_erase_ptr_at(members, i); vec_erase_at(members, i);
member_count--; member_count--;
if (i < member_count) goto AGAIN; if (i < member_count) goto AGAIN;
break; break;
@@ -1508,7 +1508,7 @@ static inline bool sema_analyse_enum(SemaContext *context, Decl *decl, bool *era
SEMA_ERROR(decl, "No enum values left in enum after @if resolution, there must be at least one."); SEMA_ERROR(decl, "No enum values left in enum after @if resolution, there must be at least one.");
return decl_poison(decl); return decl_poison(decl);
} }
vec_erase_ptr_at(enum_values, i); vec_erase_at(enum_values, i);
enums--; enums--;
i--; i--;
continue; continue;

View File

@@ -196,7 +196,7 @@ static inline uint32_t fnv1a(const char *key, uint32_t len);
INLINE uint32_t vec_size(const void *vec); INLINE uint32_t vec_size(const void *vec);
static inline void vec_resize(void *vec, uint32_t new_size); static inline void vec_resize(void *vec, uint32_t new_size);
static inline void vec_pop(void *vec); static inline void vec_pop(void *vec);
static inline void vec_erase_ptr_at(void *vec, unsigned i); static inline void vec_erase_at(void *vec, unsigned i);
#define NUMBER_CHAR_CASE '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9' #define NUMBER_CHAR_CASE '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9'
#define UPPER_CHAR_CASE 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': \ #define UPPER_CHAR_CASE 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': \
@@ -272,7 +272,7 @@ static inline void vec_pop(void *vec)
header[-1].size--; header[-1].size--;
} }
static inline void vec_erase_ptr_at(void *vec, unsigned i) static inline void vec_erase_at(void *vec, unsigned i)
{ {
assert(vec); assert(vec);
unsigned size = vec_size(vec); unsigned size = vec_size(vec);