~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/default_modify.cc

  • Committer: Nathan Williams
  • Date: 2009-06-24 23:48:15 UTC
  • mto: This revision was merged to the branch mainline in revision 1082.
  • Revision ID: nathanlws@gmail.com-20090624234815-q51znoiozkas596c
Converted all cmin/cmax usages in the mysys directory to std::min/max.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include <mysys/my_dir.h>
19
19
 
20
20
#include <stdio.h>
 
21
#include <algorithm>
 
22
 
 
23
using namespace std;
21
24
 
22
25
#define BUFF_SIZE 1024
23
26
#define RESERVE 1024                   /* Extend buffer with this extent */
93
96
                     NEWLINE_LEN +              /* Space for newline */
94
97
                     RESERVE);                  /* Some additional space */
95
98
 
96
 
  buffer_size= (size_t)cmax((uint64_t)file_stat.st_size + 1, (uint64_t)SIZE_MAX);
 
99
  buffer_size= (size_t)max((uint64_t)file_stat.st_size + 1, (uint64_t)SIZE_MAX);
97
100
 
98
101
  /*
99
102
    Reserve space to read the contents of the file and some more
100
103
    for the option we want to add.
101
104
  */
102
 
  if (!(file_buffer= (char*) malloc(cmax(buffer_size + reserve_extended,
 
105
  if (!(file_buffer= (char*) malloc(max(buffer_size + reserve_extended,
103
106
                                         SIZE_MAX))))
104
107
    goto malloc_err;
105
108