Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at prefs.c:2591

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

write_pref

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/prefs.c)expand/collapse
Show more  
 2476  write_pref(gpointer data, gpointer user_data)
 2477  {
 2478          pref_t *pref = data;
 2479          write_pref_arg_t *arg = user_data;
 2480          const enum_val_t *enum_valp;
 2481          const char *val_string;
 2482          gchar **desc_lines;
 2483          int i;
 2484   
 2485          if (pref->type == PREF_OBSOLETE) {
 2486                  /*
 2487                   * This preference is no longer supported; it's not a
 2488                   * real preference, so we don't write it out (i.e., we 
 2489                   * treat it as if it weren't found in the list of 
 2490                   * preferences, and we weren't called in the first place).
 2491                   */
 2492                  return;
 2493          }
 2494   
 2495          /*
 2496           * Make multiple line descriptions appear as
 2497           * multiple commented lines in prefs file.
 2498           */
 2499          if (g_ascii_strncasecmp(pref->description,"", 2) != 0) {
 2500                  desc_lines = g_strsplit(pref->description,"\n",0);
 2501                  for (i = 0; desc_lines[i] != NULL; ++i) {
 2502                          fprintf(arg->pf, "\n# %s", desc_lines[i]);
 2503                  }
 2504                  fprintf(arg->pf, "\n");
 2505                  g_strfreev(desc_lines);
 2506          } else {
 2507                  fprintf(arg->pf, "\n# No description\n");
 2508          }
 2509   
 2510          switch (pref->type) {
 2511   
 2512          case PREF_UINT:
 2513                  switch (pref->info.base) {
 2514   
 2515                  case 10:
 2516                          fprintf(arg->pf, "# A decimal number.\n");
 2517                          fprintf(arg->pf, "%s.%s: %u\n", arg->module->name,
 2518                              pref->name, *pref->varp.uint);
 2519                          break;
 2520   
 2521                  case 8:
 2522                          fprintf(arg->pf, "# An octal number.\n");
 2523                          fprintf(arg->pf, "%s.%s: %#o\n", arg->module->name,
 2524                              pref->name, *pref->varp.uint);
 2525                          break;
 2526   
 2527                  case 16:
 2528                          fprintf(arg->pf, "# A hexadecimal number.\n");
 2529                          fprintf(arg->pf, "%s.%s: %#x\n", arg->module->name,
 2530                              pref->name, *pref->varp.uint);
 2531                          break;
 2532                  }
 2533                  break;
 2534   
 2535          case PREF_BOOL:
 2536                  fprintf(arg->pf, "# TRUE or FALSE (case-insensitive).\n");
 2537                  fprintf(arg->pf, "%s.%s: %s\n", arg->module->name, pref->name,
 2538                      *pref->varp.boolp ? "TRUE" : "FALSE");
 2539                  break;
 2540   
 2541          case PREF_ENUM:
 2542                  /*
 2543                   * For now, we save the "description" value, so that if we
 2544                   * save the preferences older versions of Wireshark can at 
 2545                   * least read preferences that they supported; we support
 2546                   * either the short name or the description when reading 
 2547                   * the preferences file or a "-o" option.
 2548                   */
 2549                  fprintf(arg->pf, "# One of: ");
 2550                  enum_valp = pref->info.enum_info.enumvals;
 2551                  val_string = NULL;
 2552                  while (enum_valp->name != NULL) {
 2553                          if (enum_valp->value == *pref->varp.enump)
 2554                                  val_string = enum_valp->description;
 2555                          fprintf(arg->pf, "%s", enum_valp->description);
 2556                          enum_valp++;
 2557                          if (enum_valp->name == NULL)
 2558                                  fprintf(arg->pf, "\n");
 2559                          else 
 2560                                  fprintf(arg->pf, ", ");
 2561                  }
 2562                  fprintf(arg->pf, "# (case-insensitive).\n");
 2563                  fprintf(arg->pf, "%s.%s: %s\n", arg->module->name,
 2564                      pref->name, val_string);
 2565                  break;
 2566   
 2567          case PREF_STRING:
 2568                  fprintf(arg->pf, "# A string.\n");
 2569                  fprintf(arg->pf, "%s.%s: %s\n", arg->module->name, pref->name,
 2570                      *pref->varp.string);
 2571                  break;
 2572   
 2573          case PREF_RANGE:
 2574          {
 2575                  char *range_string;
 2576   
 2577                  range_string = range_convert_range(*pref->varp.range);
 2578                  fprintf(arg->pf, "# A string denoting an positive integer range (e.g., \"1-20,30-40\").\n");
 2579                  fprintf(arg->pf, "%s.%s: %s\n", arg->module->name, pref->name,
 2580                          range_string);
 2581                  break;
 2582          }
 2583   
 2584          case PREF_STATIC_TEXT:
 2585          case PREF_UAT:
 2586          {
 2587                  /* Nothing to do */
 2588                  break;
 2589          }
 2590   
 2591          case PREF_OBSOLETE:
 2592                  g_assert_not_reached();
 2593                  break;
 2594          }
 2595  }
Show more  




Change Warning 3496.30722 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: