Merge lp://staging/~mordred/libmemcached/write-strings into lp://staging/~tangent-org/libmemcached/trunk
- write-strings
- Merge into trunk
Proposed by
Monty Taylor
Status: | Superseded |
---|---|
Proposed branch: | lp://staging/~mordred/libmemcached/write-strings |
Merge into: | lp://staging/~tangent-org/libmemcached/trunk |
Diff against target: | None lines |
To merge this branch: | bzr merge lp://staging/~mordred/libmemcached/write-strings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Libmemcached-developers | Pending | ||
Review via email: mp+8482@code.staging.launchpad.net |
This proposal has been superseded by a proposal from 2009-07-11.
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Monty Taylor (mordred) wrote : | # |
- 557. By Monty Taylor
-
pandora-build v0.10
- 558. By Monty Taylor
-
Merged from myself.
- 559. By Monty Taylor
-
Merged from Padraig.
- 560. By Monty Taylor
-
Merged in a lost patch.
- 561. By Monty Taylor
-
pandora-build v0.20
Turned off inllargeuse warning in sun studio - 562. By Monty Taylor
-
Added macro files I missed earlier...
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'clients/memcp.c' | |||
2 | --- clients/memcp.c 2009-06-15 13:03:47 +0000 | |||
3 | +++ clients/memcp.c 2009-07-08 13:38:34 +0000 | |||
4 | @@ -91,7 +91,7 @@ | |||
5 | 91 | 91 | ||
6 | 92 | if (opt_verbose) | 92 | if (opt_verbose) |
7 | 93 | { | 93 | { |
9 | 94 | static char *opstr[] = { "set", "add", "replace" }; | 94 | static const char *opstr[] = { "set", "add", "replace" }; |
10 | 95 | printf("op: %s\nsource file: %s\nlength: %zu\n" | 95 | printf("op: %s\nsource file: %s\nlength: %zu\n" |
11 | 96 | "key: %s\nflags: %x\nexpires: %llu\n", | 96 | "key: %s\nflags: %x\nexpires: %llu\n", |
12 | 97 | opstr[opt_method - OPT_SET], argv[optind], (size_t)sbuf.st_size, | 97 | opstr[opt_method - OPT_SET], argv[optind], (size_t)sbuf.st_size, |
13 | 98 | 98 | ||
14 | === modified file 'clients/utilities.c' | |||
15 | --- clients/utilities.c 2009-06-15 13:03:47 +0000 | |||
16 | +++ clients/utilities.c 2009-07-08 13:38:34 +0000 | |||
17 | @@ -16,13 +16,13 @@ | |||
18 | 16 | return s + us; | 16 | return s + us; |
19 | 17 | } | 17 | } |
20 | 18 | 18 | ||
22 | 19 | void version_command(char *command_name) | 19 | void version_command(const char *command_name) |
23 | 20 | { | 20 | { |
24 | 21 | printf("%s v%u.%u\n", command_name, 1, 0); | 21 | printf("%s v%u.%u\n", command_name, 1, 0); |
25 | 22 | exit(0); | 22 | exit(0); |
26 | 23 | } | 23 | } |
27 | 24 | 24 | ||
29 | 25 | static char *lookup_help(memcached_options option) | 25 | static const char *lookup_help(memcached_options option) |
30 | 26 | { | 26 | { |
31 | 27 | switch (option) | 27 | switch (option) |
32 | 28 | { | 28 | { |
33 | @@ -54,7 +54,7 @@ | |||
34 | 54 | return "forgot to document this function :)"; | 54 | return "forgot to document this function :)"; |
35 | 55 | } | 55 | } |
36 | 56 | 56 | ||
38 | 57 | void help_command(char *command_name, char *description, | 57 | void help_command(const char *command_name, const char *description, |
39 | 58 | const struct option *long_options, | 58 | const struct option *long_options, |
40 | 59 | memcached_programs_help_st *options __attribute__((unused))) | 59 | memcached_programs_help_st *options __attribute__((unused))) |
41 | 60 | { | 60 | { |
42 | @@ -66,7 +66,7 @@ | |||
43 | 66 | 66 | ||
44 | 67 | for (x= 0; long_options[x].name; x++) | 67 | for (x= 0; long_options[x].name; x++) |
45 | 68 | { | 68 | { |
47 | 69 | char *help_message; | 69 | const char *help_message; |
48 | 70 | 70 | ||
49 | 71 | printf("\t --%s%c\n", long_options[x].name, | 71 | printf("\t --%s%c\n", long_options[x].name, |
50 | 72 | long_options[x].has_arg ? '=' : ' '); | 72 | long_options[x].has_arg ? '=' : ' '); |
51 | 73 | 73 | ||
52 | === modified file 'clients/utilities.h' | |||
53 | --- clients/utilities.h 2008-04-20 22:49:37 +0000 | |||
54 | +++ clients/utilities.h 2009-07-08 13:38:34 +0000 | |||
55 | @@ -23,8 +23,8 @@ | |||
56 | 23 | char *strdup_cleanup(const char *str); | 23 | char *strdup_cleanup(const char *str); |
57 | 24 | void cleanup(void); | 24 | void cleanup(void); |
58 | 25 | long int timedif(struct timeval a, struct timeval b); | 25 | long int timedif(struct timeval a, struct timeval b); |
61 | 26 | void version_command(char *command_name); | 26 | void version_command(const char *command_name); |
62 | 27 | void help_command(char *command_name, char *description, | 27 | void help_command(const char *command_name, const char *description, |
63 | 28 | const struct option *long_options, | 28 | const struct option *long_options, |
64 | 29 | memcached_programs_help_st *options); | 29 | memcached_programs_help_st *options); |
65 | 30 | void process_hash_option(memcached_st *memc, char *opt_hash); | 30 | void process_hash_option(memcached_st *memc, char *opt_hash); |
66 | 31 | 31 | ||
67 | === modified file 'libmemcached/common.h' | |||
68 | --- libmemcached/common.h 2009-07-06 17:20:04 +0000 | |||
69 | +++ libmemcached/common.h 2009-07-08 13:38:34 +0000 | |||
70 | @@ -135,7 +135,7 @@ | |||
71 | 135 | void server_list_free(memcached_st *ptr, memcached_server_st *servers); | 135 | void server_list_free(memcached_st *ptr, memcached_server_st *servers); |
72 | 136 | 136 | ||
73 | 137 | LIBMEMCACHED_LOCAL | 137 | LIBMEMCACHED_LOCAL |
75 | 138 | memcached_return memcached_key_test(char **keys, size_t *key_length, | 138 | memcached_return memcached_key_test(const char **keys, size_t *key_length, |
76 | 139 | unsigned int number_of_keys); | 139 | unsigned int number_of_keys); |
77 | 140 | 140 | ||
78 | 141 | 141 | ||
79 | 142 | 142 | ||
80 | === modified file 'libmemcached/memcached.h' | |||
81 | --- libmemcached/memcached.h 2009-07-06 17:20:04 +0000 | |||
82 | +++ libmemcached/memcached.h 2009-07-08 13:38:34 +0000 | |||
83 | @@ -172,7 +172,7 @@ | |||
84 | 172 | LIBMEMCACHED_API | 172 | LIBMEMCACHED_API |
85 | 173 | void memcached_quit(memcached_st *ptr); | 173 | void memcached_quit(memcached_st *ptr); |
86 | 174 | LIBMEMCACHED_API | 174 | LIBMEMCACHED_API |
88 | 175 | char *memcached_strerror(memcached_st *ptr, memcached_return rc); | 175 | const char *memcached_strerror(memcached_st *ptr, memcached_return rc); |
89 | 176 | LIBMEMCACHED_API | 176 | LIBMEMCACHED_API |
90 | 177 | memcached_return memcached_behavior_set(memcached_st *ptr, memcached_behavior flag, uint64_t data); | 177 | memcached_return memcached_behavior_set(memcached_st *ptr, memcached_behavior flag, uint64_t data); |
91 | 178 | LIBMEMCACHED_API | 178 | LIBMEMCACHED_API |
92 | 179 | 179 | ||
93 | === modified file 'libmemcached/memcached.hh' | |||
94 | --- libmemcached/memcached.hh 2009-07-07 21:57:24 +0000 | |||
95 | +++ libmemcached/memcached.hh 2009-07-08 13:38:34 +0000 | |||
96 | @@ -46,7 +46,7 @@ | |||
97 | 46 | value_length, &flags, &rc); | 46 | value_length, &flags, &rc); |
98 | 47 | } | 47 | } |
99 | 48 | 48 | ||
101 | 49 | memcached_return mget(char **keys, size_t *key_length, | 49 | memcached_return mget(const char **keys, size_t *key_length, |
102 | 50 | unsigned int number_of_keys) | 50 | unsigned int number_of_keys) |
103 | 51 | { | 51 | { |
104 | 52 | 52 | ||
105 | 53 | 53 | ||
106 | === modified file 'libmemcached/memcached_auto.c' | |||
107 | --- libmemcached/memcached_auto.c 2009-06-15 13:03:47 +0000 | |||
108 | +++ libmemcached/memcached_auto.c 2009-07-08 13:38:34 +0000 | |||
109 | @@ -15,7 +15,7 @@ | |||
110 | 15 | unlikely (ptr->hosts == NULL || ptr->number_of_hosts == 0) | 15 | unlikely (ptr->hosts == NULL || ptr->number_of_hosts == 0) |
111 | 16 | return MEMCACHED_NO_SERVERS; | 16 | return MEMCACHED_NO_SERVERS; |
112 | 17 | 17 | ||
114 | 18 | if ((ptr->flags & MEM_VERIFY_KEY) && (memcached_key_test((char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)) | 18 | if ((ptr->flags & MEM_VERIFY_KEY) && (memcached_key_test((const char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)) |
115 | 19 | return MEMCACHED_BAD_KEY_PROVIDED; | 19 | return MEMCACHED_BAD_KEY_PROVIDED; |
116 | 20 | 20 | ||
117 | 21 | server_key= memcached_generate_hash(ptr, key, key_length); | 21 | server_key= memcached_generate_hash(ptr, key, key_length); |
118 | 22 | 22 | ||
119 | === modified file 'libmemcached/memcached_callback.c' | |||
120 | --- libmemcached/memcached_callback.c 2009-06-21 10:59:22 +0000 | |||
121 | +++ libmemcached/memcached_callback.c 2009-07-08 13:38:34 +0000 | |||
122 | @@ -21,7 +21,7 @@ | |||
123 | 21 | { | 21 | { |
124 | 22 | size_t key_length= strlen(key); | 22 | size_t key_length= strlen(key); |
125 | 23 | 23 | ||
127 | 24 | if (memcached_key_test((char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED) | 24 | if (memcached_key_test((const char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED) |
128 | 25 | { | 25 | { |
129 | 26 | return MEMCACHED_BAD_KEY_PROVIDED; | 26 | return MEMCACHED_BAD_KEY_PROVIDED; |
130 | 27 | } | 27 | } |
131 | 28 | 28 | ||
132 | === modified file 'libmemcached/memcached_get.c' | |||
133 | --- libmemcached/memcached_get.c 2009-06-21 15:51:17 +0000 | |||
134 | +++ libmemcached/memcached_get.c 2009-07-08 13:38:34 +0000 | |||
135 | @@ -37,7 +37,7 @@ | |||
136 | 37 | *error= memcached_mget_by_key(ptr, | 37 | *error= memcached_mget_by_key(ptr, |
137 | 38 | master_key, | 38 | master_key, |
138 | 39 | master_key_length, | 39 | master_key_length, |
140 | 40 | (char **)&key, &key_length, 1); | 40 | (const char **)&key, &key_length, 1); |
141 | 41 | 41 | ||
142 | 42 | value= memcached_fetch(ptr, NULL, NULL, | 42 | value= memcached_fetch(ptr, NULL, NULL, |
143 | 43 | value_length, flags, error); | 43 | value_length, flags, error); |
144 | @@ -102,7 +102,7 @@ | |||
145 | 102 | } | 102 | } |
146 | 103 | 103 | ||
147 | 104 | memcached_return memcached_mget(memcached_st *ptr, | 104 | memcached_return memcached_mget(memcached_st *ptr, |
149 | 105 | char **keys, size_t *key_length, | 105 | const char **keys, size_t *key_length, |
150 | 106 | unsigned int number_of_keys) | 106 | unsigned int number_of_keys) |
151 | 107 | { | 107 | { |
152 | 108 | return memcached_mget_by_key(ptr, NULL, 0, keys, key_length, number_of_keys); | 108 | return memcached_mget_by_key(ptr, NULL, 0, keys, key_length, number_of_keys); |
153 | @@ -111,19 +111,19 @@ | |||
154 | 111 | static memcached_return binary_mget_by_key(memcached_st *ptr, | 111 | static memcached_return binary_mget_by_key(memcached_st *ptr, |
155 | 112 | unsigned int master_server_key, | 112 | unsigned int master_server_key, |
156 | 113 | bool is_master_key_set, | 113 | bool is_master_key_set, |
158 | 114 | char **keys, size_t *key_length, | 114 | const char **keys, size_t *key_length, |
159 | 115 | unsigned int number_of_keys); | 115 | unsigned int number_of_keys); |
160 | 116 | 116 | ||
161 | 117 | memcached_return memcached_mget_by_key(memcached_st *ptr, | 117 | memcached_return memcached_mget_by_key(memcached_st *ptr, |
162 | 118 | const char *master_key, | 118 | const char *master_key, |
163 | 119 | size_t master_key_length, | 119 | size_t master_key_length, |
165 | 120 | char **keys, | 120 | const char **keys, |
166 | 121 | size_t *key_length, | 121 | size_t *key_length, |
167 | 122 | unsigned int number_of_keys) | 122 | unsigned int number_of_keys) |
168 | 123 | { | 123 | { |
169 | 124 | unsigned int x; | 124 | unsigned int x; |
170 | 125 | memcached_return rc= MEMCACHED_NOTFOUND; | 125 | memcached_return rc= MEMCACHED_NOTFOUND; |
172 | 126 | char *get_command= "get "; | 126 | const char *get_command= "get "; |
173 | 127 | uint8_t get_command_length= 4; | 127 | uint8_t get_command_length= 4; |
174 | 128 | unsigned int master_server_key= (unsigned int)-1; /* 0 is a valid server id! */ | 128 | unsigned int master_server_key= (unsigned int)-1; /* 0 is a valid server id! */ |
175 | 129 | bool is_master_key_set= false; | 129 | bool is_master_key_set= false; |
176 | @@ -145,7 +145,7 @@ | |||
177 | 145 | 145 | ||
178 | 146 | if (master_key && master_key_length) | 146 | if (master_key && master_key_length) |
179 | 147 | { | 147 | { |
181 | 148 | if ((ptr->flags & MEM_VERIFY_KEY) && (memcached_key_test((char **)&master_key, &master_key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)) | 148 | if ((ptr->flags & MEM_VERIFY_KEY) && (memcached_key_test((const char **)&master_key, &master_key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)) |
182 | 149 | return MEMCACHED_BAD_KEY_PROVIDED; | 149 | return MEMCACHED_BAD_KEY_PROVIDED; |
183 | 150 | master_server_key= memcached_generate_hash(ptr, master_key, master_key_length); | 150 | master_server_key= memcached_generate_hash(ptr, master_key, master_key_length); |
184 | 151 | is_master_key_set= true; | 151 | is_master_key_set= true; |
185 | @@ -259,7 +259,7 @@ | |||
186 | 259 | static memcached_return simple_binary_mget(memcached_st *ptr, | 259 | static memcached_return simple_binary_mget(memcached_st *ptr, |
187 | 260 | unsigned int master_server_key, | 260 | unsigned int master_server_key, |
188 | 261 | bool is_master_key_set, | 261 | bool is_master_key_set, |
190 | 262 | char **keys, size_t *key_length, | 262 | const char **keys, size_t *key_length, |
191 | 263 | unsigned int number_of_keys) | 263 | unsigned int number_of_keys) |
192 | 264 | { | 264 | { |
193 | 265 | memcached_return rc= MEMCACHED_NOTFOUND; | 265 | memcached_return rc= MEMCACHED_NOTFOUND; |
194 | @@ -360,7 +360,7 @@ | |||
195 | 360 | 360 | ||
196 | 361 | static memcached_return replication_binary_mget(memcached_st *ptr, | 361 | static memcached_return replication_binary_mget(memcached_st *ptr, |
197 | 362 | uint32_t* hash, bool* dead_servers, | 362 | uint32_t* hash, bool* dead_servers, |
199 | 363 | char **keys, size_t *key_length, | 363 | const char **keys, size_t *key_length, |
200 | 364 | unsigned int number_of_keys) | 364 | unsigned int number_of_keys) |
201 | 365 | { | 365 | { |
202 | 366 | memcached_return rc= MEMCACHED_NOTFOUND; | 366 | memcached_return rc= MEMCACHED_NOTFOUND; |
203 | @@ -459,7 +459,7 @@ | |||
204 | 459 | static memcached_return binary_mget_by_key(memcached_st *ptr, | 459 | static memcached_return binary_mget_by_key(memcached_st *ptr, |
205 | 460 | unsigned int master_server_key, | 460 | unsigned int master_server_key, |
206 | 461 | bool is_master_key_set, | 461 | bool is_master_key_set, |
208 | 462 | char **keys, size_t *key_length, | 462 | const char **keys, size_t *key_length, |
209 | 463 | unsigned int number_of_keys) | 463 | unsigned int number_of_keys) |
210 | 464 | { | 464 | { |
211 | 465 | memcached_return rc; | 465 | memcached_return rc; |
212 | 466 | 466 | ||
213 | === modified file 'libmemcached/memcached_get.h' | |||
214 | --- libmemcached/memcached_get.h 2009-07-06 17:20:04 +0000 | |||
215 | +++ libmemcached/memcached_get.h 2009-07-08 13:38:34 +0000 | |||
216 | @@ -23,7 +23,7 @@ | |||
217 | 23 | 23 | ||
218 | 24 | LIBMEMCACHED_API | 24 | LIBMEMCACHED_API |
219 | 25 | memcached_return memcached_mget(memcached_st *ptr, | 25 | memcached_return memcached_mget(memcached_st *ptr, |
221 | 26 | char **keys, size_t *key_length, | 26 | const char **keys, size_t *key_length, |
222 | 27 | unsigned int number_of_keys); | 27 | unsigned int number_of_keys); |
223 | 28 | 28 | ||
224 | 29 | LIBMEMCACHED_API | 29 | LIBMEMCACHED_API |
225 | @@ -38,7 +38,7 @@ | |||
226 | 38 | memcached_return memcached_mget_by_key(memcached_st *ptr, | 38 | memcached_return memcached_mget_by_key(memcached_st *ptr, |
227 | 39 | const char *master_key, size_t | 39 | const char *master_key, size_t |
228 | 40 | master_key_length, | 40 | master_key_length, |
230 | 41 | char **keys, | 41 | const char **keys, |
231 | 42 | size_t *key_length, | 42 | size_t *key_length, |
232 | 43 | unsigned int number_of_keys); | 43 | unsigned int number_of_keys); |
233 | 44 | 44 | ||
234 | 45 | 45 | ||
235 | === modified file 'libmemcached/memcached_key.c' | |||
236 | --- libmemcached/memcached_key.c 2009-03-21 13:09:45 +0000 | |||
237 | +++ libmemcached/memcached_key.c 2009-07-08 13:38:34 +0000 | |||
238 | @@ -1,6 +1,6 @@ | |||
239 | 1 | #include "common.h" | 1 | #include "common.h" |
240 | 2 | 2 | ||
242 | 3 | memcached_return memcached_key_test(char **keys, size_t *key_length, | 3 | memcached_return memcached_key_test(const char **keys, size_t *key_length, |
243 | 4 | unsigned int number_of_keys) | 4 | unsigned int number_of_keys) |
244 | 5 | { | 5 | { |
245 | 6 | uint32_t x; | 6 | uint32_t x; |
246 | 7 | 7 | ||
247 | === modified file 'libmemcached/memcached_result.c' | |||
248 | --- libmemcached/memcached_result.c 2009-06-10 10:29:06 +0000 | |||
249 | +++ libmemcached/memcached_result.c 2009-07-08 13:38:34 +0000 | |||
250 | @@ -40,7 +40,7 @@ | |||
251 | 40 | /* | 40 | /* |
252 | 41 | NOTE turn into macro | 41 | NOTE turn into macro |
253 | 42 | */ | 42 | */ |
255 | 43 | memcached_return memcached_result_set_value(memcached_result_st *ptr, char *value, size_t length) | 43 | memcached_return memcached_result_set_value(memcached_result_st *ptr, const char *value, size_t length) |
256 | 44 | { | 44 | { |
257 | 45 | return memcached_string_append(&ptr->value, value, length); | 45 | return memcached_string_append(&ptr->value, value, length); |
258 | 46 | } | 46 | } |
259 | 47 | 47 | ||
260 | === modified file 'libmemcached/memcached_result.h' | |||
261 | --- libmemcached/memcached_result.h 2009-07-06 17:20:04 +0000 | |||
262 | +++ libmemcached/memcached_result.h 2009-07-08 13:38:34 +0000 | |||
263 | @@ -48,7 +48,7 @@ | |||
264 | 48 | #define memcached_result_flags(A) (A)->flags | 48 | #define memcached_result_flags(A) (A)->flags |
265 | 49 | #define memcached_result_cas(A) (A)->cas | 49 | #define memcached_result_cas(A) (A)->cas |
266 | 50 | LIBMEMCACHED_API | 50 | LIBMEMCACHED_API |
268 | 51 | memcached_return memcached_result_set_value(memcached_result_st *ptr, char *value, size_t length); | 51 | memcached_return memcached_result_set_value(memcached_result_st *ptr, const char *value, size_t length); |
269 | 52 | #define memcached_result_set_flags(A,B) (A)->flags=(B) | 52 | #define memcached_result_set_flags(A,B) (A)->flags=(B) |
270 | 53 | #define memcached_result_set_expiration(A,B) (A)->expiration=(B) | 53 | #define memcached_result_set_expiration(A,B) (A)->expiration=(B) |
271 | 54 | 54 | ||
272 | 55 | 55 | ||
273 | === modified file 'libmemcached/memcached_server.c' | |||
274 | --- libmemcached/memcached_server.c 2009-06-10 10:29:06 +0000 | |||
275 | +++ libmemcached/memcached_server.c 2009-07-08 13:38:34 +0000 | |||
276 | @@ -120,7 +120,7 @@ | |||
277 | 120 | return NULL; | 120 | return NULL; |
278 | 121 | } | 121 | } |
279 | 122 | 122 | ||
281 | 123 | if ((ptr->flags & MEM_VERIFY_KEY) && (memcached_key_test((char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)) | 123 | if ((ptr->flags & MEM_VERIFY_KEY) && (memcached_key_test((const char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)) |
282 | 124 | { | 124 | { |
283 | 125 | *error= MEMCACHED_BAD_KEY_PROVIDED; | 125 | *error= MEMCACHED_BAD_KEY_PROVIDED; |
284 | 126 | return NULL; | 126 | return NULL; |
285 | 127 | 127 | ||
286 | === modified file 'libmemcached/memcached_stats.c' | |||
287 | --- libmemcached/memcached_stats.c 2009-06-14 21:24:48 +0000 | |||
288 | +++ libmemcached/memcached_stats.c 2009-07-08 13:38:34 +0000 | |||
289 | @@ -3,7 +3,7 @@ | |||
290 | 3 | 3 | ||
291 | 4 | #include "common.h" | 4 | #include "common.h" |
292 | 5 | 5 | ||
294 | 6 | static char *memcached_stat_keys[] = { | 6 | static const char *memcached_stat_keys[] = { |
295 | 7 | "pid", | 7 | "pid", |
296 | 8 | "uptime", | 8 | "uptime", |
297 | 9 | "time", | 9 | "time", |
298 | 10 | 10 | ||
299 | === modified file 'libmemcached/memcached_storage.c' | |||
300 | --- libmemcached/memcached_storage.c 2009-07-01 19:36:25 +0000 | |||
301 | +++ libmemcached/memcached_storage.c 2009-07-08 13:38:34 +0000 | |||
302 | @@ -19,7 +19,7 @@ | |||
303 | 19 | } memcached_storage_action; | 19 | } memcached_storage_action; |
304 | 20 | 20 | ||
305 | 21 | /* Inline this */ | 21 | /* Inline this */ |
307 | 22 | static char *storage_op_string(memcached_storage_action verb) | 22 | static const char *storage_op_string(memcached_storage_action verb) |
308 | 23 | { | 23 | { |
309 | 24 | switch (verb) | 24 | switch (verb) |
310 | 25 | { | 25 | { |
311 | @@ -79,7 +79,7 @@ | |||
312 | 79 | unlikely (ptr->number_of_hosts == 0) | 79 | unlikely (ptr->number_of_hosts == 0) |
313 | 80 | return MEMCACHED_NO_SERVERS; | 80 | return MEMCACHED_NO_SERVERS; |
314 | 81 | 81 | ||
316 | 82 | if ((ptr->flags & MEM_VERIFY_KEY) && (memcached_key_test((char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)) | 82 | if ((ptr->flags & MEM_VERIFY_KEY) && (memcached_key_test((const char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)) |
317 | 83 | return MEMCACHED_BAD_KEY_PROVIDED; | 83 | return MEMCACHED_BAD_KEY_PROVIDED; |
318 | 84 | 84 | ||
319 | 85 | if (ptr->flags & MEM_BINARY_PROTOCOL) | 85 | if (ptr->flags & MEM_BINARY_PROTOCOL) |
320 | 86 | 86 | ||
321 | === modified file 'libmemcached/memcached_strerror.c' | |||
322 | --- libmemcached/memcached_strerror.c 2009-06-21 00:33:44 +0000 | |||
323 | +++ libmemcached/memcached_strerror.c 2009-07-08 13:38:34 +0000 | |||
324 | @@ -1,6 +1,6 @@ | |||
325 | 1 | #include "common.h" | 1 | #include "common.h" |
326 | 2 | 2 | ||
328 | 3 | char *memcached_strerror(memcached_st *ptr __attribute__((unused)), memcached_return rc) | 3 | const char *memcached_strerror(memcached_st *ptr __attribute__((unused)), memcached_return rc) |
329 | 4 | { | 4 | { |
330 | 5 | switch (rc) | 5 | switch (rc) |
331 | 6 | { | 6 | { |
332 | 7 | 7 | ||
333 | === modified file 'libmemcached/memcached_string.c' | |||
334 | --- libmemcached/memcached_string.c 2009-06-10 10:29:06 +0000 | |||
335 | +++ libmemcached/memcached_string.c 2009-07-08 13:38:34 +0000 | |||
336 | @@ -79,7 +79,7 @@ | |||
337 | 79 | } | 79 | } |
338 | 80 | 80 | ||
339 | 81 | memcached_return memcached_string_append(memcached_string_st *string, | 81 | memcached_return memcached_string_append(memcached_string_st *string, |
341 | 82 | char *value, size_t length) | 82 | const char *value, size_t length) |
342 | 83 | { | 83 | { |
343 | 84 | memcached_return rc; | 84 | memcached_return rc; |
344 | 85 | 85 | ||
345 | 86 | 86 | ||
346 | === modified file 'libmemcached/memcached_string.h' | |||
347 | --- libmemcached/memcached_string.h 2009-07-06 17:20:04 +0000 | |||
348 | +++ libmemcached/memcached_string.h 2009-07-08 13:38:34 +0000 | |||
349 | @@ -40,7 +40,7 @@ | |||
350 | 40 | char character); | 40 | char character); |
351 | 41 | LIBMEMCACHED_API | 41 | LIBMEMCACHED_API |
352 | 42 | memcached_return memcached_string_append(memcached_string_st *string, | 42 | memcached_return memcached_string_append(memcached_string_st *string, |
354 | 43 | char *value, size_t length); | 43 | const char *value, size_t length); |
355 | 44 | LIBMEMCACHED_API | 44 | LIBMEMCACHED_API |
356 | 45 | memcached_return memcached_string_reset(memcached_string_st *string); | 45 | memcached_return memcached_string_reset(memcached_string_st *string); |
357 | 46 | LIBMEMCACHED_API | 46 | LIBMEMCACHED_API |
358 | 47 | 47 | ||
359 | === modified file 'libmemcached/memcached_version.c' | |||
360 | --- libmemcached/memcached_version.c 2009-03-09 21:59:06 +0000 | |||
361 | +++ libmemcached/memcached_version.c 2009-07-08 13:38:34 +0000 | |||
362 | @@ -26,7 +26,7 @@ | |||
363 | 26 | memcached_return rc; | 26 | memcached_return rc; |
364 | 27 | char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE]; | 27 | char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE]; |
365 | 28 | char *response_ptr; | 28 | char *response_ptr; |
367 | 29 | char *command= "version\r\n"; | 29 | const char *command= "version\r\n"; |
368 | 30 | 30 | ||
369 | 31 | send_length= strlen(command); | 31 | send_length= strlen(command); |
370 | 32 | 32 | ||
371 | 33 | 33 | ||
372 | === modified file 'm4/pandora_canonical.m4' | |||
373 | --- m4/pandora_canonical.m4 2009-07-08 23:05:36 +0000 | |||
374 | +++ m4/pandora_canonical.m4 2009-07-09 18:33:08 +0000 | |||
375 | @@ -4,7 +4,7 @@ | |||
376 | 4 | dnl with or without modifications, as long as this notice is preserved. | 4 | dnl with or without modifications, as long as this notice is preserved. |
377 | 5 | 5 | ||
378 | 6 | dnl Which version of the canonical setup we're using | 6 | dnl Which version of the canonical setup we're using |
380 | 7 | AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.3]) | 7 | AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.9]) |
381 | 8 | 8 | ||
382 | 9 | AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[ | 9 | AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[ |
383 | 10 | dnl Force dependency tracking on for Sun Studio builds | 10 | dnl Force dependency tracking on for Sun Studio builds |
384 | @@ -22,7 +22,8 @@ | |||
385 | 22 | m4_define([PCT_USE_GNULIB],[no]) | 22 | m4_define([PCT_USE_GNULIB],[no]) |
386 | 23 | m4_define([PCT_REQUIRE_CXX],[no]) | 23 | m4_define([PCT_REQUIRE_CXX],[no]) |
387 | 24 | m4_define([PCT_IGNORE_SHARED_PTR],[no]) | 24 | m4_define([PCT_IGNORE_SHARED_PTR],[no]) |
389 | 25 | m4_foreach([pct_arg],$*,[ | 25 | m4_define([PCT_FORCE_GCC42],[no]) |
390 | 26 | m4_foreach([pct_arg],[$*],[ | ||
391 | 26 | m4_case(pct_arg, | 27 | m4_case(pct_arg, |
392 | 27 | [use-gnulib], [ | 28 | [use-gnulib], [ |
393 | 28 | m4_undefine([PCT_USE_GNULIB]) | 29 | m4_undefine([PCT_USE_GNULIB]) |
394 | @@ -35,6 +36,10 @@ | |||
395 | 35 | [ignore-shared-ptr], [ | 36 | [ignore-shared-ptr], [ |
396 | 36 | m4_undefine([PCT_IGNORE_SHARED_PTR]) | 37 | m4_undefine([PCT_IGNORE_SHARED_PTR]) |
397 | 37 | m4_define([PCT_IGNORE_SHARED_PTR],[yes]) | 38 | m4_define([PCT_IGNORE_SHARED_PTR],[yes]) |
398 | 39 | ], | ||
399 | 40 | [force-gcc42], [ | ||
400 | 41 | m4_undefine([PCT_FORCE_GCC42]) | ||
401 | 42 | m4_define([PCT_FORCE_GCC42],[yes]) | ||
402 | 38 | ]) | 43 | ]) |
403 | 39 | ]) | 44 | ]) |
404 | 40 | 45 | ||
405 | @@ -53,6 +58,7 @@ | |||
406 | 53 | m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ]) | 58 | m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ]) |
407 | 54 | 59 | ||
408 | 55 | AC_REQUIRE([AC_PROG_CC]) | 60 | AC_REQUIRE([AC_PROG_CC]) |
409 | 61 | AC_REQUIRE([PANDORA_MAC_GCC42]) | ||
410 | 56 | 62 | ||
411 | 57 | dnl Once we can use a modern autoconf, we can use this | 63 | dnl Once we can use a modern autoconf, we can use this |
412 | 58 | dnl AC_PROG_CC_C99 | 64 | dnl AC_PROG_CC_C99 |
413 | @@ -61,6 +67,9 @@ | |||
414 | 61 | AM_PROG_CC_C_O | 67 | AM_PROG_CC_C_O |
415 | 62 | 68 | ||
416 | 63 | gl_USE_SYSTEM_EXTENSIONS | 69 | gl_USE_SYSTEM_EXTENSIONS |
417 | 70 | m4_if(PCT_FORCE_GCC42, [yes], [ | ||
418 | 71 | AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION) | ||
419 | 72 | ]) | ||
420 | 64 | 73 | ||
421 | 65 | 74 | ||
422 | 66 | PANDORA_LIBTOOL | 75 | PANDORA_LIBTOOL |
423 | @@ -99,15 +108,17 @@ | |||
424 | 99 | 108 | ||
425 | 100 | AC_SYS_LARGEFILE | 109 | AC_SYS_LARGEFILE |
426 | 101 | 110 | ||
427 | 111 | |||
428 | 102 | PANDORA_CHECK_C_VERSION | 112 | PANDORA_CHECK_C_VERSION |
429 | 103 | PANDORA_CHECK_CXX_VERSION | 113 | PANDORA_CHECK_CXX_VERSION |
430 | 104 | 114 | ||
431 | 105 | PANDORA_OPTIMIZE | 115 | PANDORA_OPTIMIZE |
432 | 106 | PANDORA_64BIT | 116 | PANDORA_64BIT |
433 | 117 | |||
434 | 118 | gl_VISIBILITY | ||
435 | 119 | |||
436 | 107 | PANDORA_WARNINGS(PCT_ALL_ARGS) | 120 | PANDORA_WARNINGS(PCT_ALL_ARGS) |
437 | 108 | 121 | ||
438 | 109 | gl_VISIBILITY | ||
439 | 110 | |||
440 | 111 | PANDORA_ENABLE_DTRACE | 122 | PANDORA_ENABLE_DTRACE |
441 | 112 | PANDORA_HEADER_ASSERT | 123 | PANDORA_HEADER_ASSERT |
442 | 113 | 124 | ||
443 | 114 | 125 | ||
444 | === modified file 'm4/pandora_optimize.m4' | |||
445 | --- m4/pandora_optimize.m4 2009-07-08 07:37:38 +0000 | |||
446 | +++ m4/pandora_optimize.m4 2009-07-09 18:33:08 +0000 | |||
447 | @@ -39,12 +39,15 @@ | |||
448 | 39 | CXX="${CXX} -xlang=c99" | 39 | CXX="${CXX} -xlang=c99" |
449 | 40 | 40 | ||
450 | 41 | AM_CFLAGS="-g -mt -xstrconst -Xa ${AM_CFLAGS}" | 41 | AM_CFLAGS="-g -mt -xstrconst -Xa ${AM_CFLAGS}" |
452 | 42 | AM_CXXFLAGS="-g -mt -compat=5 -library=stlport4 -template=no%extdef ${AM_CXXFLAGS}" | 42 | AM_CXXFLAGS="-mt -compat=5 -library=stlport4 -template=no%extdef ${AM_CXXFLAGS}" |
453 | 43 | |||
454 | 44 | DEBUG_CXXFLAGS="-g" | ||
455 | 43 | 45 | ||
456 | 44 | dnl TODO: Make a test for -xO4 usability here | 46 | dnl TODO: Make a test for -xO4 usability here |
457 | 45 | OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend -xbuiltin" | 47 | OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend -xbuiltin" |
458 | 46 | OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS}" | 48 | OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS}" |
460 | 47 | OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}" | 49 | OPTIMIZE_CXXFLAGS="-g0 ${OPTIMIZE_FLAGS}" |
461 | 50 | |||
462 | 48 | ]) | 51 | ]) |
463 | 49 | 52 | ||
464 | 50 | AC_ARG_WITH([debug], | 53 | AC_ARG_WITH([debug], |
465 | 51 | 54 | ||
466 | === modified file 'm4/pandora_warnings.m4' | |||
467 | --- m4/pandora_warnings.m4 2009-07-08 19:28:20 +0000 | |||
468 | +++ m4/pandora_warnings.m4 2009-07-09 05:34:19 +0000 | |||
469 | @@ -15,7 +15,7 @@ | |||
470 | 15 | m4_define([PW_WARN_ALWAYS_ON],[no]) | 15 | m4_define([PW_WARN_ALWAYS_ON],[no]) |
471 | 16 | ifdef([m4_define],,[define([m4_define], defn([define]))]) | 16 | ifdef([m4_define],,[define([m4_define], defn([define]))]) |
472 | 17 | ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))]) | 17 | ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))]) |
474 | 18 | m4_foreach([pw_arg],$*,[ | 18 | m4_foreach([pw_arg],[$*],[ |
475 | 19 | m4_case(pw_arg, | 19 | m4_case(pw_arg, |
476 | 20 | [less-warnings],[ | 20 | [less-warnings],[ |
477 | 21 | m4_undefine([PW_LESS_WARNINGS]) | 21 | m4_undefine([PW_LESS_WARNINGS]) |
478 | @@ -129,13 +129,13 @@ | |||
479 | 129 | 129 | ||
480 | 130 | m4_if(PW_LESS_WARNINGS,[no],[ | 130 | m4_if(PW_LESS_WARNINGS,[no],[ |
481 | 131 | BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing" | 131 | BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing" |
483 | 132 | CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum" | 132 | CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings" |
484 | 133 | CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast" | 133 | CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast" |
485 | 134 | ],[ | 134 | ],[ |
486 | 135 | BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}" | 135 | BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}" |
487 | 136 | ]) | 136 | ]) |
488 | 137 | 137 | ||
490 | 138 | BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow -Wstrict-aliasing ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}" | 138 | BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}" |
491 | 139 | CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}" | 139 | CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}" |
492 | 140 | CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}" | 140 | CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}" |
493 | 141 | 141 | ||
494 | 142 | 142 | ||
495 | === modified file 'tests/atomsmasher.c' | |||
496 | --- tests/atomsmasher.c 2009-07-07 21:57:24 +0000 | |||
497 | +++ tests/atomsmasher.c 2009-07-08 13:38:34 +0000 | |||
498 | @@ -156,8 +156,8 @@ | |||
499 | 156 | static test_return add_test(memcached_st *memc) | 156 | static test_return add_test(memcached_st *memc) |
500 | 157 | { | 157 | { |
501 | 158 | memcached_return rc; | 158 | memcached_return rc; |
504 | 159 | char *key= "foo"; | 159 | const char *key= "foo"; |
505 | 160 | char *value= "when we sanitize"; | 160 | const char *value= "when we sanitize"; |
506 | 161 | unsigned long long setting_value; | 161 | unsigned long long setting_value; |
507 | 162 | 162 | ||
508 | 163 | setting_value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NO_BLOCK); | 163 | setting_value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NO_BLOCK); |
509 | 164 | 164 | ||
510 | === modified file 'tests/function.c' | |||
511 | --- tests/function.c 2009-07-06 17:20:04 +0000 | |||
512 | +++ tests/function.c 2009-07-08 13:38:34 +0000 | |||
513 | @@ -38,7 +38,7 @@ | |||
514 | 38 | static uint32_t global_count; | 38 | static uint32_t global_count; |
515 | 39 | 39 | ||
516 | 40 | static pairs_st *global_pairs; | 40 | static pairs_st *global_pairs; |
518 | 41 | static char *global_keys[GLOBAL_COUNT]; | 41 | static const char *global_keys[GLOBAL_COUNT]; |
519 | 42 | static size_t global_keys_length[GLOBAL_COUNT]; | 42 | static size_t global_keys_length[GLOBAL_COUNT]; |
520 | 43 | 43 | ||
521 | 44 | static test_return init_test(memcached_st *not_used __attribute__((unused))) | 44 | static test_return init_test(memcached_st *not_used __attribute__((unused))) |
522 | @@ -299,8 +299,8 @@ | |||
523 | 299 | static test_return set_test(memcached_st *memc) | 299 | static test_return set_test(memcached_st *memc) |
524 | 300 | { | 300 | { |
525 | 301 | memcached_return rc; | 301 | memcached_return rc; |
528 | 302 | char *key= "foo"; | 302 | const char *key= "foo"; |
529 | 303 | char *value= "when we sanitize"; | 303 | const char *value= "when we sanitize"; |
530 | 304 | 304 | ||
531 | 305 | rc= memcached_set(memc, key, strlen(key), | 305 | rc= memcached_set(memc, key, strlen(key), |
532 | 306 | value, strlen(value), | 306 | value, strlen(value), |
533 | @@ -313,8 +313,9 @@ | |||
534 | 313 | static test_return append_test(memcached_st *memc) | 313 | static test_return append_test(memcached_st *memc) |
535 | 314 | { | 314 | { |
536 | 315 | memcached_return rc; | 315 | memcached_return rc; |
539 | 316 | char *key= "fig"; | 316 | const char *key= "fig"; |
540 | 317 | char *value= "we"; | 317 | const char *in_value= "we"; |
541 | 318 | char *out_value= NULL; | ||
542 | 318 | size_t value_length; | 319 | size_t value_length; |
543 | 319 | uint32_t flags; | 320 | uint32_t flags; |
544 | 320 | 321 | ||
545 | @@ -322,7 +323,7 @@ | |||
546 | 322 | assert(rc == MEMCACHED_SUCCESS); | 323 | assert(rc == MEMCACHED_SUCCESS); |
547 | 323 | 324 | ||
548 | 324 | rc= memcached_set(memc, key, strlen(key), | 325 | rc= memcached_set(memc, key, strlen(key), |
550 | 325 | value, strlen(value), | 326 | in_value, strlen(in_value), |
551 | 326 | (time_t)0, (uint32_t)0); | 327 | (time_t)0, (uint32_t)0); |
552 | 327 | assert(rc == MEMCACHED_SUCCESS); | 328 | assert(rc == MEMCACHED_SUCCESS); |
553 | 328 | 329 | ||
554 | @@ -336,12 +337,12 @@ | |||
555 | 336 | (time_t)0, (uint32_t)0); | 337 | (time_t)0, (uint32_t)0); |
556 | 337 | assert(rc == MEMCACHED_SUCCESS); | 338 | assert(rc == MEMCACHED_SUCCESS); |
557 | 338 | 339 | ||
559 | 339 | value= memcached_get(memc, key, strlen(key), | 340 | out_value= memcached_get(memc, key, strlen(key), |
560 | 340 | &value_length, &flags, &rc); | 341 | &value_length, &flags, &rc); |
562 | 341 | assert(!memcmp(value, "we the people", strlen("we the people"))); | 342 | assert(!memcmp(out_value, "we the people", strlen("we the people"))); |
563 | 342 | assert(strlen("we the people") == value_length); | 343 | assert(strlen("we the people") == value_length); |
564 | 343 | assert(rc == MEMCACHED_SUCCESS); | 344 | assert(rc == MEMCACHED_SUCCESS); |
566 | 344 | free(value); | 345 | free(out_value); |
567 | 345 | 346 | ||
568 | 346 | return 0; | 347 | return 0; |
569 | 347 | } | 348 | } |
570 | @@ -349,7 +350,7 @@ | |||
571 | 349 | static test_return append_binary_test(memcached_st *memc) | 350 | static test_return append_binary_test(memcached_st *memc) |
572 | 350 | { | 351 | { |
573 | 351 | memcached_return rc; | 352 | memcached_return rc; |
575 | 352 | char *key= "numbers"; | 353 | const char *key= "numbers"; |
576 | 353 | unsigned int *store_ptr; | 354 | unsigned int *store_ptr; |
577 | 354 | unsigned int store_list[] = { 23, 56, 499, 98, 32847, 0 }; | 355 | unsigned int store_list[] = { 23, 56, 499, 98, 32847, 0 }; |
578 | 355 | char *value; | 356 | char *value; |
579 | @@ -395,9 +396,9 @@ | |||
580 | 395 | static test_return cas2_test(memcached_st *memc) | 396 | static test_return cas2_test(memcached_st *memc) |
581 | 396 | { | 397 | { |
582 | 397 | memcached_return rc; | 398 | memcached_return rc; |
584 | 398 | char *keys[]= {"fudge", "son", "food"}; | 399 | const char *keys[]= {"fudge", "son", "food"}; |
585 | 399 | size_t key_length[]= {5, 3, 4}; | 400 | size_t key_length[]= {5, 3, 4}; |
587 | 400 | char *value= "we the people"; | 401 | const char *value= "we the people"; |
588 | 401 | size_t value_length= strlen("we the people"); | 402 | size_t value_length= strlen("we the people"); |
589 | 402 | unsigned int x; | 403 | unsigned int x; |
590 | 403 | memcached_result_st results_obj; | 404 | memcached_result_st results_obj; |
591 | @@ -442,7 +443,7 @@ | |||
592 | 442 | const char *key= "fun"; | 443 | const char *key= "fun"; |
593 | 443 | size_t key_length= strlen(key); | 444 | size_t key_length= strlen(key); |
594 | 444 | const char *value= "we the people"; | 445 | const char *value= "we the people"; |
596 | 445 | char* keys[2] = { (char*)key, NULL }; | 446 | const char* keys[2] = { key, NULL }; |
597 | 446 | size_t keylengths[2] = { strlen(key), 0 }; | 447 | size_t keylengths[2] = { strlen(key), 0 }; |
598 | 447 | size_t value_length= strlen(value); | 448 | size_t value_length= strlen(value); |
599 | 448 | const char *value2= "change the value"; | 449 | const char *value2= "change the value"; |
600 | @@ -499,8 +500,9 @@ | |||
601 | 499 | static test_return prepend_test(memcached_st *memc) | 500 | static test_return prepend_test(memcached_st *memc) |
602 | 500 | { | 501 | { |
603 | 501 | memcached_return rc; | 502 | memcached_return rc; |
606 | 502 | char *key= "fig"; | 503 | const char *key= "fig"; |
607 | 503 | char *value= "people"; | 504 | const char *value= "people"; |
608 | 505 | char *out_value= NULL; | ||
609 | 504 | size_t value_length; | 506 | size_t value_length; |
610 | 505 | uint32_t flags; | 507 | uint32_t flags; |
611 | 506 | 508 | ||
612 | @@ -522,12 +524,12 @@ | |||
613 | 522 | (time_t)0, (uint32_t)0); | 524 | (time_t)0, (uint32_t)0); |
614 | 523 | assert(rc == MEMCACHED_SUCCESS); | 525 | assert(rc == MEMCACHED_SUCCESS); |
615 | 524 | 526 | ||
617 | 525 | value= memcached_get(memc, key, strlen(key), | 527 | out_value= memcached_get(memc, key, strlen(key), |
618 | 526 | &value_length, &flags, &rc); | 528 | &value_length, &flags, &rc); |
620 | 527 | assert(!memcmp(value, "we the people", strlen("we the people"))); | 529 | assert(!memcmp(out_value, "we the people", strlen("we the people"))); |
621 | 528 | assert(strlen("we the people") == value_length); | 530 | assert(strlen("we the people") == value_length); |
622 | 529 | assert(rc == MEMCACHED_SUCCESS); | 531 | assert(rc == MEMCACHED_SUCCESS); |
624 | 530 | free(value); | 532 | free(out_value); |
625 | 531 | 533 | ||
626 | 532 | return 0; | 534 | return 0; |
627 | 533 | } | 535 | } |
628 | @@ -539,8 +541,8 @@ | |||
629 | 539 | static test_return add_test(memcached_st *memc) | 541 | static test_return add_test(memcached_st *memc) |
630 | 540 | { | 542 | { |
631 | 541 | memcached_return rc; | 543 | memcached_return rc; |
634 | 542 | char *key= "foo"; | 544 | const char *key= "foo"; |
635 | 543 | char *value= "when we sanitize"; | 545 | const char *value= "when we sanitize"; |
636 | 544 | unsigned long long setting_value; | 546 | unsigned long long setting_value; |
637 | 545 | 547 | ||
638 | 546 | setting_value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NO_BLOCK); | 548 | setting_value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NO_BLOCK); |
639 | @@ -587,9 +589,9 @@ | |||
640 | 587 | static test_return replace_test(memcached_st *memc) | 589 | static test_return replace_test(memcached_st *memc) |
641 | 588 | { | 590 | { |
642 | 589 | memcached_return rc; | 591 | memcached_return rc; |
646 | 590 | char *key= "foo"; | 592 | const char *key= "foo"; |
647 | 591 | char *value= "when we sanitize"; | 593 | const char *value= "when we sanitize"; |
648 | 592 | char *original= "first we insert some data"; | 594 | const char *original= "first we insert some data"; |
649 | 593 | 595 | ||
650 | 594 | rc= memcached_set(memc, key, strlen(key), | 596 | rc= memcached_set(memc, key, strlen(key), |
651 | 595 | original, strlen(original), | 597 | original, strlen(original), |
652 | @@ -607,8 +609,8 @@ | |||
653 | 607 | static test_return delete_test(memcached_st *memc) | 609 | static test_return delete_test(memcached_st *memc) |
654 | 608 | { | 610 | { |
655 | 609 | memcached_return rc; | 611 | memcached_return rc; |
658 | 610 | char *key= "foo"; | 612 | const char *key= "foo"; |
659 | 611 | char *value= "when we sanitize"; | 613 | const char *value= "when we sanitize"; |
660 | 612 | 614 | ||
661 | 613 | rc= memcached_set(memc, key, strlen(key), | 615 | rc= memcached_set(memc, key, strlen(key), |
662 | 614 | value, strlen(value), | 616 | value, strlen(value), |
663 | @@ -642,19 +644,19 @@ | |||
664 | 642 | 644 | ||
665 | 643 | static test_return memcached_server_cursor_test(memcached_st *memc) | 645 | static test_return memcached_server_cursor_test(memcached_st *memc) |
666 | 644 | { | 646 | { |
668 | 645 | char *context= "foo bad"; | 647 | char context[8]; |
669 | 648 | strcpy(context, "foo bad"); | ||
670 | 646 | memcached_server_function callbacks[1]; | 649 | memcached_server_function callbacks[1]; |
671 | 647 | 650 | ||
672 | 648 | callbacks[0]= server_function; | 651 | callbacks[0]= server_function; |
673 | 649 | memcached_server_cursor(memc, callbacks, context, 1); | 652 | memcached_server_cursor(memc, callbacks, context, 1); |
674 | 650 | |||
675 | 651 | return 0; | 653 | return 0; |
676 | 652 | } | 654 | } |
677 | 653 | 655 | ||
678 | 654 | static test_return bad_key_test(memcached_st *memc) | 656 | static test_return bad_key_test(memcached_st *memc) |
679 | 655 | { | 657 | { |
680 | 656 | memcached_return rc; | 658 | memcached_return rc; |
682 | 657 | char *key= "foo bad"; | 659 | const char *key= "foo bad"; |
683 | 658 | char *string; | 660 | char *string; |
684 | 659 | size_t string_length; | 661 | size_t string_length; |
685 | 660 | uint32_t flags; | 662 | uint32_t flags; |
686 | @@ -687,7 +689,7 @@ | |||
687 | 687 | assert(!string); | 689 | assert(!string); |
688 | 688 | 690 | ||
689 | 689 | /* Test multi key for bad keys */ | 691 | /* Test multi key for bad keys */ |
691 | 690 | char *keys[] = { "GoodKey", "Bad Key", "NotMine" }; | 692 | const char *keys[] = { "GoodKey", "Bad Key", "NotMine" }; |
692 | 691 | size_t key_lengths[] = { 7, 7, 7 }; | 693 | size_t key_lengths[] = { 7, 7, 7 }; |
693 | 692 | set= 1; | 694 | set= 1; |
694 | 693 | rc= memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set); | 695 | rc= memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set); |
695 | @@ -756,7 +758,7 @@ | |||
696 | 756 | static test_return read_through(memcached_st *memc) | 758 | static test_return read_through(memcached_st *memc) |
697 | 757 | { | 759 | { |
698 | 758 | memcached_return rc; | 760 | memcached_return rc; |
700 | 759 | char *key= "foo"; | 761 | const char *key= "foo"; |
701 | 760 | char *string; | 762 | char *string; |
702 | 761 | size_t string_length; | 763 | size_t string_length; |
703 | 762 | uint32_t flags; | 764 | uint32_t flags; |
704 | @@ -817,7 +819,7 @@ | |||
705 | 817 | static test_return get_test(memcached_st *memc) | 819 | static test_return get_test(memcached_st *memc) |
706 | 818 | { | 820 | { |
707 | 819 | memcached_return rc; | 821 | memcached_return rc; |
709 | 820 | char *key= "foo"; | 822 | const char *key= "foo"; |
710 | 821 | char *string; | 823 | char *string; |
711 | 822 | size_t string_length; | 824 | size_t string_length; |
712 | 823 | uint32_t flags; | 825 | uint32_t flags; |
713 | @@ -838,8 +840,8 @@ | |||
714 | 838 | static test_return get_test2(memcached_st *memc) | 840 | static test_return get_test2(memcached_st *memc) |
715 | 839 | { | 841 | { |
716 | 840 | memcached_return rc; | 842 | memcached_return rc; |
719 | 841 | char *key= "foo"; | 843 | const char *key= "foo"; |
720 | 842 | char *value= "when we sanitize"; | 844 | const char *value= "when we sanitize"; |
721 | 843 | char *string; | 845 | char *string; |
722 | 844 | size_t string_length; | 846 | size_t string_length; |
723 | 845 | uint32_t flags; | 847 | uint32_t flags; |
724 | @@ -865,8 +867,8 @@ | |||
725 | 865 | static test_return set_test2(memcached_st *memc) | 867 | static test_return set_test2(memcached_st *memc) |
726 | 866 | { | 868 | { |
727 | 867 | memcached_return rc; | 869 | memcached_return rc; |
730 | 868 | char *key= "foo"; | 870 | const char *key= "foo"; |
731 | 869 | char *value= "train in the brain"; | 871 | const char *value= "train in the brain"; |
732 | 870 | size_t value_length= strlen(value); | 872 | size_t value_length= strlen(value); |
733 | 871 | unsigned int x; | 873 | unsigned int x; |
734 | 872 | 874 | ||
735 | @@ -915,7 +917,7 @@ | |||
736 | 915 | static test_return get_test3(memcached_st *memc) | 917 | static test_return get_test3(memcached_st *memc) |
737 | 916 | { | 918 | { |
738 | 917 | memcached_return rc; | 919 | memcached_return rc; |
740 | 918 | char *key= "foo"; | 920 | const char *key= "foo"; |
741 | 919 | char *value; | 921 | char *value; |
742 | 920 | size_t value_length= 8191; | 922 | size_t value_length= 8191; |
743 | 921 | char *string; | 923 | char *string; |
744 | @@ -951,7 +953,7 @@ | |||
745 | 951 | static test_return get_test4(memcached_st *memc) | 953 | static test_return get_test4(memcached_st *memc) |
746 | 952 | { | 954 | { |
747 | 953 | memcached_return rc; | 955 | memcached_return rc; |
749 | 954 | char *key= "foo"; | 956 | const char *key= "foo"; |
750 | 955 | char *value; | 957 | char *value; |
751 | 956 | size_t value_length= 8191; | 958 | size_t value_length= 8191; |
752 | 957 | char *string; | 959 | char *string; |
753 | @@ -998,7 +1000,7 @@ | |||
754 | 998 | ** Request the same key twice, to ensure that we hash to the same server | 1000 | ** Request the same key twice, to ensure that we hash to the same server |
755 | 999 | ** (so that we have multiple response values queued up) ;-) | 1001 | ** (so that we have multiple response values queued up) ;-) |
756 | 1000 | */ | 1002 | */ |
758 | 1001 | char *keys[]= { "key", "key" }; | 1003 | const char *keys[]= { "key", "key" }; |
759 | 1002 | size_t lengths[]= { 3, 3 }; | 1004 | size_t lengths[]= { 3, 3 }; |
760 | 1003 | uint32_t flags; | 1005 | uint32_t flags; |
761 | 1004 | size_t rlen; | 1006 | size_t rlen; |
762 | @@ -1048,8 +1050,8 @@ | |||
763 | 1048 | { | 1050 | { |
764 | 1049 | uint64_t new_number; | 1051 | uint64_t new_number; |
765 | 1050 | memcached_return rc; | 1052 | memcached_return rc; |
768 | 1051 | char *key= "number"; | 1053 | const char *key= "number"; |
769 | 1052 | char *value= "0"; | 1054 | const char *value= "0"; |
770 | 1053 | 1055 | ||
771 | 1054 | rc= memcached_set(memc, key, strlen(key), | 1056 | rc= memcached_set(memc, key, strlen(key), |
772 | 1055 | value, strlen(value), | 1057 | value, strlen(value), |
773 | @@ -1075,7 +1077,7 @@ | |||
774 | 1075 | { | 1077 | { |
775 | 1076 | uint64_t new_number; | 1078 | uint64_t new_number; |
776 | 1077 | memcached_return rc; | 1079 | memcached_return rc; |
778 | 1078 | char *key= "number"; | 1080 | const char *key= "number"; |
779 | 1079 | uint64_t initial= 0; | 1081 | uint64_t initial= 0; |
780 | 1080 | 1082 | ||
781 | 1081 | rc= memcached_increment_with_initial(memc, key, strlen(key), | 1083 | rc= memcached_increment_with_initial(memc, key, strlen(key), |
782 | @@ -1095,8 +1097,8 @@ | |||
783 | 1095 | { | 1097 | { |
784 | 1096 | uint64_t new_number; | 1098 | uint64_t new_number; |
785 | 1097 | memcached_return rc; | 1099 | memcached_return rc; |
788 | 1098 | char *key= "number"; | 1100 | const char *key= "number"; |
789 | 1099 | char *value= "3"; | 1101 | const char *value= "3"; |
790 | 1100 | 1102 | ||
791 | 1101 | rc= memcached_set(memc, key, strlen(key), | 1103 | rc= memcached_set(memc, key, strlen(key), |
792 | 1102 | value, strlen(value), | 1104 | value, strlen(value), |
793 | @@ -1122,7 +1124,7 @@ | |||
794 | 1122 | { | 1124 | { |
795 | 1123 | uint64_t new_number; | 1125 | uint64_t new_number; |
796 | 1124 | memcached_return rc; | 1126 | memcached_return rc; |
798 | 1125 | char *key= "number"; | 1127 | const char *key= "number"; |
799 | 1126 | uint64_t initial= 3; | 1128 | uint64_t initial= 3; |
800 | 1127 | 1129 | ||
801 | 1128 | rc= memcached_decrement_with_initial(memc, key, strlen(key), | 1130 | rc= memcached_decrement_with_initial(memc, key, strlen(key), |
802 | @@ -1141,8 +1143,8 @@ | |||
803 | 1141 | static test_return quit_test(memcached_st *memc) | 1143 | static test_return quit_test(memcached_st *memc) |
804 | 1142 | { | 1144 | { |
805 | 1143 | memcached_return rc; | 1145 | memcached_return rc; |
808 | 1144 | char *key= "fudge"; | 1146 | const char *key= "fudge"; |
809 | 1145 | char *value= "sanford and sun"; | 1147 | const char *value= "sanford and sun"; |
810 | 1146 | 1148 | ||
811 | 1147 | rc= memcached_set(memc, key, strlen(key), | 1149 | rc= memcached_set(memc, key, strlen(key), |
812 | 1148 | value, strlen(value), | 1150 | value, strlen(value), |
813 | @@ -1161,7 +1163,7 @@ | |||
814 | 1161 | static test_return mget_result_test(memcached_st *memc) | 1163 | static test_return mget_result_test(memcached_st *memc) |
815 | 1162 | { | 1164 | { |
816 | 1163 | memcached_return rc; | 1165 | memcached_return rc; |
818 | 1164 | char *keys[]= {"fudge", "son", "food"}; | 1166 | const char *keys[]= {"fudge", "son", "food"}; |
819 | 1165 | size_t key_length[]= {5, 3, 4}; | 1167 | size_t key_length[]= {5, 3, 4}; |
820 | 1166 | unsigned int x; | 1168 | unsigned int x; |
821 | 1167 | 1169 | ||
822 | @@ -1218,7 +1220,7 @@ | |||
823 | 1218 | static test_return mget_result_alloc_test(memcached_st *memc) | 1220 | static test_return mget_result_alloc_test(memcached_st *memc) |
824 | 1219 | { | 1221 | { |
825 | 1220 | memcached_return rc; | 1222 | memcached_return rc; |
827 | 1221 | char *keys[]= {"fudge", "son", "food"}; | 1223 | const char *keys[]= {"fudge", "son", "food"}; |
828 | 1222 | size_t key_length[]= {5, 3, 4}; | 1224 | size_t key_length[]= {5, 3, 4}; |
829 | 1223 | unsigned int x; | 1225 | unsigned int x; |
830 | 1224 | 1226 | ||
831 | @@ -1280,7 +1282,7 @@ | |||
832 | 1280 | static test_return mget_result_function(memcached_st *memc) | 1282 | static test_return mget_result_function(memcached_st *memc) |
833 | 1281 | { | 1283 | { |
834 | 1282 | memcached_return rc; | 1284 | memcached_return rc; |
836 | 1283 | char *keys[]= {"fudge", "son", "food"}; | 1285 | const char *keys[]= {"fudge", "son", "food"}; |
837 | 1284 | size_t key_length[]= {5, 3, 4}; | 1286 | size_t key_length[]= {5, 3, 4}; |
838 | 1285 | unsigned int x; | 1287 | unsigned int x; |
839 | 1286 | unsigned int counter; | 1288 | unsigned int counter; |
840 | @@ -1311,7 +1313,7 @@ | |||
841 | 1311 | static test_return mget_test(memcached_st *memc) | 1313 | static test_return mget_test(memcached_st *memc) |
842 | 1312 | { | 1314 | { |
843 | 1313 | memcached_return rc; | 1315 | memcached_return rc; |
845 | 1314 | char *keys[]= {"fudge", "son", "food"}; | 1316 | const char *keys[]= {"fudge", "son", "food"}; |
846 | 1315 | size_t key_length[]= {5, 3, 4}; | 1317 | size_t key_length[]= {5, 3, 4}; |
847 | 1316 | unsigned int x; | 1318 | unsigned int x; |
848 | 1317 | uint32_t flags; | 1319 | uint32_t flags; |
849 | @@ -1695,7 +1697,7 @@ | |||
850 | 1695 | key_lengths[x]= strlen(keys[x]); | 1697 | key_lengths[x]= strlen(keys[x]); |
851 | 1696 | } | 1698 | } |
852 | 1697 | 1699 | ||
854 | 1698 | rc= memcached_mget(memc, keys, key_lengths, KEY_COUNT); | 1700 | rc= memcached_mget(memc, (const char **)keys, key_lengths, KEY_COUNT); |
855 | 1699 | assert(rc == MEMCACHED_SUCCESS); | 1701 | assert(rc == MEMCACHED_SUCCESS); |
856 | 1700 | 1702 | ||
857 | 1701 | /* Turn this into a help function */ | 1703 | /* Turn this into a help function */ |
858 | @@ -1726,7 +1728,7 @@ | |||
859 | 1726 | static test_return user_supplied_bug4(memcached_st *memc) | 1728 | static test_return user_supplied_bug4(memcached_st *memc) |
860 | 1727 | { | 1729 | { |
861 | 1728 | memcached_return rc; | 1730 | memcached_return rc; |
863 | 1729 | char *keys[]= {"fudge", "son", "food"}; | 1731 | const char *keys[]= {"fudge", "son", "food"}; |
864 | 1730 | size_t key_length[]= {5, 3, 4}; | 1732 | size_t key_length[]= {5, 3, 4}; |
865 | 1731 | unsigned int x; | 1733 | unsigned int x; |
866 | 1732 | uint32_t flags; | 1734 | uint32_t flags; |
867 | @@ -1789,7 +1791,7 @@ | |||
868 | 1789 | static test_return user_supplied_bug5(memcached_st *memc) | 1791 | static test_return user_supplied_bug5(memcached_st *memc) |
869 | 1790 | { | 1792 | { |
870 | 1791 | memcached_return rc; | 1793 | memcached_return rc; |
872 | 1792 | char *keys[]= {"036790384900", "036790384902", "036790384904", "036790384906"}; | 1794 | const char *keys[]= {"036790384900", "036790384902", "036790384904", "036790384906"}; |
873 | 1793 | size_t key_length[]= {strlen("036790384900"), strlen("036790384902"), strlen("036790384904"), strlen("036790384906")}; | 1795 | size_t key_length[]= {strlen("036790384900"), strlen("036790384902"), strlen("036790384904"), strlen("036790384906")}; |
874 | 1794 | char return_key[MEMCACHED_MAX_KEY]; | 1796 | char return_key[MEMCACHED_MAX_KEY]; |
875 | 1795 | size_t return_key_length; | 1797 | size_t return_key_length; |
876 | @@ -1847,7 +1849,7 @@ | |||
877 | 1847 | static test_return user_supplied_bug6(memcached_st *memc) | 1849 | static test_return user_supplied_bug6(memcached_st *memc) |
878 | 1848 | { | 1850 | { |
879 | 1849 | memcached_return rc; | 1851 | memcached_return rc; |
881 | 1850 | char *keys[]= {"036790384900", "036790384902", "036790384904", "036790384906"}; | 1852 | const char *keys[]= {"036790384900", "036790384902", "036790384904", "036790384906"}; |
882 | 1851 | size_t key_length[]= {strlen("036790384900"), strlen("036790384902"), strlen("036790384904"), strlen("036790384906")}; | 1853 | size_t key_length[]= {strlen("036790384900"), strlen("036790384902"), strlen("036790384904"), strlen("036790384906")}; |
883 | 1852 | char return_key[MEMCACHED_MAX_KEY]; | 1854 | char return_key[MEMCACHED_MAX_KEY]; |
884 | 1853 | size_t return_key_length; | 1855 | size_t return_key_length; |
885 | @@ -1916,7 +1918,7 @@ | |||
886 | 1916 | memcached_st *memc_clone; | 1918 | memcached_st *memc_clone; |
887 | 1917 | 1919 | ||
888 | 1918 | memcached_server_st *servers; | 1920 | memcached_server_st *servers; |
890 | 1919 | char *server_list= "memcache1.memcache.bk.sapo.pt:11211, memcache1.memcache.bk.sapo.pt:11212, memcache1.memcache.bk.sapo.pt:11213, memcache1.memcache.bk.sapo.pt:11214, memcache2.memcache.bk.sapo.pt:11211, memcache2.memcache.bk.sapo.pt:11212, memcache2.memcache.bk.sapo.pt:11213, memcache2.memcache.bk.sapo.pt:11214"; | 1921 | const char *server_list= "memcache1.memcache.bk.sapo.pt:11211, memcache1.memcache.bk.sapo.pt:11212, memcache1.memcache.bk.sapo.pt:11213, memcache1.memcache.bk.sapo.pt:11214, memcache2.memcache.bk.sapo.pt:11211, memcache2.memcache.bk.sapo.pt:11212, memcache2.memcache.bk.sapo.pt:11213, memcache2.memcache.bk.sapo.pt:11214"; |
891 | 1920 | 1922 | ||
892 | 1921 | servers= memcached_servers_parse(server_list); | 1923 | servers= memcached_servers_parse(server_list); |
893 | 1922 | assert(servers); | 1924 | assert(servers); |
894 | @@ -1943,8 +1945,8 @@ | |||
895 | 1943 | static test_return user_supplied_bug7(memcached_st *memc) | 1945 | static test_return user_supplied_bug7(memcached_st *memc) |
896 | 1944 | { | 1946 | { |
897 | 1945 | memcached_return rc; | 1947 | memcached_return rc; |
900 | 1946 | char *keys= "036790384900"; | 1948 | const char *keys= "036790384900"; |
901 | 1947 | size_t key_length= strlen("036790384900"); | 1949 | size_t key_length= strlen(keys); |
902 | 1948 | char return_key[MEMCACHED_MAX_KEY]; | 1950 | char return_key[MEMCACHED_MAX_KEY]; |
903 | 1949 | size_t return_key_length; | 1951 | size_t return_key_length; |
904 | 1950 | char *value; | 1952 | char *value; |
905 | @@ -1987,7 +1989,7 @@ | |||
906 | 1987 | static test_return user_supplied_bug9(memcached_st *memc) | 1989 | static test_return user_supplied_bug9(memcached_st *memc) |
907 | 1988 | { | 1990 | { |
908 | 1989 | memcached_return rc; | 1991 | memcached_return rc; |
910 | 1990 | char *keys[]= {"UDATA:edevil@sapo.pt", "fudge&*@#", "for^#@&$not"}; | 1992 | const char *keys[]= {"UDATA:edevil@sapo.pt", "fudge&*@#", "for^#@&$not"}; |
911 | 1991 | size_t key_length[3]; | 1993 | size_t key_length[3]; |
912 | 1992 | unsigned int x; | 1994 | unsigned int x; |
913 | 1993 | uint32_t flags; | 1995 | uint32_t flags; |
914 | @@ -2031,7 +2033,7 @@ | |||
915 | 2031 | /* We are testing with aggressive timeout to get failures */ | 2033 | /* We are testing with aggressive timeout to get failures */ |
916 | 2032 | static test_return user_supplied_bug10(memcached_st *memc) | 2034 | static test_return user_supplied_bug10(memcached_st *memc) |
917 | 2033 | { | 2035 | { |
919 | 2034 | char *key= "foo"; | 2036 | const char *key= "foo"; |
920 | 2035 | char *value; | 2037 | char *value; |
921 | 2036 | size_t value_length= 512; | 2038 | size_t value_length= 512; |
922 | 2037 | unsigned int x; | 2039 | unsigned int x; |
923 | @@ -2074,7 +2076,7 @@ | |||
924 | 2074 | */ | 2076 | */ |
925 | 2075 | static test_return user_supplied_bug11(memcached_st *memc) | 2077 | static test_return user_supplied_bug11(memcached_st *memc) |
926 | 2076 | { | 2078 | { |
928 | 2077 | char *key= "foo"; | 2079 | const char *key= "foo"; |
929 | 2078 | char *value; | 2080 | char *value; |
930 | 2079 | size_t value_length= 512; | 2081 | size_t value_length= 512; |
931 | 2080 | unsigned int x; | 2082 | unsigned int x; |
932 | @@ -2199,7 +2201,7 @@ | |||
933 | 2199 | size_t setter= 1; | 2201 | size_t setter= 1; |
934 | 2200 | memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, setter); | 2202 | memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, setter); |
935 | 2201 | memcached_return rc; | 2203 | memcached_return rc; |
937 | 2202 | char *key= "foo"; | 2204 | const char *key= "foo"; |
938 | 2203 | char *value; | 2205 | char *value; |
939 | 2204 | size_t value_length= 18000; | 2206 | size_t value_length= 18000; |
940 | 2205 | char *string; | 2207 | char *string; |
941 | @@ -2243,7 +2245,7 @@ | |||
942 | 2243 | { | 2245 | { |
943 | 2244 | uint32_t x; | 2246 | uint32_t x; |
944 | 2245 | memcached_return rc; | 2247 | memcached_return rc; |
946 | 2246 | char *key= "mykey"; | 2248 | const char *key= "mykey"; |
947 | 2247 | char *value; | 2249 | char *value; |
948 | 2248 | size_t length; | 2250 | size_t length; |
949 | 2249 | uint32_t flags; | 2251 | uint32_t flags; |
950 | @@ -2280,7 +2282,7 @@ | |||
951 | 2280 | static test_return user_supplied_bug16(memcached_st *memc) | 2282 | static test_return user_supplied_bug16(memcached_st *memc) |
952 | 2281 | { | 2283 | { |
953 | 2282 | memcached_return rc; | 2284 | memcached_return rc; |
955 | 2283 | char *key= "mykey"; | 2285 | const char *key= "mykey"; |
956 | 2284 | char *value; | 2286 | char *value; |
957 | 2285 | size_t length; | 2287 | size_t length; |
958 | 2286 | uint32_t flags; | 2288 | uint32_t flags; |
959 | @@ -2306,8 +2308,8 @@ | |||
960 | 2306 | static test_return user_supplied_bug17(memcached_st *memc) | 2308 | static test_return user_supplied_bug17(memcached_st *memc) |
961 | 2307 | { | 2309 | { |
962 | 2308 | memcached_return rc; | 2310 | memcached_return rc; |
965 | 2309 | char *key= "豆瓣"; | 2311 | const char *key= "豆瓣"; |
966 | 2310 | char *value="我们在炎热抑郁的夏天无法停止豆瓣"; | 2312 | const char *value="我们在炎热抑郁的夏天无法停止豆瓣"; |
967 | 2311 | char *value2; | 2313 | char *value2; |
968 | 2312 | size_t length; | 2314 | size_t length; |
969 | 2313 | uint32_t flags; | 2315 | uint32_t flags; |
970 | @@ -2358,9 +2360,9 @@ | |||
971 | 2358 | { | 2360 | { |
972 | 2359 | memcached_return status; | 2361 | memcached_return status; |
973 | 2360 | memcached_result_st *result, result_obj; | 2362 | memcached_result_st *result, result_obj; |
975 | 2361 | char *key = "abc"; | 2363 | const char *key = "abc"; |
976 | 2362 | size_t key_len = strlen("abc"); | 2364 | size_t key_len = strlen("abc"); |
978 | 2363 | char *value = "foobar"; | 2365 | const char *value = "foobar"; |
979 | 2364 | size_t value_len = strlen(value); | 2366 | size_t value_len = strlen(value); |
980 | 2365 | 2367 | ||
981 | 2366 | memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, 1); | 2368 | memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, 1); |
982 | @@ -3139,7 +3141,9 @@ | |||
983 | 3139 | 3141 | ||
984 | 3140 | /* Set to Zero, and then Set to something too large */ | 3142 | /* Set to Zero, and then Set to something too large */ |
985 | 3141 | { | 3143 | { |
987 | 3142 | char *long_key; | 3144 | char long_key[255]; |
988 | 3145 | memset(long_key, 0, 255); | ||
989 | 3146 | |||
990 | 3143 | rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, NULL); | 3147 | rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, NULL); |
991 | 3144 | assert(rc == MEMCACHED_SUCCESS); | 3148 | assert(rc == MEMCACHED_SUCCESS); |
992 | 3145 | 3149 | ||
993 | @@ -3149,13 +3153,13 @@ | |||
994 | 3149 | 3153 | ||
995 | 3150 | /* Test a long key for failure */ | 3154 | /* Test a long key for failure */ |
996 | 3151 | /* TODO, extend test to determine based on setting, what result should be */ | 3155 | /* TODO, extend test to determine based on setting, what result should be */ |
998 | 3152 | long_key= "Thisismorethentheallottednumberofcharacters"; | 3156 | strcpy(long_key, "Thisismorethentheallottednumberofcharacters"); |
999 | 3153 | rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, long_key); | 3157 | rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, long_key); |
1000 | 3154 | //assert(rc == MEMCACHED_BAD_KEY_PROVIDED); | 3158 | //assert(rc == MEMCACHED_BAD_KEY_PROVIDED); |
1001 | 3155 | assert(rc == MEMCACHED_SUCCESS); | 3159 | assert(rc == MEMCACHED_SUCCESS); |
1002 | 3156 | 3160 | ||
1003 | 3157 | /* Now test a key with spaces (which will fail from long key, since bad key is not set) */ | 3161 | /* Now test a key with spaces (which will fail from long key, since bad key is not set) */ |
1005 | 3158 | long_key= "This is more then the allotted number of characters"; | 3162 | strcpy(long_key, "This is more then the allotted number of characters"); |
1006 | 3159 | rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, long_key); | 3163 | rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, long_key); |
1007 | 3160 | assert(rc == MEMCACHED_BAD_KEY_PROVIDED); | 3164 | assert(rc == MEMCACHED_BAD_KEY_PROVIDED); |
1008 | 3161 | 3165 | ||
1009 | @@ -3163,7 +3167,7 @@ | |||
1010 | 3163 | rc= memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_VERIFY_KEY, 1); | 3167 | rc= memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_VERIFY_KEY, 1); |
1011 | 3164 | assert(rc == MEMCACHED_SUCCESS); | 3168 | assert(rc == MEMCACHED_SUCCESS); |
1012 | 3165 | 3169 | ||
1014 | 3166 | long_key= "dog cat"; | 3170 | strcpy(long_key, "dog cat"); |
1015 | 3167 | rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, long_key); | 3171 | rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, long_key); |
1016 | 3168 | assert(rc == MEMCACHED_BAD_KEY_PROVIDED); | 3172 | assert(rc == MEMCACHED_BAD_KEY_PROVIDED); |
1017 | 3169 | } | 3173 | } |
1018 | @@ -3429,7 +3433,7 @@ | |||
1019 | 3429 | /* Try setting an illegal cas value (should not return an error to | 3433 | /* Try setting an illegal cas value (should not return an error to |
1020 | 3430 | * the caller (because we don't expect a return message from the server) | 3434 | * the caller (because we don't expect a return message from the server) |
1021 | 3431 | */ | 3435 | */ |
1023 | 3432 | char* keys[]= {"0"}; | 3436 | const char* keys[]= {"0"}; |
1024 | 3433 | size_t lengths[]= {1}; | 3437 | size_t lengths[]= {1}; |
1025 | 3434 | size_t length; | 3438 | size_t length; |
1026 | 3435 | uint32_t flags; | 3439 | uint32_t flags; |
1027 | @@ -3668,7 +3672,7 @@ | |||
1028 | 3668 | memcached_st *memc_clone= memcached_clone(NULL, memc); | 3672 | memcached_st *memc_clone= memcached_clone(NULL, memc); |
1029 | 3669 | memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, 0); | 3673 | memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, 0); |
1030 | 3670 | 3674 | ||
1032 | 3671 | char *keys[]= { "bubba", "key1", "key2", "key3" }; | 3675 | const char *keys[]= { "bubba", "key1", "key2", "key3" }; |
1033 | 3672 | size_t len[]= { 5, 4, 4, 4 }; | 3676 | size_t len[]= { 5, 4, 4, 4 }; |
1034 | 3673 | 3677 | ||
1035 | 3674 | for (int x=0; x< 4; ++x) | 3678 | for (int x=0; x< 4; ++x) |
1036 | @@ -3705,7 +3709,7 @@ | |||
1037 | 3705 | 3709 | ||
1038 | 3706 | for (int x= 'a'; x <= 'z'; ++x) | 3710 | for (int x= 'a'; x <= 'z'; ++x) |
1039 | 3707 | { | 3711 | { |
1041 | 3708 | char key[2]= { [0]= (char)x }; | 3712 | const char key[2]= { [0]= (const char)x }; |
1042 | 3709 | 3713 | ||
1043 | 3710 | rc= memcached_mget_by_key(new_clone, key, 1, keys, len, 4); | 3714 | rc= memcached_mget_by_key(new_clone, key, 1, keys, len, 4); |
1044 | 3711 | assert(rc == MEMCACHED_SUCCESS); | 3715 | assert(rc == MEMCACHED_SUCCESS); |
1045 | @@ -3737,7 +3741,7 @@ | |||
1046 | 3737 | MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS); | 3741 | MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS); |
1047 | 3738 | memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, --repl); | 3742 | memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, --repl); |
1048 | 3739 | 3743 | ||
1050 | 3740 | char *keys[]= { "bubba", "key1", "key2", "key3" }; | 3744 | const char *keys[]= { "bubba", "key1", "key2", "key3" }; |
1051 | 3741 | size_t len[]= { 5, 4, 4, 4 }; | 3745 | size_t len[]= { 5, 4, 4, 4 }; |
1052 | 3742 | 3746 | ||
1053 | 3743 | for (int x=0; x< 4; ++x) | 3747 | for (int x=0; x< 4; ++x) |
1054 | @@ -3764,7 +3768,7 @@ | |||
1055 | 3764 | { | 3768 | { |
1056 | 3765 | for (int x= 'a'; x <= 'z'; ++x) | 3769 | for (int x= 'a'; x <= 'z'; ++x) |
1057 | 3766 | { | 3770 | { |
1059 | 3767 | char key[2]= { [0]= (char)x }; | 3771 | const char key[2]= { [0]= (const char)x }; |
1060 | 3768 | 3772 | ||
1061 | 3769 | rc= memcached_mget_by_key(memc_clone, key, 1, keys, len, 4); | 3773 | rc= memcached_mget_by_key(memc_clone, key, 1, keys, len, 4); |
1062 | 3770 | assert(rc == MEMCACHED_SUCCESS); | 3774 | assert(rc == MEMCACHED_SUCCESS); |
1063 | @@ -3907,8 +3911,8 @@ | |||
1064 | 3907 | for (x= 0; x < num_iters;x++) | 3911 | for (x= 0; x < num_iters;x++) |
1065 | 3908 | { | 3912 | { |
1066 | 3909 | memcached_return rc; | 3913 | memcached_return rc; |
1069 | 3910 | char *key= "foo"; | 3914 | const char *key= "foo"; |
1070 | 3911 | char *value= "when we sanitize"; | 3915 | const char *value= "when we sanitize"; |
1071 | 3912 | uint16_t *expected_ids= get_udp_request_ids(memc); | 3916 | uint16_t *expected_ids= get_udp_request_ids(memc); |
1072 | 3913 | unsigned int server_key= memcached_generate_hash(memc,key,strlen(key)); | 3917 | unsigned int server_key= memcached_generate_hash(memc,key,strlen(key)); |
1073 | 3914 | size_t init_offset= memc->hosts[server_key].write_buffer_offset; | 3918 | size_t init_offset= memc->hosts[server_key].write_buffer_offset; |
1074 | @@ -3947,7 +3951,7 @@ | |||
1075 | 3947 | static test_return udp_set_too_big_test(memcached_st *memc) | 3951 | static test_return udp_set_too_big_test(memcached_st *memc) |
1076 | 3948 | { | 3952 | { |
1077 | 3949 | memcached_return rc; | 3953 | memcached_return rc; |
1079 | 3950 | char *key= "bar"; | 3954 | const char *key= "bar"; |
1080 | 3951 | char value[MAX_UDP_DATAGRAM_LENGTH]; | 3955 | char value[MAX_UDP_DATAGRAM_LENGTH]; |
1081 | 3952 | uint16_t *expected_ids= get_udp_request_ids(memc); | 3956 | uint16_t *expected_ids= get_udp_request_ids(memc); |
1082 | 3953 | rc= memcached_set(memc, key, strlen(key), | 3957 | rc= memcached_set(memc, key, strlen(key), |
1083 | @@ -3964,7 +3968,7 @@ | |||
1084 | 3964 | for (x= 0; x < num_iters;x++) | 3968 | for (x= 0; x < num_iters;x++) |
1085 | 3965 | { | 3969 | { |
1086 | 3966 | memcached_return rc; | 3970 | memcached_return rc; |
1088 | 3967 | char *key= "foo"; | 3971 | const char *key= "foo"; |
1089 | 3968 | uint16_t *expected_ids=get_udp_request_ids(memc); | 3972 | uint16_t *expected_ids=get_udp_request_ids(memc); |
1090 | 3969 | unsigned int server_key= memcached_generate_hash(memc, key, strlen(key)); | 3973 | unsigned int server_key= memcached_generate_hash(memc, key, strlen(key)); |
1091 | 3970 | size_t init_offset= memc->hosts[server_key].write_buffer_offset; | 3974 | size_t init_offset= memc->hosts[server_key].write_buffer_offset; |
1092 | @@ -4026,8 +4030,8 @@ | |||
1093 | 4026 | static test_return udp_incr_test(memcached_st *memc) | 4030 | static test_return udp_incr_test(memcached_st *memc) |
1094 | 4027 | { | 4031 | { |
1095 | 4028 | memcached_return rc; | 4032 | memcached_return rc; |
1098 | 4029 | char *key= "incr"; | 4033 | const char *key= "incr"; |
1099 | 4030 | char *value= "1"; | 4034 | const char *value= "1"; |
1100 | 4031 | rc= memcached_set(memc, key, strlen(key), | 4035 | rc= memcached_set(memc, key, strlen(key), |
1101 | 4032 | value, strlen(value), | 4036 | value, strlen(value), |
1102 | 4033 | (time_t)0, (uint32_t)0); | 4037 | (time_t)0, (uint32_t)0); |
1103 | @@ -4045,8 +4049,8 @@ | |||
1104 | 4045 | static test_return udp_decr_test(memcached_st *memc) | 4049 | static test_return udp_decr_test(memcached_st *memc) |
1105 | 4046 | { | 4050 | { |
1106 | 4047 | memcached_return rc; | 4051 | memcached_return rc; |
1109 | 4048 | char *key= "decr"; | 4052 | const char *key= "decr"; |
1110 | 4049 | char *value= "1"; | 4053 | const char *value= "1"; |
1111 | 4050 | rc= memcached_set(memc, key, strlen(key), | 4054 | rc= memcached_set(memc, key, strlen(key), |
1112 | 4051 | value, strlen(value), | 4055 | value, strlen(value), |
1113 | 4052 | (time_t)0, (uint32_t)0); | 4056 | (time_t)0, (uint32_t)0); |
1114 | @@ -4086,7 +4090,7 @@ | |||
1115 | 4086 | static test_return udp_get_test(memcached_st *memc) | 4090 | static test_return udp_get_test(memcached_st *memc) |
1116 | 4087 | { | 4091 | { |
1117 | 4088 | memcached_return rc; | 4092 | memcached_return rc; |
1119 | 4089 | char *key= "foo"; | 4093 | const char *key= "foo"; |
1120 | 4090 | size_t vlen; | 4094 | size_t vlen; |
1121 | 4091 | uint16_t *expected_ids = get_udp_request_ids(memc); | 4095 | uint16_t *expected_ids = get_udp_request_ids(memc); |
1122 | 4092 | char *val= memcached_get(memc, key, strlen(key), &vlen, (uint32_t)0, &rc); | 4096 | char *val= memcached_get(memc, key, strlen(key), &vlen, (uint32_t)0, &rc); |
1123 | @@ -4130,7 +4134,7 @@ | |||
1124 | 4130 | return TEST_SUCCESS; | 4134 | return TEST_SUCCESS; |
1125 | 4131 | } | 4135 | } |
1126 | 4132 | 4136 | ||
1128 | 4133 | static char *list[]= | 4137 | static const char *list[]= |
1129 | 4134 | { | 4138 | { |
1130 | 4135 | "apple", | 4139 | "apple", |
1131 | 4136 | "beat", | 4140 | "beat", |
1132 | @@ -4163,7 +4167,7 @@ | |||
1133 | 4163 | static test_return md5_run (memcached_st *memc __attribute__((unused))) | 4167 | static test_return md5_run (memcached_st *memc __attribute__((unused))) |
1134 | 4164 | { | 4168 | { |
1135 | 4165 | uint32_t x; | 4169 | uint32_t x; |
1137 | 4166 | char **ptr; | 4170 | const char **ptr; |
1138 | 4167 | uint32_t values[]= { 3195025439U, 2556848621U, 3724893440U, 3332385401U, | 4171 | uint32_t values[]= { 3195025439U, 2556848621U, 3724893440U, 3332385401U, |
1139 | 4168 | 245758794U, 2550894432U, 121710495U, 3053817768U, | 4172 | 245758794U, 2550894432U, 121710495U, 3053817768U, |
1140 | 4169 | 1250994555U, 1862072655U, 2631955953U, 2951528551U, | 4173 | 1250994555U, 1862072655U, 2631955953U, 2951528551U, |
1141 | @@ -4187,7 +4191,7 @@ | |||
1142 | 4187 | static test_return crc_run (memcached_st *memc __attribute__((unused))) | 4191 | static test_return crc_run (memcached_st *memc __attribute__((unused))) |
1143 | 4188 | { | 4192 | { |
1144 | 4189 | uint32_t x; | 4193 | uint32_t x; |
1146 | 4190 | char **ptr; | 4194 | const char **ptr; |
1147 | 4191 | uint32_t values[]= { 10542U, 22009U, 14526U, 19510U, 19432U, 10199U, 20634U, | 4195 | uint32_t values[]= { 10542U, 22009U, 14526U, 19510U, 19432U, 10199U, 20634U, |
1148 | 4192 | 9369U, 11511U, 10362U, 7893U, 31289U, 11313U, 9354U, | 4196 | 9369U, 11511U, 10362U, 7893U, 31289U, 11313U, 9354U, |
1149 | 4193 | 7621U, 30628U, 15218U, 25967U, 2695U, 9380U, | 4197 | 7621U, 30628U, 15218U, 25967U, 2695U, 9380U, |
1150 | @@ -4207,7 +4211,7 @@ | |||
1151 | 4207 | static test_return fnv1_64_run (memcached_st *memc __attribute__((unused))) | 4211 | static test_return fnv1_64_run (memcached_st *memc __attribute__((unused))) |
1152 | 4208 | { | 4212 | { |
1153 | 4209 | uint32_t x; | 4213 | uint32_t x; |
1155 | 4210 | char **ptr; | 4214 | const char **ptr; |
1156 | 4211 | uint32_t values[]= { 473199127U, 4148981457U, 3971873300U, 3257986707U, | 4215 | uint32_t values[]= { 473199127U, 4148981457U, 3971873300U, 3257986707U, |
1157 | 4212 | 1722477987U, 2991193800U, 4147007314U, 3633179701U, | 4216 | 1722477987U, 2991193800U, 4147007314U, 3633179701U, |
1158 | 4213 | 1805162104U, 3503289120U, 3395702895U, 3325073042U, | 4217 | 1805162104U, 3503289120U, 3395702895U, 3325073042U, |
1159 | @@ -4230,7 +4234,7 @@ | |||
1160 | 4230 | static test_return fnv1a_64_run (memcached_st *memc __attribute__((unused))) | 4234 | static test_return fnv1a_64_run (memcached_st *memc __attribute__((unused))) |
1161 | 4231 | { | 4235 | { |
1162 | 4232 | uint32_t x; | 4236 | uint32_t x; |
1164 | 4233 | char **ptr; | 4237 | const char **ptr; |
1165 | 4234 | uint32_t values[]= { 1488911807U, 2500855813U, 1510099634U, 1390325195U, | 4238 | uint32_t values[]= { 1488911807U, 2500855813U, 1510099634U, 1390325195U, |
1166 | 4235 | 3647689787U, 3241528582U, 1669328060U, 2604311949U, | 4239 | 3647689787U, 3241528582U, 1669328060U, 2604311949U, |
1167 | 4236 | 734810122U, 1516407546U, 560948863U, 1767346780U, | 4240 | 734810122U, 1516407546U, 560948863U, 1767346780U, |
1168 | @@ -4253,7 +4257,7 @@ | |||
1169 | 4253 | static test_return fnv1_32_run (memcached_st *memc __attribute__((unused))) | 4257 | static test_return fnv1_32_run (memcached_st *memc __attribute__((unused))) |
1170 | 4254 | { | 4258 | { |
1171 | 4255 | uint32_t x; | 4259 | uint32_t x; |
1173 | 4256 | char **ptr; | 4260 | const char **ptr; |
1174 | 4257 | uint32_t values[]= { 67176023U, 1190179409U, 2043204404U, 3221866419U, | 4261 | uint32_t values[]= { 67176023U, 1190179409U, 2043204404U, 3221866419U, |
1175 | 4258 | 2567703427U, 3787535528U, 4147287986U, 3500475733U, | 4262 | 2567703427U, 3787535528U, 4147287986U, 3500475733U, |
1176 | 4259 | 344481048U, 3865235296U, 2181839183U, 119581266U, | 4263 | 344481048U, 3865235296U, 2181839183U, 119581266U, |
1177 | @@ -4277,7 +4281,7 @@ | |||
1178 | 4277 | static test_return fnv1a_32_run (memcached_st *memc __attribute__((unused))) | 4281 | static test_return fnv1a_32_run (memcached_st *memc __attribute__((unused))) |
1179 | 4278 | { | 4282 | { |
1180 | 4279 | uint32_t x; | 4283 | uint32_t x; |
1182 | 4280 | char **ptr; | 4284 | const char **ptr; |
1183 | 4281 | uint32_t values[]= { 280767167U, 2421315013U, 3072375666U, 855001899U, | 4285 | uint32_t values[]= { 280767167U, 2421315013U, 3072375666U, 855001899U, |
1184 | 4282 | 459261019U, 3521085446U, 18738364U, 1625305005U, | 4286 | 459261019U, 3521085446U, 18738364U, 1625305005U, |
1185 | 4283 | 2162232970U, 777243802U, 3323728671U, 132336572U, | 4287 | 2162232970U, 777243802U, 3323728671U, 132336572U, |
1186 | @@ -4300,7 +4304,7 @@ | |||
1187 | 4300 | static test_return hsieh_run (memcached_st *memc __attribute__((unused))) | 4304 | static test_return hsieh_run (memcached_st *memc __attribute__((unused))) |
1188 | 4301 | { | 4305 | { |
1189 | 4302 | uint32_t x; | 4306 | uint32_t x; |
1191 | 4303 | char **ptr; | 4307 | const char **ptr; |
1192 | 4304 | #ifdef HAVE_HSIEH_HASH | 4308 | #ifdef HAVE_HSIEH_HASH |
1193 | 4305 | uint32_t values[]= { 3738850110, 3636226060, 3821074029, 3489929160, 3485772682, 80540287, | 4309 | uint32_t values[]= { 3738850110, 3636226060, 3821074029, 3489929160, 3485772682, 80540287, |
1194 | 4306 | 1805464076, 1895033657, 409795758, 979934958, 3634096985, 1284445480, | 4310 | 1805464076, 1895033657, 409795758, 979934958, 3634096985, 1284445480, |
1195 | @@ -4325,7 +4329,7 @@ | |||
1196 | 4325 | static test_return murmur_run (memcached_st *memc __attribute__((unused))) | 4329 | static test_return murmur_run (memcached_st *memc __attribute__((unused))) |
1197 | 4326 | { | 4330 | { |
1198 | 4327 | uint32_t x; | 4331 | uint32_t x; |
1200 | 4328 | char **ptr; | 4332 | const char **ptr; |
1201 | 4329 | uint32_t values[]= { 473199127U, 4148981457U, 3971873300U, 3257986707U, | 4333 | uint32_t values[]= { 473199127U, 4148981457U, 3971873300U, 3257986707U, |
1202 | 4330 | 1722477987U, 2991193800U, 4147007314U, 3633179701U, | 4334 | 1722477987U, 2991193800U, 4147007314U, 3633179701U, |
1203 | 4331 | 1805162104U, 3503289120U, 3395702895U, 3325073042U, | 4335 | 1805162104U, 3503289120U, 3395702895U, 3325073042U, |
1204 | @@ -4348,7 +4352,7 @@ | |||
1205 | 4348 | static test_return jenkins_run (memcached_st *memc __attribute__((unused))) | 4352 | static test_return jenkins_run (memcached_st *memc __attribute__((unused))) |
1206 | 4349 | { | 4353 | { |
1207 | 4350 | uint32_t x; | 4354 | uint32_t x; |
1209 | 4351 | char **ptr; | 4355 | const char **ptr; |
1210 | 4352 | uint32_t values[]= { 1442444624U, 4253821186U, 1885058256U, 2120131735U, | 4356 | uint32_t values[]= { 1442444624U, 4253821186U, 1885058256U, 2120131735U, |
1211 | 4353 | 3261968576U, 3515188778U, 4232909173U, 4288625128U, | 4357 | 3261968576U, 3515188778U, 4232909173U, 4288625128U, |
1212 | 4354 | 1812047395U, 3689182164U, 2502979932U, 1214050606U, | 4358 | 1812047395U, 3689182164U, 2502979932U, 1214050606U, |
1213 | 4355 | 4359 | ||
1214 | === modified file 'tests/ketama_test_cases.h' | |||
1215 | --- tests/ketama_test_cases.h 2008-11-03 22:20:00 +0000 | |||
1216 | +++ tests/ketama_test_cases.h 2009-07-08 13:38:34 +0000 | |||
1217 | @@ -1,8 +1,8 @@ | |||
1218 | 1 | typedef struct { | 1 | typedef struct { |
1220 | 2 | char *key; | 2 | const char *key; |
1221 | 3 | unsigned long hash1; | 3 | unsigned long hash1; |
1222 | 4 | unsigned long hash2; | 4 | unsigned long hash2; |
1224 | 5 | char *server; | 5 | const char *server; |
1225 | 6 | } TestCase; | 6 | } TestCase; |
1226 | 7 | 7 | ||
1227 | 8 | static TestCase test_cases[99] = { | 8 | static TestCase test_cases[99] = { |
1228 | 9 | 9 | ||
1229 | === modified file 'tests/udp.c' | |||
1230 | --- tests/udp.c 2008-08-19 18:07:14 +0000 | |||
1231 | +++ tests/udp.c 2009-07-08 13:38:34 +0000 | |||
1232 | @@ -22,8 +22,8 @@ | |||
1233 | 22 | test_return set_test(memcached_st *memc) | 22 | test_return set_test(memcached_st *memc) |
1234 | 23 | { | 23 | { |
1235 | 24 | memcached_return rc; | 24 | memcached_return rc; |
1238 | 25 | char *key= "foo"; | 25 | const char *key= "foo"; |
1239 | 26 | char *value= "when we sanitize"; | 26 | const char *value= "when we sanitize"; |
1240 | 27 | 27 | ||
1241 | 28 | rc= memcached_set(memc, key, strlen(key), | 28 | rc= memcached_set(memc, key, strlen(key), |
1242 | 29 | value, strlen(value), | 29 | value, strlen(value), |
Updated to latest pandora-build macros.
Fixed warnings related to -Wwrite-strings - which are treating string literals as char * instead of const char *.