kopia lustrzana https://github.com/Hamlib/Hamlib
Fix compilation errors and warnings and link failure
Compile-tested with commit 8ea3f0e (tag: 3.4.10) from https://github.com/osmocom/libusrp Fixes: usrp_impl.cc:33:10: fatal error: usrp_standard.h: No such file or directory usrp_impl.cc:49:63: error: expected '(' before 'malloc' usrp_impl.cc:49:100: error: expected ')' before ';' token usrp_impl.cc:72:39: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*' usrp_impl.cc:86:39: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*' usrp_impl.cc:104:39: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*' usrp_impl.cc:129:45: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*' usrp_impl.cc:151:45: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*' usrp_impl.cc:169:45: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*' usrp_impl.cc:114:37: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] usrp_impl.cc:139:38: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] /usr/bin/ld: ../src/.libs/libhamlib.so: undefined reference to `usrp_caps'pull/1739/head
rodzic
ad824fa85e
commit
5fe81cdef4
|
@ -19,6 +19,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <hamlib/config.h>
|
||||
|
||||
/*
|
||||
* Compile only this model if usrp is available
|
||||
*/
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <usrp_standard.h>
|
||||
#include <usrp/usrp_standard.h>
|
||||
|
||||
#include "usrp_impl.h"
|
||||
#include "token.h"
|
||||
|
@ -46,7 +46,7 @@ struct usrp_priv_data {
|
|||
int usrp_init(RIG *rig)
|
||||
{
|
||||
// cppcheck-suppress leakReturnValNotUsed
|
||||
STATE(rig)->priv = static_cast<struct usrp_priv_data*>malloc(sizeof(struct usrp_priv_data));
|
||||
STATE(rig)->priv = static_cast<struct usrp_priv_data*>(malloc(sizeof(struct usrp_priv_data)));
|
||||
if (!STATE(rig)->priv) {
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
|
@ -69,7 +69,7 @@ int usrp_cleanup(RIG *rig)
|
|||
|
||||
int usrp_open(RIG *rig)
|
||||
{
|
||||
struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>STATE(rig)->priv;
|
||||
struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>(STATE(rig)->priv);
|
||||
|
||||
int which_board = 0;
|
||||
int decim = 125;
|
||||
|
@ -83,7 +83,7 @@ int usrp_open(RIG *rig)
|
|||
|
||||
int usrp_close(RIG *rig)
|
||||
{
|
||||
struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>STATE(rig)->priv;
|
||||
struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>(STATE(rig)->priv);
|
||||
|
||||
if (!priv)
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ int usrp_close(RIG *rig)
|
|||
*/
|
||||
int usrp_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
||||
{
|
||||
struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>STATE(rig)->priv;
|
||||
struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>(STATE(rig)->priv);
|
||||
|
||||
if (!priv)
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ int usrp_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
|||
|
||||
switch(token) {
|
||||
case TOK_IFMIXFREQ:
|
||||
sscanf(val, "%"SCNfreq, &priv->if_mix_freq);
|
||||
sscanf(val, "%" SCNfreq, &priv->if_mix_freq);
|
||||
break;
|
||||
default:
|
||||
return -RIG_EINVAL;
|
||||
|
@ -126,7 +126,7 @@ int usrp_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
|||
*/
|
||||
int usrp_get_conf(RIG *rig, hamlib_token_t token, char *val)
|
||||
{
|
||||
const struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>STATE(rig)->priv;
|
||||
const struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>(STATE(rig)->priv);
|
||||
|
||||
if (!priv)
|
||||
{
|
||||
|
@ -136,7 +136,7 @@ int usrp_get_conf(RIG *rig, hamlib_token_t token, char *val)
|
|||
|
||||
switch(token) {
|
||||
case TOK_IFMIXFREQ:
|
||||
sprintf(val, "%"PRIfreq, priv->if_mix_freq);
|
||||
sprintf(val, "%" PRIfreq, priv->if_mix_freq);
|
||||
break;
|
||||
default:
|
||||
return -RIG_EINVAL;
|
||||
|
@ -148,7 +148,7 @@ int usrp_get_conf(RIG *rig, hamlib_token_t token, char *val)
|
|||
|
||||
int usrp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
const struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>STATE(rig)->priv;
|
||||
const struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>(STATE(rig)->priv);
|
||||
int chan = 0;
|
||||
|
||||
if (!priv)
|
||||
|
@ -166,7 +166,7 @@ int usrp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
int usrp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
const struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>STATE(rig)->priv;
|
||||
const struct usrp_priv_data *priv = static_cast<struct usrp_priv_data*>(STATE(rig)->priv);
|
||||
int chan = 0;
|
||||
|
||||
if (!priv)
|
||||
|
|
Ładowanie…
Reference in New Issue