  }
  
  static void read_param_bool(bool* param, const char* param_name, bool persistent_param = false) {
    char *s;
    const int result = read_db_value(param_name, &s, NULL, persistent_param);
    if (result == 0) {
      *param = s[0] == '1';
      free(s);
    }
  }
  
  static int read_param_float(float* param, const char* param_name, bool persistent_param = false) {
    char *s;
    const int result = read_db_value(param_name, &s, NULL, persistent_param);
    if (result == 0) {
      *param = strtod(s, NULL);
      free(s);
    }
    return result;
  }
  
 
</s> remove static void read_param_bool(bool* param, const char* param_name, bool persistent_param = false) {
 </s> add template <class T>
static int read_param(T* param, const char *param_name, bool persistent_param = false){ </s> remove static int read_param_uint64(uint64_t* dest, const char* param_name, bool persistent_param = false) {
  char *s;
  const int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0) {
    *dest = strtoull(s, NULL, 0);
    free(s);
  }
  return result;
}

static void read_param_bool_timeout(bool* param, const char* param_name, int* timeout, bool persistent_param = false) {
  if (*timeout > 0){
    (*timeout)--;
  } else {
    read_param_bool(param, param_name, persistent_param);
    *timeout = 2 * UI_FREQ; // 0.5Hz
  }
}

static void read_param_float_timeout(float* param, const char* param_name, int* timeout, bool persistent_param = false) {
 </s> add template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1; </s> remove }

static int read_param_uint64_timeout(uint64_t* dest, const char* param_name, int* timeout, bool persistent_param = false) {
  if (*timeout > 0){
    (*timeout)--;
    return -1;
  } else {
    *timeout = 2 * UI_FREQ; // 0.5Hz
    return read_param_uint64(dest, param_name, persistent_param);
  }
 </s> add   return result; </s> remove     read_param_float(param, param_name, persistent_param);
 </s> add 
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  }
  
  static void read_param_bool(bool* param, const char* param_name, bool persistent_param = false) {
    char *s;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
  int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param;
      free(s);
    }
    return result;
  }
  
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Template version of read_param (#1593) 
selfdrive/ui/ui.cc