diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 22:45:02 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 22:45:02 -0400 |
| commit | 44cd26f2cebd760a53aa4ff1b7779e718a101650 (patch) | |
| tree | 4bdc9144c6825a0c394155712d5e464ee2a61061 /src/stdlib/integers.c | |
| parent | 3406515a44b13d0c290c28ac42bd364ce27560c7 (diff) | |
Rename Array -> List in all code and docs
Diffstat (limited to 'src/stdlib/integers.c')
| -rw-r--r-- | src/stdlib/integers.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/stdlib/integers.c b/src/stdlib/integers.c index 8086239d..7943caee 100644 --- a/src/stdlib/integers.c +++ b/src/stdlib/integers.c @@ -9,7 +9,7 @@ #include <stdio.h> #include <stdlib.h> -#include "arrays.h" +#include "lists.h" #include "datatypes.h" #include "integers.h" #include "optionals.h" @@ -480,7 +480,7 @@ static void Int$serialize(const void *obj, FILE *out, Table_t *pointers, const T } } -static void Int$deserialize(FILE *in, void *obj, Array_t *pointers, const TypeInfo_t*) +static void Int$deserialize(FILE *in, void *obj, List_t *pointers, const TypeInfo_t*) { if (fgetc(in) == 0) { int64_t i = 0; @@ -519,7 +519,7 @@ public void Int64$serialize(const void *obj, FILE *out, Table_t*, const TypeInfo fputc((uint8_t)z, out); } -public void Int64$deserialize(FILE *in, void *outval, Array_t*, const TypeInfo_t*) +public void Int64$deserialize(FILE *in, void *outval, List_t*, const TypeInfo_t*) { uint64_t z = 0; for(size_t shift = 0; ; shift += 7) { @@ -541,7 +541,7 @@ public void Int32$serialize(const void *obj, FILE *out, Table_t*, const TypeInfo fputc((uint8_t)z, out); } -public void Int32$deserialize(FILE *in, void *outval, Array_t*, const TypeInfo_t*) +public void Int32$deserialize(FILE *in, void *outval, List_t*, const TypeInfo_t*) { uint32_t z = 0; for(size_t shift = 0; ; shift += 7) { @@ -580,14 +580,14 @@ public void Int32$deserialize(FILE *in, void *outval, Array_t*, const TypeInfo_t Int_t as_int = Int$from_int64((int64_t)i); \ return Int$octal(as_int, digits_int, prefix); \ } \ - public Array_t KindOfInt ## $bits(c_type x) { \ - Array_t bit_array = (Array_t){.data=GC_MALLOC_ATOMIC(sizeof(bool[8*sizeof(c_type)])), .atomic=1, .stride=sizeof(bool), .length=8*sizeof(c_type)}; \ - bool *bits = bit_array.data + sizeof(c_type)*8; \ + public List_t KindOfInt ## $bits(c_type x) { \ + List_t bit_list = (List_t){.data=GC_MALLOC_ATOMIC(sizeof(bool[8*sizeof(c_type)])), .atomic=1, .stride=sizeof(bool), .length=8*sizeof(c_type)}; \ + bool *bits = bit_list.data + sizeof(c_type)*8; \ for (size_t i = 0; i < 8*sizeof(c_type); i++) { \ *(bits--) = x & 1; \ x >>= 1; \ } \ - return bit_array; \ + return bit_list; \ } \ typedef struct { \ Optional##KindOfInt##_t current, last; \ |
