some c snippets (dim/dimloop)