mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from 'size_t' to 'type', possible loss of data)
Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
This commit is contained in:
@@ -144,7 +144,7 @@ static unsigned long connect_flags= CLIENT_MULTI_RESULTS |
|
||||
CLIENT_MULTI_STATEMENTS |
|
||||
CLIENT_REMEMBER_OPTIONS;
|
||||
|
||||
static int verbose, delimiter_length;
|
||||
static int verbose;
|
||||
static uint commit_rate;
|
||||
static uint detach_rate;
|
||||
const char *num_int_cols_opt;
|
||||
@@ -263,7 +263,7 @@ void option_cleanup(option_string *stmt);
|
||||
void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr);
|
||||
static int run_statements(MYSQL *mysql, statement *stmt);
|
||||
int slap_connect(MYSQL *mysql);
|
||||
static int run_query(MYSQL *mysql, const char *query, int len);
|
||||
static int run_query(MYSQL *mysql, const char *query, size_t len);
|
||||
|
||||
static const char ALPHANUMERICS[]=
|
||||
"0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
@@ -343,9 +343,6 @@ int main(int argc, char **argv)
|
||||
if (auto_generate_sql)
|
||||
srandom((uint)time(NULL));
|
||||
|
||||
/* globals? Yes, so we only have to run strlen once */
|
||||
delimiter_length= strlen(delimiter);
|
||||
|
||||
if (argc > 2)
|
||||
{
|
||||
fprintf(stderr,"%s: Too many arguments\n",my_progname);
|
||||
@@ -1552,18 +1549,18 @@ get_options(int *argc,char ***argv)
|
||||
}
|
||||
|
||||
|
||||
static int run_query(MYSQL *mysql, const char *query, int len)
|
||||
static int run_query(MYSQL *mysql, const char *query, size_t len)
|
||||
{
|
||||
if (opt_only_print)
|
||||
{
|
||||
printf("%.*s;\n", len, query);
|
||||
printf("%.*s;\n", (int)len, query);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (verbose >= 3)
|
||||
printf("%.*s;\n", len, query);
|
||||
printf("%.*s;\n", (int)len, query);
|
||||
|
||||
return mysql_real_query(mysql, query, len);
|
||||
return mysql_real_query(mysql, query, (ulong)len);
|
||||
}
|
||||
|
||||
|
||||
@@ -2131,7 +2128,7 @@ parse_delimiter(const char *script, statement **stmt, char delm)
|
||||
char *ptr= (char *)script;
|
||||
statement **sptr= stmt;
|
||||
statement *tmp;
|
||||
uint length= strlen(script);
|
||||
size_t length= strlen(script);
|
||||
uint count= 0; /* We know that there is always one */
|
||||
|
||||
for (tmp= *sptr= (statement *)my_malloc(sizeof(statement),
|
||||
|
Reference in New Issue
Block a user