summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-12-07 13:48:06 +0100
committerJo-Philipp Wich <jo@mein.io>2021-12-07 13:49:29 +0100
commit0d29b2558987eda5d8a913638f40d506172606ac (patch)
treea72710c311f0a86862adc62be21d9f29087dbce5
parent5680fab214cd35a54636d5dfb95dc552d1258144 (diff)
treewide: fix "resource" misspellings
Fix various misspelling of "resource". This commit changes the exported libucode ABI. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--include/ucode/lib.h2
-rw-r--r--include/ucode/types.h2
-rw-r--r--lib.c2
-rw-r--r--types.c40
-rw-r--r--vm.c4
5 files changed, 25 insertions, 25 deletions
diff --git a/include/ucode/lib.h b/include/ucode/lib.h
index a033dfd..4b70635 100644
--- a/include/ucode/lib.h
+++ b/include/ucode/lib.h
@@ -60,7 +60,7 @@ _uc_fn_arg(uc_vm_t *vm, size_t nargs, size_t n)
#define uc_value_pop() uc_vm_stack_pop(vm)
-/* ressource type helper */
+/* resource type helper */
static inline uc_value_t *
uc_resource_new(uc_resource_type_t *type, void *data)
diff --git a/include/ucode/types.h b/include/ucode/types.h
index 4a3ccd7..ccb0e1b 100644
--- a/include/ucode/types.h
+++ b/include/ucode/types.h
@@ -40,7 +40,7 @@ typedef enum uc_type {
UC_CFUNCTION,
UC_CLOSURE,
UC_UPVALUE,
- UC_RESSOURCE
+ UC_RESOURCE
} uc_type_t;
typedef struct uc_value {
diff --git a/lib.c b/lib.c
index 2c91d1d..aa4d43f 100644
--- a/lib.c
+++ b/lib.c
@@ -2422,7 +2422,7 @@ uc_proto(uc_vm_t *vm, size_t nargs)
proto = uc_fn_arg(1);
if (!ucv_prototype_set(val, proto))
- uc_vm_raise_exception(vm, EXCEPTION_TYPE, "Passed value is neither a prototype, ressource or object");
+ uc_vm_raise_exception(vm, EXCEPTION_TYPE, "Passed value is neither a prototype, resource or object");
ucv_get(proto);
diff --git a/types.c b/types.c
index 0c0f40b..c3032e1 100644
--- a/types.c
+++ b/types.c
@@ -53,7 +53,7 @@ ucv_typename(uc_value_t *uv)
case UC_CFUNCTION: return "cfunction";
case UC_CLOSURE: return "closure";
case UC_UPVALUE: return "upvalue";
- case UC_RESSOURCE: return "ressource";
+ case UC_RESOURCE: return "resource";
}
return "unknown";
@@ -174,7 +174,7 @@ ucv_gc_mark(uc_value_t *uv)
ucv_gc_mark(upval->value);
break;
- case UC_RESSOURCE:
+ case UC_RESOURCE:
resource = (uc_resource_t *)uv;
if (resource->type)
@@ -191,7 +191,7 @@ void
ucv_free(uc_value_t *uv, bool retain)
{
uc_resource_type_t *restype;
- uc_resource_t *ressource;
+ uc_resource_t *resource;
uc_function_t *function;
uc_closure_t *closure;
uc_upvalref_t *upval;
@@ -252,12 +252,12 @@ ucv_free(uc_value_t *uv, bool retain)
ucv_put_value(&function->header, retain);
break;
- case UC_RESSOURCE:
- ressource = (uc_resource_t *)uv;
- restype = ressource->type;
+ case UC_RESOURCE:
+ resource = (uc_resource_t *)uv;
+ restype = resource->type;
if (restype && restype->free)
- restype->free(ressource->data);
+ restype->free(resource->data);
break;
@@ -1000,7 +1000,7 @@ ucv_resource_new(uc_resource_type_t *type, void *data)
uc_resource_t *res;
res = xalloc(sizeof(*res));
- res->header.type = UC_RESSOURCE;
+ res->header.type = UC_RESOURCE;
res->header.refcount = 1;
res->type = type;
res->data = data;
@@ -1013,7 +1013,7 @@ ucv_resource_dataptr(uc_value_t *uv, const char *name)
{
uc_resource_t *res = (uc_resource_t *)uv;
- if (ucv_type(uv) != UC_RESSOURCE)
+ if (ucv_type(uv) != UC_RESOURCE)
return NULL;
if (name) {
@@ -1083,7 +1083,7 @@ uc_value_t *
ucv_prototype_get(uc_value_t *uv)
{
uc_resource_type_t *restype;
- uc_resource_t *ressource;
+ uc_resource_t *resource;
uc_object_t *object;
uc_array_t *array;
@@ -1098,9 +1098,9 @@ ucv_prototype_get(uc_value_t *uv)
return object->proto;
- case UC_RESSOURCE:
- ressource = (uc_resource_t *)uv;
- restype = ressource->type;
+ case UC_RESOURCE:
+ resource = (uc_resource_t *)uv;
+ restype = resource->type;
return restype ? restype->proto : NULL;
@@ -1294,7 +1294,7 @@ ucv_to_json(uc_value_t *uv)
case UC_CLOSURE:
case UC_CFUNCTION:
case UC_FUNCTION:
- case UC_RESSOURCE:
+ case UC_RESOURCE:
case UC_UPVALUE:
case UC_NULL:
return NULL;
@@ -1422,7 +1422,7 @@ ucv_to_stringbuf_formatted(uc_vm_t *vm, uc_stringbuf_t *pb, uc_value_t *uv, size
{
bool json = (pad_char != '\0');
uc_resource_type_t *restype;
- uc_resource_t *ressource;
+ uc_resource_t *resource;
uc_cfunction_t *cfunction;
uc_function_t *function;
uc_closure_t *closure;
@@ -1622,14 +1622,14 @@ ucv_to_stringbuf_formatted(uc_vm_t *vm, uc_stringbuf_t *pb, uc_value_t *uv, size
break;
- case UC_RESSOURCE:
- ressource = (uc_resource_t *)uv;
- restype = ressource->type;
+ case UC_RESOURCE:
+ resource = (uc_resource_t *)uv;
+ restype = resource->type;
ucv_stringbuf_printf(pb, "%s<%s %p>%s",
json ? "\"" : "",
- restype ? restype->name : "ressource",
- ressource->data,
+ restype ? restype->name : "resource",
+ resource->data,
json ? "\"" : "");
break;
diff --git a/vm.c b/vm.c
index 05fa3b1..a1be51b 100644
--- a/vm.c
+++ b/vm.c
@@ -1025,7 +1025,7 @@ uc_vm_insn_load_val(uc_vm_t *vm, uc_vm_insn_t insn)
uc_value_t *v = uc_vm_stack_pop(vm);
switch (ucv_type(v)) {
- case UC_RESSOURCE:
+ case UC_RESOURCE:
case UC_OBJECT:
case UC_ARRAY:
uc_vm_stack_push(vm, ucv_key_get(vm, v, k));
@@ -1833,7 +1833,7 @@ uc_vm_insn_next(uc_vm_t *vm, uc_vm_insn_t insn)
struct lh_entry *curr;
uint64_t n;
- if (k != NULL && ucv_type(k) != UC_RESSOURCE) {
+ if (k != NULL && ucv_type(k) != UC_RESOURCE) {
fprintf(stderr, "Invalid iterator value\n");
abort();
}