Corrected adapt struct to handle const pointers