Fix various minor build warnings:
lib/pb-protocol/pb-protocol.c:72: warning: comparison between signed and unsigned
lib/pb-protocol/pb-protocol.c:78: warning: comparison between signed and unsigned
lib/pb-protocol/pb-protocol.c:141: warning: unused parameter 'buf_len'
lib/pb-protocol/pb-protocol.c:241: warning: comparison between signed and unsigned
discover/pb-discover.c:14: warning: no previous prototype for 'sigint_handler'
discover/pb-discover.c:13: warning: unused parameter 'signum'
discover/log.c:22: warning: no previous prototype for 'pb_log_set_stream'
discover/discover-server.c:159: warning: no previous prototype for 'discover_server_notify_add'
discover/discover-server.c:169: warning: no previous prototype for 'discover_server_notify_remove'
discover/discover-server.c:179: warning: no previous prototype for 'discover_server_set_device_source'
discover/discover-server.c:184: warning: no previous prototype for 'discover_server_init'
discover/discover-server.c:229: warning: no previous prototype for 'discover_server_destroy'
discover/device-handler.c:395: warning: comparison between signed and unsigned
discover/paths.c:44: warning: comparison between signed and unsigned
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
struct device_handler *device_handler_init(struct discover_server *server)
{
struct device_handler *handler;
struct device_handler *device_handler_init(struct discover_server *server)
{
struct device_handler *handler;
handler = talloc(NULL, struct device_handler);
handler->devices = NULL;
handler = talloc(NULL, struct device_handler);
handler->devices = NULL;
#include "log.h"
#include "waiter.h"
#include "device-handler.h"
#include "log.h"
#include "waiter.h"
#include "device-handler.h"
+#include "discover-server.h"
struct discover_server {
int socket;
struct discover_server {
int socket;
#ifndef _LOG_H
#define _LOG_H
#ifndef _LOG_H
#define _LOG_H
void pb_log(const char *fmt, ...);
void pb_log(const char *fmt, ...);
+void pb_log_set_stream(FILE *stream);
char *encode_label(void *alloc_ctx, const char *label)
{
char *str, *c;
char *encode_label(void *alloc_ctx, const char *label)
{
char *str, *c;
/* the label can be expanded by up to four times */
str = talloc_size(alloc_ctx, strlen(label) * 4 + 1);
/* the label can be expanded by up to four times */
str = talloc_size(alloc_ctx, strlen(label) * 4 + 1);
-void sigint_handler(int signum)
+static void sigint_handler(int __attribute__((unused)) signum)
#include <string.h>
#include <stdint.h>
#include <asm/byteorder.h>
#include <string.h>
#include <stdint.h>
#include <asm/byteorder.h>
* @param[out] str Pointer to resuling string
* @return zero on success, non-zero on failure
*/
* @param[out] str Pointer to resuling string
* @return zero on success, non-zero on failure
*/
-static int read_string(void *ctx, char **pos, int *len, char **str)
+static int read_string(void *ctx, char **pos, unsigned int *len, char **str)
{
uint32_t str_len, read_len;
{
uint32_t str_len, read_len;
struct pb_protocol_message *message)
{
char *buf, *str;
struct pb_protocol_message *message)
{
char *buf, *str;
len = message->payload_len;
buf = message->payload;
len = message->payload_len;
buf = message->payload;
pos += pb_protocol_serialise_string(pos, opt->boot_args);
}
pos += pb_protocol_serialise_string(pos, opt->boot_args);
}
+ assert(pos <= buf + buf_len);
+
struct pb_protocol_message *pb_protocol_read_message(void *ctx, int fd)
{
struct pb_protocol_message *message, m;
struct pb_protocol_message *pb_protocol_read_message(void *ctx, int fd)
{
struct pb_protocol_message *message, m;
+ int rc;
+ unsigned int len;
/* use the stack for the initial 8-byte read */
/* use the stack for the initial 8-byte read */
{
struct device *dev;
char *pos;
{
struct device *dev;
char *pos;
+ int i, n_options;
+ unsigned int len;
len = message->payload_len;
pos = message->payload;
len = message->payload_len;
pos = message->payload;