def replace_negative(l, default_value=0):
  """
  Replaces all negative values with default_value

  :param l: Original list
  :param default_value: The value to replace negatives values with. Default is 0.
  :return: Number of values replaced
  """
  n_replaced = 0

  for i in range(len(l)):
    if l[i] < 0:
      l[i] = default_value
      n_replaced += 1

  return n_replaced