minor formatting fixes

This commit is contained in:
CPunch 2023-02-09 12:52:36 -06:00 committed by cpunch
parent b902ac90de
commit e335fd95d6
4 changed files with 2 additions and 13 deletions

View File

@ -9,7 +9,6 @@
#include <sys/time.h> #include <sys/time.h>
// ================================================================ [BASELIB] // ================================================================ [BASELIB]
// ================================================================
int cosmoB_print(CState *state, int nargs, CValue *args) int cosmoB_print(CState *state, int nargs, CValue *args)
{ {
@ -164,7 +163,6 @@ void cosmoB_loadLibrary(CState *state)
} }
// ================================================================ [OBJECT.*] // ================================================================ [OBJECT.*]
// ================================================================
int cosmoB_osetProto(CState *state, int nargs, CValue *args) int cosmoB_osetProto(CState *state, int nargs, CValue *args)
{ {
@ -255,7 +253,6 @@ COSMO_API void cosmoB_loadObjLib(CState *state)
} }
// ================================================================ [OS.*] // ================================================================ [OS.*]
// ================================================================
// os.read() // os.read()
int cosmoB_osRead(CState *state, int nargs, CValue *args) int cosmoB_osRead(CState *state, int nargs, CValue *args)
@ -353,7 +350,6 @@ COSMO_API void cosmoB_loadOSLib(CState *state)
} }
// ================================================================ [STRING.*] // ================================================================ [STRING.*]
// ================================================================
// string.sub // string.sub
int cosmoB_sSub(CState *state, int nargs, CValue *args) int cosmoB_sSub(CState *state, int nargs, CValue *args)
@ -629,7 +625,6 @@ void cosmoB_loadStrLib(CState *state)
} }
// ================================================================ [MATH] // ================================================================ [MATH]
// ================================================================
// math.abs // math.abs
int cosmoB_mAbs(CState *state, int nargs, CValue *args) int cosmoB_mAbs(CState *state, int nargs, CValue *args)
@ -847,7 +842,6 @@ void cosmoB_loadMathLib(CState *state)
} }
// ================================================================ [VM.*] // ================================================================ [VM.*]
// ================================================================
// vm.__getter["globals"] // vm.__getter["globals"]
int cosmoB_vgetGlobal(CState *state, int nargs, CValue *args) int cosmoB_vgetGlobal(CState *state, int nargs, CValue *args)

View File

@ -56,7 +56,6 @@ int addConstant(CState *state, CChunk *chunk, CValue value)
} }
// ================================================================ [WRITE TO CHUNK] // ================================================================ [WRITE TO CHUNK]
// ================================================================
void writeu8Chunk(CState *state, CChunk *chunk, INSTRUCTION i, int line) void writeu8Chunk(CState *state, CChunk *chunk, INSTRUCTION i, int line)
{ {
@ -71,8 +70,8 @@ void writeu8Chunk(CState *state, CChunk *chunk, INSTRUCTION i, int line)
void writeu16Chunk(CState *state, CChunk *chunk, uint16_t i, int line) void writeu16Chunk(CState *state, CChunk *chunk, uint16_t i, int line)
{ {
static const int sz = sizeof(uint16_t) / sizeof(INSTRUCTION);
INSTRUCTION *buffer = (INSTRUCTION *)(&i); INSTRUCTION *buffer = (INSTRUCTION *)(&i);
int sz = sizeof(uint16_t) / sizeof(INSTRUCTION);
for (int i = 0; i < sz; i++) { for (int i = 0; i < sz; i++) {
writeu8Chunk(state, chunk, buffer[i], line); writeu8Chunk(state, chunk, buffer[i], line);

View File

@ -108,7 +108,6 @@ static ParseRule *getRule(CTokenType type);
static CObjFunction *endCompiler(CParseState *pstate); static CObjFunction *endCompiler(CParseState *pstate);
// ================================================================ [FRONT END/TALK TO LEXER] // ================================================================ [FRONT END/TALK TO LEXER]
// ================================================================
static void initCompilerState(CParseState *pstate, CCompilerState *ccstate, FunctionType type, static void initCompilerState(CParseState *pstate, CCompilerState *ccstate, FunctionType type,
CCompilerState *enclosing) CCompilerState *enclosing)
@ -269,7 +268,6 @@ static bool blockFollow(CToken token)
} }
// ================================================================ [WRITE TO CHUNK] // ================================================================ [WRITE TO CHUNK]
// ================================================================
CChunk *getChunk(CParseState *pstate) CChunk *getChunk(CParseState *pstate)
{ {
@ -460,7 +458,6 @@ static bool isLast(CParseState *pstate, Precedence pType)
} }
// ================================================================ [PARSER] // ================================================================ [PARSER]
// ================================================================
static void number(CParseState *pstate, bool canAssign, Precedence prec) static void number(CParseState *pstate, bool canAssign, Precedence prec)
{ {

View File

@ -59,8 +59,7 @@ struct CState
CValue *top; // top of the stack CValue *top; // top of the stack
CObjObject *protoObjects[COBJ_MAX]; // proto object for each COBJ type [NULL = no default proto] CObjObject *protoObjects[COBJ_MAX]; // proto object for each COBJ type [NULL = no default proto]
CObjString CObjString *iStrings[ISTRING_MAX]; // strings used internally by the VM, eg. __init, __index
*iStrings[ISTRING_MAX]; // strings used internally by the VM, eg. __init, __index & friends
CCallFrame callFrame[FRAME_MAX]; // call frames CCallFrame callFrame[FRAME_MAX]; // call frames
CValue stack[STACK_MAX]; // stack CValue stack[STACK_MAX]; // stack
}; };