Skip to content

Commit

Permalink
Changed type of database fields from 'long' to 'int'
Browse files Browse the repository at this point in the history
They are stored in the database the same way, sizeof() are equal
but new gcc compiler couldn't find the right SqliteStatement::Bind()
  • Loading branch information
ffes committed Oct 1, 2014
1 parent 178bebe commit 76e64e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions DlgImportLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down
18 changes: 9 additions & 9 deletions Snippets.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -58,17 +58,17 @@ 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); }
char* GetAfterSelection() { return Unicode2Ansi(_AfterSelection); }
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);
Expand All @@ -77,21 +77,21 @@ 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();

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; }
Expand Down

0 comments on commit 76e64e0

Please sign in to comment.