[httpd/jsonapi] Fix unused variables when compiling without (#421)

--enable-spotify
This commit is contained in:
chme 2017-09-16 12:37:32 +02:00 committed by ejurgensen
parent ab6f599973
commit 6c45b808c0
2 changed files with 6 additions and 6 deletions

View File

@ -212,14 +212,14 @@ scrobble_cb(void *arg)
static void static void
oauth_interface(struct evhttp_request *req, const char *uri) oauth_interface(struct evhttp_request *req, const char *uri)
{ {
#ifdef HAVE_SPOTIFY_H
struct evkeyvalq query; struct evkeyvalq query;
const char *req_uri; const char *req_uri;
const char *ptr; const char *ptr;
char __attribute__((unused)) redirect_uri[256]; char redirect_uri[256];
char *errmsg; char *errmsg;
int ret; int ret;
#ifdef HAVE_SPOTIFY_H
req_uri = evhttp_request_get_uri(req); req_uri = evhttp_request_get_uri(req);
memset(&query, 0, sizeof(struct evkeyvalq)); memset(&query, 0, sizeof(struct evkeyvalq));

View File

@ -198,15 +198,15 @@ jsonapi_reply_update(struct evhttp_request *req, struct evbuffer *evbuf, char *u
static int static int
jsonapi_reply_spotify(struct evhttp_request *req, struct evbuffer *evbuf, char *uri, struct evkeyvalq *query) jsonapi_reply_spotify(struct evhttp_request *req, struct evbuffer *evbuf, char *uri, struct evkeyvalq *query)
{ {
int httpd_port;
char __attribute__((unused)) redirect_uri[256];
char *oauth_uri;
json_object *reply; json_object *reply;
int ret; int ret;
reply = json_object_new_object(); reply = json_object_new_object();
#ifdef HAVE_SPOTIFY_H #ifdef HAVE_SPOTIFY_H
int httpd_port;
char redirect_uri[256];
char *oauth_uri;
struct spotify_status_info info; struct spotify_status_info info;
json_object_object_add(reply, "enabled", json_object_new_boolean(true)); json_object_object_add(reply, "enabled", json_object_new_boolean(true));
@ -250,6 +250,7 @@ jsonapi_reply_spotify(struct evhttp_request *req, struct evbuffer *evbuf, char *
static int static int
jsonapi_reply_spotify_login(struct evhttp_request *req, struct evbuffer *evbuf, char *uri, struct evkeyvalq *query) jsonapi_reply_spotify_login(struct evhttp_request *req, struct evbuffer *evbuf, char *uri, struct evkeyvalq *query)
{ {
#ifdef HAVE_SPOTIFY_H
struct evbuffer *in_evbuf; struct evbuffer *in_evbuf;
json_object* request; json_object* request;
const char *user; const char *user;
@ -261,7 +262,6 @@ jsonapi_reply_spotify_login(struct evhttp_request *req, struct evbuffer *evbuf,
DPRINTF(E_DBG, L_WEB, "Received spotify login request\n"); DPRINTF(E_DBG, L_WEB, "Received spotify login request\n");
#ifdef HAVE_SPOTIFY_H
in_evbuf = evhttp_request_get_input_buffer(req); in_evbuf = evhttp_request_get_input_buffer(req);
request = jparse_obj_from_evbuffer(in_evbuf); request = jparse_obj_from_evbuffer(in_evbuf);
if (!request) if (!request)