Пример #1
0
Файл: gen.c Проект: 4ker/8cc
static void maybe_print_source_loc(Node *node) {
    if (!node->sourceLoc)
        return;
    char *file = node->sourceLoc->file;
    long fileno = (long)map_get(source_files, file);
    if (!fileno) {
        fileno = map_len(source_files) + 1;
        map_put(source_files, file, (void *)fileno);
        emit(".file %ld \"%s\"", fileno, quote_cstring(file));
    }
    char *loc = format(".loc %ld %d 0", fileno, node->sourceLoc->line);
    if (strcmp(loc, last_loc)) {
        emit("%s", loc);
        maybe_print_source_line(file, node->sourceLoc->line);
    }
    last_loc = loc;
}
Пример #2
0
void			print_solution_map(char **map)
{
	unsigned short	mcoord[2] = {0};
	t_fillit_inst	*inst;

	inst = get_instance();
	ft_printf("MAP (%u):\n", map_len(inst, map));
	while (Y < inst->ylen)
	{
		while (X < inst->xlen)
		{
			ft_putchar(map[Y][X]);
			X++;
		}
		ft_putchar('\n');
		X = 0;
		Y++;
	}
	ft_putchar('\n');
}