That will convert to javascript almost as-is. You will not need to change the meaning of each line, just change to javascript syntax. You won't need the short and float typecasts.
I don't think the first two lines are valid C though, but I imagine that is just a typo.