shithub: sl

Download patch

ref: 10edeefbcbac6cb53205902005adbbb2a37b8cdc
parent: f5817e38d5aee775a8548c9be4e804b910a8090b
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Jan 21 20:38:09 EST 2025

cvalues: more uint8_t instead of char

--- a/cvalues.c
+++ b/cvalues.c
@@ -738,7 +738,7 @@
 }
 
 static void
-check_addr_args(value_t arr, value_t ind, char **data, int *index)
+check_addr_args(value_t arr, value_t ind, uint8_t **data, int *index)
 {
 	int numel;
 	cvalue_t *cv = ptr(arr);
@@ -752,7 +752,8 @@
 value_t
 cvalue_array_aref(value_t *args)
 {
-	char *data; int index;
+	uint8_t *data;
+	int index;
 	fltype_t *eltype = cv_class(ptr(args[0]))->eltype;
 	value_t el = 0;
 	numerictype_t nt = eltype->numtype;
@@ -768,7 +769,7 @@
 			return fixnum(((int16_t*)data)[index]);
 		return fixnum(((uint16_t*)data)[index]);
 	}
-	char *dest = cptr(el);
+	uint8_t *dest = cptr(el);
 	size_t sz = eltype->size;
 	if(sz == 1)
 		*dest = data[index];
@@ -786,10 +787,10 @@
 value_t
 cvalue_array_aset(value_t *args)
 {
-	char *data; int index;
+	uint8_t *data; int index;
 	fltype_t *eltype = cv_class(ptr(args[0]))->eltype;
 	check_addr_args(args[0], args[1], &data, &index);
-	char *dest = data + index*eltype->size;
+	uint8_t *dest = data + index*eltype->size;
 	cvalue_init(eltype, args[2], dest);
 	return args[2];
 }