From 889316ea13bdb113a60870445cd334bd0cd3fede Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 19 Feb 2013 03:00:11 +0100 Subject: [PATCH] get rid of unused variables --- CMakeLists.txt | 3 ++- commands-wms.c | 10 ++-------- dev.c | 5 ----- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b70350..4db9185 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) PROJECT(uqmi C) -ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-unused) +ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations) SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") @@ -33,6 +33,7 @@ FOREACH(service ctl dms nas pds wds wms) DEPENDS ./data/gen-code.pl ./data/qmi-service-${service}.json ./data/gen-common.pm ) SET(service_sources ${service_sources} qmi-message-${service}.c) + set_property(SOURCE qmi-message-${service}.c PROPERTY COMPILE_FLAGS "-Wno-unused") ENDFOREACH() ADD_CUSTOM_COMMAND( diff --git a/commands-wms.c b/commands-wms.c index cdd1dd8..62199ab 100644 --- a/commands-wms.c +++ b/commands-wms.c @@ -54,7 +54,6 @@ pdu_decode_7bit_str(char *dest, const unsigned char *data, int data_len, int bit static void decode_udh(const unsigned char *data) { - const unsigned char *start = data; const unsigned char *end; unsigned int type, len; @@ -84,7 +83,6 @@ static void decode_udh(const unsigned char *data) static void decode_7bit_field(char *name, const unsigned char *data, int data_len, bool udh) { - bool multipart = false; const unsigned char *udh_start; char *dest; int pos_offset = 0; @@ -154,7 +152,7 @@ static void cmd_wms_get_message_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_wms_raw_read_response res; unsigned char *data, *end; char *str; - int i, cur_len; + int cur_len; bool sent; unsigned char first, dcs; @@ -275,8 +273,8 @@ static void cmd_wms_get_raw_message_cb(struct qmi_dev *qmi, struct qmi_request * { struct qmi_wms_raw_read_response res; unsigned char *data; - int i, len = 0; char *str; + int i; qmi_parse_wms_raw_read_response(msg, &res); data = (unsigned char *) res.data.raw_message_data.raw_data; @@ -350,8 +348,6 @@ pdu_encode_7bit_str(unsigned char *data, const char *str) int ofs = 0; while(1) { - unsigned char mask; - c = *(str++) & 0x7f; if (!c) break; @@ -440,8 +436,6 @@ cmd_wms_send_message_prepare(struct qmi_dev *qmi, struct qmi_request *req, struc unsigned char first_octet = 0x11; unsigned char protocol_id = 0x00; unsigned char dcs = 0x00; - char *str; - int i; if (!send.smsc || !*send.smsc || !send.target || !*send.target) { blobmsg_add_string(&status, "error", "Missing argument"); diff --git a/dev.c b/dev.c index b00ee8d..2e20274 100644 --- a/dev.c +++ b/dev.c @@ -49,7 +49,6 @@ static void __qmi_request_complete(struct qmi_dev *qmi, struct qmi_request *req, { void *tlv_buf; int tlv_len; - int ret; if (!req->pending) return; @@ -103,7 +102,6 @@ static void qmi_notify_read(struct ustream *us, int bytes) struct qmi_msg *msg; char *buf; int len, msg_len; - int i; while (1) { buf = ustream_get_read_buf(us, &len); @@ -128,8 +126,6 @@ int qmi_request_start(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_m { int len = qmi_complete_request_message(msg); uint16_t tid; - int ret; - int i; memset(req, 0, sizeof(*req)); req->ret = -1; @@ -314,7 +310,6 @@ int qmi_device_open(struct qmi_dev *qmi, const char *path) void qmi_device_close(struct qmi_dev *qmi) { struct qmi_request *req; - int idx; qmi_close_all_services(qmi); ustream_free(&qmi->sf.stream); -- 2.25.1