Skip to content

Commit

Permalink
Explicitly use int64_t to match SQLite headers on old Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
bengotow committed Dec 31, 2024
1 parent dc3cb75 commit 97f1a95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MailSync/MailStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ map<uint32_t, MessageAttributes> MailStore::fetchMessagesAttributesInRange(Range
SQLite::Statement query(this->_db, "SELECT id, unread, starred, remoteUID, remoteXGMLabels FROM Message WHERE accountId = ? AND remoteFolderId = ? AND remoteUID >= ? AND remoteUID <= ?");
query.bind(1, folder.accountId());
query.bind(2, folder.id());
query.bind(3, (long long)(range.location));
query.bind(3, (int64_t)(range.location));

// Range is uint64_t, and "*" is represented by UINT64_MAX.
// SQLite doesn't support UINT64 and the conversion /can/ fail.
if (range.length == UINT64_MAX) {
query.bind(4, LLONG_MAX);
query.bind(4, (int64_t)INT64_MAX);
} else {
query.bind(4, (long long)(range.location + range.length));
query.bind(4, (int64_t)(range.location + range.length));
}

map<uint32_t, MessageAttributes> results {};
Expand Down

0 comments on commit 97f1a95

Please sign in to comment.