Rename CPEXX_VER to cpeXX_ver and remove CPEXX_NATTR, which is redundant.

This commit is contained in:
Dag-Erling Smørgrav 2014-08-01 22:38:36 +00:00 committed by des
parent 479ffbba4a
commit 35d982ea57
2 changed files with 6 additions and 10 deletions

View file

@ -30,14 +30,9 @@
#ifndef CRYB_CPE_H_INCLUDED
#define CRYB_CPE_H_INCLUDED
#define CPE22_VER 202
#define CPE22_NATTR 7
#define CPE23_VER 203
#define CPE23_NATTR 11
#define cpe_name cryb_cpe_name
#define cpe22_ver 202
enum cpe22_attributes {
/* CPE 2.2 attributes */
cpe22_part,
@ -51,6 +46,7 @@ enum cpe22_attributes {
cpe22_nattr
};
#define cpe23_ver 203
enum cpe23_attributes {
/* CPE 2.2 attributes */
cpe23_part = cpe22_part,

View file

@ -103,8 +103,8 @@ cpe_new(void)
if ((ncpe = calloc(1, sizeof *ncpe)) == NULL)
return (NULL);
ncpe->ver = CPE23_VER;
ncpe->nattr = CPE23_NATTR;
ncpe->ver = cpe23_ver;
ncpe->nattr = cpe23_nattr;
return (ncpe);
}
@ -145,10 +145,10 @@ cpe_upgrade(const struct cpe_name *cpe)
{
switch (cpe->ver) {
case CPE22_VER:
case cpe22_ver:
/* already latest */
return (cpe_clone(cpe));
case CPE23_VER:
case cpe23_ver:
return (cpe_upgrade22(cpe));
default:
return (NULL);