summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-09-10 11:44:49 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-09-10 11:44:49 -0700
commite7fd45c7efe8dcb2c38bd518e02e20bfb8898c86 (patch)
tree3cf9e4432c983f2aa0b395afbec91edaa53cf097
parente91ac60f4985667f8599d30881698e14e15fffca (diff)
downloadsubsurface-e7fd45c7efe8dcb2c38bd518e02e20bfb8898c86.tar.gz
Change ws_info and tank_info types
This is correct C. But debuggers in C++ mode are broken and can't display the global variables. While I hate having to do this change, I hate not being able to debug my software because of broken tools even more. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--dive.h8
-rw-r--r--equipment.c6
-rw-r--r--qt-ui/models.cpp18
3 files changed, 16 insertions, 16 deletions
diff --git a/dive.h b/dive.h
index 64da53c87..53b2d0a98 100644
--- a/dive.h
+++ b/dive.h
@@ -732,17 +732,17 @@ struct event *get_next_event(struct event *event, char *name);
* dialog
*/
-struct tank_info {
+struct tank_info_t {
const char *name;
int cuft, ml, psi, bar;
};
-extern struct tank_info tank_info[100];
+extern struct tank_info_t tank_info[100];
-struct ws_info {
+struct ws_info_t {
const char *name;
int grams;
};
-extern struct ws_info ws_info[100];
+extern struct ws_info_t ws_info[100];
extern bool cylinder_nodata(cylinder_t *cyl);
extern bool cylinder_none(void *_data);
diff --git a/equipment.c b/equipment.c
index b9001a85c..0c5939ff3 100644
--- a/equipment.c
+++ b/equipment.c
@@ -831,7 +831,7 @@ static void record_weightsystem_changes(weightsystem_t *ws, struct ws_widget *we
* we should pick up any other names from the dive
* logs directly.
*/
-struct tank_info tank_info[100] = {
+struct tank_info_t tank_info[100] = {
/* Need an empty entry for the no-cylinder case */
{ "", },
@@ -925,7 +925,7 @@ bad_tank_info:
* We hardcode the most common weight system types
* This is a bit odd as the weight system types don't usually encode weight
*/
-struct ws_info ws_info[100] = {
+struct ws_info_t ws_info[100] = {
{ N_("integrated"), 0 },
{ N_("belt"), 0 },
{ N_("ankle"), 0 },
@@ -937,7 +937,7 @@ struct ws_info ws_info[100] = {
static void fill_ws_list(GtkListStore *store)
{
GtkTreeIter iter;
- struct ws_info *info = ws_info;
+ struct ws_info_t *info = ws_info;
while (info->name) {
gtk_list_store_append(store, &iter);
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 1e5f15f0c..479f58582 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -549,7 +549,7 @@ bool WSInfoModel::insertRows(int row, int count, const QModelIndex& parent)
bool WSInfoModel::setData(const QModelIndex& index, const QVariant& value, int role)
{
- struct ws_info *info = &ws_info[index.row()];
+ struct ws_info_t *info = &ws_info[index.row()];
switch(index.column()) {
case DESCRIPTION:
info->name = strdup(value.toByteArray().data());
@@ -577,7 +577,7 @@ QVariant WSInfoModel::data(const QModelIndex& index, int role) const
if (!index.isValid()) {
return ret;
}
- struct ws_info *info = &ws_info[index.row()];
+ struct ws_info_t *info = &ws_info[index.row()];
int gr = info->grams;
switch(role){
@@ -636,7 +636,7 @@ const QString& WSInfoModel::biggerString() const
WSInfoModel::WSInfoModel() : QAbstractTableModel(), rows(-1)
{
- struct ws_info *info = ws_info;
+ struct ws_info_t *info = ws_info;
for (info = ws_info; info->name; info++, rows++){
QString wsInfoName(info->name);
if( wsInfoName.count() > biggerEntry.count()){
@@ -652,7 +652,7 @@ WSInfoModel::WSInfoModel() : QAbstractTableModel(), rows(-1)
void WSInfoModel::updateInfo()
{
- struct ws_info *info = ws_info;
+ struct ws_info_t *info = ws_info;
beginRemoveRows(QModelIndex(), 0, this->rows);
endRemoveRows();
for (info = ws_info; info->name; info++, rows++){
@@ -675,7 +675,7 @@ void WSInfoModel::update()
endRemoveRows();
rows = -1;
}
- struct ws_info *info = ws_info;
+ struct ws_info_t *info = ws_info;
for (info = ws_info; info->name; info++, rows++);
if (rows > -1) {
@@ -705,7 +705,7 @@ bool TankInfoModel::insertRows(int row, int count, const QModelIndex& parent)
bool TankInfoModel::setData(const QModelIndex& index, const QVariant& value, int role)
{
- struct tank_info *info = &tank_info[index.row()];
+ struct tank_info_t *info = &tank_info[index.row()];
switch(index.column()) {
case DESCRIPTION:
info->name = strdup(value.toByteArray().data());
@@ -740,7 +740,7 @@ QVariant TankInfoModel::data(const QModelIndex& index, int role) const
return defaultModelFont();
}
if (role == Qt::DisplayRole || role == Qt::EditRole) {
- struct tank_info *info = &tank_info[index.row()];
+ struct tank_info_t *info = &tank_info[index.row()];
int ml = info->ml;
double bar = (info->psi) ? psi_to_bar(info->psi) : info->bar;
@@ -797,7 +797,7 @@ int TankInfoModel::rowCount(const QModelIndex& parent) const
TankInfoModel::TankInfoModel() : QAbstractTableModel(), rows(-1)
{
- struct tank_info *info = tank_info;
+ struct tank_info_t *info = tank_info;
for (info = tank_info; info->name; info++, rows++){
QString infoName(info->name);
if (infoName.count() > biggerEntry.count()){
@@ -818,7 +818,7 @@ void TankInfoModel::update()
endRemoveRows();
rows = -1;
}
- struct tank_info *info = tank_info;
+ struct tank_info_t *info = tank_info;
for (info = tank_info; info->name; info++, rows++);
if (rows > -1) {