forked from ground/ground
Updated old code
This commit is contained in:
@@ -561,12 +561,12 @@ List createList() {
|
|||||||
|
|
||||||
void appendToList(List* list, GroundValue value) {
|
void appendToList(List* list, GroundValue value) {
|
||||||
if (list == NULL) {
|
if (list == NULL) {
|
||||||
printf("Expecting a List ptr, got a null pointer instead.\nThis is likely not an error with your Ground program.\nPlease report this issue to https://chsp.au/ground/cground\n");
|
printf("Expecting a List ptr, got a null pointer instead.\nThis is likely not an error with your Ground program.\nPlease report this issue to https://chsp.au/ground/ground\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
GroundValue* ptr = realloc(list->values, (list->size + 1) * sizeof(GroundValue));
|
GroundValue* ptr = realloc(list->values, (list->size + 1) * sizeof(GroundValue));
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
printf("There was an error allocating memory for a list.\nThis is likely not an error with your Ground program.\nPlease report this issue to https://chsp.au/ground/cground\n");
|
printf("There was an error allocating memory for a list.\nThis is likely not an error with your Ground program.\nPlease report this issue to https://chsp.au/ground/ground\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
list->size++;
|
list->size++;
|
||||||
@@ -576,7 +576,7 @@ void appendToList(List* list, GroundValue value) {
|
|||||||
|
|
||||||
ListAccess getListAt(List* list, size_t idx) {
|
ListAccess getListAt(List* list, size_t idx) {
|
||||||
if (list == NULL) {
|
if (list == NULL) {
|
||||||
printf("Expecting a List ptr, got a null pointer instead.\nThis is likely not an error with your Ground program.\nPlease report this issue to https://chsp.au/ground/cground\n");
|
printf("Expecting a List ptr, got a null pointer instead.\nThis is likely not an error with your Ground program.\nPlease report this issue to https://chsp.au/ground/ground\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (idx < list->size) {
|
if (idx < list->size) {
|
||||||
@@ -594,7 +594,7 @@ ListAccess getListAt(List* list, size_t idx) {
|
|||||||
|
|
||||||
ListAccessStatus setListAt(List* list, size_t idx, GroundValue value) {
|
ListAccessStatus setListAt(List* list, size_t idx, GroundValue value) {
|
||||||
if (list == NULL) {
|
if (list == NULL) {
|
||||||
printf("Expecting a List ptr, got a null pointer instead.\nThis is likely not an error with your Ground program.\nPlease report this issue to https://chsp.au/ground/cground\n");
|
printf("Expecting a List ptr, got a null pointer instead.\nThis is likely not an error with your Ground program.\nPlease report this issue to https://chsp.au/ground/ground\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (idx < list->size) {
|
if (idx < list->size) {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ typedef struct GroundError {
|
|||||||
typedef struct GroundValue {
|
typedef struct GroundValue {
|
||||||
GroundValueType type;
|
GroundValueType type;
|
||||||
struct GroundStruct* customType;
|
struct GroundStruct* customType;
|
||||||
struct {
|
union {
|
||||||
int64_t intVal;
|
int64_t intVal;
|
||||||
double doubleVal;
|
double doubleVal;
|
||||||
char* stringVal;
|
char* stringVal;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[hello, there, general, hello]
|
[hello, there, general, kenobi][hello, there, general, kenobi][hello, there, general, hello]
|
||||||
hello
|
hello
|
||||||
there
|
there
|
||||||
general
|
general
|
||||||
,WV
|
Nqb˜V
|
||||||
|
|||||||
Reference in New Issue
Block a user