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

XMLWordPrintable

    • Sprint 12, Sprint 13, Sprint 14, Sprint 15, Sprint 16
    • 0.5

      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.

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

              Created:
              Updated:
              Resolved: