~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/default_modify.cc

Merge Nathan

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,
103
 
                                         SIZE_MAX))))
 
105
  if (!(file_buffer= (char*) malloc(max(buffer_size + reserve_extended,
 
106
                                        (size_t)SIZE_MAX))))
104
107
    goto malloc_err;
105
108
 
106
109
  sect_len= strlen(section_name);