~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/typelib.c

  • Committer: Jay Pipes
  • Date: 2008-07-17 20:00:00 UTC
  • mto: This revision was merged to the branch mainline in revision 182.
  • Revision ID: jay@mysql.com-20080717200000-x3s5kwlgqm6oukj3
Phase 2 removal of DBUG in mysys

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
  int find,pos,findpos=0;
74
74
  register char * i;
75
75
  register const char *j;
76
 
  DBUG_ENTER("find_type");
77
 
  DBUG_PRINT("enter",("x: '%s'  lib: 0x%lx", x, (long) typelib));
78
76
 
79
77
  if (!typelib->count)
80
78
  {
81
 
    DBUG_PRINT("exit",("no count"));
82
 
    DBUG_RETURN(0);
 
79
    return(0);
83
80
  }
84
81
  find=0;
85
82
  for (pos=0 ; (j=typelib->type_names[pos]) ; pos++)
93
90
      while (*i == ' ')
94
91
        i++;                                    /* skip_end_space */
95
92
      if (! *i || ((full_name & 8) && *i == field_separator))
96
 
        DBUG_RETURN(pos+1);
 
93
        return(pos+1);
97
94
    }
98
95
    if ((!*i && (!(full_name & 8) || *i != field_separator)) && 
99
96
        (!*j || !(full_name & 1)))
107
104
    find=1;
108
105
  else if (find == 0 || ! x[0])
109
106
  {
110
 
    DBUG_PRINT("exit",("Couldn't find type"));
111
 
    DBUG_RETURN(0);
 
107
    return(0);
112
108
  }
113
109
  else if (find != 1 || (full_name & 1))
114
110
  {
115
 
    DBUG_PRINT("exit",("Too many possybilities"));
116
 
    DBUG_RETURN(-1);
 
111
    return(-1);
117
112
  }
118
113
  if (!(full_name & 2))
119
114
    (void) strmov(x,typelib->type_names[findpos]);
120
 
  DBUG_RETURN(findpos+1);
 
115
  return(findpos+1);
121
116
} /* find_type */
122
117
 
123
118
 
127
122
void make_type(register char * to, register uint nr,
128
123
               register TYPELIB *typelib)
129
124
{
130
 
  DBUG_ENTER("make_type");
131
125
  if (!nr)
132
126
    to[0]=0;
133
127
  else
134
128
    (void) strmov(to,get_type(typelib,nr-1));
135
 
  DBUG_VOID_RETURN;
 
129
  return;
136
130
} /* make_type */
137
131
 
138
132
 
167
161
  uint64_t result;
168
162
  int find;
169
163
  char *i;
170
 
  DBUG_ENTER("find_set");
171
 
  DBUG_PRINT("enter",("x: '%s'  lib: 0x%lx", x, (long) lib));
172
164
 
173
165
  if (!lib->count)
174
166
  {
175
 
    DBUG_PRINT("exit",("no count"));
176
 
    DBUG_RETURN(0);
 
167
    return(0);
177
168
  }
178
169
  result= 0;
179
170
  *err= 0;
183
174
    i= x;
184
175
    while (*x && *x != field_separator) x++;
185
176
    if ((find= find_type(i, lib, 2 | 8) - 1) < 0)
186
 
      DBUG_RETURN(0);
 
177
      return(0);
187
178
    result|= (1ULL << find);
188
179
  }
189
180
  *err= 0;
190
 
  DBUG_RETURN(result);
 
181
  return(result);
191
182
} /* find_set */
192
183
 
193
184