Merge lp:~dshrews/libdrizzle/libdrizzle into lp:libdrizzle

Proposed by Andrew Hutchings
Status: Merged
Approved by: Andrew Hutchings
Approved revision: 118
Merged at revision: 119
Proposed branch: lp:~dshrews/libdrizzle/libdrizzle
Merge into: lp:libdrizzle
Diff against target: 110 lines (+14/-9)
4 files modified
libdrizzle/command.cc (+4/-3)
libdrizzle/drizzle.cc (+2/-0)
libdrizzle/field.cc (+2/-2)
libdrizzle/handshake.cc (+6/-4)
To merge this branch: bzr merge lp:~dshrews/libdrizzle/libdrizzle
Reviewer Review Type Date Requested Status
Drizzle Trunk Pending
Review via email: mp+161218@code.launchpad.net

Description of the change

Shrew's clang fixes

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
=== modified file 'libdrizzle/command.cc'
--- libdrizzle/command.cc 2013-01-27 11:55:48 +0000
+++ libdrizzle/command.cc 2013-04-26 19:03:38 +0000
@@ -85,11 +85,12 @@
85 /* Make sure we can fit the largest non-streaming packet, currently a85 /* Make sure we can fit the largest non-streaming packet, currently a
86 DRIZZLE_COMMAND_CHANGE_USER command. */86 DRIZZLE_COMMAND_CHANGE_USER command. */
8787
88 con->packet_size= 1 /* Command */88 con->packet_size= (uint32_t)(
89 1 /* Command */
89 + strlen(con->user) + 190 + strlen(con->user) + 1
90 + 1 /* Scramble size */91 + 1 /* Scramble size */
91 + DRIZZLE_MAX_SCRAMBLE_SIZE92 + DRIZZLE_MAX_SCRAMBLE_SIZE
92 + strlen(con->db) + 1;93 + strlen(con->db) + 1);
9394
94 /* Flush buffer if there is not enough room. */95 /* Flush buffer if there is not enough room. */
95 free_size= con->buffer_allocation - (size_t)(start - con->buffer);96 free_size= con->buffer_allocation - (size_t)(start - con->buffer);
@@ -121,7 +122,7 @@
121 }122 }
122 else123 else
123 {124 {
124 con->packet_size= 1 + con->command_total;125 con->packet_size= (uint32_t)(1 + con->command_total);
125 free_size-= 5;126 free_size-= 5;
126127
127 /* Copy as much of the data in as we can into the write buffer. */128 /* Copy as much of the data in as we can into the write buffer. */
128129
=== modified file 'libdrizzle/drizzle.cc'
--- libdrizzle/drizzle.cc 2013-01-27 14:00:17 +0000
+++ libdrizzle/drizzle.cc 2013-04-26 19:03:38 +0000
@@ -364,6 +364,7 @@
364 * Local Definitions364 * Local Definitions
365 */365 */
366366
367__attribute__((__format__ (__printf__, 3, 4)))
367void drizzle_set_error(drizzle_st *con, const char *function,368void drizzle_set_error(drizzle_st *con, const char *function,
368 const char *format, ...)369 const char *format, ...)
369{370{
@@ -413,6 +414,7 @@
413 }414 }
414}415}
415416
417__attribute__((__format__ (__printf__, 3, 0)))
416void drizzle_log(drizzle_st *con, drizzle_verbose_t verbose,418void drizzle_log(drizzle_st *con, drizzle_verbose_t verbose,
417 const char *format, va_list args)419 const char *format, va_list args)
418{420{
419421
=== modified file 'libdrizzle/field.cc'
--- libdrizzle/field.cc 2013-04-25 09:02:57 +0000
+++ libdrizzle/field.cc 2013-04-26 19:03:38 +0000
@@ -307,7 +307,7 @@
307 con->result->field_total)307 con->result->field_total)
308 {308 {
309 con->result->column_buffer[con->result->field_current].size=309 con->result->column_buffer[con->result->field_current].size=
310 con->result->field_total;310 (uint32_t)con->result->field_total;
311 }311 }
312312
313 con->result->field_current++;313 con->result->field_current++;
@@ -388,7 +388,7 @@
388 case DRIZZLE_COLUMN_TYPE_DECIMAL:388 case DRIZZLE_COLUMN_TYPE_DECIMAL:
389 case DRIZZLE_COLUMN_TYPE_NEWDECIMAL:389 case DRIZZLE_COLUMN_TYPE_NEWDECIMAL:
390 case DRIZZLE_COLUMN_TYPE_NEWDATE:390 case DRIZZLE_COLUMN_TYPE_NEWDATE:
391 con->result->field_size= (size_t)drizzle_unpack_length(con, &ret);391 con->result->field_size= (uint32_t)drizzle_unpack_length(con, &ret);
392 if (ret != DRIZZLE_RETURN_OK)392 if (ret != DRIZZLE_RETURN_OK)
393 {393 {
394 return ret;394 return ret;
395395
=== modified file 'libdrizzle/handshake.cc'
--- libdrizzle/handshake.cc 2013-02-28 02:19:33 +0000
+++ libdrizzle/handshake.cc 2013-04-26 19:03:38 +0000
@@ -228,7 +228,8 @@
228 drizzle_log_debug(con, "drizzle_state_handshake_server_write");228 drizzle_log_debug(con, "drizzle_state_handshake_server_write");
229229
230 /* Calculate max packet size. */230 /* Calculate max packet size. */
231 con->packet_size= 1 /* Protocol version */231 con->packet_size= (uint32_t)(
232 1 /* Protocol version */
232 + strlen(con->server_version) + 1233 + strlen(con->server_version) + 1
233 + 4 /* Thread ID */234 + 4 /* Thread ID */
234 + 8 /* Scramble */235 + 8 /* Scramble */
@@ -238,7 +239,7 @@
238 + 2 /* Status */239 + 2 /* Status */
239 + 13 /* Unused */240 + 13 /* Unused */
240 + 12 /* Scramble */241 + 12 /* Scramble */
241 + 1; /* NULL */242 + 1); /* NULL */
242243
243 /* Assume the entire handshake packet will fit in the buffer. */244 /* Assume the entire handshake packet will fit in the buffer. */
244 if ((con->packet_size + 4) > con->buffer_allocation)245 if ((con->packet_size + 4) > con->buffer_allocation)
@@ -541,14 +542,15 @@
541 }542 }
542#endif543#endif
543 /* Calculate max packet size. */544 /* Calculate max packet size. */
544 con->packet_size= 4 /* Capabilities */545 con->packet_size= (uint32_t)(
546 4 /* Capabilities */
545 + 4 /* Max packet size */547 + 4 /* Max packet size */
546 + 1 /* Charset */548 + 1 /* Charset */
547 + 23 /* Unused */549 + 23 /* Unused */
548 + strlen(con->user) + 1550 + strlen(con->user) + 1
549 + 1 /* Scramble size */551 + 1 /* Scramble size */
550 + DRIZZLE_MAX_SCRAMBLE_SIZE552 + DRIZZLE_MAX_SCRAMBLE_SIZE
551 + strlen(con->db) + 1;553 + strlen(con->db) + 1);
552554
553 /* Assume the entire handshake packet will fit in the buffer. */555 /* Assume the entire handshake packet will fit in the buffer. */
554 if ((con->packet_size + 4) > con->buffer_allocation)556 if ((con->packet_size + 4) > con->buffer_allocation)

Subscribers

People subscribed via source and target branches

to status/vote changes: