src/node_stage.c
static Flag bubble(Op* head, int n) {
  Flag swapped     = FALSE;
  Flag swapped_now = FALSE;
  int  i;
  Op*  prev = NULL;
  Op*  cur  = head;
  Op*  next = head->next_rdy;

  for(i = 0; i < n - 1; i++) {
    swapped_now = FALSE;
    if(cur->op_num > next->op_num) {
      if(prev)
        prev->next_rdy = next;
      cur->next_rdy  = next->next_rdy;
      next->next_rdy = cur;
      swapped        = TRUE;
      swapped_now    = TRUE;
      if(!prev)
        node->rdy_head = next;
    }
    if(swapped_now) {
      prev = next;
      next = cur->next_rdy;
    } else {
      prev = cur;
      cur  = next;
      next = next->next_rdy;
    }
  }

  return swapped;
}
/**************************************************************************************/
/* bubble: bubble pass for the ready list. Part of the bubble sort function
 * below. */
bubble pass for the ready list. Part of the bubble sort function
below.
bubble pass for the ready list . Part of the bubble sort function below .
static Flag bubble(Op* head, int n) {
  Flag swapped     = FALSE;
  Flag swapped_now = FALSE;
  int  i;
  Op*  prev = NULL;
  Op*  cur  = head;
  Op*  next = head->next_rdy;
  for(i = 0; i < n - 1; i++) {
    swapped_now = FALSE;
    if(cur->op_num > next->op_num) {
      if(prev)
        prev->next_rdy = next;
      cur->next_rdy  = next->next_rdy;
      next->next_rdy = cur;
      swapped        = TRUE;
      swapped_now    = TRUE;
      if(!prev)
        node->rdy_head = next;
    }
    if(swapped_now) {
      prev = next;
      next = cur->next_rdy;
    } else {
      prev = cur;
      cur  = next;
      next = next->next_rdy;
    }
  }
  return swapped;
}
static Flag bubble ( Op * head , int n ) { Flag swapped = FALSE ; Flag swapped_now = FALSE ; int i ; Op * prev = NULL ; Op * cur = head ; Op * next = head -> next_rdy ; for ( i = 0 ; i < n - 1 ; i ++ ) { swapped_now = FALSE ; if ( cur -> op_num > next -> op_num ) { if ( prev ) prev -> next_rdy = next ; cur -> next_rdy = next -> next_rdy ; next -> next_rdy = cur ; swapped = TRUE ; swapped_now = TRUE ; if ( ! prev ) node -> rdy_head = next ; } if ( swapped_now ) { prev = next ; next = cur -> next_rdy ; } else { prev = cur ; cur = next ; next = next -> next_rdy ; } } return swapped ; }
bubble: bubble pass for the ready list.
bubble : bubble pass for the ready list .