1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tools: make v test-cleancode test everything by default (#10050)

This commit is contained in:
Delyan Angelov
2021-05-08 13:32:29 +03:00
committed by GitHub
parent cba2cb6b9c
commit 8a380f4699
132 changed files with 3230 additions and 3440 deletions

View File

@@ -10,15 +10,15 @@ struct C.MYSQL_RES {
[typedef]
struct C.MYSQL_FIELD {
name byteptr // Name of column
org_name byteptr // Original column name, if an alias
table byteptr // Table of column if column was a field
org_table byteptr // Org table name, if table was an alias
db byteptr // Database for table
catalog byteptr // Catalog for table
def byteptr // Default value (set by mysql_list_fields)
length int // Width of column (create length)
max_length int // Max width for selected set
name &byte // Name of column
org_name &byte // Original column name, if an alias
table &byte // Table of column if column was a field
org_table &byte // Org table name, if table was an alias
db &byte // Database for table
catalog &byte // Catalog for table
def &byte // Default value (set by mysql_list_fields)
length int // Width of column (create length)
max_length int // Max width for selected set
name_length u32
org_name_length u32
table_length u32
@@ -34,15 +34,15 @@ struct C.MYSQL_FIELD {
fn C.mysql_init(mysql &C.MYSQL) &C.MYSQL
fn C.mysql_real_connect(mysql &C.MYSQL, host charptr, user charptr, passwd charptr, db charptr, port u32, unix_socket charptr, client_flag ConnectionFlag) &C.MYSQL
fn C.mysql_real_connect(mysql &C.MYSQL, host &char, user &char, passwd &char, db &char, port u32, unix_socket &char, client_flag ConnectionFlag) &C.MYSQL
fn C.mysql_query(mysql &C.MYSQL, q byteptr) int
fn C.mysql_query(mysql &C.MYSQL, q &byte) int
fn C.mysql_real_query(mysql &C.MYSQL, q byteptr, len u32) int
fn C.mysql_real_query(mysql &C.MYSQL, q &byte, len u32) int
fn C.mysql_select_db(mysql &C.MYSQL, db byteptr) int
fn C.mysql_select_db(mysql &C.MYSQL, db &byte) int
fn C.mysql_change_user(mysql &C.MYSQL, user byteptr, password byteptr, db byteptr) bool
fn C.mysql_change_user(mysql &C.MYSQL, user &byte, password &byte, db &byte) bool
fn C.mysql_affected_rows(mysql &C.MYSQL) u64
@@ -50,7 +50,7 @@ fn C.mysql_options(mysql &C.MYSQL, option int, arg voidptr) int
fn C.mysql_get_option(mysql &C.MYSQL, option int, arg voidptr) int
fn C.mysql_list_tables(mysql &C.MYSQL, wild byteptr) &C.MYSQL_RES
fn C.mysql_list_tables(mysql &C.MYSQL, wild &byte) &C.MYSQL_RES
fn C.mysql_num_fields(res &C.MYSQL_RES) int
@@ -66,34 +66,34 @@ fn C.mysql_ping(mysql &C.MYSQL) int
fn C.mysql_store_result(mysql &C.MYSQL) &C.MYSQL_RES
fn C.mysql_fetch_row(res &C.MYSQL_RES) &byteptr
fn C.mysql_fetch_row(res &C.MYSQL_RES) &&byte
fn C.mysql_fetch_fields(res &C.MYSQL_RES) &C.MYSQL_FIELD
fn C.mysql_free_result(res &C.MYSQL_RES)
fn C.mysql_real_escape_string_quote(mysql &C.MYSQL, to byteptr, from byteptr, len u64, quote byte) u64
fn C.mysql_real_escape_string_quote(mysql &C.MYSQL, to &byte, from &byte, len u64, quote byte) u64
fn C.mysql_close(sock &C.MYSQL)
// INFO & VERSION
fn C.mysql_info(mysql &C.MYSQL) byteptr
fn C.mysql_info(mysql &C.MYSQL) &byte
fn C.mysql_get_host_info(mysql &C.MYSQL) byteptr
fn C.mysql_get_host_info(mysql &C.MYSQL) &byte
fn C.mysql_get_server_info(mysql &C.MYSQL) byteptr
fn C.mysql_get_server_info(mysql &C.MYSQL) &byte
fn C.mysql_get_server_version(mysql &C.MYSQL) u64
fn C.mysql_get_client_version() u64
fn C.mysql_get_client_info() byteptr
fn C.mysql_get_client_info() &byte
// DEBUG & ERROR INFO
fn C.mysql_error(mysql &C.MYSQL) byteptr
fn C.mysql_error(mysql &C.MYSQL) &byte
fn C.mysql_errno(mysql &C.MYSQL) int
fn C.mysql_dump_debug_info(mysql &C.MYSQL) int
fn C.mysql_debug(debug byteptr)
fn C.mysql_debug(debug &byte)

View File

@@ -33,7 +33,7 @@ pub struct Field {
}
// fetch_row - fetches the next row from a result.
pub fn (r Result) fetch_row() &byteptr {
pub fn (r Result) fetch_row() &&byte {
return C.mysql_fetch_row(r.result)
}
@@ -58,7 +58,7 @@ pub fn (r Result) rows() []Row {
if unsafe { rr[i] == 0 } {
row.vals << ''
} else {
row.vals << mystring(unsafe { byteptr(rr[i]) })
row.vals << mystring(unsafe { &byte(rr[i]) })
}
}
rows << row
@@ -66,7 +66,7 @@ pub fn (r Result) rows() []Row {
return rows
}
// maps - returns an array of maps, each containing a set of
// maps - returns an array of maps, each containing a set of
// field name: field value pairs.
pub fn (r Result) maps() []map[string]string {
mut array_map := []map[string]string{}

View File

@@ -11,7 +11,7 @@ fn get_errno(conn &C.MYSQL) int {
}
// resolve_nil_str - returns an empty string if passed value is a nil pointer.
fn resolve_nil_str(ptr byteptr) string {
fn resolve_nil_str(ptr &byte) string {
if isnil(ptr) {
return ''
}
@@ -19,7 +19,7 @@ fn resolve_nil_str(ptr byteptr) string {
}
[inline]
fn mystring(b byteptr) string {
fn mystring(b &byte) string {
unsafe {
return b.vstring()
}