(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c) |
| |
| 368 | | | ct_sort_column(GtkCList *clist, gconstpointer ptr1, gconstpointer ptr2) |
| 369 | | | { |
| 370 | | | guint32 idx1, idx2; |
| 371 | | | conversations_table *ct = g_object_get_data(G_OBJECT(clist), CONV_PTR_KEY);
x /usr/include/glib-2.0/gobject/gobject.h |
| |
52 | #define G_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_OBJECT, GObject)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
181 | #define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
222 | #define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) |
| |
|
| 372 | | | conv_t *conv1 = NULL; |
| 373 | | | conv_t *conv2 = NULL; |
| 374 | | | double duration1, duration2; |
| 375 | | | |
| 376 | | | const GtkCListRow *row1 = ptr1; |
| 377 | | | const GtkCListRow *row2 = ptr2; |
| 378 | | | |
| 379 | | | idx1 = GPOINTER_TO_INT(row1->data); |
| 380 | | | idx2 = GPOINTER_TO_INT(row2->data); |
| 381 | | | |
| 382 | | | if (!ct || idx1 >= ct->num_conversations || idx2 >= ct->num_conversations) |
| 383 | | | return 0; |
| 384 | | | |
| 385 | | | conv1 = &ct->conversations[idx1]; |
| 386 | | | conv2 = &ct->conversations[idx2]; |
| 387 | | | |
| 388 | | | duration1 = nstime_to_sec(&conv1->stop_time) - nstime_to_sec(&conv1->start_time); |
| 389 | | | duration2 = nstime_to_sec(&conv2->stop_time) - nstime_to_sec(&conv2->start_time); |
| 390 | | | |
| 391 | | | switch(clist->sort_column){ |
| 392 | | | case 0: |
| 393 | | | return(CMP_ADDRESS(&conv1->src_address, &conv2->src_address));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/address.h |
| |
78 | #define CMP_ADDRESS(addr1, addr2) \ |
79 | ( ((addr1)->type > (addr2)->type)?1: \ |
80 | ((addr1)->type < (addr2)->type)?-1: \ |
81 | ((addr1)->len > (addr2)->len) ?1: \ |
82 | ((addr1)->len < (addr2)->len) ?-1: \ |
83 | memcmp((addr1)->data, (addr2)->data, (addr1)->len)\ |
84 | ) |
| |
|
| 394 | | | case 2: |
| 395 | | | return(CMP_ADDRESS(&conv1->dst_address, &conv2->dst_address));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/address.h |
| |
78 | #define CMP_ADDRESS(addr1, addr2) \ |
79 | ( ((addr1)->type > (addr2)->type)?1: \ |
80 | ((addr1)->type < (addr2)->type)?-1: \ |
81 | ((addr1)->len > (addr2)->len) ?1: \ |
82 | ((addr1)->len < (addr2)->len) ?-1: \ |
83 | memcmp((addr1)->data, (addr2)->data, (addr1)->len)\ |
84 | ) |
| |
|
| 396 | | | case 1: |
| 397 | | | CMP_NUM(conv1->src_port, conv2->src_port);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 398 | | | case 3: |
| 399 | | | CMP_NUM(conv1->dst_port, conv2->dst_port);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 400 | | | case 4: |
| 401 | | | CMP_NUM(conv1->tx_frames+conv1->rx_frames,
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 402 | | | conv2->tx_frames+conv2->rx_frames); |
| 403 | | | case 5: |
| 404 | | | CMP_NUM(conv1->tx_bytes+conv1->rx_bytes,
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 405 | | | conv2->tx_bytes+conv2->rx_bytes); |
| 406 | | | case 6: |
| 407 | | | CMP_NUM(conv1->tx_frames, conv2->tx_frames);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 408 | | | case 7: |
| 409 | | | CMP_NUM(conv1->tx_bytes, conv2->tx_bytes);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 410 | | | case 8: |
| 411 | | | CMP_NUM(conv1->rx_frames, conv2->rx_frames);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 412 | | | case 9: |
| 413 | | | CMP_NUM(conv1->rx_bytes, conv2->rx_bytes);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 414 | | | case 10: |
| 415 | | | return nstime_cmp(&conv1->start_time, &conv2->start_time); |
| 416 | | | case 11: |
| 417 | | | CMP_NUM(duration1, duration2);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 418 | | | case 12: |
| 419 | | | if (duration1 > 0 && conv1->tx_frames > 1 && duration2 > 0 && conv2->tx_frames > 1) { |
| 420 | | | CMP_NUM((gint64) conv1->tx_bytes / duration1, (gint64) conv2->tx_bytes / duration2);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 421 | | | } else { |
| 422 | | | CMP_NUM(conv1->tx_bytes, conv2->tx_bytes);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 423 | | | } |
| 424 | | | case 13: |
| 425 | | | if (duration1 > 0 && conv1->rx_frames > 1 && duration2 > 0 && conv2->rx_frames > 1) { |
| 426 | | | CMP_NUM((gint64) conv1->rx_bytes / duration1, (gint64) conv2->rx_bytes / duration2);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 427 | | | } else { |
| 428 | | | CMP_NUM(conv1->rx_bytes, conv2->rx_bytes);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c |
| |
70 | #define CMP_NUM(n1, n2) \ |
71 | if ((n1) > (n2)) \ |
72 | return 1; \ |
73 | else if ((n1) < (n2)) \ |
74 | return -1; \ |
75 | else \ |
76 | return 0; |
| |
|
| 429 | | | } |
| 430 | | | default: |
| 431 | | | g_assert_not_reached();
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
73 | #define g_assert_not_reached() do { g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 432 | | | } |
| 433 | | | |
| 434 | | | return 0; |
Unreachable Data Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 435 | | | } |
| |