diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-03-17 12:56:27 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-03-17 21:09:34 +0000 |
commit | cced5fb94968f7d07d7c72500da8c861cba219e5 (patch) | |
tree | 485219e32194753830fd1c9e5f822d134e72d0fc /ui | |
parent | 7d8cb0ab4feb30759545ccacd32df6aa1f6492cc (diff) |
Constification, to remove some compiler warnings.
Change-Id: I24f0bdc72109a6ef3d801dc28cb9b523ff4e5fe7
Reviewed-on: https://code.wireshark.org/review/32458
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/models/decode_as_model.cpp | 14 | ||||
-rw-r--r-- | ui/qt/models/decode_as_model.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/ui/qt/models/decode_as_model.cpp b/ui/qt/models/decode_as_model.cpp index 18b9c8834a..3851357856 100644 --- a/ui/qt/models/decode_as_model.cpp +++ b/ui/qt/models/decode_as_model.cpp @@ -115,7 +115,7 @@ QVariant DecodeAsModel::data(const QModelIndex &index, int role) const if (IS_FT_UINT(selector_type)) { return entryString(item->tableName_, GUINT_TO_POINTER(item->selectorUint_)); } else if (IS_FT_STRING(selector_type)) { - return entryString(item->tableName_, (gpointer)item->selectorString_.toUtf8().constData()); + return entryString(item->tableName_, (gconstpointer)item->selectorString_.toUtf8().constData()); } else if (selector_type == FT_GUID) { if (item->selectorDCERPC_ != NULL) { return item->selectorDCERPC_->ctx_id; @@ -426,7 +426,7 @@ bool DecodeAsModel::copyRow(int dst_row, int src_row) return true; } -QString DecodeAsModel::entryString(const gchar *table_name, gpointer value) +QString DecodeAsModel::entryString(const gchar *table_name, gconstpointer value) { QString entry_str; ftenum_t selector_type = get_dissector_table_selector_type(table_name); @@ -479,7 +479,7 @@ QString DecodeAsModel::entryString(const gchar *table_name, gpointer value) case FT_STRINGZ: case FT_UINT_STRING: case FT_STRINGZPAD: - entry_str = (char *)value; + entry_str = (const char *)value; break; case FT_GUID: @@ -666,7 +666,7 @@ void DecodeAsModel::applyChanges() if (!g_strcmp0(decode_as_entry->table_name, item->tableName_)) { ftenum_t selector_type = get_dissector_table_selector_type(item->tableName_); - gpointer selector_value; + gconstpointer selector_value; QByteArray byteArray; switch (selector_type) { @@ -681,7 +681,7 @@ void DecodeAsModel::applyChanges() case FT_UINT_STRING: case FT_STRINGZPAD: byteArray = item->selectorString_.toUtf8(); - selector_value = (gpointer) byteArray.constData(); + selector_value = (gconstpointer) byteArray.constData(); break; case FT_NONE: //selector value is ignored, but dissector table needs to happen @@ -689,7 +689,7 @@ void DecodeAsModel::applyChanges() break; case FT_GUID: if (item->selectorDCERPC_ != NULL) { - selector_value = (gpointer)item->selectorDCERPC_; + selector_value = (gconstpointer)item->selectorDCERPC_; } else { //TODO: Support normal GUID dissector tables selector_value = NULL; @@ -716,7 +716,7 @@ void DecodeAsModel::applyChanges() } break; } else { - decode_as_entry->change_value(decode_as_entry->table_name, selector_value, &item->dissector_handle_, (char *) item->current_proto_.toUtf8().constData()); + decode_as_entry->change_value(decode_as_entry->table_name, selector_value, &item->dissector_handle_, item->current_proto_.toUtf8().constData()); sub_dissectors = find_dissector_table(decode_as_entry->table_name); /* For now, only numeric dissector tables can use preferences */ diff --git a/ui/qt/models/decode_as_model.h b/ui/qt/models/decode_as_model.h index 003d005dde..61b0aec059 100644 --- a/ui/qt/models/decode_as_model.h +++ b/ui/qt/models/decode_as_model.h @@ -75,7 +75,7 @@ public: void clearAll(); bool copyRow(int dst_row, int src_row); - static QString entryString(const gchar *table_name, gpointer value); + static QString entryString(const gchar *table_name, gconstpointer value); void applyChanges(); |