How to integrate $\int_{\gamma}\frac{dz}{z}$ 
How to integrate $\int_{\gamma}\frac{dz}{z}$ If $\ A=1+i, B=1-i, C=-1-i, D=-1+i$ and $\gamma$ is the path $[A,B,C,D,A]$

If I write $\frac1z=\frac{1}{x+iy}=\frac{x-iy}{x^2+y^2}$
The first segment $[A,B]$ can be parametrized as $t(1+i)+(1-t)(1-i)=1+i(2t-1)$ and $\gamma'(t)=2i$ hence
$\displaystyle\int_{[A,B]}\frac{1-i(2t-1)}{1+(2t-1)^2}2idt=\frac{-i\pi}{2}$
and parametrizing the rest in the same manner I get that the total integral is $0$, bu I think it must be $2i\pi$ or $-2i\pi $ am I wrong ?
and another question does this number divided by $2i\pi$ correspond the the winding number of $\gamma$ around $0$, so the winding number is either $1$ or $-1$, if my guess is correct ?
 A: Are you familiar with Cauchy's integral theorem and Cauchy's residue theorem? 
The second one basically says that your integral does not depend on the exact path $\gamma$, as long as it is a closed curve around the $0$ pole.
Long-story short, the second theorem says that your integral is equal to $-2\pi i$.
A: You can, of course, parametrize as you wish, but why to choose a slightly messy parametrization if we can have a simple one? 
We want the straight path from $\;A=1+i\;$ to $\;B=1-i\;$ , so we can parametrize simply
$$z(t)=1-ti\;,\;\;-1\le t\le 1\implies z'(t)=-i$$
and thus
$$\int_A^B\frac{dz}z=\int_{-1}^1\frac{-i\,dt}{1-ti}=\left.\frac{(-i)}{-i}\,\text{Log}\,(1-ti)\right|_{-1}^1=\left.\left(\log|1-ti|+i\arg(1-ti)\right)\right|_{-1}^1=$$
$$=\left(\log\sqrt2+i\arg(1-i)-\log\sqrt2-i\arg(1+i)\right)=i\left(-\frac\pi4-\frac\pi4\right)=-\frac\pi2i$$
Now from $\;B\to C\;$ :
$$z(t)=-t-i\;,\;\;-1\implies z'(t)=-1\implies$$
$$ \int_{-1}^1\frac{-dt}{-t-i}=\left.\text{Log}(t+i)\right|_{-1}^1=i\left(\frac\pi4-\frac{3\pi}4\right)=-\frac\pi2i$$
and etc. At the end you get $\;4\left(-\frac\pi2i\right)=-2\pi i\;$
