Change function pointer casting to satisfy -pedantic