Fixed compiler warnings about signed/unsigned comparisons, unused and shadowed identifiers and use of void * arithmetic