static int next_token(struct confread *cread)
{
int idx = cread->index + cread->length;
- cread->index = idx + strspn(&cread->buffer[idx], separators);
- cread->length = strcspn(&cread->buffer[cread->index], separators);
+ cread->index = idx + (int)strspn(&cread->buffer[idx], separators);
+ cread->length = (int)strcspn(&cread->buffer[cread->index], separators);
return cread->length;
}
{
while (fgets(cread->buffer, sizeof cread->buffer, cread->file) != NULL) {
cread->lineno++;
- cread->index = strspn(cread->buffer, separators);
+ cread->index = (int)strspn(cread->buffer, separators);
if (cread->buffer[cread->index]
&& cread->buffer[cread->index] != '#') {
- cread->length = strcspn(&cread->buffer[cread->index],
- separators);
+ cread->length = (int)strcspn(
+ &cread->buffer[cread->index], separators);
assert(cread->length > 0);
return cread->length;
}
int index0, length0;
const char **vector;
char *args;
- int count, length;
+ unsigned count, length;
/* record origin */
index0 = cread->index;
length = 0;
while(cread->length) {
count++;
- length += cread->length;
+ length += (unsigned)cread->length;
next_token(cread);
}
count = 0;
while(cread->length) {
vector[count++] = args;
- memcpy(args, &cread->buffer[cread->index], cread->length);
+ memcpy(args, &cread->buffer[cread->index],
+ (unsigned)cread->length);
args += cread->length;
*args++ = 0;
next_token(cread);
}
/* allocate structure */
- result = malloc(sizeof(struct type_list) + length);
+ result = malloc(sizeof(struct type_list) + (unsigned)length);
if (result == NULL) {
ERROR("%s:%d: out of memory", cread->filepath, cread->lineno);
errno = ENOMEM;
}
/* fill the structure */
- memcpy(result->type, &cread->buffer[index], length);
+ memcpy(result->type, &cread->buffer[index], (unsigned)length);
result->type[length] = 0;
return result;
}
const char * const *iter;
const char *p, *v;
char *data, c, sep;
- int n, s;
+ unsigned n, s;
union arguments result;
char port[20], width[20], height[20], readyfd[20], mini[3];
if (data)
data = stpcpy(data, v);
else
- s += strlen(v);
+ s += (unsigned)strlen(v);
}
}
/* terminate the argument */
/* prepare paths */
rc = snprintf(datadir, sizeof datadir, "%s/%s",
desc->home, desc->appid);
- if (rc < 0 || rc >= sizeof datadir) {
+ if (rc < 0 || rc >= (int)sizeof datadir) {
ERROR("overflow for datadir");
errno = EINVAL;
return -1;
if (s && s != e)
groupid = s; /* the original groupid is used */
else
- groupid = -1;
+ groupid = (gid_t)-1;
rc = read_configuration_file(FWK_LAUNCH_CONF);
/* dump_launchers(stderr); */