Resolved gcc compiler error of mismatched type