srt: rename shadow variable

Change-Id: I69bda25f79b6b46bdb288e32133847a853b614e0
Reviewed-on: https://code.wireshark.org/review/16101
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dario Lombardo 2016-06-23 17:35:17 +02:00 committed by Anders Broman
parent b845e29d97
commit bfb6f62e36
3 changed files with 11 additions and 11 deletions

View File

@ -254,7 +254,7 @@ init_srt_table(const char *name, const char *short_name, GArray *srt_array, int
table->procedures=(srt_procedure_t *)g_malloc(sizeof(srt_procedure_t)*num_procs);
for(i=0;i<num_procs;i++){
time_stat_init(&table->procedures[i].stats);
table->procedures[i].index = 0;
table->procedures[i].proc_index = 0;
table->procedures[i].procedure = NULL;
}
@ -280,11 +280,11 @@ init_srt_table_row(srt_stat_table *rst, int indx, const char *procedure)
rst->procedures=(srt_procedure_t *)g_realloc(rst->procedures, sizeof(srt_procedure_t)*(rst->num_procs));
for(i=old_num_procs;i<rst->num_procs;i++){
time_stat_init(&rst->procedures[i].stats);
rst->procedures[i].index = i;
rst->procedures[i].proc_index = i;
rst->procedures[i].procedure=NULL;
}
}
rst->procedures[indx].index = indx;
rst->procedures[indx].proc_index = indx;
rst->procedures[indx].procedure=g_strdup(procedure);
}

View File

@ -32,7 +32,7 @@ extern "C" {
/** Procedure data */
typedef struct _srt_procedure_t {
int index;
int proc_index;
timestat_t stats; /**< stats */
char *procedure; /**< column entries */
} srt_procedure_t;
@ -206,19 +206,19 @@ WS_DLL_PUBLIC srt_stat_table* init_srt_table(const char *name, const char *short
/** Init an srt table row data structure.
*
* @param rst the srt table
* @param index number of procedure
* @param proc_index number of procedure
* @param procedure the procedures name
*/
WS_DLL_PUBLIC void init_srt_table_row(srt_stat_table *rst, int index, const char *procedure);
WS_DLL_PUBLIC void init_srt_table_row(srt_stat_table *rst, int proc_index, const char *procedure);
/** Add srt response to table row data.
*
* @param rst the srt table
* @param index number of procedure
* @param proc_index number of procedure
* @param req_time the time of the corresponding request
* @param pinfo current packet info
*/
WS_DLL_PUBLIC void add_srt_table_data(srt_stat_table *rst, int index, const nstime_t *req_time, packet_info *pinfo);
WS_DLL_PUBLIC void add_srt_table_data(srt_stat_table *rst, int proc_index, const nstime_t *req_time, packet_info *pinfo);
#ifdef __cplusplus

View File

@ -93,7 +93,7 @@ public:
}
void draw() {
setText(SRT_COLUMN_INDEX, QString::number(procedure_->index));
setText(SRT_COLUMN_INDEX, QString::number(procedure_->proc_index));
setText(SRT_COLUMN_CALLS, QString::number(procedure_->stats.num));
setText(SRT_COLUMN_MIN, QString::number(nstime_to_sec(&procedure_->stats.min), 'f', 6));
setText(SRT_COLUMN_MAX, QString::number(nstime_to_sec(&procedure_->stats.max), 'f', 6));
@ -115,7 +115,7 @@ public:
switch (treeWidget()->sortColumn()) {
case SRT_COLUMN_INDEX:
return procedure_->index < other_row->procedure_->index;
return procedure_->proc_index < other_row->procedure_->proc_index;
case SRT_COLUMN_CALLS:
return procedure_->stats.num < other_row->procedure_->stats.num;
case SRT_COLUMN_MIN:
@ -137,7 +137,7 @@ public:
return QTreeWidgetItem::operator< (other);
}
QList<QVariant> rowData() {
return QList<QVariant>() << QString(procedure_->procedure) << procedure_->index << procedure_->stats.num
return QList<QVariant>() << QString(procedure_->procedure) << procedure_->proc_index << procedure_->stats.num
<< nstime_to_sec(&procedure_->stats.min) << nstime_to_sec(&procedure_->stats.max)
<< get_average(&procedure_->stats.tot, procedure_->stats.num) / 1000.0
<< nstime_to_sec(&procedure_->stats.tot);