Skip to content

Commit 16f9e6f

Browse files
changes vm reg data types
1 parent 48fd24f commit 16f9e6f

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

src/tensor-array/interp/parser.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ limitations under the License.
2424
#include "sym_map.h"
2525
#include "vm_type.h"
2626

27-
void emit(int size, ...)
27+
void emit(unsigned size, ...)
2828
{
2929
va_list args;
3030
va_start(args, size);
3131

3232
// Process the variable arguments as needed
33-
for (int i = 0; i < size; ++i) {
33+
for (unsigned i = 0; i < size; ++i) {
3434
++text;
3535
*text = va_arg(args, VM_INSTRUCTION);
3636
}
3737

3838
va_end(args);
3939
}
4040

41-
void match(long tk)
41+
void match(int tk)
4242
{
4343
if (tkn == tk) {
4444
token_next(); // Move to the next token

src/tensor-array/interp/sym_map.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ extern "C"
2020
#endif
2121
typedef struct
2222
{
23-
long tkn;
24-
long hash;
25-
long cls;
26-
long type;
23+
int tkn;
24+
int hash;
25+
int cls;
26+
int type;
2727
void* data; // Pointer to additional data if needed
2828
} sym_data;
2929
void sym_data_set(char* name, sym_data dat);

src/tensor-array/interp/token.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ limitations under the License.
2222
#include "open_file.h"
2323
#include "token.h"
2424

25-
long tkn = 0;
26-
long tkn_val = 0; // Variable to hold the value of the current token
25+
int tkn = 0;
26+
int tkn_val = 0; // Variable to hold the value of the current token
2727

2828
char* tknname[] = {
2929
"num", "sys", "glo", "loc", "id",

src/tensor-array/interp/token.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ typedef enum
2525
} TOKEN_TYPE;
2626

2727
void token_next();
28-
extern long tkn;
29-
extern long tkn_val;
28+
extern int tkn;
29+
extern int tkn_val;
3030
extern char *tknname[];

src/tensor-array/interp/vm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ typedef enum
2121
OPEN, READ, CLOSE, PRTF, MALC, MSET, MCMP, EXIT
2222
} VM_INSTRUCTION_V2;
2323

24-
typedef long VM_INSTRUCTION;
24+
typedef size_t VM_INSTRUCTION;
2525

2626
void eval();
2727

28-
extern long any_value;
28+
extern size_t any_value;
2929
extern VM_INSTRUCTION* orig;

src/tensor-array/interp/vmop.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ limitations under the License.
2222
#include "vmop.h"
2323
#include "vm_type.h"
2424

25-
typedef void* VM_INSTRUCTION;
25+
typedef size_t VM_INSTRUCTION;
2626
extern VM_INSTRUCTION* pc;
2727

2828
std::stack<tensor_array::value::Tensor> tensor_stack;
2929
std::stack<std::string> var_stack;
3030
std::stack<std::pair<VM_INSTRUCTION*, scope>> call_stack;
3131
tensor_array::value::Tensor ag;
3232
void* aptr;
33-
long any_value;
34-
long any_type;
33+
size_t any_value;
34+
size_t any_type;
3535

3636
void new_int()
3737
{

src/tensor-array/interp/vmop.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ limitations under the License.
1818
extern "C"
1919
{
2020
#endif
21-
extern long any_value;
22-
extern long any_type;
21+
extern size_t any_value;
22+
extern size_t any_type;
2323
void op_imm();
2424
void op_add();
2525
void op_sub();

0 commit comments

Comments
 (0)