From 47bacf04562bf002d7ab47dc2d3518780b8b11fb Mon Sep 17 00:00:00 2001 From: "H. S. Teoh" Date: Tue, 12 Dec 2017 17:58:12 -0800 Subject: [PATCH] Range API needs size_t for .length. --- database.d | 2 +- mssql.d | 2 +- mysql.d | 2 +- postgres.d | 2 +- sqlite.d | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/database.d b/database.d index 639589c..c4e2632 100644 --- a/database.d +++ b/database.d @@ -147,7 +147,7 @@ interface ResultSet { bool empty() @property; Row front() @property; void popFront() ; - int length() @property; + size_t length() @property; /* deprecated */ final ResultSet byAssoc() { return this; } } diff --git a/mssql.d b/mssql.d index ba86d55..8957bd8 100644 --- a/mssql.d +++ b/mssql.d @@ -111,7 +111,7 @@ class MsSqlResult : ResultSet { fetchNext; } - int length() + override size_t length() { return 1; //FIX ME } diff --git a/mysql.d b/mysql.d index 73ad5a6..aa59bdd 100644 --- a/mysql.d +++ b/mysql.d @@ -72,7 +72,7 @@ class MySqlResult : ResultSet { } - override int length() { + override size_t length() { if(result is null) return 0; return cast(int) mysql_num_rows(result); diff --git a/postgres.d b/postgres.d index bc87a8d..6c396d9 100644 --- a/postgres.d +++ b/postgres.d @@ -126,7 +126,7 @@ class PostgresResult : ResultSet { fetchNext(); } - int length() { + override size_t length() { return numRows; } diff --git a/sqlite.d b/sqlite.d index 90fad9e..f7e6b11 100644 --- a/sqlite.d +++ b/sqlite.d @@ -227,8 +227,8 @@ class SqliteResult : ResultSet { position++; } - int length() { - return cast(int) rows.length; + override size_t length() { + return rows.length; } this(Variant[][] rows, char[][] columnNames) {