Rename countvars

This commit is contained in:
Augusto Gunsch 2020-10-24 22:35:54 -03:00
parent 4adaf2d4d9
commit 733c8fa285
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
3 changed files with 3 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
assembler

BIN
assembler

Binary file not shown.

View File

@ -183,7 +183,7 @@ void populatevars(struct symbol** vars, int* varscount) {
*varscount = firstamnt+ramvamnt+2; *varscount = firstamnt+ramvamnt+2;
} }
void countvars(FILE* input, int* lnscount, int* labelscount) { void countstuff(FILE* input, int* lnscount, int* labelscount) {
char c; char c;
while(c = fgetc(input), c != -1) { while(c = fgetc(input), c != -1) {
if(c == '\n') { if(c == '\n') {
@ -472,7 +472,7 @@ int main(int argc, char* argv[]) {
// line chopping // line chopping
int lnscount = 0; int lnscount = 0;
int labelscount = 0; int labelscount = 0;
countvars(input, &lnscount, &labelscount); countstuff(input, &lnscount, &labelscount);
struct line* lns[lnscount]; // some lines will be empty/comments/labels, so this array is bigger than needed struct line* lns[lnscount]; // some lines will be empty/comments/labels, so this array is bigger than needed
struct symbol* labels[labelscount]; struct symbol* labels[labelscount];