From 7ec814525c6aac66d2203ea70f02436b26633861 Mon Sep 17 00:00:00 2001 From: CPunch Date: Thu, 29 Sep 2022 16:36:19 -0500 Subject: [PATCH] minor refactoring --- cnc/include/{cpanel.h => cauth.h} | 0 cnc/src/{cpanel.c => cauth.c} | 2 +- cnc/src/cnc.c | 2 +- lib/include/core/lbox.h | 17 ++++++++--------- 4 files changed, 10 insertions(+), 11 deletions(-) rename cnc/include/{cpanel.h => cauth.h} (100%) rename cnc/src/{cpanel.c => cauth.c} (99%) diff --git a/cnc/include/cpanel.h b/cnc/include/cauth.h similarity index 100% rename from cnc/include/cpanel.h rename to cnc/include/cauth.h diff --git a/cnc/src/cpanel.c b/cnc/src/cauth.c similarity index 99% rename from cnc/src/cpanel.c rename to cnc/src/cauth.c index 4e3cca5..5df9aa3 100644 --- a/cnc/src/cpanel.c +++ b/cnc/src/cauth.c @@ -1,4 +1,4 @@ -#include "cpanel.h" +#include "cauth.h" #include "cnc.h" #include "core/lerror.h" diff --git a/cnc/src/cnc.c b/cnc/src/cnc.c index 0c0136b..34c4653 100644 --- a/cnc/src/cnc.c +++ b/cnc/src/cnc.c @@ -4,7 +4,7 @@ #include "core/lmem.h" #include "core/lsodium.h" #include "core/ltask.h" -#include "cpanel.h" +#include "cauth.h" #include "cpeer.h" #include "net/lsocket.h" diff --git a/lib/include/core/lbox.h b/lib/include/core/lbox.h index 7c943d2..6f929c1 100644 --- a/lib/include/core/lbox.h +++ b/lib/include/core/lbox.h @@ -93,15 +93,14 @@ struct sLaikaB_box LAIKA_FORCEINLINE void *laikaB_unlock(struct sLaikaB_box *box, void *data) { struct sLaikaV_vm vm = { - /* boxes have 2 reserved constants, [0] for the output, [1] for the input */ - .constList = - { - [LAIKA_BOX_UNLOCKED_INDX] = LAIKA_MAKE_VM_PTR(box->unlockedData), - [LAIKA_BOX_SCRATCH_INDX] = LAIKA_MAKE_VM_PTR(box->scratch), - [LAIKA_BOX_DATA_INDX] = LAIKA_MAKE_VM_PTR(data), - }, - .code = { 0 }, - .stack = { 0 }, + /* boxes have 3 reserved constants */ + .constList = { + [LAIKA_BOX_UNLOCKED_INDX] = LAIKA_MAKE_VM_PTR(box->unlockedData), + [LAIKA_BOX_SCRATCH_INDX] = LAIKA_MAKE_VM_PTR(box->scratch), + [LAIKA_BOX_DATA_INDX] = LAIKA_MAKE_VM_PTR(data), + }, + .code = {0}, /* zero initalized */ + .stack = {0}, /* zero initalized */ .pc = 0 };