Merge lp:~stewart/percona-playback/compiler-warnings-2 into lp:~percona-dev/percona-playback/light
- compiler-warnings-2
- Merge into light
Proposed by
Stewart Smith
Status: | Merged |
---|---|
Merged at revision: | 126 |
Proposed branch: | lp:~stewart/percona-playback/compiler-warnings-2 |
Merge into: | lp:~percona-dev/percona-playback/light |
Prerequisite: | lp:~stewart/percona-playback/compiler-warnings |
Diff against target: |
515 lines (+98/-158) 10 files modified
m4/pandora_have_libmysqlclient.m4 (+2/-1) src/common.h (+1/-1) src/long_string.cc (+61/-61) src/long_string.h (+1/-1) src/mysql_client.cc (+7/-7) src/options.cc (+16/-11) src/query.cc (+5/-66) src/queue.h (+1/-1) src/slow_query_log_parser.h (+2/-2) src/supervisor.cc (+2/-7) |
To merge this branch: | bzr merge lp:~stewart/percona-playback/compiler-warnings-2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Laurynas Biveinis (community) | Approve | ||
Review via email: mp+77457@code.launchpad.net |
Commit message
Description of the change
even more compiler warning fixes. with this tree, we're down to just 6.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'm4/pandora_have_libmysqlclient.m4' | |||
2 | --- m4/pandora_have_libmysqlclient.m4 2011-09-29 06:41:38 +0000 | |||
3 | +++ m4/pandora_have_libmysqlclient.m4 2011-09-29 06:41:38 +0000 | |||
4 | @@ -64,10 +64,11 @@ | |||
5 | 64 | AS_IF([test "x$MYSQL_CONFIG" = "xISDIR"],[ | 64 | AS_IF([test "x$MYSQL_CONFIG" = "xISDIR"],[ |
6 | 65 | IBASE="-I${with_mysql}" | 65 | IBASE="-I${with_mysql}" |
7 | 66 | MYSQL_CONFIG="${with_mysql}/scripts/mysql_config" | 66 | MYSQL_CONFIG="${with_mysql}/scripts/mysql_config" |
9 | 67 | ADDIFLAGS="$IBASE/include " | 67 | ADDIFLAGS="$IBASE/include -isystem $IBASE/include" |
10 | 68 | ADDLDFLAGS="-L${with_mysql}/libmysql_r/.libs/ -L${with_mysql}/mysys/.libs -L${with_mysql}/mysys -L${with_mysql}/strings/.libs -L${with_mysql}/strings " | 68 | ADDLDFLAGS="-L${with_mysql}/libmysql_r/.libs/ -L${with_mysql}/mysys/.libs -L${with_mysql}/mysys -L${with_mysql}/strings/.libs -L${with_mysql}/strings " |
11 | 69 | ],[ | 69 | ],[ |
12 | 70 | MYSQL_INCLUDES=$(${MYSQL_CONFIG} --include) | 70 | MYSQL_INCLUDES=$(${MYSQL_CONFIG} --include) |
13 | 71 | MYSQL_INCLUDES="$MYSQL_INCLUDES $(echo $MYSQL_INCLUDES|sed -e 's/-I/-isystem /')" | ||
14 | 71 | MYSQL_LIBS=$(${MYSQL_CONFIG} --libs_r) | 72 | MYSQL_LIBS=$(${MYSQL_CONFIG} --libs_r) |
15 | 72 | ]) | 73 | ]) |
16 | 73 | 74 | ||
17 | 74 | 75 | ||
18 | === modified file 'src/common.h' | |||
19 | --- src/common.h 2011-09-29 06:41:38 +0000 | |||
20 | +++ src/common.h 2011-09-29 06:41:38 +0000 | |||
21 | @@ -29,7 +29,7 @@ | |||
22 | 29 | #include <boost/shared_ptr.hpp> | 29 | #include <boost/shared_ptr.hpp> |
23 | 30 | #include <pthread.h> | 30 | #include <pthread.h> |
24 | 31 | 31 | ||
26 | 32 | #if DEBUG | 32 | #ifdef DEBUG |
27 | 33 | //DEBUG | 33 | //DEBUG |
28 | 34 | 34 | ||
29 | 35 | #include <cassert> | 35 | #include <cassert> |
30 | 36 | 36 | ||
31 | === modified file 'src/long_string.cc' | |||
32 | --- src/long_string.cc 2011-09-29 06:41:38 +0000 | |||
33 | +++ src/long_string.cc 2011-09-29 06:41:38 +0000 | |||
34 | @@ -123,35 +123,35 @@ | |||
35 | 123 | m_length= 0; | 123 | m_length= 0; |
36 | 124 | m_data[m_length]= 0; | 124 | m_data[m_length]= 0; |
37 | 125 | } | 125 | } |
59 | 126 | void String::set(const char* data) | 126 | void String::set(const char* str) |
60 | 127 | { | 127 | { |
61 | 128 | clear(); | 128 | clear(); |
62 | 129 | add_last(data); | 129 | add_last(str); |
63 | 130 | } | 130 | } |
64 | 131 | void String::set(const char* data, std::size_t length) | 131 | void String::set(const char* str, std::size_t len) |
65 | 132 | { | 132 | { |
66 | 133 | clear(); | 133 | clear(); |
67 | 134 | add_last(data, length); | 134 | add_last(str, len); |
68 | 135 | } | 135 | } |
69 | 136 | void String::set(std::string const &data) | 136 | void String::set(std::string const &str) |
70 | 137 | { | 137 | { |
71 | 138 | clear(); | 138 | clear(); |
72 | 139 | add_last(data); | 139 | add_last(str); |
73 | 140 | } | 140 | } |
74 | 141 | void String::set(String const &data) | 141 | void String::set(String const &str) |
75 | 142 | { | 142 | { |
76 | 143 | clear(); | 143 | clear(); |
77 | 144 | add_last(data); | 144 | add_last(str); |
78 | 145 | } | 145 | } |
79 | 146 | void String::remove_first(std::size_t length) | 146 | void String::remove_first(std::size_t len) |
80 | 147 | { | 147 | { |
81 | 148 | CHECK_C_STRING_LENGTH(m_data, m_length); | 148 | CHECK_C_STRING_LENGTH(m_data, m_length); |
84 | 149 | if (m_length < length) | 149 | if (m_length < len) |
85 | 150 | throw Too_Short_String(m_max, m_length, length); | 150 | throw Too_Short_String(m_max, m_length, len); |
86 | 151 | else | 151 | else |
87 | 152 | { | 152 | { |
90 | 153 | m_length -= length; | 153 | m_length -= len; |
91 | 154 | memmove(m_data, m_data + length, m_length); | 154 | memmove(m_data, m_data + len, m_length); |
92 | 155 | m_data[m_length]= 0; | 155 | m_data[m_length]= 0; |
93 | 156 | } | 156 | } |
94 | 157 | } | 157 | } |
95 | @@ -169,30 +169,30 @@ | |||
96 | 169 | CHECK_C_STRING(value); | 169 | CHECK_C_STRING(value); |
97 | 170 | add_last(value, strlen(value)); | 170 | add_last(value, strlen(value)); |
98 | 171 | } | 171 | } |
100 | 172 | void String::add_last(const char* value, std::size_t length) | 172 | void String::add_last(const char* value, std::size_t len) |
101 | 173 | { | 173 | { |
102 | 174 | CHECK_C_STRING_LENGTH(m_data, m_length); | 174 | CHECK_C_STRING_LENGTH(m_data, m_length); |
104 | 175 | if((m_max - m_length) < length) | 175 | if((m_max - m_length) < len) |
105 | 176 | { | 176 | { |
106 | 177 | std::cerr << "Too_Long_String, current:\n" << (*this); | 177 | std::cerr << "Too_Long_String, current:\n" << (*this); |
107 | 178 | std::cerr << "\nlength: " << m_length << " max: " << m_max; | 178 | std::cerr << "\nlength: " << m_length << " max: " << m_max; |
110 | 179 | std::cerr << "\nadd_last: " << length << "\n" << std::flush; | 179 | std::cerr << "\nadd_last: " << len << "\n" << std::flush; |
111 | 180 | throw Too_Long_String(m_max, m_length, length); | 180 | throw Too_Long_String(m_max, m_length, len); |
112 | 181 | } | 181 | } |
115 | 182 | memcpy(m_data + m_length, value, length); | 182 | memcpy(m_data + m_length, value, len); |
116 | 183 | m_length += length; | 183 | m_length += len; |
117 | 184 | m_data[ m_length ]= 0; | 184 | m_data[ m_length ]= 0; |
118 | 185 | CHECK_C_STRING_LENGTH(m_data, m_length); | 185 | CHECK_C_STRING_LENGTH(m_data, m_length); |
119 | 186 | } | 186 | } |
121 | 187 | void String::add_last(std::string const &data) | 187 | void String::add_last(std::string const &str) |
122 | 188 | { | 188 | { |
123 | 189 | CHECK_C_STRING_LENGTH(m_data, m_length); | 189 | CHECK_C_STRING_LENGTH(m_data, m_length); |
125 | 190 | add_last(data.c_str(), data.length()); | 190 | add_last(str.c_str(), str.length()); |
126 | 191 | } | 191 | } |
128 | 192 | void String::add_last(String const &data) | 192 | void String::add_last(String const &str) |
129 | 193 | { | 193 | { |
130 | 194 | CHECK_C_STRING_LENGTH(m_data, m_length); | 194 | CHECK_C_STRING_LENGTH(m_data, m_length); |
132 | 195 | add_last(data.data(), data.length()); | 195 | add_last(str.data(), str.length()); |
133 | 196 | } | 196 | } |
134 | 197 | std::size_t String::index(char c, std::size_t from) const | 197 | std::size_t String::index(char c, std::size_t from) const |
135 | 198 | { | 198 | { |
136 | @@ -279,12 +279,12 @@ | |||
137 | 279 | return p != s.length(); | 279 | return p != s.length(); |
138 | 280 | } | 280 | } |
139 | 281 | 281 | ||
141 | 282 | String_Null_Error::String_Null_Error(const char* method_name) | 282 | String_Null_Error::String_Null_Error(const char* where) |
142 | 283 | { | 283 | { |
144 | 284 | m_method_name= method_name; | 284 | m_method_name= where; |
145 | 285 | m_method_name_c_str= m_method_name.c_str(); | 285 | m_method_name_c_str= m_method_name.c_str(); |
146 | 286 | m_reason= "Impossible call method "; | 286 | m_reason= "Impossible call method "; |
148 | 287 | m_reason += method_name; | 287 | m_reason += where; |
149 | 288 | m_reason += " when Nullable_String is null"; | 288 | m_reason += " when Nullable_String is null"; |
150 | 289 | m_reason_c_str= m_reason.c_str(); | 289 | m_reason_c_str= m_reason.c_str(); |
151 | 290 | } | 290 | } |
152 | @@ -300,8 +300,8 @@ | |||
153 | 300 | { | 300 | { |
154 | 301 | } | 301 | } |
155 | 302 | 302 | ||
158 | 303 | Nullable_String::Nullable_String(std::size_t max) : | 303 | Nullable_String::Nullable_String(std::size_t max_size) : |
159 | 304 | String(max), m_null(true) | 304 | String(max_size), m_null(true) |
160 | 305 | { | 305 | { |
161 | 306 | } | 306 | } |
162 | 307 | Nullable_String::Nullable_String(Nullable_String const &other) : | 307 | Nullable_String::Nullable_String(Nullable_String const &other) : |
163 | @@ -349,7 +349,7 @@ | |||
164 | 349 | else | 349 | else |
165 | 350 | return String::data(); | 350 | return String::data(); |
166 | 351 | } | 351 | } |
168 | 352 | void Nullable_String::length(std::size_t const &length) | 352 | void Nullable_String::length(std::size_t const &len) |
169 | 353 | { | 353 | { |
170 | 354 | if (m_null) | 354 | if (m_null) |
171 | 355 | { | 355 | { |
172 | @@ -357,7 +357,7 @@ | |||
173 | 357 | throw String_Null_Error("length"); | 357 | throw String_Null_Error("length"); |
174 | 358 | } | 358 | } |
175 | 359 | else | 359 | else |
177 | 360 | return String::length(length); | 360 | return String::length(len); |
178 | 361 | } | 361 | } |
179 | 362 | std::size_t Nullable_String::length() const | 362 | std::size_t Nullable_String::length() const |
180 | 363 | { | 363 | { |
181 | @@ -387,47 +387,47 @@ | |||
182 | 387 | m_null= false; | 387 | m_null= false; |
183 | 388 | String::clear(); | 388 | String::clear(); |
184 | 389 | } | 389 | } |
200 | 390 | void Nullable_String::set(const char* data) | 390 | void Nullable_String::set(const char* str) |
201 | 391 | { | 391 | { |
202 | 392 | CHECK_NULLABLE_C_STRING(data); | 392 | CHECK_NULLABLE_C_STRING(str); |
203 | 393 | clear(); | 393 | clear(); |
204 | 394 | add_last(data); | 394 | add_last(str); |
205 | 395 | } | 395 | } |
206 | 396 | void Nullable_String::set(const char* data, std::size_t length) | 396 | void Nullable_String::set(const char* str, std::size_t l) |
207 | 397 | { | 397 | { |
208 | 398 | clear(); | 398 | clear(); |
209 | 399 | add_last(data, length); | 399 | add_last(str, l); |
210 | 400 | } | 400 | } |
211 | 401 | void Nullable_String::set(std::string const &data) | 401 | void Nullable_String::set(std::string const &str) |
212 | 402 | { | 402 | { |
213 | 403 | clear(); | 403 | clear(); |
214 | 404 | add_last(data); | 404 | add_last(str); |
215 | 405 | } | 405 | } |
216 | 406 | void Nullable_String::set(Nullable_String const &other) | 406 | void Nullable_String::set(Nullable_String const &other) |
217 | 407 | { | 407 | { |
218 | 408 | clear(); | 408 | clear(); |
219 | 409 | add_last(other); | 409 | add_last(other); |
220 | 410 | } | 410 | } |
222 | 411 | void Nullable_String::remove_first(std::size_t length) | 411 | void Nullable_String::remove_first(std::size_t n) |
223 | 412 | { | 412 | { |
224 | 413 | if (m_null) | 413 | if (m_null) |
225 | 414 | throw String_Null_Error("remove_first"); | 414 | throw String_Null_Error("remove_first"); |
226 | 415 | else | 415 | else |
228 | 416 | String::remove_first(length); | 416 | String::remove_first(n); |
229 | 417 | } | 417 | } |
230 | 418 | void Nullable_String::add_last(const char* value) | 418 | void Nullable_String::add_last(const char* value) |
231 | 419 | { | 419 | { |
232 | 420 | if (value) | 420 | if (value) |
233 | 421 | add_last(value, strlen(value)); | 421 | add_last(value, strlen(value)); |
234 | 422 | } | 422 | } |
236 | 423 | void Nullable_String::add_last(const char* value, std::size_t length) | 423 | void Nullable_String::add_last(const char* value, std::size_t len) |
237 | 424 | { | 424 | { |
238 | 425 | if (value) | 425 | if (value) |
239 | 426 | { | 426 | { |
240 | 427 | if (is_null()) | 427 | if (is_null()) |
241 | 428 | throw String_Null_Error("add_last"); | 428 | throw String_Null_Error("add_last"); |
242 | 429 | else | 429 | else |
244 | 430 | get_string().add_last(value, length); | 430 | get_string().add_last(value, len); |
245 | 431 | } | 431 | } |
246 | 432 | } | 432 | } |
247 | 433 | void Nullable_String::add_last(std::string const &value) | 433 | void Nullable_String::add_last(std::string const &value) |
248 | 434 | 434 | ||
249 | === modified file 'src/long_string.h' | |||
250 | --- src/long_string.h 2011-09-29 06:41:38 +0000 | |||
251 | +++ src/long_string.h 2011-09-29 06:41:38 +0000 | |||
252 | @@ -200,7 +200,7 @@ | |||
253 | 200 | static void apply(Reader &action, Nullable_String &value) | 200 | static void apply(Reader &action, Nullable_String &value) |
254 | 201 | { | 201 | { |
255 | 202 | action.begin_compound(value); | 202 | action.begin_compound(value); |
257 | 203 | action.member( (const char*)"m_null", value.m_null ); | 203 | action.member("m_null", value.m_null ); |
258 | 204 | if (!value.is_null()) | 204 | if (!value.is_null()) |
259 | 205 | { | 205 | { |
260 | 206 | superclass(action, value.get_string()); | 206 | superclass(action, value.get_string()); |
261 | 207 | 207 | ||
262 | === modified file 'src/mysql_client.cc' | |||
263 | --- src/mysql_client.cc 2011-07-11 07:34:56 +0000 | |||
264 | +++ src/mysql_client.cc 2011-09-29 06:41:38 +0000 | |||
265 | @@ -215,20 +215,20 @@ | |||
266 | 215 | { | 215 | { |
267 | 216 | if (::verbose_error()) | 216 | if (::verbose_error()) |
268 | 217 | { | 217 | { |
271 | 218 | Nullable_String &error= r.error; | 218 | Nullable_String &err= r.error; |
272 | 219 | if (error.is_null()) | 219 | if (err.is_null()) |
273 | 220 | { | 220 | { |
275 | 221 | error.set(""); | 221 | err.set(""); |
276 | 222 | } | 222 | } |
280 | 223 | int old_length= (error.is_null() ? 0 : error.length()); | 223 | int old_length= (err.is_null() ? 0 : err.length()); |
281 | 224 | int new_length= snprintf(error.data() + old_length | 224 | int new_length= snprintf(err.data() + old_length |
282 | 225 | , error.max() - old_length | 225 | , err.max() - old_length |
283 | 226 | , "%s(%d): %s" | 226 | , "%s(%d): %s" |
284 | 227 | , (old_length == 0 ? "" : "\n") | 227 | , (old_length == 0 ? "" : "\n") |
285 | 228 | , mysql_errno(handle()) | 228 | , mysql_errno(handle()) |
286 | 229 | , mysql_error(handle())); | 229 | , mysql_error(handle())); |
287 | 230 | assert(new_length > 0); | 230 | assert(new_length > 0); |
289 | 231 | error.length(old_length + new_length); | 231 | err.length(old_length + new_length); |
290 | 232 | } | 232 | } |
291 | 233 | } | 233 | } |
292 | 234 | private: | 234 | private: |
293 | 235 | 235 | ||
294 | === modified file 'src/options.cc' | |||
295 | --- src/options.cc 2011-09-29 06:41:38 +0000 | |||
296 | +++ src/options.cc 2011-09-29 06:41:38 +0000 | |||
297 | @@ -31,12 +31,16 @@ | |||
298 | 31 | #include <sys/types.h> | 31 | #include <sys/types.h> |
299 | 32 | #include <errno.h> | 32 | #include <errno.h> |
300 | 33 | 33 | ||
301 | 34 | std::size_t quiet_verbose_callback(char*, std::size_t, Query const &, | ||
302 | 35 | Query_Result const &); | ||
303 | 34 | std::size_t status_verbose_callback(char* buffer, std::size_t length, | 36 | std::size_t status_verbose_callback(char* buffer, std::size_t length, |
304 | 35 | Query const &q, Query_Result const &r); | 37 | Query const &q, Query_Result const &r); |
305 | 36 | std::size_t full_verbose_callback(char* buffer, std::size_t length, | 38 | std::size_t full_verbose_callback(char* buffer, std::size_t length, |
306 | 37 | Query const &q, Query_Result const &r); | 39 | Query const &q, Query_Result const &r); |
307 | 38 | std::size_t custom_verbose_callback(char* buffer, std::size_t length, | 40 | std::size_t custom_verbose_callback(char* buffer, std::size_t length, |
308 | 39 | Query const &q, Query_Result const &r); | 41 | Query const &q, Query_Result const &r); |
309 | 42 | std::size_t error_verbose_callback(char* buffer, std::size_t length, | ||
310 | 43 | Query const &q, Query_Result const &r); | ||
311 | 40 | 44 | ||
312 | 41 | static const char* query_type_str(Query const &a_query) | 45 | static const char* query_type_str(Query const &a_query) |
313 | 42 | { | 46 | { |
314 | @@ -288,18 +292,18 @@ | |||
315 | 288 | } | 292 | } |
316 | 289 | else | 293 | else |
317 | 290 | { | 294 | { |
319 | 291 | Verbose_Callback_Fill *fill= 0; | 295 | Verbose_Callback_Fill *cb_fill= 0; |
320 | 292 | if (!custom_verbose_callback_vector.empty()) | 296 | if (!custom_verbose_callback_vector.empty()) |
321 | 293 | { | 297 | { |
323 | 294 | fill= custom_verbose_callback_vector.back().get()->fill(); | 298 | cb_fill= custom_verbose_callback_vector.back().get()->fill(); |
324 | 295 | } | 299 | } |
326 | 296 | if (0 == fill) | 300 | if (0 == cb_fill) |
327 | 297 | { | 301 | { |
328 | 298 | custom_verbose_callback_vector.push_back(Verbose_Callback_Pointer(new Verbose_Callback_Fill())); | 302 | custom_verbose_callback_vector.push_back(Verbose_Callback_Pointer(new Verbose_Callback_Fill())); |
330 | 299 | fill= custom_verbose_callback_vector.back().get()->fill(); | 303 | cb_fill= custom_verbose_callback_vector.back().get()->fill(); |
331 | 300 | } | 304 | } |
334 | 301 | assert(fill); | 305 | assert(cb_fill); |
335 | 302 | fill->add(*mask); | 306 | cb_fill->add(*mask); |
336 | 303 | } | 307 | } |
337 | 304 | } | 308 | } |
338 | 305 | } | 309 | } |
339 | @@ -322,12 +326,13 @@ | |||
340 | 322 | return message.str(); | 326 | return message.str(); |
341 | 323 | } | 327 | } |
342 | 324 | Too_Long_Argument::Too_Long_Argument(std::string const &argument_name | 328 | Too_Long_Argument::Too_Long_Argument(std::string const &argument_name |
346 | 325 | , std::string const &limitation | 329 | , std::string const &arg_limitation |
347 | 326 | , std::string const &received) : | 330 | , std::string const &arg_received) : |
348 | 327 | Error(generate_message_Too_Long_Argument(argument_name, limitation, received)) | 331 | Error(generate_message_Too_Long_Argument(argument_name, arg_limitation, |
349 | 332 | arg_received)) | ||
350 | 328 | , m_name(argument_name) | 333 | , m_name(argument_name) |
353 | 329 | , m_limitation(limitation) | 334 | , m_limitation(arg_limitation) |
354 | 330 | , m_received(received) | 335 | , m_received(arg_received) |
355 | 331 | { | 336 | { |
356 | 332 | } | 337 | } |
357 | 333 | std::string const& Too_Long_Argument::name() const | 338 | std::string const& Too_Long_Argument::name() const |
358 | 334 | 339 | ||
359 | === modified file 'src/query.cc' | |||
360 | --- src/query.cc 2011-09-29 06:41:38 +0000 | |||
361 | +++ src/query.cc 2011-09-29 06:41:38 +0000 | |||
362 | @@ -153,68 +153,7 @@ | |||
363 | 153 | */ | 153 | */ |
364 | 154 | typedef int Query_Parse_State; | 154 | typedef int Query_Parse_State; |
365 | 155 | 155 | ||
428 | 156 | const char * to_c_str(Enum_Query_Parse parse) | 156 | static Query_Parse_State query_parse_state(Enum_Query_Detect detect, Enum_Query_Type type, Enum_Query_Parse parse) |
367 | 157 | { | ||
368 | 158 | #define CONVERT(s) case(s): return #s ; | ||
369 | 159 | switch(parse) | ||
370 | 160 | { | ||
371 | 161 | CONVERT(ZERO); | ||
372 | 162 | CONVERT(ZERO_BACK); | ||
373 | 163 | CONVERT(SLASH); | ||
374 | 164 | CONVERT(C_COMMENT); | ||
375 | 165 | CONVERT(C_COMMENT_BACK); | ||
376 | 166 | CONVERT(C_COMMENT_STAR); | ||
377 | 167 | CONVERT(MINUS); | ||
378 | 168 | CONVERT(MINUS_COMMENT); | ||
379 | 169 | CONVERT(MINUS_COMMENT_BACK); | ||
380 | 170 | CONVERT(SHARP_COMMENT); | ||
381 | 171 | CONVERT(SHARP_COMMENT_BACK); | ||
382 | 172 | CONVERT(U); | ||
383 | 173 | CONVERT(US); | ||
384 | 174 | CONVERT(USE); | ||
385 | 175 | CONVERT(UP); | ||
386 | 176 | CONVERT(UPD); | ||
387 | 177 | CONVERT(UPDA); | ||
388 | 178 | CONVERT(UPDAT); | ||
389 | 179 | CONVERT(UPDATE); | ||
390 | 180 | CONVERT(D); | ||
391 | 181 | CONVERT(DE); | ||
392 | 182 | CONVERT(DEL); | ||
393 | 183 | CONVERT(DELE); | ||
394 | 184 | CONVERT(DELET); | ||
395 | 185 | CONVERT(DELETE); | ||
396 | 186 | CONVERT(I); | ||
397 | 187 | CONVERT(IN); | ||
398 | 188 | CONVERT(INS); | ||
399 | 189 | CONVERT(INSE); | ||
400 | 190 | CONVERT(INSER); | ||
401 | 191 | CONVERT(INSERT); | ||
402 | 192 | CONVERT(S); | ||
403 | 193 | CONVERT(SE); | ||
404 | 194 | CONVERT(SET); | ||
405 | 195 | CONVERT(SEL); | ||
406 | 196 | CONVERT(SELE); | ||
407 | 197 | CONVERT(SELEC); | ||
408 | 198 | CONVERT(SELECT); | ||
409 | 199 | CONVERT(SH); | ||
410 | 200 | CONVERT(SHO); | ||
411 | 201 | CONVERT(SHOW); | ||
412 | 202 | CONVERT(SINGLE_QUOTE); | ||
413 | 203 | CONVERT(SINGLE_QUOTE_BACK); | ||
414 | 204 | CONVERT(DOUBLE_QUOTE); | ||
415 | 205 | CONVERT(DOUBLE_QUOTE_BACK); | ||
416 | 206 | CONVERT(FINAL); | ||
417 | 207 | default: | ||
418 | 208 | return "Enum_Query_Parse: unknown value"; | ||
419 | 209 | }; | ||
420 | 210 | #undef CONVERT | ||
421 | 211 | } | ||
422 | 212 | std::ostream& operator<<(std::ostream &s, Enum_Query_Parse parse) | ||
423 | 213 | { | ||
424 | 214 | return s << to_c_str(parse); | ||
425 | 215 | } | ||
426 | 216 | |||
427 | 217 | Query_Parse_State query_parse_state(Enum_Query_Detect detect, Enum_Query_Type type, Enum_Query_Parse parse) | ||
429 | 218 | { | 157 | { |
430 | 219 | return static_cast<Query_Parse_State>(detect) + (static_cast<Query_Parse_State>(type) << 8) + (static_cast<Query_Parse_State>(parse) << 16); | 158 | return static_cast<Query_Parse_State>(detect) + (static_cast<Query_Parse_State>(type) << 8) + (static_cast<Query_Parse_State>(parse) << 16); |
431 | 220 | } | 159 | } |
432 | @@ -223,7 +162,7 @@ | |||
433 | 223 | { | 162 | { |
434 | 224 | return query_parse_state(detect, eQuery_Type_Unknown, ZERO); | 163 | return query_parse_state(detect, eQuery_Type_Unknown, ZERO); |
435 | 225 | } | 164 | } |
437 | 226 | Enum_Query_Detect query_detect(Query_Parse_State state) | 165 | static Enum_Query_Detect query_detect(Query_Parse_State state) |
438 | 227 | { | 166 | { |
439 | 228 | return static_cast<Enum_Query_Detect>(state & 0xFF); | 167 | return static_cast<Enum_Query_Detect>(state & 0xFF); |
440 | 229 | } | 168 | } |
441 | @@ -231,14 +170,14 @@ | |||
442 | 231 | { | 170 | { |
443 | 232 | return static_cast<Enum_Query_Type>((state >> 8) & 0xFF); | 171 | return static_cast<Enum_Query_Type>((state >> 8) & 0xFF); |
444 | 233 | } | 172 | } |
446 | 234 | Enum_Query_Parse query_parse(Query_Parse_State state) | 173 | static Enum_Query_Parse query_parse(Query_Parse_State state) |
447 | 235 | { | 174 | { |
448 | 236 | return static_cast<Enum_Query_Parse>((state >> 16) & 0xFF); | 175 | return static_cast<Enum_Query_Parse>((state >> 16) & 0xFF); |
449 | 237 | } | 176 | } |
451 | 238 | std::size_t query_parse_stupid(Query_Parse_State &state, const char* data, std::size_t length) | 177 | static std::size_t query_parse_stupid(Query_Parse_State &state, const char* data, std::size_t length) |
452 | 239 | { | 178 | { |
453 | 240 | assert(eQuery_Detect_Stupid == query_detect(state)); | 179 | assert(eQuery_Detect_Stupid == query_detect(state)); |
455 | 241 | const char* result= (const char*)memchr(data, ';', length); | 180 | const char* result= static_cast<const char*>(memchr(data, ';', length)); |
456 | 242 | if (result == NULL) | 181 | if (result == NULL) |
457 | 243 | return length; | 182 | return length; |
458 | 244 | else | 183 | else |
459 | 245 | 184 | ||
460 | === modified file 'src/queue.h' | |||
461 | --- src/queue.h 2011-09-29 06:41:38 +0000 | |||
462 | +++ src/queue.h 2011-09-29 06:41:38 +0000 | |||
463 | @@ -413,7 +413,7 @@ | |||
464 | 413 | std::cout << s.str() << std::flush;*/ | 413 | std::cout << s.str() << std::flush;*/ |
465 | 414 | m_queue.clear(); | 414 | m_queue.clear(); |
466 | 415 | } | 415 | } |
468 | 416 | bool can_push(T* a_item) | 416 | bool can_push(T*) |
469 | 417 | { | 417 | { |
470 | 418 | /*std::ostringstream s; | 418 | /*std::ostringstream s; |
471 | 419 | s << *this << " : " << this << " CAN_PUSH: QUEUE SIZE IS "; | 419 | s << *this << " : " << this << " CAN_PUSH: QUEUE SIZE IS "; |
472 | 420 | 420 | ||
473 | === modified file 'src/slow_query_log_parser.h' | |||
474 | --- src/slow_query_log_parser.h 2011-07-11 14:41:36 +0000 | |||
475 | +++ src/slow_query_log_parser.h 2011-09-29 06:41:38 +0000 | |||
476 | @@ -51,9 +51,9 @@ | |||
477 | 51 | { | 51 | { |
478 | 52 | m_scheduler->start(); | 52 | m_scheduler->start(); |
479 | 53 | } | 53 | } |
481 | 54 | bool run(Query const &query) | 54 | bool run(Query const &q) |
482 | 55 | { | 55 | { |
484 | 56 | return m_scheduler->run(query); | 56 | return m_scheduler->run(q); |
485 | 57 | } | 57 | } |
486 | 58 | void flush() | 58 | void flush() |
487 | 59 | { | 59 | { |
488 | 60 | 60 | ||
489 | === modified file 'src/supervisor.cc' | |||
490 | --- src/supervisor.cc 2011-07-11 07:34:56 +0000 | |||
491 | +++ src/supervisor.cc 2011-09-29 06:41:38 +0000 | |||
492 | @@ -22,11 +22,6 @@ | |||
493 | 22 | #include "options.h" | 22 | #include "options.h" |
494 | 23 | #include "worker.h" | 23 | #include "worker.h" |
495 | 24 | 24 | ||
496 | 25 | void connection_trace(void */* a_context */, Error const &a_error) | ||
497 | 26 | { | ||
498 | 27 | std::cerr << a_error << std::endl; | ||
499 | 28 | } | ||
500 | 29 | |||
501 | 30 | static void *s_context= 0; | 25 | static void *s_context= 0; |
502 | 31 | static troubles s_troubles= 0; | 26 | static troubles s_troubles= 0; |
503 | 32 | void set_troubles(void *a_context, troubles a_function) | 27 | void set_troubles(void *a_context, troubles a_function) |
504 | @@ -106,9 +101,9 @@ | |||
505 | 106 | } | 101 | } |
506 | 107 | void complete(Worker *a_worker) | 102 | void complete(Worker *a_worker) |
507 | 108 | { | 103 | { |
509 | 109 | bool complete= (0 == --m_active) && (m_flush || m_stop); | 104 | bool is_complete= (0 == --m_active) && (m_flush || m_stop); |
510 | 110 | m_join.push(a_worker); | 105 | m_join.push(a_worker); |
512 | 111 | if (complete) | 106 | if (is_complete) |
513 | 112 | { | 107 | { |
514 | 113 | m_join.flush(); | 108 | m_join.flush(); |
515 | 114 | } | 109 | } |
LGTM