$data .= $indent."while($iterator\-- > 0) {\n";
}
- $var_iterator and $data .= $indent."\tint i$iterator;\n";
+ $var_iterator and $data .= $indent."\tunsigned int i$iterator;\n";
$data .= $var_data;
$data .= $indent."}\n";
print <<EOF;
{
void *tlv_buf = &msg->$type.tlv;
- int tlv_len = le16_to_cpu(msg->$type.tlv_len);
+ unsigned int tlv_len = le16_to_cpu(msg->$type.tlv_len);
EOF
if (gen_has_types($data)) {
my ($var_data, $var_iterator) =
gen_tlv_val_set($cname."[$iterator]", $elem->{"array-element"}, "$indent\t", "i$iterator", undef);
- $var_iterator and $data .= $indent."\tint i$iterator;\n";
+ $var_iterator and $data .= $indent."\tunsigned int i$iterator;\n";
$data .= $var_data;
$data .= $indent."}\n";
my $cond = "req->set.$cname";
my ($var_data, $use_iterator) =
gen_tlv_val_set("req->data.$cname", $elem, "\t\t", "i", \$cond);
- $use_iterator and $iterator = "\t\tint i;\n";
+ $use_iterator and $iterator = "\t\tunsigned int i;\n";
$data = <<EOF;
if ($cond) {
void *buf;
- int ofs;
+ unsigned int ofs;
$iterator$size_var
__qmi_alloc_reset();
$var_data
#define get_next(_size) ({ void *_buf = &tlv->data[ofs]; ofs += _size; if (ofs > cur_tlv_len) goto error_len; _buf; })
#define copy_tlv(_val, _size) \\
do { \\
- int __size = _size; \\
+ unsigned int __size = _size; \\
if (__size > 0) \\
memcpy(__qmi_alloc_static(__size), _val, __size); \\
} while (0);
}
my ($type, $no_set_field) = gen_tlv_type("*$cname", $elem->{"array-element"}, $indent);
return undef if not defined $type;
- return $indent."int $cname\_n;$type", 1;
+ return $indent."unsigned int $cname\_n;$type", 1;
} elsif ($type eq "sequence" or $type eq "struct") {
my $contents = $elem->{"contents"};
my $data = "struct {";
$_data .= $data;
next if $no_set_field;
- $_set .= "\n\t\tint $cname : 1;";
+ $_set .= "\n\t\tunsigned int $cname : 1;";
}
$name = gen_cname($name);
#include "qmi-message.h"
static uint8_t buf[QMI_BUFFER_LEN];
-static int buf_ofs;
+static unsigned int buf_ofs;
-uint8_t *__qmi_get_buf(int *ofs)
+uint8_t *__qmi_get_buf(unsigned int *ofs)
{
*ofs = buf_ofs;
return buf;
buf_ofs = 0;
}
-void *__qmi_alloc_static(int len)
+void *__qmi_alloc_static(unsigned int len)
{
void *ret;
return ret;
}
-char *__qmi_copy_string(void *data, int len)
+char *__qmi_copy_string(void *data, unsigned int len)
{
char *res;
return res;
}
-struct tlv *tlv_get_next(void **buf, int *buflen)
+struct tlv *tlv_get_next(void **buf, unsigned int *buflen)
{
struct tlv *tlv = NULL;
unsigned int tlv_len;
return tlv_end - msg_start + 1;
}
-int qmi_check_message_status(void *tlv_buf, int len)
+int qmi_check_message_status(void *tlv_buf, unsigned int len)
{
struct tlv *tlv;
struct {
#define QMI_BUFFER_LEN 2048
void __qmi_alloc_reset(void);
-void *__qmi_alloc_static(int len);
-char *__qmi_copy_string(void *data, int len);
-uint8_t *__qmi_get_buf(int *ofs);
+void *__qmi_alloc_static(unsigned int len);
+char *__qmi_copy_string(void *data, unsigned int len);
+uint8_t *__qmi_get_buf(unsigned int *ofs);
static inline int tlv_data_len(struct tlv *tlv)
{
return le16_to_cpu(tlv->len);
}
-struct tlv *tlv_get_next(void **buf, int *buflen);
+struct tlv *tlv_get_next(void **buf, unsigned int *buflen);
void tlv_new(struct qmi_msg *qm, uint8_t type, uint16_t len, void *data);
void qmi_init_request_message(struct qmi_msg *qm, QmiService service);
int qmi_complete_request_message(struct qmi_msg *qm);
-int qmi_check_message_status(void *buf, int len);
+int qmi_check_message_status(void *buf, unsigned int len);
void *qmi_msg_get_tlv_buf(struct qmi_msg *qm, int *len);
#endif