Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cf-serverd/strlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ size_t StrList_bsearch(const StrList *sl,
{
if (sl != NULL && sl->len > 0)
{
struct string **ret =
struct string *const*ret =
bsearch(&s, sl->list, sl->len, sizeof(sl->list[0]),
(int (*)(const void *, const void *)) comparator);
struct string * const *base = &sl->list[0];
Expand Down Expand Up @@ -625,7 +625,7 @@ size_t StrList_SearchLongestPrefix(const StrList *sl,
* no reason to keep going. */
while (longer_match_possible && (s_prefix_len < s_len))
{
char *separator_at;
const char *separator_at;
if (direction_forward)
{
/* Find next separator, skipping the previous one. */
Expand Down
2 changes: 1 addition & 1 deletion cf-testd/cf-testd.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ static char *IncrementIPaddress(const char *ip_str)
}

int step = 1;
char *last_dot = strrchr(ip_str, '.');
const char *last_dot = strrchr(ip_str, '.');
assert(last_dot != NULL); /* the doc comment says there must be dots! */
if (StringEqual(last_dot + 1, "255"))
{
Expand Down
2 changes: 1 addition & 1 deletion libenv/sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void CalculateDomainName(const char *nodename, const char *dnsname,
{
/* If hostname is qualified */

char *p = strchr(nodename, '.');
const char *p = strchr(nodename, '.');

if (p != NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion libpromises/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void ClassTableIteratorDestroy(ClassTableIterator *iter)

ClassRef ClassRefParse(const char *expr)
{
char *name_start = strchr(expr, ':');
const char *name_start = strchr(expr, ':');
if (!name_start)
{
return (ClassRef) { .ns = NULL, .name = xstrdup(expr) };
Expand Down
2 changes: 1 addition & 1 deletion libpromises/eval_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@ bool EvalContextClassPutSoftTagsSetWithComment(EvalContext *ctx, const char *nam
{
bool ret;
char *ns = NULL;
char *delim = strchr(name, ':');
const char *delim = strchr(name, ':');

if (delim)
{
Expand Down
2 changes: 1 addition & 1 deletion libpromises/generic_agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ static inline bool CanSetVariable(const EvalContext *ctx, VarRef *var_ref)
static inline bool CanSetClass(const EvalContext *ctx, const char *class_spec)
{
char *ns = NULL;
char *ns_delim = strchr(class_spec, ':');
const char *ns_delim = strchr(class_spec, ':');
if (ns_delim != NULL)
{
ns = xstrndup(class_spec, ns_delim - class_spec);
Expand Down
2 changes: 1 addition & 1 deletion libpromises/keyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int RemovePublicKey(const char *id)

while ((dirp = DirRead(dirh)) != NULL)
{
char *c = strstr(dirp->d_name, suffix);
const char *c = strstr(dirp->d_name, suffix);

if (c && c[strlen(suffix)] == '\0') /* dirp->d_name ends with suffix */
{
Expand Down
4 changes: 2 additions & 2 deletions libpromises/policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ const char *PolicyGetPolicyFileHash(const Policy *policy, const char *policy_fil

static const char *StripNamespace(const char *full_symbol)
{
char *sep = strchr(full_symbol, CF_NS);
const char *sep = strchr(full_symbol, CF_NS);

if (sep == NULL)
{
Expand Down Expand Up @@ -871,7 +871,7 @@ char *QualifiedNameNamespaceComponent(const char *qualified_name)
*/
char *QualifiedNameScopeComponent(const char *qualified_name)
{
char *sep = strchr(qualified_name, CF_NS);
const char *sep = strchr(qualified_name, CF_NS);
if (sep)
{
return xstrdup(sep + 1);
Expand Down
2 changes: 1 addition & 1 deletion libpromises/promises.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ static void DereferenceAndPutComment(Promise* pp, const char *comment)
{
free(pp->comment);

char *sp;
const char *sp;
if ((sp = strstr(comment, "$(this.promiser)")) != NULL ||
(sp = strstr(comment, "${this.promiser}")) != NULL)
{
Expand Down
4 changes: 2 additions & 2 deletions libpromises/verify_vars.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ static bool IsLegalVariableName(EvalContext *ctx, const Promise *pp)
return false;
}

char *bracket = strchr(var_name, '[');
char *dot = strchr(var_name, '.');
const char *bracket = strchr(var_name, '[');
const char *dot = strchr(var_name, '.');
/* we only care about variable name prefix, not dots inside array keys */
if ((dot != NULL) && ((bracket == NULL) || (dot < bracket)))
{
Expand Down
Loading