From 76e64e068c3af48f0ccfec562bcd91f199a19521 Mon Sep 17 00:00:00 2001 From: Frank Fesevur Date: Wed, 1 Oct 2014 23:12:50 +0200 Subject: [PATCH] Changed type of database fields from 'long' to 'int' They are stored in the database the same way, sizeof() are equal but new gcc compiler couldn't find the right SqliteStatement::Bind() --- DlgImportLibrary.cpp | 4 ++-- Snippets.h | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DlgImportLibrary.cpp b/DlgImportLibrary.cpp index d1dadf2..76fc438 100755 --- a/DlgImportLibrary.cpp +++ b/DlgImportLibrary.cpp @@ -106,7 +106,7 @@ static bool AddLibraryToCombo(HWND hDlg) ///////////////////////////////////////////////////////////////////////////// // -static bool ImportSnippets(long orgLibID, long newLibID) +static bool ImportSnippets(int orgLibID, int newLibID) { // Get all the snippets from the attached database SqliteStatement stmt(g_db, "SELECT * FROM Import.Snippets WHERE LibraryID = @libid"); @@ -128,7 +128,7 @@ static bool ImportSnippets(long orgLibID, long newLibID) ///////////////////////////////////////////////////////////////////////////// // -static bool ImportLanguages(long orgLibID, long newLibID) +static bool ImportLanguages(int orgLibID, int newLibID) { // Get all the languages for this library from the attached database SqliteStatement stmtSelect(g_db, "SELECT Lang FROM Import.LibraryLang WHERE LibraryID = @libid"); diff --git a/Snippets.h b/Snippets.h index 12f35e7..0584bd2 100755 --- a/Snippets.h +++ b/Snippets.h @@ -27,18 +27,18 @@ class SnippetBase { public: - long GetLibraryID() { return _LibraryID; } + int GetLibraryID() { return _LibraryID; } WCHAR* WGetName() { return _Name; } virtual void Set(SqliteStatement* stmt) = 0; - void SetLibraryID(long l) { _LibraryID = l; } + void SetLibraryID(int i) { _LibraryID = i; } void WSetName(LPCWCH txt); virtual bool SaveToDB(bool autoOpen = true) = 0; virtual bool DeleteFromDB() = 0; protected: - long _LibraryID; + int _LibraryID; WCHAR* _Name; }; @@ -58,7 +58,7 @@ class Snippet : public SnippetBase Snippet& operator=(SqliteStatement* stmt); virtual void Set(SqliteStatement* stmt); - long GetSnippetID() { return _SnippetID; } + int GetSnippetID() { return _SnippetID; } WCHAR* WGetBeforeSelection() { return _BeforeSelection; } WCHAR* WGetAfterSelection() { return _AfterSelection; } char* GetBeforeSelection() { return Unicode2Ansi(_BeforeSelection); } @@ -66,9 +66,9 @@ class Snippet : public SnippetBase bool GetReplaceSelection() { return _ReplaceSelection; } bool GetNewDocument() { return _NewDocument; } LangType GetNewDocumentLang() { return _NewDocumentLang; } - long GetSort() { return _Sort; } + int GetSort() { return _Sort; } - void SetSnippetID(long l) { _SnippetID = l; } + void SetSnippetID(int i) { _SnippetID = i; } void WSetBeforeSelection(LPCWCH txt); void WSetAfterSelection(LPCWCH txt); void SetBeforeSelection(LPCSTR txt); @@ -77,7 +77,7 @@ class Snippet : public SnippetBase void SetNewDocument(bool b) { _NewDocument = b; } void SetNewDocument(int i) { _NewDocument = (i != 0); } void SetNewDocumentLang(int i) { _NewDocumentLang = (LangType) i; } - void SetSort(long l) { _Sort = l; } + void SetSort(int i) { _Sort = i; } virtual bool SaveToDB(bool autoOpen = true); virtual bool DeleteFromDB(); @@ -85,13 +85,13 @@ class Snippet : public SnippetBase void GuessName(); private: - long _SnippetID; + int _SnippetID; WCHAR* _BeforeSelection; WCHAR* _AfterSelection; bool _ReplaceSelection; bool _NewDocument; LangType _NewDocumentLang; - long _Sort; + int _Sort; void CopyValues(const Snippet&); int GetReplaceSelectionInt() { return _ReplaceSelection ? 1 : 0; }