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

Proposed by Andrew Hutchings on 2013-04-26
Status: Merged
Approved by: Andrew Hutchings on 2013-04-26
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 2013-04-26 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
1=== modified file 'libdrizzle/command.cc'
2--- libdrizzle/command.cc 2013-01-27 11:55:48 +0000
3+++ libdrizzle/command.cc 2013-04-26 19:03:38 +0000
4@@ -85,11 +85,12 @@
5 /* Make sure we can fit the largest non-streaming packet, currently a
6 DRIZZLE_COMMAND_CHANGE_USER command. */
7
8- con->packet_size= 1 /* Command */
9+ con->packet_size= (uint32_t)(
10+ 1 /* Command */
11 + strlen(con->user) + 1
12 + 1 /* Scramble size */
13 + DRIZZLE_MAX_SCRAMBLE_SIZE
14- + strlen(con->db) + 1;
15+ + strlen(con->db) + 1);
16
17 /* Flush buffer if there is not enough room. */
18 free_size= con->buffer_allocation - (size_t)(start - con->buffer);
19@@ -121,7 +122,7 @@
20 }
21 else
22 {
23- con->packet_size= 1 + con->command_total;
24+ con->packet_size= (uint32_t)(1 + con->command_total);
25 free_size-= 5;
26
27 /* Copy as much of the data in as we can into the write buffer. */
28
29=== modified file 'libdrizzle/drizzle.cc'
30--- libdrizzle/drizzle.cc 2013-01-27 14:00:17 +0000
31+++ libdrizzle/drizzle.cc 2013-04-26 19:03:38 +0000
32@@ -364,6 +364,7 @@
33 * Local Definitions
34 */
35
36+__attribute__((__format__ (__printf__, 3, 4)))
37 void drizzle_set_error(drizzle_st *con, const char *function,
38 const char *format, ...)
39 {
40@@ -413,6 +414,7 @@
41 }
42 }
43
44+__attribute__((__format__ (__printf__, 3, 0)))
45 void drizzle_log(drizzle_st *con, drizzle_verbose_t verbose,
46 const char *format, va_list args)
47 {
48
49=== modified file 'libdrizzle/field.cc'
50--- libdrizzle/field.cc 2013-04-25 09:02:57 +0000
51+++ libdrizzle/field.cc 2013-04-26 19:03:38 +0000
52@@ -307,7 +307,7 @@
53 con->result->field_total)
54 {
55 con->result->column_buffer[con->result->field_current].size=
56- con->result->field_total;
57+ (uint32_t)con->result->field_total;
58 }
59
60 con->result->field_current++;
61@@ -388,7 +388,7 @@
62 case DRIZZLE_COLUMN_TYPE_DECIMAL:
63 case DRIZZLE_COLUMN_TYPE_NEWDECIMAL:
64 case DRIZZLE_COLUMN_TYPE_NEWDATE:
65- con->result->field_size= (size_t)drizzle_unpack_length(con, &ret);
66+ con->result->field_size= (uint32_t)drizzle_unpack_length(con, &ret);
67 if (ret != DRIZZLE_RETURN_OK)
68 {
69 return ret;
70
71=== modified file 'libdrizzle/handshake.cc'
72--- libdrizzle/handshake.cc 2013-02-28 02:19:33 +0000
73+++ libdrizzle/handshake.cc 2013-04-26 19:03:38 +0000
74@@ -228,7 +228,8 @@
75 drizzle_log_debug(con, "drizzle_state_handshake_server_write");
76
77 /* Calculate max packet size. */
78- con->packet_size= 1 /* Protocol version */
79+ con->packet_size= (uint32_t)(
80+ 1 /* Protocol version */
81 + strlen(con->server_version) + 1
82 + 4 /* Thread ID */
83 + 8 /* Scramble */
84@@ -238,7 +239,7 @@
85 + 2 /* Status */
86 + 13 /* Unused */
87 + 12 /* Scramble */
88- + 1; /* NULL */
89+ + 1); /* NULL */
90
91 /* Assume the entire handshake packet will fit in the buffer. */
92 if ((con->packet_size + 4) > con->buffer_allocation)
93@@ -541,14 +542,15 @@
94 }
95 #endif
96 /* Calculate max packet size. */
97- con->packet_size= 4 /* Capabilities */
98+ con->packet_size= (uint32_t)(
99+ 4 /* Capabilities */
100 + 4 /* Max packet size */
101 + 1 /* Charset */
102 + 23 /* Unused */
103 + strlen(con->user) + 1
104 + 1 /* Scramble size */
105 + DRIZZLE_MAX_SCRAMBLE_SIZE
106- + strlen(con->db) + 1;
107+ + strlen(con->db) + 1);
108
109 /* Assume the entire handshake packet will fit in the buffer. */
110 if ((con->packet_size + 4) > con->buffer_allocation)

Subscribers

People subscribed via source and target branches

to status/vote changes: