update list name
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
|
|
||||||
typedef struct gnCList {
|
typedef struct gnArrayList {
|
||||||
int count;
|
int count;
|
||||||
int maxCount;
|
int maxCount;
|
||||||
void* data;
|
void* data;
|
||||||
@@ -9,7 +9,7 @@ typedef struct gnCList {
|
|||||||
|
|
||||||
const int GROWTH_RATE = 2; // i heard somewhere that 1.5 is better but imma use 2 because I also heard that its better somewhere else
|
const int GROWTH_RATE = 2; // i heard somewhere that 1.5 is better but imma use 2 because I also heard that its better somewhere else
|
||||||
|
|
||||||
inline gnCList gnCreateCList(int count) {
|
inline gnArrayList gnCreateArrayList(int count) {
|
||||||
gnCList newList;
|
gnCList newList;
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
@@ -23,7 +23,7 @@ inline gnCList gnCreateCList(int count) {
|
|||||||
return newList;
|
return newList;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void gnCListResize(gnCList* cList, int count) {
|
inline void gnArrayListResize(gnArrayList* cList, int count) {
|
||||||
cList->count = count;
|
cList->count = count;
|
||||||
while (cList->count > cList->maxCount) {
|
while (cList->count > cList->maxCount) {
|
||||||
int oldMaxCount = cList->maxCount;
|
int oldMaxCount = cList->maxCount;
|
||||||
@@ -36,7 +36,7 @@ inline void gnCListResize(gnCList* cList, int count) {
|
|||||||
cList->data = realloc(cList->data, cList->maxCount);
|
cList->data = realloc(cList->data, cList->maxCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void gnCListReserve(gnCList* cList, int count) {
|
inline void gnArrayListReserve(gnArrayList* cList, int count) {
|
||||||
while (cList->count > cList->maxCount) {
|
while (cList->count > cList->maxCount) {
|
||||||
int oldMaxCount = cList->maxCount;
|
int oldMaxCount = cList->maxCount;
|
||||||
cList->maxCount *= GROWTH_RATE;
|
cList->maxCount *= GROWTH_RATE;
|
||||||
|
Reference in New Issue
Block a user