Skip to content

Commit 4a806bd

Browse files
committed
refactor!: type alias USmallInt is removed. It had been u16 had been
all platforms and therfore serves no purpose.
1 parent ef69806 commit 4a806bd

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

src/functions.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::{
22
BulkOperation, CDataType, Char, CompletionType, ConnectionAttribute, Desc, DriverConnectOption,
33
EnvironmentAttribute, FetchOrientation, FreeStmtOption, HDbc, HDesc, HEnv, HStmt, HWnd, Handle,
44
HandleType, InfoType, Len, Lock, Nullability, Operation, ParamType, Pointer, RetCode,
5-
SetPosIRow, SqlDataType, SqlReturn, StatementAttribute, ULen, USmallInt, WChar,
5+
SetPosIRow, SqlDataType, SqlReturn, StatementAttribute, ULen, WChar,
66
};
77

88
pub static mut NUM_ENVIRONMENT: u32 = 0;
@@ -173,7 +173,7 @@ extern "system" {
173173
// Can be used since odbc version 3.8 to stream results
174174
pub fn SQLGetData(
175175
statement_handle: HStmt,
176-
col_or_param_num: USmallInt,
176+
col_or_param_num: u16,
177177
target_type: CDataType,
178178
target_value_ptr: Pointer,
179179
buffer_length: Len,
@@ -402,7 +402,7 @@ extern "system" {
402402
/// `SUCCESS`, `SUCCESS_WITH_INFO`, `ERROR` or `INVALID_HANDLE`
403403
pub fn SQLBindParameter(
404404
hstmt: HStmt,
405-
parameter_number: USmallInt,
405+
parameter_number: u16,
406406
input_output_type: ParamType,
407407
value_type: CDataType,
408408
parameter_type: SqlDataType,
@@ -467,7 +467,7 @@ extern "system" {
467467
/// `SUCCESS`, `SUCCESS_WITH_INFO`, `ERROR`, or `INVALID_HANDLE`.
468468
pub fn SQLBindCol(
469469
hstmt: HStmt,
470-
col_number: USmallInt,
470+
col_number: u16,
471471
target_type: CDataType,
472472
target_value: Pointer,
473473
buffer_length: Len,
@@ -496,7 +496,7 @@ extern "system" {
496496
/// `SUCCESS`, `SUCCESS_WITH_INFO`, `ERROR`, `INVALID_HANDLE`, or `SQL_STILL_EXECUTING`.
497497
pub fn SQLColAttributeW(
498498
statement_handle: HStmt,
499-
column_number: USmallInt,
499+
column_number: u16,
500500
field_identifier: Desc,
501501
character_attribute_ptr: Pointer,
502502
buffer_length: i16,
@@ -511,7 +511,7 @@ extern "system" {
511511
/// `SUCCESS`, `SUCCESS_WITH_INFO`, `ERROR`, `INVALID_HANDLE`, or `SQL_STILL_EXECUTING`.
512512
pub fn SQLColAttribute(
513513
statement_handle: HStmt,
514-
column_number: USmallInt,
514+
column_number: u16,
515515
field_identifier: Desc,
516516
character_attribute_ptr: Pointer,
517517
buffer_length: i16,
@@ -826,7 +826,7 @@ extern "system" {
826826
/// `INVALID_HANDLE`.
827827
pub fn SQLDescribeCol(
828828
hstmt: HStmt,
829-
col_number: USmallInt,
829+
col_number: u16,
830830
col_name: *mut Char,
831831
buffer_length: i16,
832832
name_length: *mut i16,
@@ -846,7 +846,7 @@ extern "system" {
846846
/// `INVALID_HANDLE`.
847847
pub fn SQLDescribeColW(
848848
hstmt: HStmt,
849-
col_number: USmallInt,
849+
col_number: u16,
850850
col_name: *mut WChar,
851851
buffer_length: i16,
852852
name_length: *mut i16,
@@ -865,7 +865,7 @@ extern "system" {
865865
/// `INVALID_HANDLE`.
866866
pub fn SQLDescribeParam(
867867
statement_handle: HStmt,
868-
parameter_number: USmallInt,
868+
parameter_number: u16,
869869
data_type_ptr: *mut SqlDataType,
870870
parameter_size_ptr: *mut ULen,
871871
decimal_digits_ptr: *mut i16,

src/lib.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ pub use self::{
4848
};
4949
use std::os::raw::{c_int, c_void};
5050

51-
pub type USmallInt = u16;
5251
pub type Pointer = *mut c_void;
5352
pub type Char = u8;
5453
pub type SChar = i8;
@@ -178,29 +177,29 @@ pub struct IntervalStruct {
178177
#[derive(Debug, Default, PartialEq, Eq, Clone, Copy, Hash)]
179178
pub struct Date {
180179
pub year: i16,
181-
pub month: USmallInt,
182-
pub day: USmallInt,
180+
pub month: u16,
181+
pub day: u16,
183182
}
184183

185184
/// SQL_TIME_STRUCT
186185
#[repr(C)]
187186
#[derive(Debug, Default, PartialEq, Eq, Clone, Copy, Hash)]
188187
pub struct Time {
189-
pub hour: USmallInt,
190-
pub minute: USmallInt,
191-
pub second: USmallInt,
188+
pub hour: u16,
189+
pub minute: u16,
190+
pub second: u16,
192191
}
193192

194193
/// SQL_TIMESTAMP_STRUCT
195194
#[repr(C)]
196195
#[derive(Debug, Default, PartialEq, Eq, Clone, Copy, Hash)]
197196
pub struct Timestamp {
198197
pub year: i16,
199-
pub month: USmallInt,
200-
pub day: USmallInt,
201-
pub hour: USmallInt,
202-
pub minute: USmallInt,
203-
pub second: USmallInt,
198+
pub month: u16,
199+
pub day: u16,
200+
pub hour: u16,
201+
pub minute: u16,
202+
pub second: u16,
204203
pub fraction: u32,
205204
}
206205

0 commit comments

Comments
 (0)