~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_dirname.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:
16
16
#include "mysys/mysys_priv.h"
17
17
#include <mystrings/m_string.h>
18
18
 
 
19
#include <algorithm>
 
20
 
 
21
using namespace std;
 
22
 
 
23
 
19
24
        /* Functions definied in this file */
20
25
 
21
26
size_t dirname_length(const char *name)
69
74
  SYNPOSIS
70
75
    convert_dirname()
71
76
    to                          Store result here. Must be at least of size
72
 
                                cmin(FN_REFLEN, strlen(from) + 1) to make room
 
77
                                min(FN_REFLEN, strlen(from) + 1) to make room
73
78
                                for adding FN_LIBCHAR at the end.
74
79
    from                        Original filename. May be == to
75
80
    from_end                    Pointer at end of filename (normally end \0)
122
127
  }
123
128
#else
124
129
  /* This is ok even if to == from, becasue we need to cut the string */
125
 
  size_t len= cmin(strlen(from),(size_t)(from_end-from));
 
130
  size_t len= min(strlen(from),(size_t)(from_end-from));
126
131
  assert(memmove(to, from, len));
127
132
  to+= len;
128
133
  to[0]= '\0';