    }
    return result;
  }
  
  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) {
    if (*timeout > 0){
      (*timeout)--;
    } else {
      read_param_float(param, param_name, persistent_param);
      *timeout = 2 * UI_FREQ; // 0.5Hz
 
</s> remove     read_param_float(param, param_name, persistent_param);
 </s> add  </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   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);
 </s> add   int result = read_db_value(param_name, &s, NULL, persistent_param);
  if (result == 0){
    std::istringstream iss(s);
    iss >> *param; </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){
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
    }
    return result;
  }
  
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
template <class T>
static int read_param_timeout(T* param, const char* param_name, int* timeout, bool persistent_param = false) {
  int result = -1;
    if (*timeout > 0){
      (*timeout)--;
    } else {
      read_param_float(param, param_name, persistent_param);
      *timeout = 2 * UI_FREQ; // 0.5Hz
keep keep keep keep replace replace replace replace replace replace replace replace 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