[PATCH 1/2] build: Fix -Wdiscarded-qualifier warnings