Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Computation  at main_menu.c:1306

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

register_stat_menu_item_stock

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/main_menu.c)expand/collapse
Show more  
 1271  register_stat_menu_item_stock(
 1272      const char *name,
 1273      register_stat_group_t group,
 1274      const char *stock_id,
 1275      GtkItemFactoryCallback callback,
 1276      gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data),
 1277      gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data),
 1278      gpointer callback_data)
 1279  {
 1280      /*static const char toolspath[] = "/Statistics/";*/
 1281      const char *toolspath;
 1282      const char *p;
 1283      char *menupath;
 1284      size_t menupathlen;
 1285      menu_item_t *child;
 1286      GList *curnode;
 1287      GList *childnode;
 1288   
 1289      /*
 1290       * The menu path must be relative.
 1291       */
 1292      g_assert(*name != '/');
 1293   
 1294      switch(group) {
 1295      case(REGISTER_STAT_GROUP_GENERIC): toolspath = "/Statistics/"; break;
 1296      case(REGISTER_STAT_GROUP_CONVERSATION_LIST): toolspath = "/Statistics/_Conversation List/"; break;
 1297      case(REGISTER_STAT_GROUP_ENDPOINT_LIST): toolspath = "/Statistics/_Endpoint List/"; break;
 1298      case(REGISTER_STAT_GROUP_RESPONSE_TIME): toolspath = "/Statistics/Service _Response Time/"; break;
 1299      case(REGISTER_STAT_GROUP_UNSORTED): toolspath = "/Statistics/"; break;
 1300      case(REGISTER_ANALYZE_GROUP_UNSORTED): toolspath = "/Analyze/"; break;
 1301      case(REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER): toolspath = "/Analyze/Conversation Filter/"; break;
 1302      case(REGISTER_STAT_GROUP_TELEPHONY): toolspath = "/Telephony/"; break;
 1303      case(REGISTER_TOOLS_GROUP_UNSORTED): toolspath = "/Tools/"; break;
 1304      default:
 1305          g_assert(!"no such menu group");
 1306          toolspath = NULL;
 1307      }
 1308   
 1309      /* add the (empty) root node, if not already done */
 1310      if(tap_menu_tree_root == NULL) {
 1311          child = g_malloc0(sizeof (menu_item_t));
 1312          tap_menu_tree_root = g_list_append(NULL, child);
 1313      }
 1314   
 1315      /*
 1316       * Create any submenus required.
 1317       */
 1318      curnode = tap_menu_tree_root;
 1319      p = name;
 1320      while ((p = strchr(p, '/')) != NULL) {
 1321          /*
 1322           * OK, everything between "name" and "p" is 
 1323           * a menu relative subtree into which the menu item 
 1324           * will be placed.
 1325           *
 1326           * Construct the absolute path name of that subtree.
 1327           */
 1328          menupathlen = strlen(toolspath) + 1 + (p - name);
 1329          menupath = g_malloc(menupathlen);
 1330          g_strlcpy(menupath, toolspath, menupathlen);
 1331          g_strlcat(menupath, name, menupathlen);
 1332   
 1333          /*
 1334           * Does there exist an entry with that path at this
 1335           * level of the Analyze menu tree?
 1336           */
 1337          child = curnode->data;
 1338          for (childnode = child->children; childnode != NULL; childnode = childnode->next) {
 1339              child = childnode->data;
 1340              if (strcmp(child->name, menupath) == 0)
 1341                  break;
 1342          }
 1343          if (childnode == NULL) {
 1344              /*
 1345               * No.  Create such an item as a subtree, and 
 1346               * add it to the Tools menu tree.
 1347               */
 1348              childnode = tap_menu_item_add(
 1349                  menupath, group, "", NULL, NULL ,NULL, NULL, curnode);
 1350          } else {
 1351              /*
 1352               * Yes.  We don't need this "menupath" any longer.
 1353               */
 1354              g_free(menupath);
 1355          }
 1356          curnode = childnode;
 1357   
 1358          /*
 1359           * Skip over the '/' we found.
 1360           */
 1361          p++;
 1362      }
 1363   
 1364      /*
 1365       * Construct the main menu path for the menu item.
 1366       */
 1367      menupathlen = strlen(toolspath) + 1 + strlen(name);
 1368      menupath = g_malloc(menupathlen);
 1369      g_strlcpy(menupath, toolspath, menupathlen);
 1370      g_strlcat(menupath, name, menupathlen);
 1371   
 1372      /*
 1373       * Construct an item factory entry for the item, and add it to
 1374       * the main menu.
 1375       */
 1376      tap_menu_item_add(
 1377          menupath, group, stock_id, callback,
 1378          selected_packet_enabled, selected_tree_row_enabled,
 1379          callback_data, curnode);
 1380  }
Show more  




Change Warning 4153.29731 : Unreachable Computation

Priority:
State:
Finding:
Owner:
Note: