[ create a new paste ] login | about

Link: http://codepad.org/B0ZaBcRE    [ raw code | output | fork ]

C, pasted on May 21:
void inc_line(int x1, int y1, int x2, int y2, int color){

int dx, dy, incE, incNE, d, x, y;

dx = x2 - x1;

dy = y2 - y1;

d = 2 * dy - dx; /* Valor inicial de d */

incE = 2 * dy; /* Incremento de E */

incNE = 2 * (dy - dx); /* Incremento de NE */

x = x1;

y = y1;

write_pixel(x, y, color);

while (x < x2){

if (d <= 0) {

/* Escolhe E */

d = d + incE;

x = x + 1;

}else{

/* Escolhe NE */

d = d + incNE;

x = x + 1;

y = y + 1;

}/* end if */

write_pixel(x, y, color);

}/* end while */

}/* end inc_line */


Output:
1
2
3
4
5
In function `_start':
undefined reference to `main'
In function `inc_line':
undefined reference to `write_pixel'
undefined reference to `write_pixel'


Create a new paste based on this one


Comments: