size_t datalength = 0;
u_char input[3] = {0};
u_char output[4];
- int i;
+ size_t i;
while (2 < srclength) {
input[0] = *src++;
{
const char *src = _src;
unsigned char *target = dest;
- int tarindex, state, ch;
+ int state, ch;
+ size_t tarindex;
u_char nextbyte;
char *pos;
buf->head = attr;
}
-static const int blob_type_minlen[BLOB_ATTR_LAST] = {
+static const size_t blob_type_minlen[BLOB_ATTR_LAST] = {
[BLOB_ATTR_STRING] = 1,
[BLOB_ATTR_INT8] = sizeof(uint8_t),
[BLOB_ATTR_INT16] = sizeof(uint16_t),
{
struct blob_attr *pos;
int found = 0;
- int rem;
+ size_t rem;
memset(data, 0, sizeof(struct blob_attr *) * max);
blob_for_each_attr(pos, attr, rem) {
int id = blob_id(pos);
- int len = blob_len(pos);
+ size_t len = blob_len(pos);
if (id >= max)
continue;
/*
* blob_len: returns the length of the attribute's payload
*/
-static inline unsigned int
+static inline size_t
blob_len(const struct blob_attr *attr)
{
return (be32_to_cpu(attr->id_len) & BLOB_ATTR_LEN_MASK) - sizeof(struct blob_attr);
/*
* blob_raw_len: returns the complete length of an attribute (including the header)
*/
-static inline unsigned int
+static inline size_t
blob_raw_len(const struct blob_attr *attr)
{
return blob_len(attr) + sizeof(struct blob_attr);
/*
* blob_pad_len: returns the padded length of an attribute (including the header)
*/
-static inline unsigned int
+static inline size_t
blob_pad_len(const struct blob_attr *attr)
{
unsigned int len = blob_raw_len(attr);
{
struct blob_attr *cur;
bool name;
- int rem;
+ size_t rem;
int size = 0;
switch (blobmsg_type(attr)) {
static void add_separator(struct strbuf *s)
{
const char *indent_chars = "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
- int len;
+ size_t len;
if (!s->indent)
return;
{
struct blob_attr *pos;
bool first = true;
- int rem = len;
+ size_t rem = len;
blobmsg_puts(s, (array ? "[" : "{" ), 1);
s->indent_level++;
static void dump_attr_data(struct blob_attr *data, int indent, int next_indent);
static void
-dump_table(struct blob_attr *head, int len, int indent, bool array)
+dump_table(struct blob_attr *head, size_t len, int indent, bool array)
{
struct blob_attr *attr;
struct blobmsg_hdr *hdr;
struct blob_attr *data, struct blob_attr *vars)
{
struct blob_attr *cur;
- int rem;
+ size_t rem;
fprintf(stdout, "%s", name);
blobmsg_for_each_attr(cur, data, rem)
const char *name)
{
struct blob_attr *cur;
- int rem;
+ size_t rem;
blobmsg_for_each_attr(cur, vars, rem) {
if (blobmsg_type(cur) != BLOBMSG_TYPE_STRING)
{
struct blob_attr *tb[3], *cur;
const char *var;
- int rem;
+ size_t rem;
json_get_tuple(expr, tb, BLOBMSG_TYPE_STRING, BLOBMSG_TYPE_TABLE);
if (!tb[1] || !tb[2])
struct json_script_ctx *ctx = call->ctx;
struct blob_attr *tb[3], *cur;
const char *var;
- int rem;
+ size_t rem;
json_get_tuple(expr, tb, BLOBMSG_TYPE_STRING, 0);
if (!tb[1] || !tb[2])
{
struct json_script_ctx *ctx = call->ctx;
struct blob_attr *tb[3], *cur;
- int rem;
+ size_t rem;
json_get_tuple(expr, tb, 0, 0);
if (!tb[1])
static int expr_and_or(struct json_call *call, struct blob_attr *expr, bool and)
{
struct blob_attr *cur;
- int ret, rem;
+ int ret;
+ size_t rem;
int i = 0;
blobmsg_for_each_attr(cur, expr, rem) {
struct json_script_ctx *ctx = call->ctx;
struct blob_attr *cur;
int args = -1;
- int rem, ret;
+ int ret;
+ size_t rem;
void *c;
blob_buf_init(&ctx->buf, 0);
{
struct json_script_ctx *ctx = call->ctx;
struct blob_attr *cur;
- int rem;
+ size_t rem;
int ret;
int i = 0;
case BLOBMSG_TYPE_STRING:
if (!i)
return __json_process_cmd(call, block);
+ /* fall through */
default:
ret = json_process_cmd(call, cur);
if (ret < -1)