kopia lustrzana https://github.com/Hamlib/Hamlib
Fix cppcheck warning in si570avrusb.c
rodzic
df2e8a5428
commit
abd8b42c2b
|
@ -571,15 +571,17 @@ int si570avrusb_init(RIG *rig)
|
|||
hamlib_port_t *rp = &rig->state.rigport;
|
||||
struct si570xxxusb_priv_data *priv;
|
||||
|
||||
priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
si570xxxusb_priv_data), 1);
|
||||
|
||||
if (!priv)
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
priv->osc_freq = SI570_NOMINAL_XTALL_FREQ;
|
||||
/* QSD/QSE */
|
||||
priv->multiplier = 4;
|
||||
|
@ -599,8 +601,6 @@ int si570avrusb_init(RIG *rig)
|
|||
rp->parm.usb.vendor_name = VENDOR_NAME;
|
||||
rp->parm.usb.product = AVR_PRODUCT_NAME;
|
||||
|
||||
rig->state.priv = (void *)priv;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -612,15 +612,17 @@ int si570peaberry1_init(RIG *rig)
|
|||
hamlib_port_t *rp = &rig->state.rigport;
|
||||
struct si570xxxusb_priv_data *priv;
|
||||
|
||||
priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
si570xxxusb_priv_data), 1);
|
||||
|
||||
if (!priv)
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
priv->osc_freq = SI570_NOMINAL_XTALL_FREQ;
|
||||
/* QSD/QSE */
|
||||
priv->multiplier = 4;
|
||||
|
@ -640,8 +642,6 @@ int si570peaberry1_init(RIG *rig)
|
|||
rp->parm.usb.vendor_name = PEABERRY_VENDOR_NAME;
|
||||
rp->parm.usb.product = PEABERRY_PRODUCT_NAME;
|
||||
|
||||
rig->state.priv = (void *)priv;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -653,15 +653,17 @@ int si570peaberry2_init(RIG *rig)
|
|||
hamlib_port_t *rp = &rig->state.rigport;
|
||||
struct si570xxxusb_priv_data *priv;
|
||||
|
||||
priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
si570xxxusb_priv_data), 1);
|
||||
|
||||
if (!priv)
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
priv->osc_freq = SI570_NOMINAL_XTALL_FREQ;
|
||||
/* QSD/QSE */
|
||||
priv->multiplier = 4;
|
||||
|
@ -681,8 +683,6 @@ int si570peaberry2_init(RIG *rig)
|
|||
rp->parm.usb.vendor_name = VENDOR_NAME;
|
||||
rp->parm.usb.product = PEABERRY_PRODUCT_NAME;
|
||||
|
||||
rig->state.priv = (void *)priv;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -694,15 +694,17 @@ int si570picusb_init(RIG *rig)
|
|||
hamlib_port_t *rp = &rig->state.rigport;
|
||||
struct si570xxxusb_priv_data *priv;
|
||||
|
||||
priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
si570xxxusb_priv_data), 1);
|
||||
|
||||
if (!priv)
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
priv->osc_freq = SI570_NOMINAL_XTALL_FREQ;
|
||||
/* QSD/QSE */
|
||||
priv->multiplier = 2;
|
||||
|
@ -722,8 +724,6 @@ int si570picusb_init(RIG *rig)
|
|||
rp->parm.usb.vendor_name = VENDOR_NAME;
|
||||
rp->parm.usb.product = PIC_PRODUCT_NAME;
|
||||
|
||||
rig->state.priv = (void *)priv;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
/*
|
||||
|
@ -735,15 +735,17 @@ int fasdr_init(RIG *rig)
|
|||
hamlib_port_t *rp = &rig->state.rigport;
|
||||
struct si570xxxusb_priv_data *priv;
|
||||
|
||||
priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
si570xxxusb_priv_data), 1);
|
||||
|
||||
if (!priv)
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
priv->osc_freq = SI570_NOMINAL_XTALL_FREQ;
|
||||
/* QSD/QSE */
|
||||
priv->multiplier = 4;
|
||||
|
@ -763,8 +765,6 @@ int fasdr_init(RIG *rig)
|
|||
rp->parm.usb.vendor_name = VENDOR_NAME;
|
||||
rp->parm.usb.product = AVR_PRODUCT_NAME;
|
||||
|
||||
rig->state.priv = (void *)priv;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue