Replace cast by assign cast.
This commit is contained in:
1 parent
2d34932563
commit
78de4bcfe3
1 file changed
+2
-2
+2
-2
@@ -362,7 +362,7 @@ string_search_rchar (const string_t v, char c)
|
|||||||
// NOTE: Can implement it in a faster way than the libc function
|
// NOTE: Can implement it in a faster way than the libc function
|
||||||
// by scanning backward from the bottom of the string (which is
|
// by scanning backward from the bottom of the string (which is
|
||||||
// possible since we know the size)
|
// possible since we know the size)
|
||||||
const char *p = (const char*) strrchr(string_get_cstr(v), c);
|
const char *p = M_ASSIGN_CAST(const char*, strrchr(string_get_cstr(v), c));
|
||||||
return p == NULL ? STRING_FAILURE : (size_t) (p-string_get_cstr(v));
|
return p == NULL ? STRING_FAILURE : (size_t) (p-string_get_cstr(v));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ string_search_str (const string_t v, const char str[])
|
|||||||
{
|
{
|
||||||
STRING_CONTRACT (v);
|
STRING_CONTRACT (v);
|
||||||
M_ASSUME (str != NULL);
|
M_ASSUME (str != NULL);
|
||||||
const char *p = (const char*) strstr(string_get_cstr(v), str);
|
const char *p = M_ASSIGN_CAST(const char*, strstr(string_get_cstr(v), str));
|
||||||
return p == NULL ? STRING_FAILURE : (size_t) (p-string_get_cstr(v));
|
return p == NULL ? STRING_FAILURE : (size_t) (p-string_get_cstr(v));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user