Finish making code for working with lists use unsigned ints.

This commit is contained in:
Bob Nystrom
2015-03-21 12:22:04 -07:00
parent 98dbde5b1b
commit 3445c6a2cb
3 changed files with 79 additions and 80 deletions

View File

@ -393,8 +393,6 @@ typedef struct
{
Obj obj;
// TODO: Make these uint32_t to match ObjMap, or vice versa.
// The number of elements allocated.
uint32_t capacity;
@ -639,16 +637,16 @@ Value wrenNewInstance(WrenVM* vm, ObjClass* classObj);
// Creates a new list with [numElements] elements (which are left
// uninitialized.)
ObjList* wrenNewList(WrenVM* vm, int numElements);
ObjList* wrenNewList(WrenVM* vm, uint32_t numElements);
// Adds [value] to [list], reallocating and growing its storage if needed.
void wrenListAdd(WrenVM* vm, ObjList* list, Value value);
// Inserts [value] in [list] at [index], shifting down the other elements.
void wrenListInsert(WrenVM* vm, ObjList* list, Value value, int index);
void wrenListInsert(WrenVM* vm, ObjList* list, Value value, uint32_t index);
// Removes and returns the item at [index] from [list].
Value wrenListRemoveAt(WrenVM* vm, ObjList* list, int index);
Value wrenListRemoveAt(WrenVM* vm, ObjList* list, uint32_t index);
// Creates a new empty map.
ObjMap* wrenNewMap(WrenVM* vm);