Skip to content

Commit

Permalink
updated to r1904 from svn repo
Browse files Browse the repository at this point in the history
  • Loading branch information
irmen committed Apr 7, 2019
1 parent b78074a commit 7af7d01
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
13 changes: 9 additions & 4 deletions 64tass.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Turbo Assembler 6502/65C02/65816/DTV
$Id: 64tass.c 1896 2019-02-16 16:48:56Z soci $
$Id: 64tass.c 1901 2019-02-22 18:25:42Z soci $
6502/65C02 Turbo Assembler Version 1.3
(c) 1996 Taboo Productions, Marek Matula
Expand Down Expand Up @@ -1461,9 +1461,13 @@ static size_t for_command(Label *newlabel, List *lst, linepos_t epoint) {
line_t xlin = lpoint.line;
struct oper_s tmp;
const uint8_t *oldpline = pline;
size_t lentmp = strlen((const char *)pline) + 1;
expr = (uint8_t *)mallocx(lentmp);
memcpy(expr, pline, lentmp); label = NULL;
if ((size_t)(pline - current_file_list->file->data) >= current_file_list->file->len) {
size_t lentmp = strlen((const char *)pline) + 1;
expr = (uint8_t *)mallocx(lentmp);
memcpy(expr, pline, lentmp);
pline = expr;
} else expr = (uint8_t *)oldpline;
label = NULL;
new_waitfor(W_NEXT2, epoint);
waitfor->u.cmd_rept.breakout = false;
tmp.op = NULL;
Expand Down Expand Up @@ -1589,6 +1593,7 @@ static size_t for_command(Label *newlabel, List *lst, linepos_t epoint) {
}
}
pline = oldpline;
if (expr == oldpline) expr = NULL;
lpoint.line = xlin;
}
if (nf != NULL) {
Expand Down
4 changes: 2 additions & 2 deletions 64tass.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
$Id: 64tass.h 1900 2019-02-17 21:46:21Z soci $
$Id: 64tass.h 1904 2019-03-27 22:56:46Z soci $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -39,7 +39,7 @@ extern struct Listing *listing;
extern linepos_t poke_pos;
extern address_t all_mem, all_mem2;
extern unsigned int all_mem_bits;
extern unsigned int outputeor;
extern uint32_t outputeor;
extern int temporary_label_branch;
extern line_t vline;
extern struct linepos_s lpoint;
Expand Down
35 changes: 32 additions & 3 deletions error.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
$Id: error.c 1893 2019-02-11 22:35:07Z soci $
$Id: error.c 1902 2019-02-22 18:26:53Z soci $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -94,14 +94,43 @@ static int duplicate_compare(const struct avltree_node *aa, const struct avltree
{
const struct errorentry_s *a = cavltree_container_of(aa, struct errorentry_s, node);
const struct errorentry_s *b = cavltree_container_of(bb, struct errorentry_s, node);
const uint8_t *aerr, *berr;

if (a->severity != b->severity) return a->severity - b->severity;
if (a->file_list != b->file_list) return a->file_list > b->file_list ? 1 : -1;
if (a->line_len != b->line_len) return a->line_len > b->line_len ? 1 : -1;
if (a->error_len != b->error_len) return a->error_len > b->error_len ? 1 : -1;
if (a->epoint.line != b->epoint.line) return a->epoint.line > b->epoint.line ? 1 : -1;
if (a->epoint.pos != b->epoint.pos) return a->epoint.pos > b->epoint.pos ? 1 : -1;
return memcmp(a + 1, b + 1, a->line_len + a->error_len);

aerr = (const uint8_t *)(a + 1);
berr = (const uint8_t *)(b + 1);

if ((a->line_len | b->line_len) != 0) {
int i;
const uint8_t *aline, *bline;

if (a->line_len != 0) {
aline = aerr;
aerr += a->line_len;
} else if (a->epoint.line == 0) {
aline = (const uint8_t *)"";
} else {
aline = &a->file_list->file->data[a->file_list->file->line[a->epoint.line - 1]];
}

if (b->line_len != 0) {
bline = berr;
berr += b->line_len;
} else if (a->epoint.line == 0) {
bline = (const uint8_t *)"";
} else {
bline = &a->file_list->file->data[a->file_list->file->line[a->epoint.line - 1]];
}

i = strcmp((const char *)aline, (const char *)bline);
if (i != 0) return i;
}
return memcmp(aerr, berr, a->error_len);
}

static void close_error(void) {
Expand Down

0 comments on commit 7af7d01

Please sign in to comment.