~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/queues.c

  • Committer: Brian Aker
  • Date: 2008-07-15 06:45:16 UTC
  • Revision ID: brian@tangent.org-20080715064516-fnbq7kowh7w57bxj
Merge Monty's code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
{
277
277
  uchar *element;
278
278
  uint elements,half_queue,offset_to_key, next_index;
279
 
  bool first= TRUE;
 
279
  bool first= true;
280
280
  uint start_idx= idx;
281
281
 
282
282
  offset_to_key=queue->offset_to_key;
302
302
    }
303
303
    queue->root[idx]=queue->root[next_index];
304
304
    idx=next_index;
305
 
    first= FALSE;
 
305
    first= false;
306
306
  }
307
307
 
308
308
  next_index= idx >> 1;
392
392
{
393
393
  uint quotient= num / divisor;
394
394
  if (quotient * divisor == num)
395
 
    return TRUE;
396
 
  return FALSE;
 
395
    return true;
 
396
  return false;
397
397
}
398
398
 
399
399
void calculate_next()
501
501
  uint num= num_part & 0x3FFFFF;
502
502
  if (part == expected_part)
503
503
    if (num == expected_num)
504
 
      return FALSE;
 
504
      return false;
505
505
  printf("Expect part %u Expect num 0x%x got part %u num 0x%x max_ind %u fix_used %u \n",
506
506
          expected_part, expected_num, part, num, max_ind, fix_used);
507
 
  return TRUE;
 
507
  return true;
508
508
}
509
509
 
510
510
 
554
554
    uint num_part= *(uint*)queue_top(queue);
555
555
    uint part= num_part >> 22;
556
556
    if (check_num(num_part))
557
 
      return TRUE;
 
557
      return true;
558
558
    if (j++ >= no_loops)
559
559
    {
560
560
      calculate_end_next(part);
571
571
      queue_replaced(queue);
572
572
    }
573
573
  } while (++i < no_loops);
574
 
  return FALSE;
 
574
  return false;
575
575
}
576
576
 
577
577
bool do_test(uint no_parts, uint l_max_ind, bool l_fix_used)
589
589
  if (result)
590
590
  {
591
591
    printf("Error\n");
592
 
    return TRUE;
 
592
    return true;
593
593
  }
594
 
  return FALSE;
 
594
  return false;
595
595
}
596
596
 
597
597
static void start_measurement()
614
614
  QUEUE queue_real;
615
615
  QUEUE *queue= &queue_real;
616
616
  uint i, add;
617
 
  fix_used= TRUE;
618
 
  max_ind= FALSE;
 
617
  fix_used= true;
 
618
  max_ind= false;
619
619
  tot_no_parts= 1024;
620
620
  init_queue(queue, tot_no_parts, 0, max_ind, test_compare, NULL);
621
621
  /*
634
634
    }
635
635
    stop_measurement();
636
636
 
637
 
    fix_used= FALSE;
 
637
    fix_used= false;
638
638
    printf("Start benchmark queue_insert\n");
639
639
    start_measurement();
640
640
    for (i= 0; i < 128; i++)