Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-11970

Anonymous enumeration type definition in performance counter related code

    Details

    • Type: Problem report
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.4.0alpha1
    • Fix Version/s: 4.0.0alpha1, 4.0 (plan)
    • Component/s: Agent (G)
    • Labels:
    • Environment:
      Windows
    • Team:
      Team A
    • Sprint:
      Sprint 12, Sprint 13, Sprint 14, Sprint 15, Sprint 16
    • Story Points:
      0.5

      Description

      In include/perfmon.h there is a definition of an enum type without a name:

      typedef enum
      {
      	PERF_COUNTER_NOTSUPPORTED = 0,
      	PERF_COUNTER_INITIALIZED,
      	PERF_COUNTER_GET_SECOND_VALUE,	/* waiting for the second raw value (needed for some, e.g. rate, counters) */
      	PERF_COUNTER_ACTIVE,
      };
      

      and hence these values need to be stored in a generic int:

      typedef struct perf_counter_data
      {
      	...
      	int				status;
      	...
      }
      PERF_COUNTER_DATA;
      

      Would be so much better for readability to give this type a meaningful name.

      P.S. Also struct type naming does not follow the latest guidelines.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              glebs.ivanovskis Glebs Ivanovskis (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: