Skip to content

Commit

Permalink
Removed 64bit warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
r-bernhard committed Feb 2, 2024
1 parent 1c07227 commit fb25211
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion _build/win/qt4/_cmake_qt4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ if(WIN32)

# Target Ipponboard_Debug
add_custom_command(TARGET Ipponboard_Debug POST_BUILD
COMMAND call "../_env_cfg-x64.cmd"
COMMAND call "${BASE_DIR}/base/_copy_files.cmd" -debug
)

# Target setup
add_custom_target(setup
COMMAND call "../_build_doc.cmd" ${BASE_DIR}
Expand Down
5 changes: 2 additions & 3 deletions _build/win/qt4/_create_env_cfg.cmd
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
:: Please configure paths first!
@echo off
if [%1] == [] (
echo Fehlende Argumente: _create_env_cfg.cmd x86/x64 [outputDir]
echo Fehlende Argumente: _create_env_cfg.cmd x86/x64
exit /b 1
)

if [%1] == [x86] (set ARCH=x86) else if [%1] == [x64] (set ARCH=x64)
if [%2] == [] (set DIR=.) else (set DIR=%1)

set LOCAL_CONFIG=%DIR%\_env_cfg-%ARCH%.cmd
set LOCAL_CONFIG=_env_cfg-%ARCH%.cmd

if EXIST "%LOCAL_CONFIG%" (
call "%LOCAL_CONFIG%"
Expand Down
2 changes: 1 addition & 1 deletion base/ClubManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ClubManager
void UpdateClub(unsigned int index, const Ipponboard::Club& club);
void RemoveClub(unsigned int index);
void SortClubs();
int ClubCount() const { return m_Clubs.size(); }
size_t ClubCount() const { return m_Clubs.size(); }

private:
void LoadClubs_();
Expand Down
2 changes: 1 addition & 1 deletion base/DonationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ QString DonationManager::GetDonationLabel()

std::random_device rd;
std::mt19937 generator(rd());
std::uniform_int_distribution<> distribution(0, fm::array_size(DonationLabels));
std::uniform_int_distribution<> distribution(0, (int)fm::array_size(DonationLabels));

return QCoreApplication::instance()->translate("DonationLabel", DonationLabels[distribution(generator)]);
}
Expand Down
2 changes: 1 addition & 1 deletion base/FightCategoryManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class FightCategoryMgr
void UpdateCategory(QString const& oldName, FightCategory const& t);
void RenameCategory(QString const& oldName, QString const& newName);
void RemoveCategory(QString const& name);
int CategoryCount() const { return m_Categories.size(); }
size_t CategoryCount() const { return m_Categories.size(); }

bool CategoriesFromString(std::string const& s);
std::string ConvertCategoriesToString_WITH_GUI_ERROR();
Expand Down
2 changes: 1 addition & 1 deletion base/ModeManagerDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ModeManagerDlg::ModeManagerDlg(TournamentMode::List const& modes,

if (mode.id == currentModeId)
{
pos = i;
pos = (int)i;
}
}

Expand Down
3 changes: 2 additions & 1 deletion base/_copy_files.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ set THIRDPARTY=..\..\3rdParty
if "%1"=="-release" set RELEASE=1
if defined RELEASE (set DEST=%ROOT%\bin\Release) else (set DEST=%ROOT%\bin\Debug)

echo Copying files to %DEST% ...
echo Copying files to %DEST% using QTDIR=%QTDIR% ...

echo languages
rem (mkdir is recursive) if not exist "%DEST%" mkdir "%DEST%">nul
if not exist "%DEST%\lang" mkdir "%DEST%\lang">nul
Expand Down
2 changes: 1 addition & 1 deletion core/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ void Controller::SetClub(Ipponboard::FighterEnum who, const QString& clubName)

//=========================================================
void Controller::SetFight(
unsigned int round_index, unsigned int fight_index,
unsigned int round_index, size_t fight_index,
const QString& weight,
const QString& first_player_name, const QString& first_player_club,
const QString& second_player_name, const QString& second_player_club,
Expand Down
2 changes: 1 addition & 1 deletion core/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Controller : public QObject, public IController, public IControllerCore

void ClearFightsAndResetTimers();
void SetClub(Ipponboard::FighterEnum whos, const QString& clubName);
void SetFight(unsigned int tournament_index, unsigned int fight_index,
void SetFight(unsigned int tournament_index, size_t fight_index,
const QString& weight, const QString& first_player_name,
const QString& first_player_club, const QString& second_player_name,
const QString& second_player_club, int yuko1 = -1,
Expand Down
6 changes: 3 additions & 3 deletions core/TournamentModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ TournamentModel::~TournamentModel()
//=========================================================
//QModelIndex TournamentModel::parent(const QModelIndex& /*child*/) const
//=========================================================
//{
//{size_t
// return QModelIndex();
//}

//=========================================================
int TournamentModel::rowCount(const QModelIndex& parent) const
//=========================================================
{
return (parent.isValid() && parent.column() != 0) ? 0 : m_nRows;
return (parent.isValid() && parent.column() != 0) ? 0 : (int)m_nRows;
}

//=========================================================
Expand Down Expand Up @@ -441,7 +441,7 @@ void TournamentModel::SetDataChanged()
//=========================================================
{
QModelIndex idxStart = this->index(0, 0);
QModelIndex idxEnd = this->index(eCol_MAX - 1, m_nRows - 1);
QModelIndex idxEnd = this->index(eCol_MAX - 1, (int)m_nRows - 1);

emit dataChanged(idxStart, idxEnd);
}
Expand Down
4 changes: 2 additions & 2 deletions core/TournamentModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TournamentModel : public QAbstractTableModel
m_nRows = rows;
endResetModel();
}
int GetNumRows() const { return m_nRows; }
size_t GetNumRows() const { return m_nRows; }

/* QAbstractTableModel (required) */
int rowCount(const QModelIndex& parent) const;
Expand Down Expand Up @@ -81,7 +81,7 @@ private slots:

Ipponboard::PTournamentRound m_pTournamentRound;
TournamentModel* m_pIntermediateModel;
int m_nRows;
size_t m_nRows;
QString m_HeaderData[eCol_MAX];
int m_HeaderSizes[eCol_MAX];
QLineEdit* m_pEditWins;
Expand Down
2 changes: 1 addition & 1 deletion util/qt_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace fm

static QString from_utf8_str(std::string const& str)
{
return QString::fromUtf8(str.c_str(), str.length());
return QString::fromUtf8(str.c_str(), (int)str.length());
}

}
Expand Down

0 comments on commit fb25211

Please sign in to comment.