Fix declaration of ‘index’ shadows a global declaration [-Werror=shadow]