You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
codespell fixes, removed MSDOS preprocessor macros
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
FUNCTION(GET_FILE_VERSION FILE_NAME FILE_VERSION)
|
||||
|
||||
# if we build from a git repository, we calculate the file version:
|
||||
# Patch number is numer of commits for given file
|
||||
# Patch number is number of commits for given file
|
||||
IF(GIT_EXECUTABLE AND EXISTS ${CC_SOURCE_DIR}/.git)
|
||||
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} --git-dir=${CC_SOURCE_DIR}/.git --work-tree=${CC_SOURCE_DIR} rev-list HEAD --count -- ${FILE_NAME}
|
||||
OUTPUT_VARIABLE FV)
|
||||
|
@@ -113,7 +113,7 @@ void ma_hash_result(MA_HASH_CTX *ctx, unsigned char *digest);
|
||||
|
||||
@param[in] hash algorithm
|
||||
|
||||
@retuns digest size or 0 on error
|
||||
@returns digest size or 0 on error
|
||||
*/
|
||||
static inline size_t ma_hash_digest_size(unsigned int hash_alg)
|
||||
{
|
||||
|
@@ -146,22 +146,6 @@ do {\
|
||||
#define my_afree(PTR) ma_free(PTR)
|
||||
#endif /* HAVE_ALLOCA */
|
||||
|
||||
#ifdef MSDOS
|
||||
#ifdef __ZTC__
|
||||
void * __CDECL halloc(long count,size_t length);
|
||||
void __CDECL hfree(void *ptr);
|
||||
#endif
|
||||
#if defined(USE_HALLOC)
|
||||
#if defined(_VCM_) || defined(M_IC80386)
|
||||
#undef USE_HALLOC
|
||||
#endif
|
||||
#endif
|
||||
#ifdef USE_HALLOC
|
||||
#define malloc(a) halloc((long) (a),1)
|
||||
#define free(a) hfree(a)
|
||||
#endif
|
||||
#endif /* MSDOS */
|
||||
|
||||
#ifndef errno
|
||||
#ifdef HAVE_ERRNO_AS_DEFINE
|
||||
#include <errno.h> /* errno is a define */
|
||||
|
@@ -16,7 +16,7 @@
|
||||
MA 02111-1301, USA */
|
||||
|
||||
/*
|
||||
A better inplementation of the UNIX ctype(3) library.
|
||||
A better implementation of the UNIX ctype(3) library.
|
||||
Notes: my_global.h should be included before ctype.h
|
||||
*/
|
||||
|
||||
|
@@ -426,7 +426,7 @@ typedef struct st_mysql_time
|
||||
#define SEC_PART_DIGITS 6
|
||||
#define MARIADB_INVALID_SOCKET -1
|
||||
|
||||
/* Ansynchronous API constants */
|
||||
/* Asynchronous API constants */
|
||||
#define MYSQL_WAIT_READ 1
|
||||
#define MYSQL_WAIT_WRITE 2
|
||||
#define MYSQL_WAIT_EXCEPT 4
|
||||
@@ -729,7 +729,7 @@ int STDCALL mysql_stmt_send_long_data_cont(my_bool *ret, MYSQL_STMT *stmt,
|
||||
int status);
|
||||
int STDCALL mysql_reset_connection(MYSQL *mysql);
|
||||
|
||||
/* API function calls (used by dynmic plugins) */
|
||||
/* API function calls (used by dynamic plugins) */
|
||||
struct st_mariadb_api {
|
||||
unsigned long long (STDCALL *mysql_num_rows)(MYSQL_RES *res);
|
||||
unsigned int (STDCALL *mysql_num_fields)(MYSQL_RES *res);
|
||||
|
@@ -52,12 +52,12 @@ ulong net_read_timeout= NET_READ_TIMEOUT;
|
||||
ulong net_write_timeout= NET_WRITE_TIMEOUT;
|
||||
ulong net_buffer_length= 8192; /* Default length. Enlarged if necessary */
|
||||
|
||||
#if !defined(_WIN32) && !defined(MSDOS)
|
||||
#if !defined(_WIN32)
|
||||
#include <sys/socket.h>
|
||||
#else
|
||||
#undef MYSQL_SERVER /* Win32 can't handle interrupts */
|
||||
#endif
|
||||
#if !defined(MSDOS) && !defined(_WIN32) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__)
|
||||
#if !defined(_WIN32) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__)
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
|
@@ -46,7 +46,7 @@
|
||||
void ma_randominit(struct rand_struct *rand_st,ulong seed1, ulong seed2)
|
||||
{ /* For mysql 3.21.# */
|
||||
#ifdef HAVE_purify
|
||||
memset((char*) rand_st, 0m sizeof(*rand_st)); /* Avoid UMC varnings */
|
||||
memset((char*) rand_st, 0m sizeof(*rand_st)); /* Avoid UMC warnings */
|
||||
#endif
|
||||
rand_st->max_value= 0x3FFFFFFFL;
|
||||
rand_st->max_value_dbl=(double) rand_st->max_value;
|
||||
@@ -81,7 +81,7 @@ void ma_hash_password(ulong *result, const char *password, size_t len)
|
||||
}
|
||||
|
||||
/*
|
||||
* Genererate a new message based on message and password
|
||||
* Generate a new message based on message and password
|
||||
* The same thing is done in client and server and the results are checked.
|
||||
*/
|
||||
|
||||
@@ -134,7 +134,7 @@ void ma_make_scrambled_password(char *to,const char *password)
|
||||
}
|
||||
|
||||
/*
|
||||
* Genererate a new message based on message and password
|
||||
* Generate a new message based on message and password
|
||||
* The same thing is done in client and server and the results are checked.
|
||||
*/
|
||||
char *ma_scramble_323(char *to, const char *message, const char *password)
|
||||
|
@@ -370,7 +370,7 @@ end:
|
||||
|
||||
Year must be < 10000, month < 12, day < 32
|
||||
|
||||
Years with 2 digits, are coverted to values 1970-2069 according to
|
||||
Years with 2 digits, are converted to values 1970-2069 according to
|
||||
usual rules:
|
||||
|
||||
00-69 is converted to 2000-2069.
|
||||
|
@@ -3751,7 +3751,7 @@ mariadb_dyncol_check(DYNAMIC_COLUMN *str)
|
||||
i++, header.entry+= header.entry_size)
|
||||
{
|
||||
DYNAMIC_COLUMN_VALUE store;
|
||||
// already checked by previouse pass
|
||||
/* already checked by previous pass */
|
||||
(*fmt->type_and_offset_read)(&header.type, &header.offset,
|
||||
header.entry + fmt->fixed_hdr_entry,
|
||||
header.offset_size);
|
||||
|
@@ -46,7 +46,7 @@
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
#if !defined(MSDOS) && !defined(_WIN32)
|
||||
#if !defined(_WIN32)
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
@@ -131,7 +131,7 @@ my_string mysql_unix_port=0;
|
||||
|
||||
struct st_mariadb_methods MARIADB_DEFAULT_METHODS;
|
||||
|
||||
#if defined(MSDOS) || defined(_WIN32)
|
||||
#if defined(_WIN32)
|
||||
// socket_errno is defined in ma_global.h for all platforms
|
||||
#define perror(A)
|
||||
#else
|
||||
@@ -532,7 +532,7 @@ void read_user_name(char *name)
|
||||
return;
|
||||
}
|
||||
|
||||
#else /* If MSDOS || VMS */
|
||||
#else /* WIN32 */
|
||||
|
||||
void read_user_name(char *name)
|
||||
{
|
||||
@@ -1696,7 +1696,7 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
|
||||
return(mysql);
|
||||
|
||||
error:
|
||||
/* Free alloced memory */
|
||||
/* Free allocated memory */
|
||||
end_server(mysql);
|
||||
/* only free the allocated memory, user needs to call mysql_close */
|
||||
mysql_close_memory(mysql);
|
||||
@@ -1938,7 +1938,7 @@ mysql_select_db(MYSQL *mysql, const char *db)
|
||||
|
||||
/*************************************************************************
|
||||
** Send a QUIT to the server and close the connection
|
||||
** If handle is alloced by mysql connect free it.
|
||||
** If handle is allocated by mysql connect free it.
|
||||
*************************************************************************/
|
||||
|
||||
static void mysql_close_options(MYSQL *mysql)
|
||||
@@ -2847,7 +2847,7 @@ static size_t get_store_length(size_t length)
|
||||
#define MAX_STORE_SIZE 9
|
||||
unsigned char buffer[MAX_STORE_SIZE], *p;
|
||||
|
||||
/* We just store the length and substract offset of our buffer
|
||||
/* We just store the length and subtract offset of our buffer
|
||||
to determine the length */
|
||||
p= mysql_net_store_length(buffer, length);
|
||||
return p - buffer;
|
||||
|
@@ -1398,7 +1398,7 @@ static int my_verify_callback(gnutls_session_t ssl)
|
||||
(status & GNUTLS_CERT_SIGNER_NOT_FOUND))
|
||||
return 0;
|
||||
|
||||
/* gnutls default error mesage "certificate validation failed" isn't very
|
||||
/* gnutls default error message "certificate validation failed" isn't very
|
||||
descriptive, so we provide more information about the error here */
|
||||
type= gnutls_certificate_type_get(ssl);
|
||||
gnutls_certificate_verification_status_print(status, type, &out, 0);
|
||||
|
@@ -591,7 +591,7 @@ void schannel_free_store(HCERTSTORE store)
|
||||
|
||||
/*
|
||||
Verify server certificate against a wincrypt store
|
||||
@return 0 - success, otherwise error occured.
|
||||
@return 0 - success, otherwise error occurred.
|
||||
*/
|
||||
SECURITY_STATUS schannel_verify_server_certificate(
|
||||
const CERT_CONTEXT* cert,
|
||||
@@ -663,7 +663,7 @@ static SECURITY_STATUS load_private_key(CERT_CONTEXT* cert, char* private_key_st
|
||||
}
|
||||
|
||||
/*
|
||||
To accomodate for both "BEGIN PRIVATE KEY" vs "BEGIN RSA PRIVATE KEY"
|
||||
To accommodate for both "BEGIN PRIVATE KEY" vs "BEGIN RSA PRIVATE KEY"
|
||||
sections in PEM, we try to decode with PKCS_PRIVATE_KEY_INFO first,
|
||||
and, if it fails, with PKCS_RSA_PRIVATE_KEY flag.
|
||||
*/
|
||||
|
@@ -93,7 +93,7 @@ static int ma_sha256_scramble(unsigned char *scramble, size_t scramble_len,
|
||||
#endif
|
||||
size_t i;
|
||||
|
||||
/* check if all specified lenghts are valid */
|
||||
/* check if all specified lengtht are valid */
|
||||
if (!scramble_len || !source_len || !salt_len)
|
||||
return 1;
|
||||
|
||||
|
@@ -391,7 +391,7 @@ static int test_bug31669(MYSQL *mysql)
|
||||
memset(buff, 'a', sizeof(buff));
|
||||
|
||||
rc= mysql_change_user(mysql, buff, buff, buff);
|
||||
FAIL_UNLESS(rc, "Error epected");
|
||||
FAIL_UNLESS(rc, "Error expected");
|
||||
|
||||
rc = mysql_change_user(mysql, username, password, schema);
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
@@ -918,7 +918,7 @@ static int test_bug1664(MYSQL *mysql)
|
||||
|
||||
/*
|
||||
Now we are sending other long data. It should not be
|
||||
concatened to previous.
|
||||
concatenated to previous.
|
||||
*/
|
||||
|
||||
data= (char *)"SomeOtherData";
|
||||
@@ -3053,7 +3053,7 @@ static int test_bug8330(MYSQL *mysql)
|
||||
long lval[2]= {1,2};
|
||||
|
||||
stmt_text= "drop table if exists t1";
|
||||
/* in case some previos test failed */
|
||||
/* in case some previous test failed */
|
||||
rc= mysql_real_query(mysql, SL(stmt_text));
|
||||
check_mysql_rc(rc, mysql);
|
||||
stmt_text= "create table t1 (a int, b int)";
|
||||
@@ -4908,7 +4908,7 @@ static int test_conc334(MYSQL *mysql)
|
||||
result= mysql_stmt_result_metadata(stmt);
|
||||
if (!result)
|
||||
{
|
||||
diag("Coudn't retrieve result set");
|
||||
diag("Couldn't retrieve result set");
|
||||
mysql_stmt_close(stmt);
|
||||
return FAIL;
|
||||
}
|
||||
|
@@ -161,7 +161,7 @@ static int test_view_2where(MYSQL *mysql)
|
||||
MYSQL_STMT *stmt;
|
||||
int rc, i;
|
||||
MYSQL_BIND my_bind[8];
|
||||
char parms[8][100];
|
||||
char params[8][100];
|
||||
ulong length[8];
|
||||
const char *query=
|
||||
"select relid, report, handle, log_group, username, variant, type, "
|
||||
@@ -208,9 +208,9 @@ static int test_view_2where(MYSQL *mysql)
|
||||
check_mysql_rc(rc, mysql);
|
||||
memset(my_bind, '\0', sizeof(MYSQL_BIND));
|
||||
for (i=0; i < 8; i++) {
|
||||
strcpy(parms[i], "1");
|
||||
strcpy(params[i], "1");
|
||||
my_bind[i].buffer_type = MYSQL_TYPE_VAR_STRING;
|
||||
my_bind[i].buffer = (char *)&parms[i];
|
||||
my_bind[i].buffer = (char *)¶ms[i];
|
||||
my_bind[i].buffer_length = 1;
|
||||
my_bind[i].is_null = 0;
|
||||
length[i] = 1;
|
||||
@@ -245,7 +245,7 @@ static int test_view_star(MYSQL *mysql)
|
||||
MYSQL_STMT *stmt;
|
||||
int rc, i;
|
||||
MYSQL_BIND my_bind[8];
|
||||
char parms[8][100];
|
||||
char params[8][100];
|
||||
ulong length[8];
|
||||
const char *query= "SELECT * FROM vt1 WHERE a IN (?,?)";
|
||||
|
||||
@@ -259,9 +259,9 @@ static int test_view_star(MYSQL *mysql)
|
||||
check_mysql_rc(rc, mysql);
|
||||
memset(my_bind, '\0', sizeof(MYSQL_BIND));
|
||||
for (i= 0; i < 2; i++) {
|
||||
sprintf((char *)&parms[i], "%d", i);
|
||||
sprintf((char *)¶ms[i], "%d", i);
|
||||
my_bind[i].buffer_type = MYSQL_TYPE_VAR_STRING;
|
||||
my_bind[i].buffer = (char *)&parms[i];
|
||||
my_bind[i].buffer = (char *)¶ms[i];
|
||||
my_bind[i].buffer_length = 100;
|
||||
my_bind[i].is_null = 0;
|
||||
my_bind[i].length = &length[i];
|
||||
|
Reference in New Issue
Block a user